MFC:
[dragonfly.git] / share / mk / bsd.sys.mk
blob6bf9e1fbe23b946fa351327bf9c1c3ec772e3ac6
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.10 2007/09/07 00:09:02 pavalos 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(WARNS)
12 # XXX Delete -Wuninitialized by default for now -- the compiler doesn't
13 # XXX always get it right.
14 . if ${WARNS} <= 4
15 CFLAGS += -Wno-uninitialized
16 . endif
17 . if defined(WARNS_WERROR) && !defined(NO_WERROR)
18 CFLAGS += -Werror
19 . endif
20 . if ${WARNS} >= 1
21 CFLAGS += -Wunknown-pragmas -Wsystem-headers
22 .endif
23 . if ${WARNS} >= 2
24 CFLAGS += -Wall
25 . endif
26 . if ${WARNS} >= 3
27 CFLAGS += -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
28 . endif
29 . if ${WARNS} >= 4
30 CFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align
31 . endif
32 . if ${WARNS} >= 6
33 CFLAGS += -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls
34 . endif
35 . endif
37 . if defined(FORMAT_AUDIT)
38 WFORMAT = 1
39 . endif
40 . if defined(WFORMAT)
41 . if ${WFORMAT} > 0
42 CFLAGS += -Wno-format-extra-args
43 . if defined(WARNS_WERROR) && !defined(NO_WERROR)
44 CFLAGS += -Werror
45 . endif
46 . endif
47 . endif
48 .endif
50 .if defined(WARNS_NO_UNUSED_PARAMETERS)
51 CFLAGS+= -Wno-unused-parameters
52 .endif
54 # Allow user-specified additional warning flags
55 CFLAGS += ${CWARNFLAGS}