mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-04 09:18:36 +03:00
Split gcc warning options
Use gcc warning options only for .c -> .o compilation So it makes the output more clear. Do not use INCLUDES and DEFS for .o -> .so. Do not use CFLAGS for deps .d generation.
This commit is contained in:
parent
a532faa7b7
commit
4b795cc3a0
23
make.tmpl.in
23
make.tmpl.in
@ -113,13 +113,16 @@ INSTALL_SCRIPT = $(INSTALL) -p $(M_INSTALL_PROGRAM)
|
|||||||
|
|
||||||
.SUFFIXES: .c .d .o .so .a .po .pot .mo .dylib
|
.SUFFIXES: .c .d .o .so .a .po .pot .mo .dylib
|
||||||
|
|
||||||
CFLAGS += -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -Wpointer-arith
|
WFLAGS += -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings \
|
||||||
|
-Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
|
||||||
|
-Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls \
|
||||||
|
-Wpointer-arith
|
||||||
|
|
||||||
#CFLAGS += -W -Wconversion -Wbad-function-cast -Wcast-qual
|
#WFLAGS += -W -Wconversion -Wbad-function-cast -Wcast-qual
|
||||||
#CFLAGS += -pedantic -std=gnu99
|
#WFLAGS += -pedantic -std=gnu99
|
||||||
#CFLAGS += -DDEBUG_CRC32
|
#DEFS += -DDEBUG_CRC32
|
||||||
|
|
||||||
CFLAGS += @COPTIMISE_FLAG@
|
CFLAGS += -fPIC @COPTIMISE_FLAG@
|
||||||
LDFLAGS += @COPTIMISE_FLAG@
|
LDFLAGS += @COPTIMISE_FLAG@
|
||||||
|
|
||||||
ifeq ("@DEBUG@", "yes")
|
ifeq ("@DEBUG@", "yes")
|
||||||
@ -303,14 +306,14 @@ endif
|
|||||||
$(TARGETS): $(OBJECTS)
|
$(TARGETS): $(OBJECTS)
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $< -o $@
|
$(CC) -c $(INCLUDES) $(DEFS) $(WFLAGS) $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
%.pot: %.c Makefile
|
%.pot: %.c Makefile
|
||||||
$(CC) -E $(INCLUDES) -include $(top_srcdir)/include/pogen.h \
|
$(CC) -E $(INCLUDES) -include $(top_srcdir)/include/pogen.h \
|
||||||
$(DEFS) $(CFLAGS) $< > $@
|
$(DEFS) $(WFLAGS) $(CFLAGS) $< > $@
|
||||||
|
|
||||||
%.so: %.o
|
%.so: %.o
|
||||||
$(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $(CLDFLAGS) $< $(LIBS) -o $@
|
$(CC) -c $(CFLAGS) $(CLDFLAGS) $< $(LIBS) -o $@
|
||||||
|
|
||||||
ifneq (,$(LIB_SHARED))
|
ifneq (,$(LIB_SHARED))
|
||||||
|
|
||||||
@ -355,7 +358,7 @@ $(LIB_STATIC): $(OBJECTS)
|
|||||||
set -e; \
|
set -e; \
|
||||||
FILE=`echo $@ | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
|
FILE=`echo $@ | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
|
||||||
DEPS=`echo $(DEPS) | sed -e 's/\\//\\\\\\//g'`; \
|
DEPS=`echo $(DEPS) | sed -e 's/\\//\\\\\\//g'`; \
|
||||||
$(CC) -MM $(INCLUDES) $(DEFS) $(CFLAGS) -o $@ $<; \
|
$(CC) -MM $(INCLUDES) $(DEFS) -o $@ $<; \
|
||||||
sed -i "s/\(.*\)\.o[ :]*/$$FILE.o $$FILE.d $$FILE.pot: $$DEPS /g" $@; \
|
sed -i "s/\(.*\)\.o[ :]*/$$FILE.o $$FILE.d $$FILE.pot: $$DEPS /g" $@; \
|
||||||
[ -s $@ ] || $(RM) $@
|
[ -s $@ ] || $(RM) $@
|
||||||
|
|
||||||
@ -378,7 +381,7 @@ distclean: cleandir $(SUBDIRS.distclean)
|
|||||||
set -e; \
|
set -e; \
|
||||||
( cat $(srcdir)/.exported_symbols; \
|
( cat $(srcdir)/.exported_symbols; \
|
||||||
if test x$(EXPORTED_HEADER) != x; then \
|
if test x$(EXPORTED_HEADER) != x; then \
|
||||||
$(CC) -E -P $(INCLUDES) $(DEFS) $(CFLAGS) $(EXPORTED_HEADER) | \
|
$(CC) -E -P $(INCLUDES) $(DEFS) $(EXPORTED_HEADER) | \
|
||||||
$(SED) -ne "/^typedef|}/!s/.*[ \*]\(\$(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
|
$(SED) -ne "/^typedef|}/!s/.*[ \*]\(\$(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
|
||||||
fi \
|
fi \
|
||||||
) > $@
|
) > $@
|
||||||
|
Loading…
Reference in New Issue
Block a user