xref: /freebsd/share/mk/local.init.mk (revision af71f40a983c21a3c4a5c7c3d88d566e721bae45)
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
32CC=		${HOST_CC}
33HOST_CXX?=	/usr/bin/c++
34CXX=		${HOST_CXX}
35HOST_CPP?=	/usr/bin/cpp
36CPP=		${HOST_CPP}
37HOST_CFLAGS+= -DHOSTPROG
38CFLAGS+= ${HOST_CFLAGS}
39.endif
40