xref: /freebsd/share/mk/local.init.mk (revision 43a5ec4eb41567cc92586503212743d89686d78f)
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"
22CFLAGS+= -isystem ${STAGE_INCLUDEDIR}
23# XXX: May be needed for GCC to build with libc++ rather than libstdc++. See Makefile.inc1
24#CXXFLAGS+= -std=gnu++11
25#LDADD+= -L${STAGE_LIBDIR}/libc++
26#CXXFLAGS+= -I${STAGE_INCLUDEDIR}/usr/include/c++/v1
27LDADD+= -L${STAGE_LIBDIR}
28.endif
29
30.if ${MACHINE} == "host"
31.if ${.MAKE.DEPENDFILE:E} != "host"
32UPDATE_DEPENDFILE?= no
33.endif
34HOST_CFLAGS+= -DHOSTPROG
35CFLAGS+= ${HOST_CFLAGS}
36.endif
37
38.-include "src.init.mk"
39.-include "${.CURDIR}/local.init.mk"
40.endif
41