diff options
author | H. Peter Anvin <hpa@zytor.com> | 2010-01-10 12:48:06 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-01-10 12:49:30 -0800 |
commit | 71d20885019564586d5f4d316af220cdae2900f5 (patch) | |
tree | 0fb3024519040f20f4e46d87315a14ef571ee6c2 | |
parent | a7fb4143d599529def315c444c83a8e1aac734d2 (diff) | |
download | syslinux.git-71d20885019564586d5f4d316af220cdae2900f5.tar.gz syslinux.git-71d20885019564586d5f4d316af220cdae2900f5.tar.xz syslinux.git-71d20885019564586d5f4d316af220cdae2900f5.zip |
Makefile: replace -W -Wall with centralized $(GCCWARN)
Replace -W -Wall hardcoded into a bunch of Makefiles with $(GCCWARN),
a centralized variable defined in the root MCONFIG. Add
-Wstrict-prototypes to the list of global warnings: we should never
have non-prototyped declarations.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | MCONFIG | 3 | ||||
-rw-r--r-- | MCONFIG.embedded | 2 | ||||
-rw-r--r-- | com32/MCONFIG | 6 | ||||
-rw-r--r-- | com32/lib/MCONFIG | 2 | ||||
-rw-r--r-- | com32/rosh/MCONFIG | 4 | ||||
-rw-r--r-- | extlinux/Makefile | 2 | ||||
-rw-r--r-- | linux/Makefile | 2 | ||||
-rw-r--r-- | memdisk/Makefile | 2 | ||||
-rw-r--r-- | mtools/Makefile | 2 | ||||
-rw-r--r-- | utils/Makefile | 2 | ||||
-rw-r--r-- | win32/Makefile | 4 |
11 files changed, 17 insertions, 14 deletions
@@ -60,6 +60,9 @@ WGET = wget com32 = $(topdir)/com32 +# Common warnings we want for all gcc-generated code +GCCWARN := -W -Wall -Wstrict-prototypes + # Common stanza to make gcc generate .*.d dependency files MAKEDEPS = -Wp,-MT,$@,-MD,$(dir $@).$(notdir $@).d diff --git a/MCONFIG.embedded b/MCONFIG.embedded index 586afc3e..37abe917 100644 --- a/MCONFIG.embedded +++ b/MCONFIG.embedded @@ -28,7 +28,7 @@ GCCOPT := $(call gcc_ok,-m32,) \ LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc) LD += -m elf_i386 -CFLAGS = $(GCCOPT) -g -W -Wall -Wno-sign-compare $(OPTFLAGS) $(INCLUDES) +CFLAGS = $(GCCOPT) -g $(GCCWARN) -Wno-sign-compare $(OPTFLAGS) $(INCLUDES) SFLAGS = $(CFLAGS) -D__ASSEMBLY__ .SUFFIXES: .c .o .S .s .i .elf .com .bin .asm .lst .c32 .lss diff --git a/com32/MCONFIG b/com32/MCONFIG index f8d9d978..578e2832 100644 --- a/com32/MCONFIG +++ b/com32/MCONFIG @@ -32,11 +32,11 @@ GPLLIB = GPLINCLUDE = endif -CFLAGS = $(GCCOPT) -W -Wall -march=i386 \ +CFLAGS = $(GCCOPT) $(GCCWARN) -march=i386 \ -fomit-frame-pointer -D__COM32__ \ -nostdinc -iwithprefix include \ -I$(com32)/libutil/include -I$(com32)/include $(GPLINCLUDE) -SFLAGS = $(GCCOPT) -W -Wall -march=i386 \ +SFLAGS = $(GCCOPT) $(GCCWARN) -march=i386 \ -fomit-frame-pointer -D__COM32__ \ -nostdinc -iwithprefix include \ -I$(com32)/libutil/include -I$(com32)/include $(GPLINCLUDE) @@ -45,7 +45,7 @@ COM32LD = $(com32)/lib/com32.ld LDFLAGS = -m elf_i386 -T $(COM32LD) LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc) -LNXCFLAGS = -I$(com32)/libutil/include -W -Wall -O -g -D_GNU_SOURCE +LNXCFLAGS = -I$(com32)/libutil/include $(GCCWARN) -O -g -D_GNU_SOURCE LNXSFLAGS = -g LNXLDFLAGS = -g diff --git a/com32/lib/MCONFIG b/com32/lib/MCONFIG index 1eb18db1..1ae83bc7 100644 --- a/com32/lib/MCONFIG +++ b/com32/lib/MCONFIG @@ -24,7 +24,7 @@ REQFLAGS = $(GCCOPT) -g -mregparm=3 -DREGPARM=3 -D__COM32__ \ -nostdinc -iwithprefix include -I. -I./sys -I../include OPTFLAGS = -Os -march=i386 -falign-functions=0 -falign-jumps=0 \ -falign-labels=0 -ffast-math -fomit-frame-pointer -WARNFLAGS = -W -Wall -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline +WARNFLAGS = $(GCCWARN) -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline CFLAGS = $(OPTFLAGS) $(REQFLAGS) $(WARNFLAGS) $(LIBFLAGS) LDFLAGS = -m elf32_i386 diff --git a/com32/rosh/MCONFIG b/com32/rosh/MCONFIG index 30029d15..25c41396 100644 --- a/com32/rosh/MCONFIG +++ b/com32/rosh/MCONFIG @@ -17,11 +17,11 @@ ## Include the COM32 common configurables include ../MCONFIG -# CFLAGS = $(GCCOPT) -W -Wall -march=i386 \ +# CFLAGS = $(GCCOPT) $(GCCWARN) -march=i386 \ # -fomit-frame-pointer -D__COM32__ \ # -nostdinc -iwithprefix include \ # -I$(com32)/libutil/include -I$(com32)/include # -g3 -dD -# LNXCFLAGS = -I$(com32)/libutil/include -W -Wall -O -g3 -D_GNU_SOURCE -dD +# LNXCFLAGS = -I$(com32)/libutil/include $(GCCWARN) -O -g3 -D_GNU_SOURCE -dD # -U__GNUC__ diff --git a/extlinux/Makefile b/extlinux/Makefile index 48105338..23ffd400 100644 --- a/extlinux/Makefile +++ b/extlinux/Makefile @@ -19,7 +19,7 @@ include $(topdir)/MCONFIG OPTFLAGS = -g -Os INCLUDES = -I. -I.. -I../libinstaller -CFLAGS = -W -Wall -Wno-sign-compare -D_FILE_OFFSET_BITS=64 \ +CFLAGS = $(GCCWARN) -Wno-sign-compare -D_FILE_OFFSET_BITS=64 \ $(OPTFLAGS) $(INCLUDES) LDFLAGS = # -s diff --git a/linux/Makefile b/linux/Makefile index a469cefd..8872c0fc 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -19,7 +19,7 @@ include $(topdir)/MCONFIG OPTFLAGS = -g -Os INCLUDES = -I. -I.. -I../libinstaller -CFLAGS = -W -Wall -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES) +CFLAGS = $(GCCWARN) -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES) LDFLAGS = -s SRCS = syslinux.c \ diff --git a/memdisk/Makefile b/memdisk/Makefile index 09f17c8e..2e6330f9 100644 --- a/memdisk/Makefile +++ b/memdisk/Makefile @@ -91,7 +91,7 @@ memdisk: memdisk16.bin memdisk32.bin postprocess.pl $(PERL) postprocess.pl $@ memdisk16.bin memdisk32.bin e820test: e820test.c e820func.c msetup.c - $(CC) -m32 -g -W -Wall -DTEST -o $@ $^ + $(CC) -m32 -g $(GCCWARN) -DTEST -o $@ $^ # This file contains the version number, so add a dependency for it setup.s: ../version diff --git a/mtools/Makefile b/mtools/Makefile index b5517805..91b68527 100644 --- a/mtools/Makefile +++ b/mtools/Makefile @@ -3,7 +3,7 @@ include $(topdir)/MCONFIG OPTFLAGS = -g -Os INCLUDES = -I. -I.. -I../libfat -I../libinstaller -CFLAGS = -W -Wall -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES) +CFLAGS = $(GCCWARN) -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES) LDFLAGS = -s SRCS = syslinux.c \ diff --git a/utils/Makefile b/utils/Makefile index 39adf7d3..7fdf631d 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -17,7 +17,7 @@ topdir = .. include $(topdir)/MCONFIG -CFLAGS = -W -Wall -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 +CFLAGS = $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 LDFLAGS = -O2 -s TARGETS = mkdiskimage isohybrid gethostip diff --git a/win32/Makefile b/win32/Makefile index 964b74c5..a0be1d46 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -21,7 +21,7 @@ OSTYPE = $(shell uname -msr) ifeq ($(findstring CYGWIN,$(OSTYPE)),CYGWIN) ## Compiling on Cygwin WINPREFIX := -WINCFLAGS := -mno-cygwin -W -Wall -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 +WINCFLAGS := -mno-cygwin $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 WINLDFLAGS := -mno-cygwin -Os -s else ## Compiling on some variant of MinGW @@ -30,7 +30,7 @@ WINPREFIX := else WINPREFIX := $(shell ./find-mingw.sh gcc) endif -WINCFLAGS := -W -Wall -Wno-sign-compare -Os -fomit-frame-pointer \ +WINCFLAGS := $(GCCWARN) -Wno-sign-compare -Os -fomit-frame-pointer \ -D_FILE_OFFSET_BITS=64 WINLDFLAGS := -Os -s endif |