diff options
author | Christian Hesse <mail@eworm.de> | 2024-05-21 13:27:01 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2024-05-21 13:43:32 +0200 |
commit | 06df8f74d97c07904786e3ab38546043685bdf24 (patch) | |
tree | 65772b6eca24b0cf6aa4f0046c815fdd9edbfa51 | |
parent | be84e3e30ae7729c3cb4fc9be4c5a60d2e3c27d6 (diff) | |
download | mkinitcpio-ykfde-06df8f74d97c07904786e3ab38546043685bdf24.tar.gz mkinitcpio-ykfde-06df8f74d97c07904786e3ab38546043685bdf24.tar.zst |
update CFLAGS handling
-rw-r--r-- | bin/Makefile | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/Makefile b/bin/Makefile index 67d3066..583370d 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -4,17 +4,20 @@ INSTALL := install RM := rm # flags CFLAGS += -std=gnu11 -O2 -fPIC -Wall -Werror -CFLAGS_YUBIKEY += -liniparser -lkeyutils -lykpers-1 -lyubikey -CFLAGS_SYSTEMD += $(shell pkg-config --cflags --libs libsystemd 2>/dev/null) +CFLAGS_EXTRA += -liniparser -lkeyutils -lykpers-1 -lyubikey +CFLAGS_SYSTEMD := $(shell pkg-config --cflags --libs libsystemd 2>/dev/null) +ifneq ($(CFLAGS_SYSTEMD),) +CFLAGS_EXTRA += -DHAVE_SYSTEMD $(CFLAGS_SYSTEMD) +endif LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie all: worker ykfde ykfde-cpio worker: worker.c ../config.h - $(CC) worker.c $(CFLAGS) $(CFLAGS_YUBIKEY) $(CFLAGS_SYSTEMD) $(LDFLAGS) -o worker + $(CC) worker.c $(CFLAGS) $(CFLAGS_EXTRA) $(LDFLAGS) -o worker ykfde: ykfde.c ../config.h ../version.h - $(CC) ykfde.c $(CFLAGS) $(CFLAGS_YUBIKEY) $(CFLAGS_SYSTEMD) -lcryptsetup $(LDFLAGS) -o ykfde + $(CC) ykfde.c $(CFLAGS) $(CFLAGS_EXTRA) -lcryptsetup $(LDFLAGS) -o ykfde ykfde-cpio: ykfde-cpio.c ../config.h ../version.h $(CC) ykfde-cpio.c $(CFLAGS) -larchive $(LDFLAGS) -o ykfde-cpio |