1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

makefiles: split gcc -W options

Avoid using gcc only Warnings for compilation of g++ object files.
This commit is contained in:
Zdenek Kabelac 2015-03-11 15:41:03 +01:00
parent 8a2b9f045f
commit e7e499e80f

View File

@ -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")
@ -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 $@