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
+= -Wmissing-include-dirs
-Wsystem-headers
27 . if
!defined
(NO_WERROR
) && ${CCVER
:Mgcc
*}
32 CWARNFLAGS
+= -Wall
-Wformat-security
-Winit-self
-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 -Wmaybe-uninitialized by default for now -- the compiler doesn't
49 # XXX always get it right.
51 CWARNFLAGS
+= -Wno-maybe-uninitialized
53 CWARNFLAGS
+= -Wno-uninitialized
56 # Activate gcc47's -Wunused-but-set-variable (which is in -Wall) and
57 # -Wunused-but-set-parameter (which is in -Wextra) only at WARNS >= 4
58 # (which is the level when also -Wunused-parameter comes into play).
59 # unused-local-typedef warnings were introduced by gcc4.8, are in -Wall
60 . if
${WARNS} >= 2 && ${WARNS} <= 3 && ${CCVER
:Mgcc
*}
61 CWARNFLAGS
+= -Wno-unused-but-set-variable
63 . if
${WARNS} == 3 && ${CCVER
:Mgcc
*}
64 CWARNFLAGS
+= -Wno-unused-but-set-parameter
66 . if
${WARNS} == 3 && (${CCVER
:Mgcc4
[89]} ||
${CCVER
:Mgcc5
*})
67 CWARNFLAGS
+= -Wno-unused-local-typedefs
69 . if
${WARNS} == 3 && (${CCVER
:Mgcc49
} ||
${CCVER
:Mgcc5
*})
70 CWARNFLAGS
+= -Wno-unused-value
72 . if
${WARNS} >= 2 && ${CCVER
:Mgcc4
[789]}
73 CWARNFLAGS
+= -Wno-error
=maybe-uninitialized\
74 -Wno-error
=uninitialized\
79 . if defined
(FORMAT_AUDIT
)
84 CWARNFLAGS
+= -Wformat
=2 -Wno-format-extra-args
85 . if
!defined
(NO_WERROR
) && ${CCVER
:Mgcc
*}
92 .if defined
(NO_WARRAY_BOUNDS
)
93 CWARNFLAGS
+= -Wno-array-bounds
95 .if defined
(NO_STRICT_OVERFLOW
)
96 CFLAGS
+= -fno-strict-overflow
98 .if defined
(NO_STRICT_ALIASING
)
99 CFLAGS
+= -fno-strict-aliasing
103 # Allow user-specified additional warning flags
104 CFLAGS
+= ${CWARNFLAGS}
106 # Tell bmake not to mistake standard targets for things to be searched for
107 # or expect to ever be up-to-date
108 PHONY_NOTMAIN
= afterdepend afterinstall
all beforedepend beforeinstall \
109 beforelinking build build-tools buildfiles buildincludes \
110 checkdpadd
clean cleandepend cleandir cleanobj configure \
111 depend dependall
distclean distribute exe extract fetch \
112 html includes
install installfiles installincludes lint \
113 obj objlink objs objwarn patch realall realdepend \
114 realinstall regress subdir-all subdir-depend subdir-install \
117 .PHONY
: ${PHONY_NOTMAIN}
118 .NOTMAIN
: ${PHONY_NOTMAIN}