Changeset View
Changeset View
Standalone View
Standalone View
head/Makefile.inc1
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | |||||
.endfor | .endfor | ||||
# If a full path to an external cross compiler is given, don't build | # If a full path to an external cross compiler is given, don't build | ||||
# a cross compiler. | # a cross compiler. | ||||
.if ${XCC:N${CCACHE_BIN}:M/*} | .if ${XCC:N${CCACHE_BIN}:M/*} | ||||
MK_CLANG_BOOTSTRAP= no | MK_CLANG_BOOTSTRAP= no | ||||
MK_GCC_BOOTSTRAP= no | MK_GCC_BOOTSTRAP= no | ||||
.endif | .endif | ||||
MAKEOBJDIRPREFIX?= /usr/obj | |||||
.if ${MACHINE} == ${TARGET} && ${MACHINE_ARCH} == ${TARGET_ARCH} && !defined(CROSS_BUILD_TESTING) | |||||
OBJTREE= ${MAKEOBJDIRPREFIX} | |||||
.else | |||||
OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH} | |||||
.endif | |||||
# Pull in compiler metadata from buildworld/toolchain if possible to avoid | # Pull in compiler metadata from buildworld/toolchain if possible to avoid | ||||
# running CC from bsd.compiler.mk. | # running CC from bsd.compiler.mk. | ||||
.if make(installworld) || make(install) || make(distributeworld) || \ | .if make(installworld) || make(install) || make(distributeworld) || \ | ||||
make(stageworld) | make(stageworld) | ||||
.-include "${OBJTREE}${.CURDIR}/compiler-metadata.mk" | .-include "${OBJTOP}/compiler-metadata.mk" | ||||
.endif | .endif | ||||
# Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. | # Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. | ||||
.include <bsd.compiler.mk> | .include <bsd.compiler.mk> | ||||
.include "share/mk/src.opts.mk" | .include "share/mk/src.opts.mk" | ||||
# Check if there is a local compiler that can satisfy as an external compiler. | # Check if there is a local compiler that can satisfy as an external compiler. | ||||
# Which compiler is expected to be used? | # Which compiler is expected to be used? | ||||
▲ Show 20 Lines • Show All 344 Lines • ▼ Show 20 Lines | |||||
.error CPUTYPE global should be set with ?=. | .error CPUTYPE global should be set with ?=. | ||||
.endif | .endif | ||||
.if make(buildworld) | .if make(buildworld) | ||||
BUILD_ARCH!= uname -p | BUILD_ARCH!= uname -p | ||||
.if ${MACHINE_ARCH} != ${BUILD_ARCH} | .if ${MACHINE_ARCH} != ${BUILD_ARCH} | ||||
.error To cross-build, set TARGET_ARCH. | .error To cross-build, set TARGET_ARCH. | ||||
.endif | .endif | ||||
.endif | .endif | ||||
WORLDTMP= ${OBJTREE}${.CURDIR}/tmp | WORLDTMP?= ${OBJTOP}/tmp | ||||
BPATH= ${CCACHE_WRAPPER_PATH_PFX}${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin | BPATH= ${CCACHE_WRAPPER_PATH_PFX}${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin | ||||
XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin | XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin | ||||
STRICTTMPPATH= ${BPATH}:${XPATH} | STRICTTMPPATH= ${BPATH}:${XPATH} | ||||
TMPPATH= ${STRICTTMPPATH}:${PATH} | TMPPATH= ${STRICTTMPPATH}:${PATH} | ||||
# | # | ||||
# Avoid running mktemp(1) unless actually needed. | # Avoid running mktemp(1) unless actually needed. | ||||
# It may not be functional, e.g., due to new ABI | # It may not be functional, e.g., due to new ABI | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
# | # | ||||
BOOTSTRAPPING?= 0 | BOOTSTRAPPING?= 0 | ||||
# Keep these in sync -- see below for special case exception | # Keep these in sync -- see below for special case exception | ||||
MINIMUM_SUPPORTED_OSREL?= 900044 | MINIMUM_SUPPORTED_OSREL?= 900044 | ||||
MINIMUM_SUPPORTED_REL?= 9.1 | MINIMUM_SUPPORTED_REL?= 9.1 | ||||
# Common environment for world related stages | # Common environment for world related stages | ||||
CROSSENV+= MAKEOBJDIRPREFIX=${OBJTREE} \ | CROSSENV+= \ | ||||
MACHINE_ARCH=${TARGET_ARCH} \ | MACHINE_ARCH=${TARGET_ARCH} \ | ||||
MACHINE=${TARGET} \ | MACHINE=${TARGET} \ | ||||
CPUTYPE=${TARGET_CPUTYPE} | CPUTYPE=${TARGET_CPUTYPE} | ||||
.if ${MK_META_MODE} != "no" | .if ${MK_META_MODE} != "no" | ||||
# Don't rebuild build-tools targets during normal build. | # Don't rebuild build-tools targets during normal build. | ||||
CROSSENV+= BUILD_TOOLS_META=.NOMETA | CROSSENV+= BUILD_TOOLS_META=.NOMETA | ||||
.endif | .endif | ||||
.if defined(TARGET_CFLAGS) | .if defined(TARGET_CFLAGS) | ||||
Show All 18 Lines | BSARGS= DESTDIR= \ | ||||
MK_LLDB=no MK_TESTS=no \ | MK_LLDB=no MK_TESTS=no \ | ||||
MK_INCLUDES=yes | MK_INCLUDES=yes | ||||
BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ | BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ | ||||
${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ | ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ | ||||
${BSARGS} | ${BSARGS} | ||||
# build-tools stage | # build-tools stage | ||||
TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ | TMAKE= \ | ||||
${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ | ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ | ||||
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ | TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ | ||||
DESTDIR= \ | DESTDIR= \ | ||||
BOOTSTRAPPING=${OSRELDATE} \ | BOOTSTRAPPING=${OSRELDATE} \ | ||||
BWPHASE=${.TARGET:C,^_,,} \ | BWPHASE=${.TARGET:C,^_,,} \ | ||||
SSP_CFLAGS= \ | SSP_CFLAGS= \ | ||||
-DNO_LINT \ | -DNO_LINT \ | ||||
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ | -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ | ||||
▲ Show 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | |||||
# to get updated host tools. | # to get updated host tools. | ||||
.if ${MK_META_MODE} == "yes" && defined(NO_CLEAN) && \ | .if ${MK_META_MODE} == "yes" && defined(NO_CLEAN) && \ | ||||
!defined(NO_META_IGNORE_HOST) && !defined(NO_META_IGNORE_HOST_HEADERS) && \ | !defined(NO_META_IGNORE_HOST) && !defined(NO_META_IGNORE_HOST_HEADERS) && \ | ||||
!make(showconfig) | !make(showconfig) | ||||
# r318736 - ino64 major ABI breakage | # r318736 - ino64 major ABI breakage | ||||
META_MODE_BAD_ABI_VERS+= 1200031 | META_MODE_BAD_ABI_VERS+= 1200031 | ||||
.if !defined(OBJDIR_HOST_OSRELDATE) | .if !defined(OBJDIR_HOST_OSRELDATE) | ||||
.if exists(${OBJTREE}${.CURDIR}/host-osreldate.h) | .if exists(${OBJTOP}/host-osreldate.h) | ||||
OBJDIR_HOST_OSRELDATE!= \ | OBJDIR_HOST_OSRELDATE!= \ | ||||
awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ | awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ | ||||
${OBJTREE}${.CURDIR}/host-osreldate.h | ${OBJTOP}/host-osreldate.h | ||||
.elif exists(${WORLDTMP}/usr/include/osreldate.h) | .elif exists(${WORLDTMP}/usr/include/osreldate.h) | ||||
OBJDIR_HOST_OSRELDATE= 0 | OBJDIR_HOST_OSRELDATE= 0 | ||||
.endif | .endif | ||||
.export OBJDIR_HOST_OSRELDATE | .export OBJDIR_HOST_OSRELDATE | ||||
.endif | .endif | ||||
# Note that this logic is the opposite of normal BOOTSTRAP handling. We want | # Note that this logic is the opposite of normal BOOTSTRAP handling. We want | ||||
# to compare the WORLDTMP's OSRELDATE to the host's OSRELDATE. If the WORLDTMP | # to compare the WORLDTMP's OSRELDATE to the host's OSRELDATE. If the WORLDTMP | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | |||||
# tree changes, particularly with respect to removing source files and | # tree changes, particularly with respect to removing source files and | ||||
# replacing generated files. Handle these cases here in an ad-hoc fashion. | # replacing generated files. Handle these cases here in an ad-hoc fashion. | ||||
_cleanobj_fast_depend_hack: .PHONY | _cleanobj_fast_depend_hack: .PHONY | ||||
# Syscall stubs rewritten in C | # Syscall stubs rewritten in C | ||||
# Date SVN Rev Syscalls | # Date SVN Rev Syscalls | ||||
# 20160829 r305012 ptrace | # 20160829 r305012 ptrace | ||||
# 20170624 r320278 fstat fstatat fstatfs getdirentries getfsstat statfs | # 20170624 r320278 fstat fstatat fstatfs getdirentries getfsstat statfs | ||||
.for f in fstat fstatat fstatfs getdirentries getfsstat ptrace statfs | .for f in fstat fstatat fstatfs getdirentries getfsstat ptrace statfs | ||||
.if exists(${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.o) | .if exists(${OBJTOP}/lib/libc/.depend.${f}.o) | ||||
@if egrep -qw '${f}\.[sS]' \ | @if egrep -qw '${f}\.[sS]' \ | ||||
${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.o; then \ | ${OBJTOP}/lib/libc/.depend.${f}.o; then \ | ||||
echo Removing stale dependencies for ${f} syscall wrappers; \ | echo Removing stale dependencies for ${f} syscall wrappers; \ | ||||
rm -f ${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.* \ | rm -f ${OBJTOP}/lib/libc/.depend.${f}.* \ | ||||
${LIBCOMPAT:D${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.*}; \ | ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \ | ||||
fi | fi | ||||
.endif | .endif | ||||
.endfor | .endfor | ||||
# 20170607 remove stale dependencies for utimens* wrappers removed in r319663 | # 20170607 remove stale dependencies for utimens* wrappers removed in r319663 | ||||
.for f in futimens utimensat | .for f in futimens utimensat | ||||
.if exists(${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.o) | .if exists(${OBJTOP}/lib/libc/.depend.${f}.o) | ||||
@if egrep -q '/${f}.c' \ | @if egrep -q '/${f}.c' \ | ||||
${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.o; then \ | ${OBJTOP}/lib/libc/.depend.${f}.o; then \ | ||||
echo Removing stale dependencies for ${f} syscall wrappers; \ | echo Removing stale dependencies for ${f} syscall wrappers; \ | ||||
rm -f ${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.* \ | rm -f ${OBJTOP}/lib/libc/.depend.${f}.* \ | ||||
${LIBCOMPAT:D${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.*}; \ | ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \ | ||||
fi | fi | ||||
.endif | .endif | ||||
.endfor | .endfor | ||||
# 20170523 remove stale generated asm files for functions which are no longer | # 20170523 remove stale generated asm files for functions which are no longer | ||||
# syscalls after r302092 (pipe) and r318736 (others) | # syscalls after r302092 (pipe) and r318736 (others) | ||||
.for f in getdents lstat mknod pipe stat | .for f in getdents lstat mknod pipe stat | ||||
.if exists(${OBJTREE}${.CURDIR}/lib/libc/${f}.s) || \ | .if exists(${OBJTOP}/lib/libc/${f}.s) || \ | ||||
exists(${OBJTREE}${.CURDIR}/lib/libc/${f}.S) | exists(${OBJTOP}/lib/libc/${f}.S) | ||||
@echo Removing stale generated ${f} syscall files | @echo Removing stale generated ${f} syscall files | ||||
@rm -f ${OBJTREE}${.CURDIR}/lib/libc/${f}.* \ | @rm -f ${OBJTOP}/lib/libc/${f}.* \ | ||||
${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.* \ | ${OBJTOP}/lib/libc/.depend.${f}.* \ | ||||
${LIBCOMPAT:D${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc/${f}.*} \ | ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/${f}.*} \ | ||||
${LIBCOMPAT:D${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.*} | ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*} | ||||
.endif | .endif | ||||
.endfor | .endfor | ||||
_worldtmp: .PHONY | _worldtmp: .PHONY | ||||
@echo | @echo | ||||
@echo "--------------------------------------------------------------" | @echo "--------------------------------------------------------------" | ||||
@echo ">>> Rebuilding the temporary build tree" | @echo ">>> Rebuilding the temporary build tree" | ||||
@echo "--------------------------------------------------------------" | @echo "--------------------------------------------------------------" | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | _build-tools: | ||||
@echo ">>> stage 2.3: build tools" | @echo ">>> stage 2.3: build tools" | ||||
@echo "--------------------------------------------------------------" | @echo "--------------------------------------------------------------" | ||||
${_+_}cd ${.CURDIR}; ${TMAKE} build-tools | ${_+_}cd ${.CURDIR}; ${TMAKE} build-tools | ||||
_cross-tools: | _cross-tools: | ||||
@echo | @echo | ||||
@echo "--------------------------------------------------------------" | @echo "--------------------------------------------------------------" | ||||
@echo ">>> stage 3: cross tools" | @echo ">>> stage 3: cross tools" | ||||
@echo "--------------------------------------------------------------" | @echo "--------------------------------------------------------------" | ||||
@rm -f ${OBJTREE}${.CURDIR}/compiler-metadata.mk | @rm -f ${OBJTOP}/compiler-metadata.mk | ||||
${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools | ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools | ||||
${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools | ${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools | ||||
_build-metadata: | _build-metadata: | ||||
@echo | @echo | ||||
@echo "--------------------------------------------------------------" | @echo "--------------------------------------------------------------" | ||||
@echo ">>> stage 3.1: recording build metadata" | @echo ">>> stage 3.1: recording build metadata" | ||||
@echo "--------------------------------------------------------------" | @echo "--------------------------------------------------------------" | ||||
${_+_}cd ${.CURDIR}; ${WMAKE} compiler-metadata.mk | ${_+_}cd ${.CURDIR}; ${WMAKE} compiler-metadata.mk | ||||
▲ Show 20 Lines • Show All 155 Lines • ▼ Show 20 Lines | |||||
# includes rescue, try running rescue from the objdir as a sanity check. If | # includes rescue, try running rescue from the objdir as a sanity check. If | ||||
# rescue is not functional (e.g., because it depends on a system call not | # rescue is not functional (e.g., because it depends on a system call not | ||||
# supported by the currently running kernel), abort the installation. | # supported by the currently running kernel), abort the installation. | ||||
# | # | ||||
.if !make(distributeworld) && ${MK_RESCUE} != "no" && \ | .if !make(distributeworld) && ${MK_RESCUE} != "no" && \ | ||||
(empty(DESTDIR) || ${DESTDIR} == "/") && empty(BYPASS_INSTALLCHECK_SH) | (empty(DESTDIR) || ${DESTDIR} == "/") && empty(BYPASS_INSTALLCHECK_SH) | ||||
_installcheck_world: __installcheck_sh_check | _installcheck_world: __installcheck_sh_check | ||||
__installcheck_sh_check: .PHONY | __installcheck_sh_check: .PHONY | ||||
@if [ "`${OBJTREE}${.CURDIR}/rescue/rescue/rescue sh -c 'echo OK'`" != \ | @if [ "`${OBJTOP}/rescue/rescue/rescue sh -c 'echo OK'`" != \ | ||||
OK ]; then \ | OK ]; then \ | ||||
echo "rescue/sh check failed, installation aborted" >&2; \ | echo "rescue/sh check failed, installation aborted" >&2; \ | ||||
false; \ | false; \ | ||||
fi | fi | ||||
.endif | .endif | ||||
# | # | ||||
# Required install tools to be saved in a scratch dir for safety. | # Required install tools to be saved in a scratch dir for safety. | ||||
▲ Show 20 Lines • Show All 245 Lines • ▼ Show 20 Lines | |||||
KERNCONF?= GENERIC64 | KERNCONF?= GENERIC64 | ||||
.else | .else | ||||
KERNCONF?= GENERIC | KERNCONF?= GENERIC | ||||
.endif | .endif | ||||
INSTKERNNAME?= kernel | INSTKERNNAME?= kernel | ||||
KERNSRCDIR?= ${.CURDIR}/sys | KERNSRCDIR?= ${.CURDIR}/sys | ||||
KRNLCONFDIR= ${KERNSRCDIR}/${TARGET}/conf | KRNLCONFDIR= ${KERNSRCDIR}/${TARGET}/conf | ||||
KRNLOBJDIR= ${OBJTREE}${KERNSRCDIR} | KRNLOBJDIR= ${OBJTOP}${KERNSRCDIR:C,^${.CURDIR},,} | ||||
KERNCONFDIR?= ${KRNLCONFDIR} | KERNCONFDIR?= ${KRNLCONFDIR} | ||||
BUILDKERNELS= | BUILDKERNELS= | ||||
INSTALLKERNEL= | INSTALLKERNEL= | ||||
.if defined(NO_INSTALLKERNEL) | .if defined(NO_INSTALLKERNEL) | ||||
# All of the BUILDKERNELS loops start at index 1. | # All of the BUILDKERNELS loops start at index 1. | ||||
BUILDKERNELS+= dummy | BUILDKERNELS+= dummy | ||||
.endif | .endif | ||||
▲ Show 20 Lines • Show All 191 Lines • ▼ Show 20 Lines | |||||
.endfor | .endfor | ||||
.endif | .endif | ||||
.endif | .endif | ||||
stagekernel: .PHONY | stagekernel: .PHONY | ||||
${_+_}${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} distributekernel | ${_+_}${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} distributekernel | ||||
PORTSDIR?= /usr/ports | PORTSDIR?= /usr/ports | ||||
WSTAGEDIR?= ${MAKEOBJDIRPREFIX}${.CURDIR}/${TARGET}.${TARGET_ARCH}/worldstage | WSTAGEDIR?= ${OBJTOP}/worldstage | ||||
KSTAGEDIR?= ${MAKEOBJDIRPREFIX}${.CURDIR}/${TARGET}.${TARGET_ARCH}/kernelstage | KSTAGEDIR?= ${OBJTOP}/kernelstage | ||||
REPODIR?= ${MAKEOBJDIRPREFIX}${.CURDIR}/repo | REPODIR?= ${OBJROOT}repo | ||||
PKGSIGNKEY?= # empty | PKGSIGNKEY?= # empty | ||||
.ORDER: stage-packages create-packages | .ORDER: stage-packages create-packages | ||||
.ORDER: create-packages create-world-packages | .ORDER: create-packages create-world-packages | ||||
.ORDER: create-packages create-kernel-packages | .ORDER: create-packages create-kernel-packages | ||||
.ORDER: create-packages sign-packages | .ORDER: create-packages sign-packages | ||||
_pkgbootstrap: .PHONY | _pkgbootstrap: .PHONY | ||||
▲ Show 20 Lines • Show All 246 Lines • ▼ Show 20 Lines | .if ${BOOTSTRAPPING} < ${MINIMUM_SUPPORTED_OSREL} && ${BOOTSTRAPPING} != 0 | ||||
@echo "ERROR: Source upgrades from versions prior to ${MINIMUM_SUPPORTED_REL} are not supported."; \ | @echo "ERROR: Source upgrades from versions prior to ${MINIMUM_SUPPORTED_REL} are not supported."; \ | ||||
false | false | ||||
.endif | .endif | ||||
.for _tool in tools/build ${_elftoolchain_libs} | .for _tool in tools/build ${_elftoolchain_libs} | ||||
${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,all,install)"; \ | ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,all,install)"; \ | ||||
cd ${.CURDIR}/${_tool}; \ | cd ${.CURDIR}/${_tool}; \ | ||||
if [ -z "${NO_OBJ}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ | if [ -z "${NO_OBJ}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ | ||||
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \ | ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${WORLDTMP}/legacy includes; \ | ||||
${MAKE} DIRPRFX=${_tool}/ MK_INCLUDES=no all; \ | ${MAKE} DIRPRFX=${_tool}/ MK_INCLUDES=no all; \ | ||||
${MAKE} DIRPRFX=${_tool}/ MK_INCLUDES=no \ | ${MAKE} DIRPRFX=${_tool}/ MK_INCLUDES=no \ | ||||
DESTDIR=${MAKEOBJDIRPREFIX}/legacy install | DESTDIR=${WORLDTMP}/legacy install | ||||
.endfor | .endfor | ||||
# | # | ||||
# bootstrap-tools: Build tools needed for compatibility. These are binaries that | # bootstrap-tools: Build tools needed for compatibility. These are binaries that | ||||
# are built to build other binaries in the system. However, the focus of these | # are built to build other binaries in the system. However, the focus of these | ||||
# binaries is usually quite narrow. Bootstrap tools use the host's compiler and | # binaries is usually quite narrow. Bootstrap tools use the host's compiler and | ||||
# libraries, augmented by -legacy. | # libraries, augmented by -legacy. | ||||
# | # | ||||
▲ Show 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | .for _tool in \ | ||||
${_nmtree} \ | ${_nmtree} \ | ||||
${_vtfontcvt} \ | ${_vtfontcvt} \ | ||||
usr.bin/localedef | usr.bin/localedef | ||||
${_bt}-${_tool}: .PHONY .MAKE | ${_bt}-${_tool}: .PHONY .MAKE | ||||
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ | ${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ | ||||
cd ${.CURDIR}/${_tool}; \ | cd ${.CURDIR}/${_tool}; \ | ||||
if [ -z "${NO_OBJ}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ | if [ -z "${NO_OBJ}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ | ||||
${MAKE} DIRPRFX=${_tool}/ all; \ | ${MAKE} DIRPRFX=${_tool}/ all; \ | ||||
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install | ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${WORLDTMP}/legacy install | ||||
bootstrap-tools: ${_bt}-${_tool} | bootstrap-tools: ${_bt}-${_tool} | ||||
.endfor | .endfor | ||||
# | # | ||||
# build-tools: Build special purpose build tools | # build-tools: Build special purpose build tools | ||||
# | # | ||||
.if !defined(NO_SHARE) | .if !defined(NO_SHARE) | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | ${_+_}@${ECHODIR} "===> ${_tool} (${_bt_clean:D${_bt_clean},}obj,build-tools)"; \ | ||||
${MAKE} DIRPRFX=${_tool}/ build-tools | ${MAKE} DIRPRFX=${_tool}/ build-tools | ||||
build-tools: build-tools_${_tool} | build-tools: build-tools_${_tool} | ||||
.endfor | .endfor | ||||
# | # | ||||
# kernel-tools: Build kernel-building tools | # kernel-tools: Build kernel-building tools | ||||
# | # | ||||
kernel-tools: .PHONY | kernel-tools: .PHONY | ||||
mkdir -p ${MAKEOBJDIRPREFIX}/usr | mkdir -p ${WORLDTMP}/usr | ||||
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ | mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ | ||||
-p ${MAKEOBJDIRPREFIX}/usr >/dev/null | -p ${WORLDTMP}/usr >/dev/null | ||||
# | # | ||||
# cross-tools: All the tools needed to build the rest of the system after | # cross-tools: All the tools needed to build the rest of the system after | ||||
# we get done with the earlier stages. It is the last set of tools needed | # we get done with the earlier stages. It is the last set of tools needed | ||||
# to begin building the target binaries. | # to begin building the target binaries. | ||||
# | # | ||||
.if ${TARGET_ARCH} != ${MACHINE_ARCH} | .if ${TARGET_ARCH} != ${MACHINE_ARCH} | ||||
.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" | .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | .for _tool in \ | ||||
${_dtrace_tools} \ | ${_dtrace_tools} \ | ||||
${_gcc} \ | ${_gcc} \ | ||||
${_btxld} \ | ${_btxld} \ | ||||
${_usb_tools} | ${_usb_tools} | ||||
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ | ${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ | ||||
cd ${.CURDIR}/${_tool}; \ | cd ${.CURDIR}/${_tool}; \ | ||||
if [ -z "${NO_OBJ}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ | if [ -z "${NO_OBJ}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ | ||||
${MAKE} DIRPRFX=${_tool}/ all; \ | ${MAKE} DIRPRFX=${_tool}/ all; \ | ||||
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install | ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${WORLDTMP} install | ||||
.endfor | .endfor | ||||
# | # | ||||
# native-xtools is the current target for qemu-user cross builds of ports | # native-xtools is the current target for qemu-user cross builds of ports | ||||
# via poudriere and the imgact_binmisc kernel module. | # via poudriere and the imgact_binmisc kernel module. | ||||
# This target merely builds a toolchan/sysroot, then builds the tools it wants | # This target merely builds a toolchan/sysroot, then builds the tools it wants | ||||
# with the options it wants in a special MAKEOBJDIRPREFIX, using the toolchain | # with the options it wants in a special MAKEOBJDIRPREFIX, using the toolchain | ||||
# already built. It then installs the static tools to NXBDESTDIR for Poudriere | # already built. It then installs the static tools to NXBDESTDIR for Poudriere | ||||
# to pickup. | # to pickup. | ||||
# | # | ||||
NXBOBJDIR= ${MAKEOBJDIRPREFIX}/nxb/${TARGET}.${TARGET_ARCH} | NXBOBJROOT= ${OBJROOT}nxb/ | ||||
NXBOBJTOP= ${NXBOBJROOT}${TARGET}.${TARGET_ARCH} | |||||
NXTP?= /nxb-bin | NXTP?= /nxb-bin | ||||
.if ${NXTP:N/*} | .if ${NXTP:N/*} | ||||
.error NXTP variable should be an absolute path | .error NXTP variable should be an absolute path | ||||
.endif | .endif | ||||
NXBDESTDIR?= ${DESTDIR}${NXTP} | NXBDESTDIR?= ${DESTDIR}${NXTP} | ||||
# This is the list of tools to be built/installed as static and where | # This is the list of tools to be built/installed as static and where | ||||
# appropriate to build for the given TARGET.TARGET_ARCH. | # appropriate to build for the given TARGET.TARGET_ARCH. | ||||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | |||||
NXBDIRS+= usr.bin/clang | NXBDIRS+= usr.bin/clang | ||||
.elif ${MK_GCC} != "no" | .elif ${MK_GCC} != "no" | ||||
NXBDIRS+= gnu/usr.bin/cc | NXBDIRS+= gnu/usr.bin/cc | ||||
.endif | .endif | ||||
.if ${MK_BINUTILS} != "no" | .if ${MK_BINUTILS} != "no" | ||||
NXBDIRS+= gnu/usr.bin/binutils | NXBDIRS+= gnu/usr.bin/binutils | ||||
.endif | .endif | ||||
NXBMAKEENV+= \ | |||||
MAKEOBJDIRPREFIX=${NXBOBJDIR:Q} | |||||
NXBMAKEARGS+= \ | NXBMAKEARGS+= \ | ||||
OBJTREE=${NXBOBJDIR:Q} \ | OBJTOP=${NXBOBJTOP:Q} \ | ||||
OBJROOT=${NXBOBJROOT:Q} \ | |||||
-DNO_SHARED \ | -DNO_SHARED \ | ||||
-DNO_CPU_CFLAGS \ | -DNO_CPU_CFLAGS \ | ||||
-DNO_PIC \ | -DNO_PIC \ | ||||
SSP_CFLAGS= \ | SSP_CFLAGS= \ | ||||
MK_CLANG_EXTRAS=no \ | MK_CLANG_EXTRAS=no \ | ||||
MK_CLANG_FULL=no \ | MK_CLANG_FULL=no \ | ||||
MK_CTF=no \ | MK_CTF=no \ | ||||
MK_DEBUG_FILES=no \ | MK_DEBUG_FILES=no \ | ||||
▲ Show 20 Lines • Show All 557 Lines • ▼ Show 20 Lines | |||||
# files without file flags set in the first 'rm' instance saves time, | # files without file flags set in the first 'rm' instance saves time, | ||||
# because 'chflags' will need to operate on fewer files afterwards. | # because 'chflags' will need to operate on fewer files afterwards. | ||||
# | # | ||||
# It is expected that BW_CANONICALOBJDIR == the CANONICALOBJDIR as would be | # It is expected that BW_CANONICALOBJDIR == the CANONICALOBJDIR as would be | ||||
# created by bsd.obj.mk, except that we don't want to .include that file | # created by bsd.obj.mk, except that we don't want to .include that file | ||||
# in this makefile. We don't do a cleandir walk if MK_AUTO_OBJ is yes | # in this makefile. We don't do a cleandir walk if MK_AUTO_OBJ is yes | ||||
# since it is not possible for files to land in the wrong place. | # since it is not possible for files to land in the wrong place. | ||||
# | # | ||||
BW_CANONICALOBJDIR:=${OBJTREE}${.CURDIR} | BW_CANONICALOBJDIR:=${OBJTOP} | ||||
cleanworld: .PHONY | cleanworld: .PHONY | ||||
.if exists(${BW_CANONICALOBJDIR}/) | .if exists(${BW_CANONICALOBJDIR}/) | ||||
-rm -rf ${BW_CANONICALOBJDIR}/* | -rm -rf ${BW_CANONICALOBJDIR}/* | ||||
-chflags -R 0 ${BW_CANONICALOBJDIR} | -chflags -R 0 ${BW_CANONICALOBJDIR} | ||||
rm -rf ${BW_CANONICALOBJDIR}/* | rm -rf ${BW_CANONICALOBJDIR}/* | ||||
.endif | .endif | ||||
.if ${MK_AUTO_OBJ} == "no" | .if ${MK_AUTO_OBJ} == "no" | ||||
.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR} | .if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR} | ||||
Show All 15 Lines | NOFUN=-DNO_FSCHG MK_HTML=no -DNO_LINT \ | ||||
CPUTYPE=${XDEV_CPUTYPE} | CPUTYPE=${XDEV_CPUTYPE} | ||||
XDDIR=${TARGET_ARCH}-freebsd | XDDIR=${TARGET_ARCH}-freebsd | ||||
XDTP?=/usr/${XDDIR} | XDTP?=/usr/${XDDIR} | ||||
.if ${XDTP:N/*} | .if ${XDTP:N/*} | ||||
.error XDTP variable should be an absolute path | .error XDTP variable should be an absolute path | ||||
.endif | .endif | ||||
CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \ | CDBENV=MAKEOBJDIRPREFIX=${OBJTOP}/${XDDIR} \ | ||||
INSTALL="sh ${.CURDIR}/tools/install.sh" | INSTALL="sh ${.CURDIR}/tools/install.sh" | ||||
CDENV= ${CDBENV} \ | CDENV= ${CDBENV} \ | ||||
TOOLS_PREFIX=${XDTP} | TOOLS_PREFIX=${XDTP} | ||||
.if ${WANT_COMPILER_TYPE} == gcc || \ | .if ${WANT_COMPILER_TYPE} == gcc || \ | ||||
(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) | (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) | ||||
# GCC requires -isystem and -L when using a cross-compiler. --sysroot | # GCC requires -isystem and -L when using a cross-compiler. --sysroot | ||||
# won't set header path and -L is used to ensure the base library path | # won't set header path and -L is used to ensure the base library path | ||||
# is added before the port PREFIX library path. | # is added before the port PREFIX library path. | ||||
CD2CFLAGS+= -isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib | CD2CFLAGS+= -isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib | ||||
# GCC requires -B to find /usr/lib/crti.o when using a cross-compiler | # GCC requires -B to find /usr/lib/crti.o when using a cross-compiler | ||||
# combined with --sysroot. | # combined with --sysroot. | ||||
CD2CFLAGS+= -B${XDDESTDIR}/usr/lib | CD2CFLAGS+= -B${XDDESTDIR}/usr/lib | ||||
# Force using libc++ for external GCC. | # Force using libc++ for external GCC. | ||||
.if ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 | .if ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 | ||||
CD2CXXFLAGS+= -isystem ${XDDESTDIR}/usr/include/c++/v1 -std=c++11 \ | CD2CXXFLAGS+= -isystem ${XDDESTDIR}/usr/include/c++/v1 -std=c++11 \ | ||||
-nostdinc++ | -nostdinc++ | ||||
.endif | .endif | ||||
.endif | .endif | ||||
CD2CFLAGS+= --sysroot=${XDDESTDIR}/ | CD2CFLAGS+= --sysroot=${XDDESTDIR}/ | ||||
CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CXXFLAGS} ${CD2CFLAGS}" \ | CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CXXFLAGS} ${CD2CFLAGS}" \ | ||||
CPP="${CPP} ${CD2CFLAGS}" \ | CPP="${CPP} ${CD2CFLAGS}" \ | ||||
MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH} | MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH} | ||||
CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp | CDTMP= ${OBJTOP}/${XDDIR}/tmp | ||||
CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN} | CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN} | ||||
CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} ${NOFUN} | CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} ${NOFUN} | ||||
.if ${MK_META_MODE} != "no" | .if ${MK_META_MODE} != "no" | ||||
# Don't rebuild build-tools targets during normal build. | # Don't rebuild build-tools targets during normal build. | ||||
CD2MAKE+= BUILD_TOOLS_META=.NOMETA | CD2MAKE+= BUILD_TOOLS_META=.NOMETA | ||||
.endif | .endif | ||||
XDDESTDIR=${DESTDIR}${XDTP} | XDDESTDIR=${DESTDIR}${XDTP} | ||||
▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines |