[syslinux:master] Makefile: replace -W -Wall with centralized $(GCCWARN)

syslinux-bot for H. Peter Anvin hpa at zytor.com
Sun Jan 10 12:51:02 PST 2010


Commit-ID:  71d20885019564586d5f4d316af220cdae2900f5
Gitweb:     http://syslinux.zytor.com/commit/71d20885019564586d5f4d316af220cdae2900f5
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Sun, 10 Jan 2010 12:48:06 -0800
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Sun, 10 Jan 2010 12:49:30 -0800

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 at zytor.com>


---
 MCONFIG            |    3 +++
 MCONFIG.embedded   |    2 +-
 com32/MCONFIG      |    6 +++---
 com32/lib/MCONFIG  |    2 +-
 com32/rosh/MCONFIG |    4 ++--
 extlinux/Makefile  |    2 +-
 linux/Makefile     |    2 +-
 memdisk/Makefile   |    2 +-
 mtools/Makefile    |    2 +-
 utils/Makefile     |    2 +-
 win32/Makefile     |    4 ++--
 11 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/MCONFIG b/MCONFIG
index a716c6c..c73520b 100644
--- a/MCONFIG
+++ b/MCONFIG
@@ -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 586afc3..37abe91 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 f8d9d97..578e283 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 1eb18db..1ae83bc 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 30029d1..25c4139 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 4810533..23ffd40 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 a469cef..8872c0f 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 09f17c8..2e6330f 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 b551780..91b6852 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 39adf7d..7fdf631 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 964b74c..a0be1d4 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



More information about the Syslinux-commits mailing list