00bd6d0f08
centralizes the handling of CC and HOST_CC. This fixes a bug with WITH_CCACHE_BUILD when using MACHINE=host since CC is overridden in local.init.mk via src.opts.mk long before bsd.compiler.mk is included. Originally the ccache implementation was placed in local.init.mk but moved to bsd.compiler.mk as it seemed more proper and avoided other ordering issues. Sponsored by: EMC / Isilon Storage Division
37 lines
869 B
Makefile
37 lines
869 B
Makefile
# $FreeBSD$
|
|
|
|
.if ${.MAKE.MODE:Unormal:Mmeta*} != ""
|
|
.if !empty(SUBDIR) && !defined(LIB) && !defined(PROG) && ${.MAKE.MAKEFILES:M*bsd.prog.mk} == ""
|
|
.if ${.MAKE.MODE:Mleaf*} != ""
|
|
# we only want leaf dirs to build in meta mode... and we are not one
|
|
.MAKE.MODE = normal
|
|
.endif
|
|
.endif
|
|
.endif
|
|
|
|
.if ${MK_SYSROOT} == "yes" && !empty(SYSROOT) && ${MACHINE} != "host"
|
|
CFLAGS_LAST+= --sysroot=${SYSROOT}
|
|
CXXFLAGS_LAST+= --sysroot=${SYSROOT}
|
|
LDADD+= --sysroot=${SYSROOT}
|
|
.elif ${MK_STAGING} == "yes"
|
|
CFLAGS+= -nostdinc
|
|
CFLAGS+= -I${STAGE_INCLUDEDIR}
|
|
LDADD+= -L${STAGE_LIBDIR}
|
|
.endif
|
|
.if ${MACHINE} == "host"
|
|
# we cheat?
|
|
LDADD+= -B/usr/lib
|
|
CFLAGS_LAST+= -I/usr/include
|
|
CXXFLAGS_LAST+= -I/usr/include
|
|
.endif
|
|
|
|
.if ${MACHINE} == "host"
|
|
.if ${.MAKE.DEPENDFILE:E} != "host"
|
|
UPDATE_DEPENDFILE?= no
|
|
.endif
|
|
HOST_CFLAGS+= -DHOSTPROG
|
|
CFLAGS+= ${HOST_CFLAGS}
|
|
.endif
|
|
|
|
.-include "src.init.mk"
|