aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-01-01 22:23:15 +0100
committerGravatar Christian Hesse <mail@eworm.de>2021-01-01 22:27:35 +0100
commita068a2decf5494b8766ec0b0dd52e99e82482e26 (patch)
treed1dad699a31e6ea7ad59928bad8ce428f464b892
parent8fc98d8cfe35a8bf888f702ebbafe41af847a1d8 (diff)
downloadmpd-notification-a068a2decf5494b8766ec0b0dd52e99e82482e26.tar.gz
mpd-notification-a068a2decf5494b8766ec0b0dd52e99e82482e26.tar.zst
Makefile: allow to override CFLAGS...
... without loosing CFLAGS required for linked libraries. Closes #28
-rw-r--r--Makefile22
1 files changed, 11 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index f5cff76..842da60 100644
--- a/Makefile
+++ b/Makefile
@@ -8,21 +8,21 @@ CP := cp
RM := rm
# flags
-CFLAGS += -std=c11 -O2 -fPIC -Wall -Werror
+CFLAGS_EXTRA += -std=c11 -O2 -fPIC -Wall -Werror
ifneq ($(wildcard /usr/include/iniparser),)
-CFLAGS += -I/usr/include/iniparser
+CFLAGS_EXTRA += -I/usr/include/iniparser
endif
-CFLAGS += -liniparser
-CFLAGS_SYSTEMD := $(shell pkg-config --cflags --libs libsystemd 2>/dev/null)
+CFLAGS_EXTRA += -liniparser
+CFLAGS_SYSTEMD := $(shell pkg-config --cflags --libs libsystemd 2>/dev/null)
ifneq ($(CFLAGS_SYSTEMD),)
-CFLAGS += -DHAVE_SYSTEMD $(CFLAGS_SYSTEMD)
+CFLAGS_EXTRA += -DHAVE_SYSTEMD $(CFLAGS_SYSTEMD)
endif
-CFLAGS += $(shell pkg-config --cflags --libs libmpdclient)
-CFLAGS += $(shell pkg-config --cflags --libs libnotify)
-CFLAGS_LIBAV := $(shell pkg-config --cflags --libs libavformat libavutil 2>/dev/null)
+CFLAGS_EXTRA += $(shell pkg-config --cflags --libs libmpdclient)
+CFLAGS_EXTRA += $(shell pkg-config --cflags --libs libnotify)
+CFLAGS_LIBAV := $(shell pkg-config --cflags --libs libavformat libavutil 2>/dev/null)
ifneq ($(CFLAGS_LIBAV),)
-CFLAGS += -DHAVE_LIBAV $(CFLAGS_LIBAV)
-CFLAGS += -lmagic
+CFLAGS_EXTRA += -DHAVE_LIBAV $(CFLAGS_LIBAV)
+CFLAGS_EXTRA += -lmagic
endif
LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
@@ -33,7 +33,7 @@ VERSION := 0.8.5
all: mpd-notification README.html
mpd-notification: mpd-notification.c mpd-notification.h config.h version.h
- $(CC) mpd-notification.c $(CFLAGS) $(LDFLAGS) -o mpd-notification
+ $(CC) mpd-notification.c $(CFLAGS) $(CFLAGS_EXTRA) $(LDFLAGS) -o mpd-notification
config.h:
$(CP) config.def.h config.h