From 9a9c6808d386091c75bbc00b764d308034ac1c0f Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Sat, 3 Dec 2016 08:21:38 +0000 Subject: [PATCH] Move CPPFLAGS to object specific CFLAGS --- makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index f50f074..14d6a71 100644 --- a/makefile +++ b/makefile @@ -11,7 +11,6 @@ MANPREFIX ?= $(PREFIX)/share/man # Compiler GCC ?= gcc CFLAGS ?= -Wall --std=c99 -CPPFLAGS ?= -Isrc LDFLAGS ?= -lncursesw -lical # Sources @@ -22,8 +21,9 @@ TEST_SRC ?= test date cal conf util VIEWS ?= day week month year events todo settings help edit CALS ?= dummy ical -# For ncursesw -CPPFLAGS += $(strip $(shell pkg-config --cflags ncursesw)) +# Objects +views/%.o cals/%.o: CFLAGS += -Isrc +src/view.o views/%.o: CFLAGS += $(strip $(shell pkg-config --cflags ncursesw)) # Targets all: $(PROG) @@ -58,6 +58,6 @@ $(TEST): $(TEST_SRC:%=src/%.o) $(CALS:%=cals/%.o) $(GCC) $(CFLAGS) -o $@ $+ $(LDFLAGS) %.o: %.c $(wildcard src/*.h makefile config.mk) - $(GCC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< + $(GCC) $(CFLAGS) -c -o $@ $< .PHONY: all clean dist install uninstall -- 2.43.2