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