]> git.tuebingen.mpg.de Git - dss.git/commitdiff
build: Combine CFLAGS and DEBUG_CFLAGS.
authorAndre Noll <maan@tuebingen.mpg.de>
Thu, 13 Jul 2017 17:21:11 +0000 (19:21 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Thu, 13 Jul 2017 20:54:03 +0000 (22:54 +0200)
We needed two sets of flags for gengetopt because the C code generated
by gengetopt would not compile cleanly with our rather strict set of
flags. With lopsub this is no longer necessary.

Moreover, it is considered good practice to not set CFLAGS at all but
to append the contents of this variable to the compile command. This
way the user may set the variable to override some of the options.

This commit gets rid of CFLAGS in favor of DSS_CFLAGS, which is just
the union of the CFLAGS and the DEBUG_CFLAGS variables we had before.

Makefile

index c6780ef026ff86197073c007cf5100a78188cb68..7d3bd4262525b705feb82901532d9e74d9d97737 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,21 +10,19 @@ dss_objects := dss.o str.o file.o exec.o sig.o daemon.o df.o tv.o snap.o ipc.o d
 all: dss dss.1
 man: dss.1
 
-DEBUG_CFLAGS ?=
-DEBUG_CFLAGS += -Wno-sign-compare -g -Wunused -Wundef
-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 += -Wunused-parameter
-CFLAGS += -Wbad-function-cast
-CFLAGS += -Wshadow
+DSS_CFLAGS := -Wno-sign-compare -g -Wunused -Wundef
+DSS_CFLAGS += -Wredundant-decls
+DSS_CFLAGS += -Os
+DSS_CFLAGS += -Wall
+DSS_CFLAGS += -Wuninitialized
+DSS_CFLAGS += -Wchar-subscripts
+DSS_CFLAGS += -Wformat-security
+DSS_CFLAGS += -Werror-implicit-function-declaration
+DSS_CFLAGS += -Wmissing-format-attribute
+DSS_CFLAGS += -Wunused-macros
+DSS_CFLAGS += -Wunused-parameter
+DSS_CFLAGS += -Wbad-function-cast
+DSS_CFLAGS += -Wshadow
 
 Makefile.deps: $(wildcard *.c *.h)
        gcc -MM -MG *.c > $@
@@ -35,7 +33,7 @@ dss: $(dss_objects)
        $(CC) -o $@ $(dss_objects) $(LDFLAGS) -llopsub
 
 %.o: %.c Makefile
-       $(CC) -c -DVERSION_STRING='"$(VERSION_STRING)"' $(CFLAGS) $(DEBUG_CFLAGS) $<
+       $(CC) -c -DVERSION_STRING='"$(VERSION_STRING)"' $(DSS_CFLAGS) $(CFLAGS) $<
 
 %.png: %.dia
        dia -e $@ -t png $<