1 ##############################################################################
2 # pfixtools: a collection of postfix related tools #
4 # ________________________________________________________________________ #
6 # Redistribution and use in source and binary forms, with or without #
7 # modification, are permitted provided that the following conditions #
10 # 1. Redistributions of source code must retain the above copyright #
11 # notice, this list of conditions and the following disclaimer. #
12 # 2. Redistributions in binary form must reproduce the above copyright #
13 # notice, this list of conditions and the following disclaimer in the #
14 # documentation and/or other materials provided with the distribution. #
15 # 3. The names of its contributors may not be used to endorse or promote #
16 # products derived from this software without specific prior written #
19 # THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS #
20 # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #
21 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #
22 # DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY #
23 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL #
24 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS #
25 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) #
26 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, #
27 # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
28 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
29 # POSSIBILITY OF SUCH DAMAGE. #
31 # Copyright (c) 2006-2008 the Authors #
32 # see AUTHORS and source files for details #
33 ##############################################################################
36 ifneq ($(filter 4.%,$(shell gcc -dumpversion)),)
39 ifneq ($(filter Darwin%,$(shell uname)),)
43 # Use pipes and not temp files.
47 # let the type char be unsigned by default
48 CFLAGSBASE += -funsigned-char
49 CFLAGSBASE += -fno-strict-aliasing
50 # turn on all common warnings
52 # turn on extra warnings
53 CFLAGSBASE += $(if $(GCC4),-Wextra,-W)
54 # treat warnings as errors
56 CFLAGSBASE += -Wchar-subscripts
57 # warn about undefined preprocessor identifiers
59 # warn about local variable shadowing another local variable
60 # # disabled on Darwin because of warnings in ev.h
61 CFLAGSBASE += -Wshadow
62 # warn about casting of pointers to increased alignment requirements
63 CFLAGSBASE += -Wcast-align
64 # make string constants const
65 CFLAGSBASE += -Wwrite-strings
66 # warn about implicit conversions with side effects
67 # fgets, calloc and friends take an int, not size_t...
68 #CFLAGSBASE += -Wconversion
69 # warn about comparisons between signed and unsigned values
70 CFLAGSBASE += -Wsign-compare
71 # warn about unused declared stuff
72 CFLAGSBASE += -Wunused
73 CFLAGSBASE += -Wno-unused-parameter
74 # warn about variable use before initialization
75 CFLAGSBASE += -Wuninitialized
76 # warn about variables which are initialized with themselves
77 CFLAGSBASE += $(if $(GCC4),-Winit-self)
78 # warn about pointer arithmetic on void* and function pointers
79 CFLAGSBASE += -Wpointer-arith
80 # warn about multiple declarations
81 # #disabled on Darwin because of warnings in ev.h
82 CFLAGSBASE += -Wredundant-decls
83 # warn if the format string is not a string literal
84 CFLAGSBASE += -Wformat-nonliteral
85 # do not warn about zero-length formats.
86 CFLAGSBASE += -Wno-format-zero-length
87 # do not warn about strftime format with y2k issues
88 CFLAGSBASE += -Wno-format-y2k
89 # warn about functions without format attribute that should have one
90 CFLAGSBASE += -Wmissing-format-attribute
93 LDFLAGS=$(LDFLAGSBASE)