Replace legacy make with bmake
[dragonfly.git] / share / mk / bsd.sys.mk
CommitLineData
984263bc
MD
1# $FreeBSD: src/share/mk/bsd.sys.mk,v 1.3.2.5 2002/07/03 16:59:14 des Exp $
2#
114580ac 3# This file contains common settings used for building DragonFly
984263bc
MD
4# sources.
5
72819462
SW
6CSTD?= gnu99
7
8.if ${CSTD} == "k&r"
6dd73847 9CFLAGS += -traditional
72819462 10.elif ${CSTD} == "c89" || ${CSTD} == "c90"
6dd73847 11CFLAGS += -std=iso9899:1990
72819462 12.elif ${CSTD} == "c94" || ${CSTD} == "c95"
6dd73847 13CFLAGS += -std=iso9899:199409
72819462 14.elif ${CSTD} == "c99"
6dd73847 15CFLAGS += -std=iso9899:1999
72819462 16.else
6dd73847 17CFLAGS += -std=${CSTD}
c222c6d2
SW
18.endif
19
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.
22
23.if !defined(NO_WARNS)
6dd73847 24. if defined(WARNS)
38842275 25. if ${WARNS} >= 1
6dd73847 26CWARNFLAGS += -Wsystem-headers
c9a7b745 27. if !defined(NO_WERROR) && ${CCVER} == "gcc44"
dcdd01ca
SW
28CWARNFLAGS += -Werror
29. endif
6dd73847 30. endif
38842275 31. if ${WARNS} >= 2
db52ce66 32CWARNFLAGS += -Wall -Wno-pointer-sign
c8960d50 33. endif
38842275 34. if ${WARNS} >= 3
00be51d6 35CWARNFLAGS += -Wextra -Wno-unused-parameter -Wstrict-prototypes\
e7302aa0
SW
36 -Wmissing-prototypes -Wpointer-arith\
37 -Wold-style-definition
c8960d50 38. endif
38842275 39. if ${WARNS} >= 4
6dd73847
PA
40CWARNFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch\
41 -Wshadow -Wcast-align -Wunused-parameter
c8960d50 42. endif
38842275 43. if ${WARNS} >= 6
00be51d6
SW
44CWARNFLAGS += -Wchar-subscripts -Winline -Wnested-externs\
45 -Wredundant-decls
6dd73847
PA
46. endif
47. if ${WARNS} >= 2 && ${WARNS} <= 4
48# XXX Delete -Wuninitialized by default for now -- the compiler doesn't
49# XXX always get it right.
50CWARNFLAGS += -Wno-uninitialized
984263bc 51. endif
c0b7aaeb
SW
52# Activate gcc47's -Wunused-but-set-variable (which is in -Wall) and
53# -Wunused-but-set-parameter (which is in -Wextra) only at WARNS >= 4
54# (which is the level when also -Wunused-parameter comes into play).
55. if ${WARNS} >= 2 && ${WARNS} <= 3 && ${CCVER} == "gcc47"
56CWARNFLAGS += -Wno-unused-but-set-variable
57. endif
58. if ${WARNS} == 3 && ${CCVER} == "gcc47"
59CWARNFLAGS += -Wno-unused-but-set-parameter
60. endif
984263bc
MD
61. endif
62
63. if defined(FORMAT_AUDIT)
64WFORMAT = 1
65. endif
66. if defined(WFORMAT)
67. if ${WFORMAT} > 0
6dd73847 68CWARNFLAGS += -Wformat=2 -Wno-format-extra-args
f0140465 69. if !defined(NO_WERROR) && (${CCVER} == "gcc47" || ${CCVER} == "gcc44")
dcdd01ca
SW
70CWARNFLAGS += -Werror
71. endif
984263bc
MD
72. endif
73. endif
74.endif
75
76# Allow user-specified additional warning flags
77CFLAGS += ${CWARNFLAGS}
3da8e88f
JM
78
79# Tell bmake not to mistake standard targets for things to be searched for
80# or expect to ever be up-to-date
81PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \
82 beforelinking build build-tools buildfiles buildincludes \
83 checkdpadd clean cleandepend cleandir cleanobj configure \
84 depend dependall distclean distribute exe extract fetch \
85 html includes install installfiles installincludes lint \
86 obj objlink objs objwarn patch realall realdepend \
87 realinstall regress subdir-all subdir-depend subdir-install \
88 tags whereobj
89
90.PHONY: ${PHONY_NOTMAIN}
91.NOTMAIN: ${PHONY_NOTMAIN}