]> Pileus Git - lackey/commitdiff
Move CPPFLAGS to object specific CFLAGS
authorAndy Spencer <andy753421@gmail.com>
Sat, 3 Dec 2016 08:21:38 +0000 (08:21 +0000)
committerAndy Spencer <andy753421@gmail.com>
Mon, 5 Dec 2016 08:28:39 +0000 (08:28 +0000)
makefile

index f50f07445b9229007b7df637a2df4241953d08a8..14d6a71dda7331b616033a4a3b083f28a4f79a56 100644 (file)
--- 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