get mxge to build, stage 6/many
[dragonfly.git] / share / mk / bsd.sys.mk
bloba008d668c224f5fb6ca65bbdf5b2aabd97ff4e74
1 # $FreeBSD: src/share/mk/bsd.sys.mk,v 1.3.2.5 2002/07/03 16:59:14 des Exp $
2 # $DragonFly: src/share/mk/bsd.sys.mk,v 1.12 2008/11/14 15:04:42 swildner Exp $
4 # This file contains common settings used for building DragonFly
5 # sources.
7 # Enable various levels of compiler warning checks. These may be
8 # overridden (e.g. if using a non-gcc compiler) by defining NO_WARNS.
10 .if !defined(NO_WARNS)
11 . if defined(CSTD)
12 . if ${CSTD} == "k&r"
13 CFLAGS += -traditional
14 . elif ${CSTD} == "c89" || ${CSTD} == "c90"
15 CFLAGS += -std=iso9899:1990
16 . elif ${CSTD} == "c94" || ${CSTD} == "c95"
17 CFLAGS += -std=iso9899:199409
18 . elif ${CSTD} == "c99"
19 CFLAGS += -std=iso9899:1999
20 . else
21 CFLAGS += -std=${CSTD}
22 . endif
23 . endif
24 . if defined(WARNS)
25 . if ${WARNS} >= 1
26 CWARNFLAGS += -Wsystem-headers
27 . if defined(WARNS_WERROR) && !defined(NO_WERROR)
28 CWARNFLAGS += -Werror
29 . endif
30 . endif
31 . if ${WARNS} >= 2
32 CWARNFLAGS += -Wall
33 . endif
34 . if ${WARNS} >= 3
35 CWARNFLAGS += -W -Wno-unused-parameter -Wstrict-prototypes\
36 -Wmissing-prototypes -Wpointer-arith
37 . endif
38 . if ${WARNS} >= 4
39 CWARNFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch\
40 -Wshadow -Wcast-align -Wunused-parameter
41 . endif
42 . if ${WARNS} >= 6
43 CWARNFLAGS += -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls
44 . endif
45 . if ${WARNS} >= 2 && ${WARNS} <= 4
46 # XXX Delete -Wuninitialized by default for now -- the compiler doesn't
47 # XXX always get it right.
48 CWARNFLAGS += -Wno-uninitialized
49 . endif
50 . endif
52 . if defined(FORMAT_AUDIT)
53 WFORMAT = 1
54 . endif
55 . if defined(WFORMAT)
56 . if ${WFORMAT} > 0
57 CWARNFLAGS += -Wformat=2 -Wno-format-extra-args
58 . if defined(WARNS_WERROR) && !defined(NO_WERROR)
59 CWARNFLAGS += -Werror
60 . endif
61 . endif
62 . endif
63 .endif
65 # Allow user-specified additional warning flags
66 CFLAGS += ${CWARNFLAGS}