* s/FreeBSD/DragonFly/
[dragonfly.git] / share / mk / bsd.sys.mk
CommitLineData
984263bc 1# $FreeBSD: src/share/mk/bsd.sys.mk,v 1.3.2.5 2002/07/03 16:59:14 des Exp $
114580ac 2# $DragonFly: src/share/mk/bsd.sys.mk,v 1.9 2006/08/12 22:34:23 swildner Exp $
984263bc 3#
114580ac 4# This file contains common settings used for building DragonFly
984263bc
MD
5# sources.
6
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.
9
10.if !defined(NO_WARNS)
11. if defined(WARNS)
984263bc
MD
12# XXX Delete -Wuninitialized by default for now -- the compiler doesn't
13# XXX always get it right.
cf277b96 14. if ${WARNS} <= 4
984263bc 15CFLAGS += -Wno-uninitialized
cf277b96
JS
16. endif
17. if defined(WARNS_WERROR) && !defined(NO_WERROR)
984263bc 18CFLAGS += -Werror
984263bc 19. endif
cf277b96 20. if ${WARNS} > 0
d90d8005 21CFLAGS += -Wunknown-pragmas -Wsystem-headers
cf277b96 22.endif
984263bc 23. if ${WARNS} > 1
c8960d50
JR
24CFLAGS += -Wall
25. endif
26. if ${WARNS} > 2
27CFLAGS += -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
28. endif
29. if ${WARNS} > 3
30CFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align
31. endif
32. if ${WARNS} > 5
33CFLAGS += -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls
984263bc
MD
34. endif
35. endif
36
37. if defined(FORMAT_AUDIT)
38WFORMAT = 1
39. endif
40. if defined(WFORMAT)
41. if ${WFORMAT} > 0
a74a8e46 42CFLAGS += -Wno-format-extra-args
984263bc
MD
43. if defined(WARNS_WERROR) && !defined(NO_WERROR)
44CFLAGS += -Werror
45. endif
46. endif
47. endif
48.endif
49
04214b4c
JS
50.if defined(WARNS_NO_UNUSED_PARAMETERS)
51CFLAGS+= -Wno-unused-parameters
52.endif
53
984263bc
MD
54# Allow user-specified additional warning flags
55CFLAGS += ${CWARNFLAGS}