Makefiles™

This commit is contained in:
Bandie 2018-03-29 13:44:17 +02:00
parent 60c93b2cfc
commit 9c0f4c5835
Signed by: Bandie
GPG Key ID: C1E133BC65A822DD
2 changed files with 10 additions and 2 deletions

View File

@ -7,8 +7,7 @@ all:
@which poweroff >/dev/null
@which cryptsetup >/dev/null
mkdir -p build obj
gcc -fPIC --std=c99 -DPOWEROFF=\"`which poweroff`\" -DREBOOT=\"`which reboot`\" -DCRYPTSETUP=\"`which cryptsetup`\" -c src/pam_panic.c -o obj/pam_panic.o
ld -x --shared -o build/pam_panic.so obj/pam_panic.o
make -C src
@printf "Done!\n"
clean:
rm build/pam_panic.so

9
src/Makefile Normal file
View File

@ -0,0 +1,9 @@
CFLAGS = --std=c99 -O2 -fPIC -DPOWEROFF=\"`which poweroff`\" -DREBOOT=\"`which reboot`\" -DCRYPTSETUP=\"`which cryptsetup`\"
LDFLAGS = -x --shared
all:
mkdir -p ../obj
mkdir -p ../build
cc $(CFLAGS) -c pam_panic.c -o ../obj/pam_panic.o
ld $(LDFLAGS) -o ../build/pam_panic.so ../obj/pam_panic.o