xref: /dragonfly/share/mk/bsd.sys.mk (revision 2d8a3be7)
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.3 2003/08/14 18:28:49 dillon Exp $
3#
4# This file contains common settings used for building FreeBSD
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)
12.  if ${WARNS} > 0
13CFLAGS		+=	-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
14# XXX Delete -Wuninitialized by default for now -- the compiler doesn't
15# XXX always get it right.
16CFLAGS		+=	-Wno-uninitialized
17.   if defined(WARNS_WERROR) && !defined(NO_WERROR)
18CFLAGS		+=	-Werror
19.   endif
20.  endif
21.  if ${WARNS} > 1
22CFLAGS		+=	-Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow
23.  endif
24. endif
25
26. if defined(FORMAT_AUDIT)
27WFORMAT		=	1
28. endif
29. if defined(WFORMAT)
30.  if ${WFORMAT} > 0
31CFLAGS		+=	-Wnon-const-format -Wno-format-extra-args
32.   if defined(WARNS_WERROR) && !defined(NO_WERROR)
33CFLAGS		+=	-Werror
34.   endif
35.  endif
36. endif
37.endif
38
39# Allow user-specified additional warning flags
40CFLAGS		+=	${CWARNFLAGS}
41
42