xref: /freebsd/share/mk/bsd.sys.mk (revision 5036d9652a5701d00e9e40ea942c278e9f77d33d)
1#
2# This file contains common settings used for building FreeBSD
3# sources.
4
5# Enable various levels of compiler warning checks.  These may be
6# overridden (e.g. if using a non-gcc compiler) by defining MK_WARNS=no.
7
8# for GCC:   https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
9# for clang: https://clang.llvm.org/docs/DiagnosticsReference.html
10
11.include <bsd.compiler.mk>
12
13# the default is gnu99 for now
14CSTD?=		gnu99
15
16.if ${CSTD} == "c89" || ${CSTD} == "c90"
17CFLAGS+=	-std=iso9899:1990
18.elif ${CSTD} == "c94" || ${CSTD} == "c95"
19CFLAGS+=	-std=iso9899:199409
20.elif ${CSTD} == "c99"
21CFLAGS+=	-std=iso9899:1999
22.else # CSTD
23CFLAGS+=	-std=${CSTD}
24.endif # CSTD
25
26.if !empty(CXXSTD)
27CXXFLAGS+=	-std=${CXXSTD}
28.endif
29
30# This gives the Makefile we're evaluating at the top-level a chance to set
31# WARNS.  If it doesn't do so, we may freely pull a DEFAULTWARNS if it's set
32# and use that.  This allows us to default WARNS to 6 for src builds without
33# needing to set the default in various Makefile.inc.
34.if !defined(WARNS) && defined(DEFAULTWARNS)
35WARNS=	${DEFAULTWARNS}
36.endif
37
38# -pedantic is problematic because it also imposes namespace restrictions
39#CFLAGS+=	-pedantic
40.if defined(WARNS)
41.if ${WARNS} >= 1
42CWARNFLAGS+=	-Wsystem-headers
43.if ${MK_WERROR} != "no" && ${MK_WERROR.${COMPILER_TYPE}:Uyes} != "no"
44CWARNFLAGS+=	-Werror
45.endif # ${MK_WERROR} != "no" && ${MK_WERROR.${COMPILER_TYPE}:Uyes} != "no"
46.endif # WARNS >= 1
47.if ${WARNS} >= 2
48CWARNFLAGS+=	-Wall -Wno-format-y2k
49.endif # WARNS >= 2
50.if ${WARNS} >= 3
51CWARNFLAGS+=	-W -Wno-unused-parameter
52.if ${COMPILER_TYPE} == "clang"
53CWARNFLAGS+=	-Wstrict-prototypes
54.endif
55CWARNFLAGS+=	-Wmissing-prototypes -Wpointer-arith
56.endif # WARNS >= 3
57.if ${WARNS} >= 4
58CWARNFLAGS+=	-Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow\
59		-Wunused-parameter
60.if !defined(NO_WCAST_ALIGN) && !defined(NO_WCAST_ALIGN.${COMPILER_TYPE})
61CWARNFLAGS+=	-Wcast-align
62.endif # !NO_WCAST_ALIGN !NO_WCAST_ALIGN.${COMPILER_TYPE}
63.endif # WARNS >= 4
64.if ${WARNS} >= 6
65CWARNFLAGS+=	-Wchar-subscripts -Wnested-externs \
66		-Wold-style-definition
67.if !defined(NO_WMISSING_VARIABLE_DECLARATIONS)
68CWARNFLAGS.clang+=	-Wmissing-variable-declarations
69.endif
70.if !defined(NO_WTHREAD_SAFETY)
71CWARNFLAGS.clang+=	-Wthread-safety
72.endif
73.endif # WARNS >= 6
74.if ${WARNS} >= 2 && ${WARNS} <= 4
75# XXX Delete -Wuninitialized by default for now -- the compiler doesn't
76# XXX always get it right.
77CWARNFLAGS+=	-Wno-uninitialized
78.endif # WARNS >=2 && WARNS <= 4
79CWARNFLAGS+=	-Wno-pointer-sign
80.if !defined(NO_WDATE_TIME)
81CWARNFLAGS+=	-Wdate-time
82.endif # NO_WDATE_TIME
83# Clang has more warnings enabled by default, and when using -Wall, so if WARNS
84# is set to low values, these have to be disabled explicitly.
85.if ${WARNS} <= 6
86CWARNFLAGS.clang+=	-Wno-empty-body -Wno-string-plus-int
87CWARNFLAGS.clang+=	-Wno-unused-const-variable
88.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 150000
89CWARNFLAGS.clang+=	-Wno-error=unused-but-set-parameter
90.endif
91.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 190000
92# Similar to gcc >= 8.1 -Wno-error=cast-function-type below
93CWARNFLAGS.clang+=	-Wno-error=cast-function-type-mismatch
94.endif
95.endif # WARNS <= 6
96.if ${WARNS} <= 3
97CWARNFLAGS.clang+=	-Wno-tautological-compare -Wno-unused-value\
98		-Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion
99CWARNFLAGS.clang+=	-Wno-unused-local-typedef
100CWARNFLAGS.clang+=	-Wno-address-of-packed-member
101.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 90100
102CWARNFLAGS.gcc+=	-Wno-address-of-packed-member
103.endif
104.endif # WARNS <= 3
105.if ${WARNS} <= 2
106CWARNFLAGS.clang+=	-Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter
107.endif # WARNS <= 2
108.if ${WARNS} <= 1
109CWARNFLAGS.clang+=	-Wno-parentheses
110.endif # WARNS <= 1
111.if defined(NO_WARRAY_BOUNDS)
112CWARNFLAGS.clang+=	-Wno-array-bounds
113.endif # NO_WARRAY_BOUNDS
114.if defined(NO_WMISLEADING_INDENTATION) && \
115    ((${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 100000) || \
116      ${COMPILER_TYPE} == "gcc")
117CWARNFLAGS+=		-Wno-misleading-indentation
118.endif # NO_WMISLEADING_INDENTATION
119.if ${COMPILER_VERSION} >= 130000
120NO_WUNUSED_BUT_SET_VARIABLE=	-Wno-unused-but-set-variable
121.endif
122.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 140000
123NO_WBITWISE_INSTEAD_OF_LOGICAL=	-Wno-bitwise-instead-of-logical
124.endif
125.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 150000
126NO_WARRAY_PARAMETER=	-Wno-array-parameter
127NO_WSTRICT_PROTOTYPES=	-Wno-strict-prototypes
128NO_WDEPRECATED_NON_PROTOTYPE=-Wno-deprecated-non-prototype
129.endif
130.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 50200
131NO_WUNUSED_BUT_SET_VARIABLE=-Wno-unused-but-set-variable
132.endif
133.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 100100
134NO_WZERO_LENGTH_BOUNDS=	-Wno-zero-length-bounds
135.endif
136.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 110100
137NO_WARRAY_PARAMETER=	-Wno-array-parameter
138.endif
139.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 120100
140NO_WUSE_AFTER_FREE=	-Wno-use-after-free
141NO_WDANGLING_POINTER=	-Wno-dangling-pointer
142.endif
143.endif # WARNS
144
145.if defined(FORMAT_AUDIT)
146WFORMAT=	1
147.endif # FORMAT_AUDIT
148.if defined(WFORMAT)
149.if ${WFORMAT} > 0
150#CWARNFLAGS+=	-Wformat-nonliteral -Wformat-security -Wno-format-extra-args
151CWARNFLAGS+=	-Wformat=2 -Wno-format-extra-args
152.if ${WARNS:U0} <= 3
153CWARNFLAGS.clang+=	-Wno-format-nonliteral
154.endif # WARNS <= 3
155.if ${MK_WERROR} != "no" && ${MK_WERROR.${COMPILER_TYPE}:Uyes} != "no"
156CWARNFLAGS+=	-Werror
157.endif # ${MK_WERROR} != "no" && ${MK_WERROR.${COMPILER_TYPE}:Uyes} != "no"
158.endif # WFORMAT > 0
159.endif # WFORMAT
160.if defined(NO_WFORMAT) || defined(NO_WFORMAT.${COMPILER_TYPE})
161CWARNFLAGS+=	-Wno-format
162.endif # NO_WFORMAT || NO_WFORMAT.${COMPILER_TYPE}
163
164# GCC
165# We should clean up warnings produced with these flags.
166# They were originally added as a quick hack to enable gcc5/6.
167# The base system requires at least GCC 6.4, but some ports
168# use this file with older compilers.  Request an exprun
169# before changing these.
170.if ${COMPILER_TYPE} == "gcc"
171# GCC 5.2.0
172.if ${COMPILER_VERSION} >= 50200
173CWARNFLAGS+=	-Wno-error=address			\
174		-Wno-error=array-bounds			\
175		-Wno-error=attributes			\
176		-Wno-error=bool-compare			\
177		-Wno-error=cast-align			\
178		-Wno-error=clobbered			\
179		-Wno-error=deprecated-declarations	\
180		-Wno-error=enum-compare			\
181		-Wno-error=extra			\
182		-Wno-error=logical-not-parentheses	\
183		-Wno-error=strict-aliasing		\
184		-Wno-error=uninitialized		\
185		-Wno-error=unused-function		\
186		-Wno-error=unused-value
187.endif
188
189# GCC 6.1.0
190.if ${COMPILER_VERSION} >= 60100
191CWARNFLAGS+=	-Wno-error=empty-body			\
192		-Wno-error=maybe-uninitialized		\
193		-Wno-error=nonnull-compare		\
194		-Wno-error=shift-negative-value		\
195		-Wno-error=tautological-compare		\
196		-Wno-error=unused-const-variable
197.endif
198
199# GCC 7.1.0
200.if ${COMPILER_VERSION} >= 70100
201CWARNFLAGS+=	-Wno-error=bool-operation		\
202		-Wno-error=deprecated			\
203		-Wno-error=expansion-to-defined		\
204		-Wno-error=format-overflow		\
205		-Wno-error=format-truncation		\
206		-Wno-error=implicit-fallthrough		\
207		-Wno-error=int-in-bool-context		\
208		-Wno-error=memset-elt-size		\
209		-Wno-error=noexcept-type		\
210		-Wno-error=nonnull			\
211		-Wno-error=pointer-compare		\
212		-Wno-error=stringop-overflow
213.endif
214
215# GCC 8.1.0
216.if ${COMPILER_VERSION} >= 80100
217CWARNFLAGS+=	-Wno-error=aggressive-loop-optimizations	\
218		-Wno-error=cast-function-type			\
219		-Wno-error=catch-value				\
220		-Wno-error=multistatement-macros		\
221		-Wno-error=restrict				\
222		-Wno-error=sizeof-pointer-memaccess		\
223		-Wno-error=stringop-truncation
224CXXWARNFLAGS+=	-Wno-error=class-memaccess
225.endif
226
227# GCC 9.2.0
228.if ${COMPILER_VERSION} >= 90200
229.if ${MACHINE_ARCH} == "i386"
230CWARNFLAGS+=	-Wno-error=overflow
231.endif
232.endif
233
234# GCC 12.1.0
235.if ${COMPILER_VERSION} >= 120100
236# These warnings are raised by headers in libc++ so are disabled
237# globally for all C++
238CXXWARNFLAGS+=	-Wno-literal-suffix 			\
239		-Wno-error=unknown-pragmas
240.endif
241
242# GCC 13.1.0
243.if ${COMPILER_VERSION} >= 130100
244# These warnings are raised by headers in libc++ so are disabled
245# globally for all C++
246CXXWARNFLAGS+=	-Wno-dangling-reference
247.endif
248
249# GCC produces false positives for functions that switch on an
250# enum (GCC bug 87950)
251CWARNFLAGS+=	-Wno-return-type
252
253# GCC's own arm_neon.h triggers various warnings
254.if ${MACHINE_CPUARCH} == "aarch64"
255CWARNFLAGS+=	-Wno-system-headers
256.endif
257.endif	# gcc
258
259# How to handle FreeBSD custom printf format specifiers.
260.if ${COMPILER_TYPE} == "clang" || \
261    (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 120100)
262FORMAT_EXTENSIONS=	-D__printf__=__freebsd_kprintf__
263.else
264FORMAT_EXTENSIONS=	-fformat-extensions
265.endif
266
267.if defined(IGNORE_PRAGMA)
268CWARNFLAGS+=	-Wno-unknown-pragmas
269.endif # IGNORE_PRAGMA
270
271# This warning is utter nonsense
272CFLAGS+=	-Wno-format-zero-length
273
274.if ${COMPILER_TYPE} == "clang"
275# The headers provided by clang are incompatible with the FreeBSD headers.
276# If the version of clang is not one that has been patched to omit the
277# incompatible headers, we need to compile with -nobuiltininc and add the
278# resource dir to the end of the search paths. This ensures that headers such as
279# immintrin.h are still found but stddef.h, etc. are picked up from FreeBSD.
280#
281# XXX: This is a hack to support complete external installs of clang while
282# we work to synchronize our decleration guards with those in the clang tree.
283.if ${MK_CLANG_BOOTSTRAP:Uno} == "no" && \
284    ${COMPILER_RESOURCE_DIR} != "unknown" && !defined(BOOTSTRAPPING)
285CFLAGS+=-nobuiltininc -idirafter ${COMPILER_RESOURCE_DIR}/include
286.endif
287.endif
288
289CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3
290.if ${COMPILER_VERSION} < 130000
291CLANG_OPT_SMALL+= -mllvm -simplifycfg-dup-ret
292.endif
293CLANG_OPT_SMALL+= -mllvm -enable-load-pre=false
294CFLAGS.clang+=	 -Qunused-arguments
295# The libc++ headers use c++11 extensions.  These are normally silenced because
296# they are treated as system headers, but we explicitly disable that warning
297# suppression when building the base system to catch bugs in our headers.
298# Eventually we'll want to start building the base system C++ code as C++11,
299# but not yet.
300CXXFLAGS.clang+=	 -Wno-c++11-extensions
301
302# XXX This should be defaulted to 2 when WITH_SSP is in use after further
303# testing and soak time.
304FORTIFY_SOURCE?=	0
305.if ${MK_SSP} != "no"
306# Don't use -Wstack-protector as it breaks world with -Werror.
307SSP_CFLAGS?=	-fstack-protector-strong
308CFLAGS+=	${SSP_CFLAGS}
309.endif # SSP
310.if ${FORTIFY_SOURCE} > 0
311CFLAGS+=	-D_FORTIFY_SOURCE=${FORTIFY_SOURCE}
312CXXFLAGS+=	-D_FORTIFY_SOURCE=${FORTIFY_SOURCE}
313.endif
314
315# Additional flags passed in CFLAGS and CXXFLAGS when MK_DEBUG_FILES is
316# enabled.
317DEBUG_FILES_CFLAGS?= -g -gz=zlib
318
319# Allow user-specified additional warning flags, plus compiler and file
320# specific flag overrides, unless we've overridden this...
321.if ${MK_WARNS} != "no"
322CFLAGS+=	${CWARNFLAGS:M*} ${CWARNFLAGS.${COMPILER_TYPE}}
323CFLAGS+=	${CWARNFLAGS.${.IMPSRC:T}}
324CXXFLAGS+=	${CXXWARNFLAGS:M*} ${CXXWARNFLAGS.${COMPILER_TYPE}}
325CXXFLAGS+=	${CXXWARNFLAGS.${.IMPSRC:T}}
326.endif
327
328CFLAGS+=	 ${CFLAGS.${COMPILER_TYPE}}
329CXXFLAGS+=	 ${CXXFLAGS.${COMPILER_TYPE}}
330
331AFLAGS+=	${AFLAGS.${.IMPSRC:T}}
332AFLAGS+=	${AFLAGS.${.TARGET:T}}
333ACFLAGS+=	${ACFLAGS.${.IMPSRC:T}}
334ACFLAGS+=	${ACFLAGS.${.TARGET:T}}
335CFLAGS+=	${CFLAGS.${.IMPSRC:T}}
336CXXFLAGS+=	${CXXFLAGS.${.IMPSRC:T}}
337
338LDFLAGS+=	${LDFLAGS.${LINKER_TYPE}}
339
340# Only allow .TARGET when not using PROGS as it has the same syntax
341# per PROG which is ambiguous with this syntax. This is only needed
342# for PROG_VARS vars.
343#
344# Some directories (currently just clang) also need to disable this since
345# CFLAGS.${COMPILER_TYPE}, CFLAGS.${.IMPSRC:T} and CFLAGS.${.TARGET:T} all live
346# in the same namespace, meaning that, for example, GCC builds of clang pick up
347# CFLAGS.clang via CFLAGS.${.TARGET:T} and thus try to pass Clang-specific
348# flags. Ideally the different sources of CFLAGS would be namespaced to avoid
349# collisions.
350.if !defined(_RECURSING_PROGS) && !defined(NO_TARGET_FLAGS)
351.if ${MK_WARNS} != "no"
352CFLAGS+=	${CWARNFLAGS.${.TARGET:T}}
353.endif
354CFLAGS+=	${CFLAGS.${.TARGET:T}}
355CXXFLAGS+=	${CXXFLAGS.${.TARGET:T}}
356LDFLAGS+=	${LDFLAGS.${.TARGET:T}}
357LDADD+=		${LDADD.${.TARGET:T}}
358LIBADD+=	${LIBADD.${.TARGET:T}}
359.endif
360
361.if defined(SRCTOP)
362# Prevent rebuilding during install to support read-only objdirs.
363.if ${.TARGETS:M*install*} == ${.TARGETS} && empty(.MAKE.MODE:Mmeta)
364CFLAGS+=	ERROR-tried-to-rebuild-during-make-install
365.endif
366.endif
367
368# Please keep this if in sync with kern.mk
369.if ${LD} != "ld" && (${CC:[1]:H} != ${LD:[1]:H} || ${LD:[1]:T} != "ld")
370# Add -fuse-ld=${LD} if $LD is in a different directory or not called "ld".
371.if ${COMPILER_TYPE} == "clang"
372# Note: Clang does not like relative paths for ld so we map ld.lld -> lld.
373.if ${COMPILER_VERSION} >= 120000
374LDFLAGS+=	--ld-path=${LD:[1]:S/^ld.//1W}
375.else
376LDFLAGS+=	-fuse-ld=${LD:[1]:S/^ld.//1W}
377.endif
378.elif ${COMPILER_TYPE} == "gcc"
379# GCC does not support an absolute path for -fuse-ld so we just print this
380# warning instead and let the user add the required symlinks.
381# However, we can avoid this warning if -B is set appropriately (e.g. for
382# CROSS_TOOLCHAIN=...-gcc).
383.if !(${LD:[1]:T} == "ld" && ${CC:tw:M-B${LD:[1]:H}/})
384.warning LD (${LD}) is not the default linker for ${CC} but -fuse-ld= is not supported
385.endif
386.endif
387.endif
388
389# Tell bmake not to mistake standard targets for things to be searched for
390# or expect to ever be up-to-date.
391PHONY_NOTMAIN = analyze afterdepend afterinstall all beforedepend beforeinstall \
392		beforelinking build build-tools buildconfig buildfiles \
393		buildincludes check checkdpadd clean cleandepend cleandir \
394		cleanobj configure depend distclean distribute exe \
395		files html includes install installconfig installdirs \
396		installfiles installincludes lint obj objlink objs objwarn \
397		realinstall tags whereobj
398
399# we don't want ${PROG} to be PHONY
400.PHONY: ${PHONY_NOTMAIN:N${PROG:U}}
401.NOTMAIN: ${PHONY_NOTMAIN:Nall}
402
403.if ${MK_STAGING} != "no"
404.if defined(_SKIP_BUILD) || (!make(all) && !make(clean*) && !make(*clean))
405_SKIP_STAGING?= yes
406.endif
407.if ${_SKIP_STAGING:Uno} == "yes"
408staging stage_libs stage_files stage_as stage_links stage_symlinks:
409.else
410# allow targets like beforeinstall to be leveraged
411DESTDIR= ${STAGE_OBJTOP}
412.export DESTDIR
413
414.if target(beforeinstall)
415.if !empty(_LIBS) || (${MK_STAGING_PROG} != "no" && !defined(INTERNALPROG))
416staging: beforeinstall
417.endif
418.endif
419
420# normally only libs and includes are staged
421.if ${MK_STAGING_PROG} != "no" && !defined(INTERNALPROG)
422STAGE_DIR.prog= ${STAGE_OBJTOP}${BINDIR}
423
424.if !empty(PROG)
425.if defined(PROGNAME)
426STAGE_AS_SETS+= prog
427STAGE_AS_${PROG}= ${PROGNAME}
428stage_as.prog: ${PROG}
429.else
430STAGE_SETS+= prog
431stage_files.prog: ${PROG}
432STAGE_TARGETS+= stage_files
433.endif
434.endif
435.endif
436
437.if !empty(_LIBS) && !defined(INTERNALLIB)
438.if defined(SHLIBDIR) && ${SHLIBDIR} != ${LIBDIR} && ${_LIBS:Uno:M*.so.*} != ""
439STAGE_SETS+= shlib
440STAGE_DIR.shlib= ${STAGE_OBJTOP}${SHLIBDIR}
441STAGE_FILES.shlib+= ${_LIBS:M*.so.*}
442stage_files.shlib: ${_LIBS:M*.so.*}
443.endif
444
445.if defined(SHLIB_LINK) && commands(${SHLIB_LINK:R}.ld)
446STAGE_AS_SETS+= ldscript
447STAGE_AS.ldscript+= ${SHLIB_LINK:R}.ld
448stage_as.ldscript: ${SHLIB_LINK:R}.ld
449STAGE_DIR.ldscript = ${STAGE_LIBDIR}
450STAGE_AS_${SHLIB_LINK:R}.ld:= ${SHLIB_LINK}
451NO_SHLIB_LINKS=
452.endif
453
454.if defined(STATIC_LDSCRIPT) && target(lib${LIB}.ald)
455STAGE_AS_SETS+= ald
456STAGE_DIR.ald = ${STAGE_LIBDIR}
457STAGE_AS.ald+= lib${LIB}.ald
458STAGE_AS_lib${LIB}.ald = lib${LIB}.a
459stage_as.ald: lib${LIB}.ald
460.endif
461
462.if target(stage_files.shlib)
463stage_libs: ${_LIBS}
464.if defined(DEBUG_FLAGS) && target(${SHLIB_NAME}.symbols)
465stage_files.shlib: ${SHLIB_NAME}.symbols
466.endif
467.else
468stage_libs: ${_LIBS}
469.endif
470.if defined(SHLIB_NAME) && defined(DEBUG_FLAGS) && target(${SHLIB_NAME}.symbols)
471stage_libs: ${SHLIB_NAME}.symbols
472.endif
473
474.endif
475
476.if !empty(INCS) || !empty(INCSGROUPS) && target(buildincludes)
477.if !defined(NO_BEFOREBUILD_INCLUDES)
478stage_includes: buildincludes
479beforebuild: stage_includes
480.endif
481.endif
482
483.for t in stage_libs stage_files stage_as
484.if target($t)
485STAGE_TARGETS+= $t
486.endif
487.endfor
488
489.if !empty(STAGE_AS_SETS)
490STAGE_TARGETS+= stage_as
491.endif
492
493.if !empty(STAGE_TARGETS) || (${MK_STAGING_PROG} != "no" && !defined(INTERNALPROG))
494
495.if !empty(LINKS)
496STAGE_TARGETS+= stage_links
497.if ${MAKE_VERSION} < 20131001
498stage_links.links: ${_LIBS} ${PROG}
499.endif
500STAGE_SETS+= links
501STAGE_LINKS.links= ${LINKS}
502.endif
503
504.if !empty(SYMLINKS)
505STAGE_TARGETS+= stage_symlinks
506STAGE_SETS+= links
507STAGE_SYMLINKS.links= ${SYMLINKS}
508.endif
509
510.endif
511
512.include <meta.stage.mk>
513.endif
514.endif
515
516.if defined(META_TARGETS)
517.for _tgt in ${META_TARGETS}
518.if target(${_tgt})
519${_tgt}: ${META_DEPS}
520.endif
521.endfor
522.endif
523
524# we are generally the last makefile read
525CFLAGS+= ${CFLAGS_LAST}
526CXXFLAGS+= ${CXXFLAGS_LAST}
527LDFLAGS+= ${LDFLAGS_LAST}
528