xref: /freebsd/share/mk/local.init.mk (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1# $FreeBSD$
2
3.if !target(__${_this}__)
4__${_this}__:
5
6.if ${.MAKE.MODE:Mmeta*} != ""
7.if !empty(SUBDIR) && !defined(LIB) && !defined(PROG) && ${.MAKE.MAKEFILES:M*bsd.prog.mk} == ""
8.if ${.MAKE.MODE:Mleaf*} != ""
9# we only want leaf dirs to build in meta mode... and we are not one
10.MAKE.MODE = normal
11.endif
12.endif
13.endif
14
15# XXX: This should be combined with external compiler support in Makefile.inc1
16# and local.meta.sys.mk (CROSS_TARGET_FLAGS)
17.if ${MK_SYSROOT} == "yes" && !empty(SYSROOT) && ${MACHINE} != "host"
18CFLAGS_LAST+= --sysroot=${SYSROOT}
19CXXFLAGS_LAST+= --sysroot=${SYSROOT}
20LDADD+= --sysroot=${SYSROOT}
21.elif ${MK_STAGING} == "yes"
22ISYSTEM?= ${STAGE_INCLUDEDIR}
23# no space after -isystem makes it easier to
24# grep the flag out of command lines (in meta files) to see its value.
25CFLAGS+= -isystem${ISYSTEM}
26# XXX: May be needed for GCC to build with libc++ rather than libstdc++. See Makefile.inc1
27#CXXFLAGS+= -std=gnu++11
28#LDADD+= -L${STAGE_LIBDIR}/libc++
29#CXXFLAGS+= -I${STAGE_INCLUDEDIR}/usr/include/c++/v1
30LDADD+= -L${STAGE_LIBDIR}
31.endif
32
33.if ${MACHINE} == "host"
34.if ${.MAKE.DEPENDFILE:E} != "host"
35UPDATE_DEPENDFILE?= no
36.endif
37HOST_CFLAGS+= -DHOSTPROG
38CFLAGS+= ${HOST_CFLAGS}
39.endif
40
41.-include "src.init.mk"
42.-include <site.init.mk>
43.-include "${.CURDIR}/local.init.mk"
44.endif
45