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
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
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)
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
-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
## 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__
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
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 \
$(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
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 \
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
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
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