summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2015-03-11 15:41:03 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2015-03-11 21:17:23 +0100
commite7e499e80fa31c7c465d43e11e14c2342477ee53 (patch)
tree7c020ae275ce30c08e48870976c17336d7bf9c9e
parent8a2b9f045fffd4e9d9450477b946af31dde5848f (diff)
downloadlvm2-e7e499e80fa31c7c465d43e11e14c2342477ee53.tar.gz
makefiles: split gcc -W options
Avoid using gcc only Warnings for compilation of g++ object files.
-rw-r--r--make.tmpl.in52
1 files changed, 38 insertions, 14 deletions
diff --git a/make.tmpl.in b/make.tmpl.in
index 11721f157..3a8597a03 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -142,21 +142,45 @@ INSTALL_SCRIPT = $(INSTALL) -p $(M_INSTALL_PROGRAM)
.SUFFIXES: .c .cpp .d .o .so .a .po .pot .mo .dylib
-WFLAGS += -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings \
- -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
- -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls \
- -Wpointer-arith -Wuninitialized -Wmissing-include-dirs \
- -Wfloat-equal -Wstrict-prototypes \
- -Wold-style-definition -Wmissing-format-attribute
+WFLAGS +=\
+ -Wall\
+ -Wcast-align\
+ -Wfloat-equal\
+ -Wformat-security\
+ -Winline\
+ -Wmissing-declarations\
+ -Wmissing-format-attribute\
+ -Wmissing-include-dirs\
+ -Wmissing-noreturn\
+ -Wpointer-arith\
+ -Wredundant-decls\
+ -Wshadow\
+ -Wundef\
+ -Wuninitialized\
+ -Wwrite-strings
+
+WCFLAGS +=\
+ -Wmissing-prototypes\
+ -Wnested-externs\
+ -Wold-style-definition\
+ -Wstrict-prototypes
ifeq ("@HAVE_WJUMP@", "yes")
-WFLAGS += -Wjump-misses-init
+WCFLAGS += -Wjump-misses-init
endif
ifeq ("@HAVE_WCLOBBERED@", "yes")
-WFLAGS += -Wclobbered -Wempty-body -Wignored-qualifiers \
- -Wmissing-parameter-type -Wold-style-declaration -Woverride-init \
- -Wtype-limits -Wlogical-op
+WFLAGS +=\
+ -Wclobbered\
+ -Wempty-body\
+ -Wignored-qualifiers\
+ -Wlogical-op\
+ -Wtype-limits
+
+WCFLAGS +=\
+ -Wmissing-parameter-type\
+ -Wold-style-declaration\
+ -Woverride-init
endif
ifeq ("@HAVE_WSYNCNAND@", "yes")
@@ -174,7 +198,7 @@ endif
endif
#WFLAGS += -W -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers
-#WFLAGS += -Wsign-compare -Wunused-parameter -Wmissing-field-initializers
+#WFLAGS += -Wsign-compare -Wunused-parameter -Wmissing-field-initializers
#WFLAGS += -Wconversion -Wbad-function-cast -Wcast-qual -Waggregate-return -Wpacked
#WFLAGS += -pedantic -std=gnu99
#DEFS += -DDEBUG_CRC32
@@ -372,7 +396,7 @@ endif
$(TARGETS): $(OBJECTS)
%.o: %.c
- $(CC) -c $(INCLUDES) $(DEFS) $(WFLAGS) $(CFLAGS) $(CFLAGS_$@) $< -o $@
+ $(CC) -c $(INCLUDES) $(DEFS) $(WFLAGS) $(WCFLAGS) $(CFLAGS) $(CFLAGS_$@) $< -o $@
%.o: %.cpp
$(CXX) -c $(INCLUDES) $(DEFS) $(WFLAGS) $(CXXFLAGS) $(CXXFLAGS_$@) $< -o $@
@@ -405,7 +429,7 @@ install_lib_shared: $(LIB_SHARED)
$(INSTALL_DIR) $(usrlibdir)
$(LN_S) -f $(USRLIB_RELPATH)$(<F).$(LIB_VERSION) $(usrlibdir)/$(<F)
-# FIXME: plugins are installed to subdirs
+# FIXME: plugins are installed to subdirs
# and for compatibility links in libdir are created
# when the code is fixed links could be removed.
install_dm_plugin: $(LIB_SHARED)
@@ -446,7 +470,7 @@ clean: $(SUBDIRS.clean) cleandir
distclean: cleandir $(SUBDIRS.distclean)
test -z "$(DISTCLEAN_DIRS)" || $(RM) -r $(DISTCLEAN_DIRS)
- $(RM) $(DISTCLEAN_TARGETS) Makefile
+ $(RM) $(DISTCLEAN_TARGETS) Makefile
.exported_symbols_generated: $(EXPORTED_HEADER) .exported_symbols
set -e; \