1 # $FreeBSD: src/share/mk/bsd.sys.mk,v 1.3.2.5 2002/07/03 16:59:14 des Exp $
3 # This file contains common settings used for building DragonFly
10 .elif ${CSTD} == "c89" || ${CSTD} == "c90"
11 CFLAGS += -std=iso9899:1990
12 .elif ${CSTD} == "c94" || ${CSTD} == "c95"
13 CFLAGS += -std=iso9899:199409
14 .elif ${CSTD} == "c99"
15 CFLAGS += -std=iso9899:1999
17 CFLAGS += -std=${CSTD}
20 # Enable various levels of compiler warning checks. These may be
21 # overridden (e.g. if using a non-gcc compiler) by defining NO_WARNS.
23 .if !defined(NO_WARNS)
26 CWARNFLAGS += -Wsystem-headers
27 . if !defined(NO_WERROR) && (${CCVER} == "gcc44" || ${CCVER} == "gcc47")
32 CWARNFLAGS += -Wall -Wno-pointer-sign
35 CWARNFLAGS += -Wextra -Wno-unused-parameter -Wstrict-prototypes\
36 -Wmissing-prototypes -Wpointer-arith\
37 -Wold-style-definition
40 CWARNFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch\
41 -Wshadow -Wcast-align -Wunused-parameter
44 CWARNFLAGS += -Wchar-subscripts -Winline -Wnested-externs\
47 . if ${WARNS} >= 2 && ${WARNS} <= 4
48 # XXX Delete -Wuninitialized by default for now -- the compiler doesn't
49 # XXX always get it right.
50 CWARNFLAGS += -Wno-uninitialized
52 # Activate gcc47's -Wunused-but-set-variable (which is in -Wall) and
53 # -Wunused-but-set-parameter (which is in -Wextra) only at WARNS >= 4
54 # (which is the level when also -Wunused-parameter comes into play).
55 . if ${WARNS} >= 2 && ${WARNS} <= 3 && ${CCVER} == "gcc47"
56 CWARNFLAGS += -Wno-unused-but-set-variable
58 . if ${WARNS} == 3 && ${CCVER} == "gcc47"
59 CWARNFLAGS += -Wno-unused-but-set-parameter
63 . if defined(FORMAT_AUDIT)
68 CWARNFLAGS += -Wformat=2 -Wno-format-extra-args
69 . if !defined(NO_WERROR) && (${CCVER} == "gcc47" || ${CCVER} == "gcc44")
76 # Allow user-specified additional warning flags
77 CFLAGS += ${CWARNFLAGS}
79 # Tell bmake not to mistake standard targets for things to be searched for
80 # or expect to ever be up-to-date
81 PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \
82 beforelinking build build-tools buildfiles buildincludes \
83 checkdpadd clean cleandepend cleandir cleanobj configure \
84 depend dependall distclean distribute exe extract fetch \
85 html includes install installfiles installincludes lint \
86 obj objlink objs objwarn patch realall realdepend \
87 realinstall regress subdir-all subdir-depend subdir-install \
90 .PHONY: ${PHONY_NOTMAIN}
91 .NOTMAIN: ${PHONY_NOTMAIN}