xref: /freebsd/share/mk/local.init.mk (revision f4b37ed0f8b307b1f3f0f630ca725d68f1dff30d)
1# $FreeBSD$
2
3.if ${.MAKE.MODE:Unormal:Mmeta*} != ""
4.if !empty(SUBDIR) && !defined(LIB) && !defined(PROG) && ${.MAKE.MAKEFILES:M*bsd.prog.mk} == ""
5.if ${.MAKE.MODE:Mleaf*} != ""
6# we only want leaf dirs to build in meta mode... and we are not one
7.MAKE.MODE = normal
8.endif
9.endif
10.endif
11
12.if ${MK_SYSROOT} == "yes" && !empty(SYSROOT)
13CFLAGS_LAST+= --sysroot=${SYSROOT}
14CXXFLAGS_LAST+= --sysroot=${SYSROOT}
15LDADD+= --sysroot=${SYSROOT}
16.elif ${MK_STAGING} == "yes"
17CFLAGS+= -I${STAGE_INCLUDEDIR}
18LDADD+= -L${STAGE_LIBDIR}
19.endif
20.if ${MACHINE} == "host"
21# we cheat?
22LDADD+= -B/usr/lib
23CFLAGS_LAST+= -I/usr/include
24CXXFLAGS_LAST+= -I/usr/include
25.endif
26
27.if ${MACHINE} == "host"
28.if ${.MAKE.DEPENDFILE:E} != "host"
29UPDATE_DEPENDFILE?= no
30.endif
31HOST_CC?= /usr/bin/cc
32HOST_CFLAGS+= -DHOSTPROG
33CC= ${HOST_CC}
34CFLAGS+= ${HOST_CFLAGS}
35.endif
36