From 2183c68f604735f0c7f736d8ff7639c303a3bdcc Mon Sep 17 00:00:00 2001 From: Daniel Richard G Date: Thu, 2 Aug 2012 19:30:46 +0200 Subject: [PATCH] Makefile: Split CPPFLAGS. -W*/-O*/-g options belong in CFLAGS, not CPPFLAGS. CPPFLAGS is for preprocessor-specific (-D*/-I*) options. --- Makefile | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 99b8286..c4ff460 100644 --- a/Makefile +++ b/Makefile @@ -2,17 +2,19 @@ dss_objects := cmdline.o dss.o string.o fd.o exec.o signal.o daemon.o df.o time. all: dss man: dss.1 -DEBUG_CPPFLAGS += -Wno-sign-compare -g -Wunused -Wundef -W -DEBUG_CPPFLAGS += -Wredundant-decls -CPPFLAGS += -Os -CPPFLAGS += -Wall -CPPFLAGS += -Wuninitialized -CPPFLAGS += -Wchar-subscripts -CPPFLAGS += -Wformat-security -CPPFLAGS += -Werror-implicit-function-declaration -CPPFLAGS += -Wmissing-format-attribute -CPPFLAGS += -Wunused-macros -CPPFLAGS += -Wbad-function-cast +DEBUG_CFLAGS ?= +DEBUG_CFLAGS += -Wno-sign-compare -g -Wunused -Wundef -W +DEBUG_CFLAGS += -Wredundant-decls +CFLAGS ?= +CFLAGS += -Os +CFLAGS += -Wall +CFLAGS += -Wuninitialized +CFLAGS += -Wchar-subscripts +CFLAGS += -Wformat-security +CFLAGS += -Werror-implicit-function-declaration +CFLAGS += -Wmissing-format-attribute +CFLAGS += -Wunused-macros +CFLAGS += -Wbad-function-cast Makefile.deps: $(wildcard *.c *.h) gcc -MM -MG *.c > $@ @@ -23,10 +25,10 @@ dss: $(dss_objects) $(CC) -o $@ $(dss_objects) cmdline.o: cmdline.c cmdline.h - $(CC) -c $(CPPFLAGS) $< + $(CC) -c $(CFLAGS) $< %.o: %.c Makefile - $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) $< + $(CC) -c $(CFLAGS) $(DEBUG_CFLAGS) $< %.ppm: %.sk sk2ppm $< > $@ -- 2.39.5