projects
/
apps
/
pfixtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Exclude -Wredundant-decls and -Wshadow only when compiling server.c.
[apps/pfixtools.git]
/
mk
/
cflags.mk
diff --git
a/mk/cflags.mk
b/mk/cflags.mk
index
13361af
..
1dcdb31
100644
(file)
--- a/
mk/cflags.mk
+++ b/
mk/cflags.mk
@@
-1,5
+1,5
@@
##############################################################################
##############################################################################
-# p
ostlicyd: a postfix policy daemon with a lot of features
#
+# p
fixtools: a collection of postfix related tools
#
# ~~~~~~~~~ #
# ________________________________________________________________________ #
# #
# ~~~~~~~~~ #
# ________________________________________________________________________ #
# #
@@
-29,65
+29,61
@@
# THE POSSIBILITY OF SUCH DAMAGE. #
##############################################################################
# THE POSSIBILITY OF SUCH DAMAGE. #
##############################################################################
-GCCVERSION:=$(shell $(CC) -dumpversion)
-GCCMACHINE:=$(shell $(CC) -dumpmachine)
-OBJSUFFIX:=-$(GCCMACHINE:-linux-gnu=)-$(GCCVERSION)
-
-ifneq (,$(filter 4.%,$(GCCVERSION)))
+ifneq ($(filter 4.%,$(shell gcc -dumpversion)),)
GCC4=1
endif
GCC4=1
endif
-
-LDFLAGS += -Wl,--warn-common
+ifneq ($(filter Darwin%,$(shell uname)),)
+ DARWIN=1
+endif
# Use pipes and not temp files.
# Use pipes and not temp files.
-CFLAGS += -pipe
+CFLAGS
BASE
+= -pipe
# optimize even more
# optimize even more
-CFLAGS += -O2
+CFLAGS
BASE
+= -O2
# let the type char be unsigned by default
# let the type char be unsigned by default
-CFLAGS += -funsigned-char
-CFLAGS += -fstrict-aliasing
+CFLAGS
BASE
+= -funsigned-char
+CFLAGS
BASE
+= -fstrict-aliasing
# turn on all common warnings
# turn on all common warnings
-CFLAGS += -Wall
+CFLAGS
BASE
+= -Wall
# turn on extra warnings
# turn on extra warnings
-CFLAGS += $(if $(GCC4),-Wextra,-W)
+CFLAGS
BASE
+= $(if $(GCC4),-Wextra,-W)
# treat warnings as errors
# treat warnings as errors
-CFLAGS += -Werror
-CFLAGS += -Wchar-subscripts
+CFLAGS
BASE
+= -Werror
+CFLAGS
BASE
+= -Wchar-subscripts
# warn about undefined preprocessor identifiers
# warn about undefined preprocessor identifiers
-CFLAGS += -Wundef
+CFLAGS
BASE
+= -Wundef
# warn about local variable shadowing another local variable
# warn about local variable shadowing another local variable
-CFLAGS += -Wshadow
+# # disabled on Darwin because of warnings in ev.h
+CFLAGSBASE += -Wshadow
# warn about casting of pointers to increased alignment requirements
# warn about casting of pointers to increased alignment requirements
-CFLAGS += -Wcast-align
+CFLAGS
BASE
+= -Wcast-align
# make string constants const
# make string constants const
-CFLAGS += -Wwrite-strings
+CFLAGS
BASE
+= -Wwrite-strings
# warn about implicit conversions with side effects
# fgets, calloc and friends take an int, not size_t...
# warn about implicit conversions with side effects
# fgets, calloc and friends take an int, not size_t...
-#CFLAGS += -Wconversion
+#CFLAGS
BASE
+= -Wconversion
# warn about comparisons between signed and unsigned values
# warn about comparisons between signed and unsigned values
-CFLAGS += -Wsign-compare
+CFLAGS
BASE
+= -Wsign-compare
# warn about unused declared stuff
# warn about unused declared stuff
-CFLAGS += -Wunused
-# do not warn about unused function parameters
-CFLAGS += -Wno-unused-parameter
-# do not warn about unused statement value
-#CFLAGS += -Wno-unused-value
+CFLAGSBASE += -Wunused
+CFLAGSBASE += -Wno-unused-parameter
# warn about variable use before initialization
# warn about variable use before initialization
-CFLAGS += -Wuninitialized
+CFLAGS
BASE
+= -Wuninitialized
# warn about variables which are initialized with themselves
# warn about variables which are initialized with themselves
-CFLAGS += $(if $(GCC4),-Winit-self)
+CFLAGS
BASE
+= $(if $(GCC4),-Winit-self)
# warn about pointer arithmetic on void* and function pointers
# warn about pointer arithmetic on void* and function pointers
-CFLAGS += -Wpointer-arith
+CFLAGS
BASE
+= -Wpointer-arith
# warn about multiple declarations
# warn about multiple declarations
-CFLAGS += -Wredundant-decls
+# #disabled on Darwin because of warnings in ev.h
+CFLAGSBASE += -Wredundant-decls
# warn if the format string is not a string literal
# warn if the format string is not a string literal
-CFLAGS += -Wformat-nonliteral
+CFLAGS
BASE
+= -Wformat-nonliteral
# do not warn about zero-length formats.
# do not warn about zero-length formats.
-CFLAGS += -Wno-format-zero-length
+CFLAGS
BASE
+= -Wno-format-zero-length
# do not warn about strftime format with y2k issues
# do not warn about strftime format with y2k issues
-CFLAGS += -Wno-format-y2k
+CFLAGS
BASE
+= -Wno-format-y2k
# warn about functions without format attribute that should have one
# warn about functions without format attribute that should have one
-CFLAGS += -Wmissing-format-attribute
-# barf if we change constness
-#CFLAGS += -Wcast-qual
+CFLAGSBASE += -Wmissing-format-attribute
+CFLAGS=$(CFLAGSBASE)
+LDFLAGS=$(LDFLAGSBASE)