]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
build: Combine $(CFLAGS) and $(STRICT_CFLAGS).
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 17 Jul 2016 16:27:13 +0000 (18:27 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 26 Mar 2017 09:02:28 +0000 (11:02 +0200)
We used to compile the parsers generated by gengetopt with less strict
flags to avoid warnings in generated files. With lopsub this is no
longer necessary, so one set of flags suffices.

Moreover, we currently initialize $(STRICT_CFLAGS) to $(CFLAGS) (from
the environment), then append our own flags. This is unfortunate
because the user defined settings in $(CFLAGS) are overwritten.

This patch changes the Makefile to only set STRICT_CFLAGS. We now
pass $(STRICT_CFLAGS) $(CFLAGS) to the compiler, allowing the user
to override (parts of) $(STRICT_CFLAGS) by adding -Wno-foo to CFLAGS.

We use the opportunity to regroup the various options a little.

Makefile.real

index 3192bf1e35e73fbc7bd3df66743bf3192886d242..4ef8b2be7bd2231414f6d38d4fcd58fd7f07ca12 100644 (file)
@@ -108,21 +108,18 @@ CPPFLAGS += -I/usr/local/include
 CPPFLAGS += -I$(lls_suite_dir)
 CPPFLAGS += $(lopsub_cppflags)
 
-CFLAGS += -Os
-CFLAGS += -Wuninitialized
-CFLAGS += -Wchar-subscripts
-CFLAGS += -Werror-implicit-function-declaration
-CFLAGS += -Wmissing-noreturn
-CFLAGS += -Wbad-function-cast
-CFLAGS += -fno-strict-aliasing
-
-STRICT_CFLAGS = $(CFLAGS)
-STRICT_CFLAGS += -g -Wundef -W
+STRICT_CFLAGS += -fno-strict-aliasing
+STRICT_CFLAGS += -g
+STRICT_CFLAGS += -Os
+STRICT_CFLAGS += -Wundef -W -Wuninitialized
+STRICT_CFLAGS += -Wchar-subscripts
+STRICT_CFLAGS += -Werror-implicit-function-declaration
+STRICT_CFLAGS += -Wmissing-noreturn
+STRICT_CFLAGS += -Wbad-function-cast
 STRICT_CFLAGS += -Wredundant-decls
 STRICT_CFLAGS += -Wno-sign-compare -Wno-unknown-pragmas
-STRICT_CFLAGS += -Wformat -Wformat-security
-STRICT_CFLAGS += -Wmissing-format-attribute
 STRICT_CFLAGS += -Wdeclaration-after-statement
+STRICT_CFLAGS += -Wformat -Wformat-security -Wmissing-format-attribute
 
 LDFLAGS += $(clock_gettime_ldflags)
 
@@ -249,7 +246,7 @@ $(object_dir)/compress_filter.o: CFLAGS += -O3
 $(object_dir)/%.o: %.c | $(object_dir)
        @[ -z "$(Q)" ] || echo 'CC $<'
        $(Q) $(CC) -c -o $@ -MMD -MF $(dep_dir)/$(*F).d -MT $@ $(CPPFLAGS) \
-               $(STRICT_CFLAGS) $<
+               $(STRICT_CFLAGS) $(CFLAGS) $<
 
 # The compiler outputs dependencies either as foo.h or as some_directory/foo.h,
 # depending on whether the latter file exists. Since make needs the directory