From eaa2247dfa2d78bf7e2a6acc66fd85b9475746bf Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 28 May 2016 16:12:57 -0500 Subject: [PATCH] Makefile: use -Wno-pedantic-ms-format for MinGW builds --- Makefile | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 969dfe7..5bedac1 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,24 @@ # ############################################################################## +#### Common compiler flags. +#### Flags given here are not intended to be overridden, but you can add more +#### by defining CFLAGS in the environment or on the 'make' command line. + +cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null \ + 1>&2 2>/dev/null; then echo $(1); fi) + +override CFLAGS := \ + $(CFLAGS) -O2 -fomit-frame-pointer -std=c99 -I. -Icommon \ + -Wall -Wundef \ + $(call cc-option,-Wpedantic) \ + $(call cc-option,-Wdeclaration-after-statement) \ + $(call cc-option,-Wmissing-prototypes) \ + $(call cc-option,-Wstrict-prototypes) \ + $(call cc-option,-Wvla) + +############################################################################## + STATIC_LIB_SUFFIX := .a SHARED_LIB_SUFFIX := .so PROG_SUFFIX := @@ -31,28 +49,11 @@ ifneq ($(findstring -mingw,$(CC)),) PROG_CFLAGS := -static -municode PIC_REQUIRED := HARD_LINKS := + override CFLAGS := $(CFLAGS) $(call cc-option,-Wno-pedantic-ms-format) endif ############################################################################## -#### Common compiler flags. -#### Flags given here are not intended to be overridden, but you can add more -#### by defining CFLAGS in the environment or on the 'make' command line. - -cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null \ - 1>&2 2>/dev/null; then echo $(1); fi) - -override CFLAGS := \ - $(CFLAGS) -O2 -fomit-frame-pointer -std=c99 -I. -Icommon \ - -Wall -Wundef \ - $(call cc-option,-Wpedantic) \ - $(call cc-option,-Wdeclaration-after-statement) \ - $(call cc-option,-Wmissing-prototypes) \ - $(call cc-option,-Wstrict-prototypes) \ - $(call cc-option,-Wvla) - -############################################################################## - #### Quiet make is enabled by default. Define V=1 to disable. ifneq ($(findstring s,$(MAKEFLAGS)),s)