Changeset View
Changeset View
Standalone View
Standalone View
head/Makefile.inc1
Show First 20 Lines • Show All 161 Lines • ▼ Show 20 Lines | |||||
_t= ${TARGET_ARCH}/${TARGET} | _t= ${TARGET_ARCH}/${TARGET} | ||||
.endif | .endif | ||||
.for _t in ${_t} | .for _t in ${_t} | ||||
.if empty(KNOWN_ARCHES:M${_t}) | .if empty(KNOWN_ARCHES:M${_t}) | ||||
.error Unknown target ${TARGET_ARCH}:${TARGET}. | .error Unknown target ${TARGET_ARCH}:${TARGET}. | ||||
.endif | .endif | ||||
.endfor | .endfor | ||||
.if ${.MAKE.OS} != "FreeBSD" | |||||
CROSSBUILD_HOST=${.MAKE.OS} | |||||
.if ${.MAKE.OS} != "Linux" && ${.MAKE.OS} != "Darwin" | |||||
.warning "Unsupported crossbuild system: ${.MAKE.OS}. Build will probably fail!" | |||||
.endif | |||||
# We need to force NO_ROOT/DB_FROM_SRC builds when building on other operating | |||||
# systems since the BSD.foo.dist specs contain users and groups that do not | |||||
# exist by default on a Linux/MacOS system. | |||||
NO_ROOT:= 1 | |||||
DB_FROM_SRC:= 1 | |||||
.export NO_ROOT | |||||
.endif | |||||
# If all targets are disabled for system llvm then don't expect it to work | # If all targets are disabled for system llvm then don't expect it to work | ||||
# for cross-builds. | # for cross-builds. | ||||
.if !defined(TOOLS_PREFIX) && ${MK_LLVM_TARGET_ALL} == "no" && \ | .if !defined(TOOLS_PREFIX) && ${MK_LLVM_TARGET_ALL} == "no" && \ | ||||
${MACHINE} != ${TARGET} && ${MACHINE_ARCH} != ${TARGET_ARCH} && \ | ${MACHINE} != ${TARGET} && ${MACHINE_ARCH} != ${TARGET_ARCH} && \ | ||||
!make(showconfig) | !make(showconfig) | ||||
MK_SYSTEM_COMPILER= no | MK_SYSTEM_COMPILER= no | ||||
MK_SYSTEM_LINKER= no | MK_SYSTEM_LINKER= no | ||||
.endif | .endif | ||||
▲ Show 20 Lines • Show All 385 Lines • ▼ Show 20 Lines | |||||
_CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} -f /dev/null \ | _CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} -f /dev/null \ | ||||
-m ${.CURDIR}/share/mk MK_AUTO_OBJ=no -V CPUTYPE | -m ${.CURDIR}/share/mk MK_AUTO_OBJ=no -V CPUTYPE | ||||
.if ${_CPUTYPE} != ${_TARGET_CPUTYPE} | .if ${_CPUTYPE} != ${_TARGET_CPUTYPE} | ||||
.error CPUTYPE global should be set with ?=. | .error CPUTYPE global should be set with ?=. | ||||
.endif | .endif | ||||
.endif | .endif | ||||
.if make(buildworld) | .if make(buildworld) | ||||
BUILD_ARCH!= uname -p | BUILD_ARCH!= uname -p | ||||
.if ${MACHINE_ARCH} != ${BUILD_ARCH} | # On some Linux systems uname -p returns "unknown" so skip this check there. | ||||
# This check only exists to tell people to use TARGET_ARCH instead of | |||||
# MACHINE_ARCH so skipping it when crossbuilding on non-FreeBSD should be fine. | |||||
.if ${MACHINE_ARCH} != ${BUILD_ARCH} && ${.MAKE.OS} == "FreeBSD" | |||||
.error To cross-build, set TARGET_ARCH. | .error To cross-build, set TARGET_ARCH. | ||||
.endif | .endif | ||||
.endif | .endif | ||||
WORLDTMP?= ${OBJTOP}/tmp | WORLDTMP?= ${OBJTOP}/tmp | ||||
BPATH= ${CCACHE_WRAPPER_PATH_PFX}${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin:${WORLDTMP}/legacy/usr/libexec | BPATH= ${CCACHE_WRAPPER_PATH_PFX}${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin:${WORLDTMP}/legacy/usr/libexec | ||||
XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin | XPATH= ${WORLDTMP}/bin:${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin | ||||
# When building we want to find the cross tools before the host tools in ${BPATH}. | # When building we want to find the cross tools before the host tools in ${BPATH}. | ||||
# We also need to add UNIVERSE_TOOLCHAIN_PATH so that we can find the shared | # We also need to add UNIVERSE_TOOLCHAIN_PATH so that we can find the shared | ||||
# toolchain files (clang, lld, etc.) during make universe/tinderbox | # toolchain files (clang, lld, etc.) during make universe/tinderbox | ||||
STRICTTMPPATH= ${XPATH}:${BPATH}:${UNIVERSE_TOOLCHAIN_PATH} | STRICTTMPPATH= ${XPATH}:${BPATH}:${UNIVERSE_TOOLCHAIN_PATH} | ||||
# We should not be using tools from /usr/bin accidentally since this could cause | # We should not be using tools from /usr/bin accidentally since this could cause | ||||
# the build to break on other systems that don't have that tool. For now we | # the build to break on other systems that don't have that tool. For now we | ||||
# still allow using the old behaviour (inheriting $PATH) if | # still allow using the old behaviour (inheriting $PATH) if | ||||
# BUILD_WITH_STRICT_TMPPATH is set to 0 but this will eventually be removed. | # BUILD_WITH_STRICT_TMPPATH is set to 0 but this will eventually be removed. | ||||
# Currently strict $PATH can cause build failures and does not work yet with | # Currently strict $PATH can cause build failures and does not work yet with | ||||
# USING_SYSTEM_LINKER/USING_SYSTEM_COMPILER. Once these issues have been | # USING_SYSTEM_LINKER/USING_SYSTEM_COMPILER. Once these issues have been | ||||
# resolved it will be turned on by default. | # resolved it will be turned on by default. | ||||
BUILD_WITH_STRICT_TMPPATH?=0 | BUILD_WITH_STRICT_TMPPATH?=0 | ||||
.if defined(CROSSBUILD_HOST) | |||||
# When building on non-FreeBSD we can't rely on the tools in /usr/bin being compatible | |||||
# with what FreeBSD expects. Therefore we only use tools from STRICTTMPPATH | |||||
# during the world build stage. We build most tools during the bootstrap-tools | |||||
# phase but symlink host tools that are known to work instead of building them | |||||
BUILD_WITH_STRICT_TMPPATH:=1 | |||||
.endif | |||||
.if ${BUILD_WITH_STRICT_TMPPATH} != 0 | .if ${BUILD_WITH_STRICT_TMPPATH} != 0 | ||||
TMPPATH= ${STRICTTMPPATH} | TMPPATH= ${STRICTTMPPATH} | ||||
.else | .else | ||||
TMPPATH= ${STRICTTMPPATH}:${PATH} | TMPPATH= ${STRICTTMPPATH}:${PATH} | ||||
.endif | .endif | ||||
# | # | ||||
# Avoid running mktemp(1) unless actually needed. | # Avoid running mktemp(1) unless actually needed. | ||||
▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | |||||
XMAKE= ${BMAKE} \ | XMAKE= ${BMAKE} \ | ||||
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ | TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ | ||||
MK_CLANG_IS_CC=${MK_CLANG_BOOTSTRAP} \ | MK_CLANG_IS_CC=${MK_CLANG_BOOTSTRAP} \ | ||||
MK_GDB=no MK_TESTS=no | MK_GDB=no MK_TESTS=no | ||||
# kernel-tools stage | # kernel-tools stage | ||||
KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ | KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ | ||||
PATH=${BPATH}:${PATH} \ | PATH=${BPATH}:${PATH} \ | ||||
WORLDTMP=${WORLDTMP} | WORLDTMP=${WORLDTMP} \ | ||||
MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" | |||||
KTMAKE= \ | KTMAKE= \ | ||||
TOOLS_PREFIX=${TOOLS_PREFIX_UNDEF:U${WORLDTMP}} \ | TOOLS_PREFIX=${TOOLS_PREFIX_UNDEF:U${WORLDTMP}} \ | ||||
${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ | ${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ | ||||
DESTDIR= \ | DESTDIR= \ | ||||
OBJTOP='${WORLDTMP}/obj-kernel-tools' \ | OBJTOP='${WORLDTMP}/obj-kernel-tools' \ | ||||
OBJROOT='$${OBJTOP}/' \ | OBJROOT='$${OBJTOP}/' \ | ||||
MAKEOBJDIRPREFIX= \ | MAKEOBJDIRPREFIX= \ | ||||
BOOTSTRAPPING=${BOOTSTRAPPING_OSRELDATE} \ | BOOTSTRAPPING=${BOOTSTRAPPING_OSRELDATE} \ | ||||
▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | |||||
# __FreeBSD_version is in WORLDTMP. This purposely does NOT have | # __FreeBSD_version is in WORLDTMP. This purposely does NOT have | ||||
# a make dependency on /usr/include/osreldate.h as the file should | # a make dependency on /usr/include/osreldate.h as the file should | ||||
# only be copied when it is missing or meta mode determines it has changed. | # only be copied when it is missing or meta mode determines it has changed. | ||||
# Since host files are normally ignored without NO_META_IGNORE_HOST | # Since host files are normally ignored without NO_META_IGNORE_HOST | ||||
# the file will never be updated unless that flag is specified. This | # the file will never be updated unless that flag is specified. This | ||||
# allows tracking the oldest osreldate to force rebuilds via | # allows tracking the oldest osreldate to force rebuilds via | ||||
# META_MODE_BADABI_REVS above. | # META_MODE_BADABI_REVS above. | ||||
host-osreldate.h: # DO NOT ADD /usr/include/osreldate.h here | host-osreldate.h: # DO NOT ADD /usr/include/osreldate.h here | ||||
.if !defined(CROSSBUILD_HOST) | |||||
@cp -f /usr/include/osreldate.h ${.TARGET} | @cp -f /usr/include/osreldate.h ${.TARGET} | ||||
.else | |||||
@echo "#ifndef __FreeBSD_version" > ${.TARGET} | |||||
@echo "#define __FreeBSD_version ${OSRELDATE}" >> ${.TARGET} | |||||
@echo "#endif" >> ${.TARGET} | |||||
.endif | |||||
WMAKE= ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ | WMAKE= ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ | ||||
BWPHASE=${.TARGET:C,^_,,} \ | BWPHASE=${.TARGET:C,^_,,} \ | ||||
DESTDIR=${WORLDTMP} | DESTDIR=${WORLDTMP} | ||||
IMAKEENV= ${CROSSENV} | IMAKEENV= ${CROSSENV} | ||||
IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ | IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ | ||||
${IMAKE_INSTALL} ${IMAKE_MTREE} | ${IMAKE_INSTALL} ${IMAKE_MTREE} | ||||
▲ Show 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | _legacy: | ||||
@echo "--------------------------------------------------------------" | @echo "--------------------------------------------------------------" | ||||
${_+_}cd ${.CURDIR}; ${BMAKE} legacy | ${_+_}cd ${.CURDIR}; ${BMAKE} legacy | ||||
_bootstrap-tools: | _bootstrap-tools: | ||||
@echo | @echo | ||||
@echo "--------------------------------------------------------------" | @echo "--------------------------------------------------------------" | ||||
@echo ">>> stage 1.2: bootstrap tools" | @echo ">>> stage 1.2: bootstrap tools" | ||||
@echo "--------------------------------------------------------------" | @echo "--------------------------------------------------------------" | ||||
${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools | ${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools | ||||
mkdir -p ${WORLDTMP}/usr ${WORLDTMP}/lib/casper ${WORLDTMP}/lib/geom | mkdir -p ${WORLDTMP}/usr ${WORLDTMP}/lib/casper ${WORLDTMP}/lib/geom \ | ||||
${WORLDTMP}/bin | |||||
${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ | ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ | ||||
-p ${WORLDTMP}/usr >/dev/null | -p ${WORLDTMP}/usr >/dev/null | ||||
${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \ | ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \ | ||||
-p ${WORLDTMP}/usr/include >/dev/null | -p ${WORLDTMP}/usr/include >/dev/null | ||||
ln -sf ${.CURDIR}/sys ${WORLDTMP} | ln -sf ${.CURDIR}/sys ${WORLDTMP} | ||||
.if ${MK_DEBUG_FILES} != "no" | .if ${MK_DEBUG_FILES} != "no" | ||||
${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ | ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ | ||||
-p ${WORLDTMP}/usr/lib >/dev/null | -p ${WORLDTMP}/usr/lib >/dev/null | ||||
▲ Show 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | |||||
# | # | ||||
# Required install tools to be saved in a scratch dir for safety. | # Required install tools to be saved in a scratch dir for safety. | ||||
# | # | ||||
.if ${MK_ZONEINFO} != "no" | .if ${MK_ZONEINFO} != "no" | ||||
_zoneinfo= zic tzsetup | _zoneinfo= zic tzsetup | ||||
.endif | .endif | ||||
.if !defined(CROSSBUILD_HOST) | |||||
_sysctl=sysctl | |||||
.endif | |||||
ITOOLS= [ awk cap_mkdb cat chflags chmod chown cmp cp \ | ITOOLS= [ awk cap_mkdb cat chflags chmod chown cmp cp \ | ||||
date echo egrep find grep id install ${_install-info} \ | date echo egrep find grep id install ${_install-info} \ | ||||
ln make mkdir mtree mv pwd_mkdb \ | ln make mkdir mtree mv pwd_mkdb \ | ||||
rm sed services_mkdb sh sort strip sysctl test true uname wc ${_zoneinfo} \ | rm sed services_mkdb sh sort strip ${_sysctl} test true uname wc \ | ||||
${LOCAL_ITOOLS} | ${_zoneinfo} ${LOCAL_ITOOLS} | ||||
# Needed for share/man | # Needed for share/man | ||||
.if ${MK_MAN_UTILS} != "no" | .if ${MK_MAN_UTILS} != "no" | ||||
ITOOLS+=makewhatis | ITOOLS+=makewhatis | ||||
.endif | .endif | ||||
# | # | ||||
# distributeworld | # distributeworld | ||||
Show All 19 Lines | |||||
DEBUG_DISTRIBUTIONS+= base ${EXTRA_DISTRIBUTIONS:S,tests,,} | DEBUG_DISTRIBUTIONS+= base ${EXTRA_DISTRIBUTIONS:S,tests,,} | ||||
.endif | .endif | ||||
MTREE_MAGIC?= mtree 2.0 | MTREE_MAGIC?= mtree 2.0 | ||||
distributeworld installworld stageworld: _installcheck_world .PHONY | distributeworld installworld stageworld: _installcheck_world .PHONY | ||||
mkdir -p ${INSTALLTMP} | mkdir -p ${INSTALLTMP} | ||||
progs=$$(for prog in ${ITOOLS}; do \ | progs=$$(for prog in ${ITOOLS}; do \ | ||||
if progpath=`which $$prog`; then \ | if progpath=`env PATH=${TMPPATH} which $$prog`; then \ | ||||
echo $$progpath; \ | echo $$progpath; \ | ||||
else \ | else \ | ||||
echo "Required tool $$prog not found in PATH." >&2; \ | echo "Required tool $$prog not found in PATH ($$PATH)." >&2; \ | ||||
exit 1; \ | exit 1; \ | ||||
fi; \ | fi; \ | ||||
done); \ | done); \ | ||||
if [ -z "${CROSSBUILD_HOST}" ] ; then \ | |||||
libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | \ | libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | \ | ||||
while read line; do \ | while read line; do \ | ||||
set -- $$line; \ | set -- $$line; \ | ||||
if [ "$$2 $$3" != "not found" ]; then \ | if [ "$$2 $$3" != "not found" ]; then \ | ||||
echo $$2; \ | echo $$2; \ | ||||
else \ | else \ | ||||
echo "Required library $$1 not found." >&2; \ | echo "Required library $$1 not found." >&2; \ | ||||
exit 1; \ | exit 1; \ | ||||
fi; \ | fi; \ | ||||
done); \ | done); \ | ||||
fi; \ | |||||
cp $$libs $$progs ${INSTALLTMP} | cp $$libs $$progs ${INSTALLTMP} | ||||
cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale | cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale | ||||
.if defined(NO_ROOT) | .if defined(NO_ROOT) | ||||
-mkdir -p ${METALOG:H} | -mkdir -p ${METALOG:H} | ||||
echo "#${MTREE_MAGIC}" > ${METALOG} | echo "#${MTREE_MAGIC}" > ${METALOG} | ||||
.endif | .endif | ||||
.if make(distributeworld) | .if make(distributeworld) | ||||
.for dist in ${EXTRA_DISTRIBUTIONS} | .for dist in ${EXTRA_DISTRIBUTIONS} | ||||
▲ Show 20 Lines • Show All 693 Lines • ▼ Show 20 Lines | |||||
# | # | ||||
# legacy: Build compatibility shims for the next three targets. This is a | # legacy: Build compatibility shims for the next three targets. This is a | ||||
# minimal set of tools and shims necessary to compensate for older systems | # minimal set of tools and shims necessary to compensate for older systems | ||||
# which don't have the APIs required by the targets built in bootstrap-tools, | # which don't have the APIs required by the targets built in bootstrap-tools, | ||||
# build-tools or cross-tools. | # build-tools or cross-tools. | ||||
# | # | ||||
# libnv and libsbuf are requirements for config(8), which is an unconditional | |||||
# libnv is a requirement for config(8), which is an unconditional | |||||
# bootstrap-tool. | # bootstrap-tool. | ||||
_config_deps= lib/libnv | _config_deps= lib/libnv lib/libsbuf | ||||
legacy: .PHONY | legacy: .PHONY | ||||
.if ${BOOTSTRAPPING} < ${MINIMUM_SUPPORTED_OSREL} && ${BOOTSTRAPPING} != 0 | .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 ${_config_deps} | .for _tool in tools/build | ||||
bdrewery: `_config_deps` is unused now. It was updated though. Is it needed somewhere? | |||||
arichardsonAuthorUnsubmitted Done Inline ActionsI thought I fixed that in a follow-up commit, but I may have only done it in CheriBSD. Will check tomorrow morning. arichardson: I thought I fixed that in a follow-up commit, but I may have only done it in CheriBSD. Will… | |||||
arichardsonAuthorUnsubmitted Done Inline ActionsFixed in rS367636 arichardson: Fixed in rS367636 | |||||
${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,all,install)"; \ | ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,all,install)"; \ | ||||
cd ${.CURDIR}/${_tool}; \ | cd ${.CURDIR}/${_tool}; \ | ||||
if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ | if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ | ||||
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${WORLDTMP}/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=${WORLDTMP}/legacy install | DESTDIR=${WORLDTMP}/legacy install | ||||
.endfor | .endfor | ||||
Show All 19 Lines | |||||
# linked to $WORLDTMP. The tools are listed in the _host_tools_to_symlink | # linked to $WORLDTMP. The tools are listed in the _host_tools_to_symlink | ||||
# variable in tools/build/Makefile and are linked during the legacy phase. | # variable in tools/build/Makefile and are linked during the legacy phase. | ||||
# Since they could be Linux or MacOS binaries, too we must only use flags that | # Since they could be Linux or MacOS binaries, too we must only use flags that | ||||
# are portable across operating systems. | # are portable across operating systems. | ||||
# If BOOTSTRAP_ALL_TOOLS is set we will build all the required tools from the | # If BOOTSTRAP_ALL_TOOLS is set we will build all the required tools from the | ||||
# current source tree. Otherwise we create a symlink to the version found in | # current source tree. Otherwise we create a symlink to the version found in | ||||
# $PATH during the bootstrap-tools stage. | # $PATH during the bootstrap-tools stage. | ||||
# When building on non-FreeBSD systems we can't assume that the host binaries | |||||
# accept compatible flags or produce compatible output. Therefore we force | |||||
# BOOTSTRAP_ALL_TOOLS and just build the FreeBSD version of the binary. | |||||
.if defined(CROSSBUILD_HOST) | |||||
BOOTSTRAP_ALL_TOOLS:= 1 | |||||
.endif | |||||
.if defined(BOOTSTRAP_ALL_TOOLS) | .if defined(BOOTSTRAP_ALL_TOOLS) | ||||
# BOOTSTRAPPING will be set on the command line so we can't override it here. | # BOOTSTRAPPING will be set on the command line so we can't override it here. | ||||
# Instead set BOOTSTRAPPING_OSRELDATE so that the value 0 is set ${BSARGS} | # Instead set BOOTSTRAPPING_OSRELDATE so that the value 0 is set ${BSARGS} | ||||
BOOTSTRAPPING_OSRELDATE:= 0 | BOOTSTRAPPING_OSRELDATE:= 0 | ||||
.endif | .endif | ||||
# libnv and libsbuf are requirements for config(8), which is an unconditional | |||||
# bootstrap-tool. | |||||
_config=usr.sbin/config lib/libnv lib/libsbuf | |||||
${_bt}-usr.sbin/config: ${_bt}-lib/libnv ${_bt}-lib/libsbuf | |||||
.if ${MK_GAMES} != "no" | .if ${MK_GAMES} != "no" | ||||
_strfile= usr.bin/fortune/strfile | _strfile= usr.bin/fortune/strfile | ||||
.endif | .endif | ||||
.if ${MK_VT} != "no" | .if ${MK_VT} != "no" | ||||
_vtfontcvt= usr.bin/vtfontcvt | _vtfontcvt= usr.bin/vtfontcvt | ||||
.endif | .endif | ||||
# If we are not building the bootstrap because BOOTSTRAPPING is sufficient | # If we are not building the bootstrap because BOOTSTRAPPING is sufficient | ||||
# we symlink the host version to $WORLDTMP instead. By doing this we can also | # we symlink the host version to $WORLDTMP instead. By doing this we can also | ||||
# detect when a bootstrap tool is being used without the required MK_FOO. | # detect when a bootstrap tool is being used without the required MK_FOO. | ||||
# If you add a new bootstrap tool where we could also use the host version, | # If you add a new bootstrap tool where we could also use the host version, | ||||
# please ensure that you also add a .else case where you add the tool to the | # please ensure that you also add a .else case where you add the tool to the | ||||
# _bootstrap_tools_links variable. | # _bootstrap_tools_links variable. | ||||
.if ${BOOTSTRAPPING} < 1000033 | .if ${BOOTSTRAPPING} < 1000033 | ||||
_m4= usr.bin/m4 | # Note: lex needs m4 to build but m4 also depends on lex (which needs m4 to | ||||
# generate any files). To fix this cyclic dependency we can build a bootstrap | |||||
# version of m4 (with pre-generated files) then use that to build the real m4. | |||||
# We can't simply use the host m4 since e.g. the macOS version does not accept | |||||
# the flags that are passed by lex. | |||||
# For lex we also use the pre-gerated files since we would otherwise need to | |||||
# build awk and sed first (which need lex to build) | |||||
# TODO: add a _bootstrap_lex and then build the real lex afterwards | |||||
_lex= usr.bin/lex | _lex= usr.bin/lex | ||||
# Note: lex needs m4 to build but m4 also depends on lex. However, lex can be | _m4= tools/build/bootstrap-m4 usr.bin/m4 | ||||
# bootstrapped so we build lex first. | ${_bt}-tools/build/bootstrap-m4: ${_bt}-usr.bin/lex ${_bt}-lib/libopenbsd ${_bt}-usr.bin/yacc | ||||
${_bt}-usr.bin/m4: ${_bt}-lib/libopenbsd ${_bt}-usr.bin/yacc ${_bt}-${_lex} | ${_bt}-usr.bin/m4: ${_bt}-lib/libopenbsd ${_bt}-usr.bin/yacc ${_bt}-usr.bin/lex ${_bt}-tools/build/bootstrap-m4 | ||||
_bt_m4_depend=${_bt}-${_m4} | _bt_m4_depend=${_bt}-usr.bin/m4 | ||||
_bt_lex_depend=${_bt}-${_lex} ${_bt_m4_depend} | _bt_lex_depend=${_bt}-usr.bin/lex ${_bt_m4_depend} | ||||
.else | .else | ||||
_bootstrap_tools_links+=m4 lex | _bootstrap_tools_links+=m4 lex | ||||
.endif | .endif | ||||
# ELF Tool Chain libraries are needed for ELF tools and dtrace tools. | # ELF Tool Chain libraries are needed for ELF tools and dtrace tools. | ||||
# r296685 fix cross-endian objcopy | # r296685 fix cross-endian objcopy | ||||
# r310724 fixed PR 215350, a crash in libdwarf with objects built by GCC 6.2. | # r310724 fixed PR 215350, a crash in libdwarf with objects built by GCC 6.2. | ||||
# r334881 added libdwarf constants used by ctfconvert. | # r334881 added libdwarf constants used by ctfconvert. | ||||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | .if ${BOOTSTRAPPING} < 1100078 || \ | ||||
(${MK_AUTO_OBJ} == "yes" && ${BOOTSTRAPPING} < 1100114) || \ | (${MK_AUTO_OBJ} == "yes" && ${BOOTSTRAPPING} < 1100114) || \ | ||||
(${MK_META_MODE} == "yes" && ${BOOTSTRAPPING} < 1200006) | (${MK_META_MODE} == "yes" && ${BOOTSTRAPPING} < 1200006) | ||||
_crunchgen= usr.sbin/crunch/crunchgen | _crunchgen= usr.sbin/crunch/crunchgen | ||||
.else | .else | ||||
_bootstrap_tools_links+=crunchgen | _bootstrap_tools_links+=crunchgen | ||||
.endif | .endif | ||||
# r296926 -P keymap search path, MFC to stable/10 in r298297 | # r296926 -P keymap search path, MFC to stable/10 in r298297 | ||||
.if ${BOOTSTRAPPING} < 1003501 || \ | # Note: kbdcontrol can not be bootstrapped on non-FreeBSD systems | ||||
(${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103) | .if !defined(CROSSBUILD_HOST) | ||||
.if (${BOOTSTRAPPING} < 1003501 || \ | |||||
(${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103)) | |||||
_kbdcontrol= usr.sbin/kbdcontrol | _kbdcontrol= usr.sbin/kbdcontrol | ||||
.else | .else | ||||
_bootstrap_tools_links+=kbdcontrol | _bootstrap_tools_links+=kbdcontrol | ||||
.endif | .endif | ||||
.endif | |||||
_yacc= usr.bin/yacc | _yacc= usr.bin/yacc | ||||
.if ${MK_BSNMP} != "no" | .if ${MK_BSNMP} != "no" | ||||
_gensnmptree= usr.sbin/bsnmpd/gensnmptree | _gensnmptree= usr.sbin/bsnmpd/gensnmptree | ||||
.endif | .endif | ||||
Show All 10 Lines | |||||
${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/libllvmminimal | ${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/libllvmminimal | ||||
${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-lib/clang/libllvmminimal | ${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-lib/clang/libllvmminimal | ||||
${_bt}-usr.bin/clang/lldb-tblgen: ${_bt}-lib/clang/libllvmminimal | ${_bt}-usr.bin/clang/lldb-tblgen: ${_bt}-lib/clang/libllvmminimal | ||||
.endif | .endif | ||||
.if ${MK_LOCALES} != "no" | .if ${MK_LOCALES} != "no" | ||||
_localedef= usr.bin/localedef | _localedef= usr.bin/localedef | ||||
${_bt}-usr.bin/localedef: ${_bt}-usr.bin/yacc ${_bt_lex_depend} | |||||
.endif | .endif | ||||
.if ${MK_KERBEROS} != "no" | .if ${MK_KERBEROS} != "no" | ||||
_kerberos5_bootstrap_tools= \ | _kerberos5_bootstrap_tools= \ | ||||
kerberos5/tools/make-roken \ | kerberos5/tools/make-roken \ | ||||
kerberos5/lib/libroken \ | kerberos5/lib/libroken \ | ||||
kerberos5/lib/libvers \ | kerberos5/lib/libvers \ | ||||
kerberos5/tools/asn1_compile \ | kerberos5/tools/asn1_compile \ | ||||
Show All 13 Lines | |||||
# Linux or MacOS host the host versions are incompatible so we need to build | # Linux or MacOS host the host versions are incompatible so we need to build | ||||
# them from the source tree. Usually the link name will be the same as the subdir, | # them from the source tree. Usually the link name will be the same as the subdir, | ||||
# but some directories such as grep or test install multiple binaries. In that | # but some directories such as grep or test install multiple binaries. In that | ||||
# case we use the _basic_bootstrap_tools_multilink variable which is a list of | # case we use the _basic_bootstrap_tools_multilink variable which is a list of | ||||
# subdirectory and comma-separated list of files. | # subdirectory and comma-separated list of files. | ||||
_basic_bootstrap_tools_multilink=usr.bin/grep grep,egrep,fgrep | _basic_bootstrap_tools_multilink=usr.bin/grep grep,egrep,fgrep | ||||
_basic_bootstrap_tools_multilink+=bin/test test,[ | _basic_bootstrap_tools_multilink+=bin/test test,[ | ||||
# bootstrap tools needed by buildworld: | # bootstrap tools needed by buildworld: | ||||
_basic_bootstrap_tools=usr.bin/cut bin/expr usr.bin/gencat \ | _basic_bootstrap_tools+=usr.bin/cut bin/expr usr.bin/gencat usr.bin/join \ | ||||
usr.bin/join usr.bin/mktemp bin/rmdir usr.bin/sed usr.bin/sort \ | usr.bin/mktemp bin/realpath bin/rmdir usr.bin/sed usr.bin/sort \ | ||||
usr.bin/truncate usr.bin/tsort | usr.bin/truncate usr.bin/tsort | ||||
# Some build scripts use nawk instead of awk (this happens at least in | # Some build scripts use nawk instead of awk (this happens at least in | ||||
# cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh) so we need both awk | # cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh) so we need both awk | ||||
# and nawk in ${WORLDTMP}/legacy/bin. | # and nawk in ${WORLDTMP}/legacy/bin. | ||||
_basic_bootstrap_tools_multilink+=usr.bin/awk awk,nawk | _basic_bootstrap_tools_multilink+=usr.bin/awk awk,nawk | ||||
# file2c is required for building usr.sbin/config: | # file2c is required for building usr.sbin/config: | ||||
_basic_bootstrap_tools+=usr.bin/file2c | _basic_bootstrap_tools+=usr.bin/file2c | ||||
# uuencode/uudecode required for share/tabset | # uuencode/uudecode required for share/tabset | ||||
_basic_bootstrap_tools+=usr.bin/uuencode usr.bin/uudecode | _basic_bootstrap_tools+=usr.bin/uuencode usr.bin/uudecode | ||||
# xargs is required by mkioctls | # xargs is required by mkioctls | ||||
_basic_bootstrap_tools+=usr.bin/xargs | _basic_bootstrap_tools+=usr.bin/xargs | ||||
# cap_mkdb is required for share/termcap: | # cap_mkdb is required for share/termcap: | ||||
_basic_bootstrap_tools+=usr.bin/cap_mkdb | _basic_bootstrap_tools+=usr.bin/cap_mkdb | ||||
# ldd is required for installcheck (TODO: just always use /usr/bin/ldd instead?) | |||||
_basic_bootstrap_tools+=usr.bin/ldd | |||||
# services_mkdb/pwd_mkdb are required for installworld: | # services_mkdb/pwd_mkdb are required for installworld: | ||||
_basic_bootstrap_tools+=usr.sbin/services_mkdb usr.sbin/pwd_mkdb | _basic_bootstrap_tools+=usr.sbin/services_mkdb usr.sbin/pwd_mkdb | ||||
# ldd is required for installcheck (TODO: just always use /usr/bin/ldd instead?) | |||||
.if !defined(CROSSBUILD_HOST) | |||||
# ldd is only needed for updating the running system so we don't need to | |||||
# bootstrap ldd on non-FreeBSD systems | |||||
_basic_bootstrap_tools+=usr.bin/ldd | |||||
.endif | |||||
# sysctl/chflags are required for installkernel: | # sysctl/chflags are required for installkernel: | ||||
.if !defined(CROSSBUILD_HOST) | |||||
_basic_bootstrap_tools+=sbin/sysctl bin/chflags | _basic_bootstrap_tools+=sbin/sysctl bin/chflags | ||||
.else | |||||
# When building on non-FreeBSD, install a fake chflags instead since the | |||||
# version from the source tree cannot work. We also don't need sysctl since we | |||||
# are install with -DNO_ROOT. | |||||
_other_bootstrap_tools+=tools/build/cross-build/fake_chflags | |||||
.endif | |||||
# mkfifo is used by sys/conf/newvers.sh | # mkfifo is used by sys/conf/newvers.sh | ||||
_basic_bootstrap_tools+=usr.bin/mkfifo | _basic_bootstrap_tools+=usr.bin/mkfifo | ||||
.if ${MK_BOOT} != "no" | .if ${MK_BOOT} != "no" | ||||
_basic_bootstrap_tools+=bin/dd | |||||
# xz/unxz is used by EFI | |||||
_basic_bootstrap_tools_multilink+=usr.bin/xz xz,unxz | |||||
# md5 is used by boot/beri (and possibly others) | # md5 is used by boot/beri (and possibly others) | ||||
_basic_bootstrap_tools+=sbin/md5 | _basic_bootstrap_tools+=sbin/md5 | ||||
.if defined(BOOTSTRAP_ALL_TOOLS) | |||||
${_bt}-sbin/md5: ${_bt}-lib/libmd | |||||
.endif | .endif | ||||
.endif | |||||
.if ${MK_ZONEINFO} != "no" | .if ${MK_ZONEINFO} != "no" | ||||
_basic_bootstrap_tools+=usr.sbin/zic usr.sbin/tzsetup | _basic_bootstrap_tools+=usr.sbin/zic usr.sbin/tzsetup | ||||
.endif | .endif | ||||
.if defined(BOOTSTRAP_ALL_TOOLS) | .if defined(BOOTSTRAP_ALL_TOOLS) | ||||
_other_bootstrap_tools+=${_basic_bootstrap_tools} | _other_bootstrap_tools+=${_basic_bootstrap_tools} | ||||
.for _subdir _links in ${_basic_bootstrap_tools_multilink} | .for _subdir _links in ${_basic_bootstrap_tools_multilink} | ||||
_other_bootstrap_tools+=${_subdir} | _other_bootstrap_tools+=${_subdir} | ||||
.endfor | .endfor | ||||
${_bt}-usr.bin/awk: ${_bt_lex_depend} ${_bt}-usr.bin/yacc | ${_bt}-usr.bin/awk: ${_bt_lex_depend} ${_bt}-usr.bin/yacc | ||||
${_bt}-bin/expr: ${_bt_lex_depend} ${_bt}-usr.bin/yacc | ${_bt}-bin/expr: ${_bt_lex_depend} ${_bt}-usr.bin/yacc | ||||
# If we are bootstrapping file2c, we have to build it before config: | # If we are bootstrapping file2c, we have to build it before config: | ||||
${_bt}-usr.sbin/config: ${_bt}-usr.bin/file2c ${_bt_lex_depend} | ${_bt}-usr.sbin/config: ${_bt}-usr.bin/file2c ${_bt_lex_depend} | ||||
# Note: no symlink to make/bmake in the !BOOTSTRAP_ALL_TOOLS case here since | # Note: no symlink to make/bmake in the !BOOTSTRAP_ALL_TOOLS case here since | ||||
# the links to make/bmake make links will have already have been created in the | # the links to make/bmake make links will have already have been created in the | ||||
# `make legacy` step. Not adding a link to make is important on non-FreeBSD | # `make legacy` step. Not adding a link to make is important on non-FreeBSD | ||||
# since "make" will usually point to GNU make there. | # since "make" will usually point to GNU make there. | ||||
_other_bootstrap_tools+=usr.bin/bmake | _other_bootstrap_tools+=usr.bin/bmake | ||||
# Avoid dependency on host bz2 headers: | |||||
_other_bootstrap_tools+=lib/libbz2 | |||||
${_bt}-usr.bin/grep: ${_bt}-lib/libbz2 | |||||
.else | .else | ||||
# All tools in _basic_bootstrap_tools have the same name as the subdirectory | # All tools in _basic_bootstrap_tools have the same name as the subdirectory | ||||
# so we can use :T to get the name of the symlinks that we need to create. | # so we can use :T to get the name of the symlinks that we need to create. | ||||
_bootstrap_tools_links+=${_basic_bootstrap_tools:T} | _bootstrap_tools_links+=${_basic_bootstrap_tools:T} | ||||
.for _subdir _links in ${_basic_bootstrap_tools_multilink} | .for _subdir _links in ${_basic_bootstrap_tools_multilink} | ||||
_bootstrap_tools_links+=${_links:S/,/ /g} | _bootstrap_tools_links+=${_links:S/,/ /g} | ||||
.endfor | .endfor | ||||
.endif # defined(BOOTSTRAP_ALL_TOOLS) | .endif # defined(BOOTSTRAP_ALL_TOOLS) | ||||
Show All 33 Lines | .for _tool in \ | ||||
usr.bin/mandoc \ | usr.bin/mandoc \ | ||||
usr.bin/rpcgen \ | usr.bin/rpcgen \ | ||||
${_yacc} \ | ${_yacc} \ | ||||
${_m4} \ | ${_m4} \ | ||||
${_lex} \ | ${_lex} \ | ||||
${_other_bootstrap_tools} \ | ${_other_bootstrap_tools} \ | ||||
usr.bin/xinstall \ | usr.bin/xinstall \ | ||||
${_gensnmptree} \ | ${_gensnmptree} \ | ||||
usr.sbin/config \ | ${_config} \ | ||||
${_flua} \ | ${_flua} \ | ||||
${_crunchide} \ | ${_crunchide} \ | ||||
${_crunchgen} \ | ${_crunchgen} \ | ||||
${_nmtree} \ | ${_nmtree} \ | ||||
${_vtfontcvt} \ | ${_vtfontcvt} \ | ||||
${_localedef} | ${_localedef} | ||||
${_bt}-${_tool}: ${_bt}-links .PHONY .MAKE | ${_bt}-${_tool}: ${_bt}-links .PHONY .MAKE | ||||
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ | ${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ | ||||
cd ${.CURDIR}/${_tool}; \ | cd ${.CURDIR}/${_tool}; \ | ||||
if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ | if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ | ||||
if [ "${_tool}" = "usr.bin/lex" ]; then \ | if [ "${_tool}" = "usr.bin/lex" ]; then \ | ||||
${MAKE} DIRPRFX=${_tool}/ bootstrap; \ | ${MAKE} DIRPRFX=${_tool}/ bootstrap; \ | ||||
fi; \ | fi; \ | ||||
${MAKE} DIRPRFX=${_tool}/ all; \ | ${MAKE} DIRPRFX=${_tool}/ all; \ | ||||
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${WORLDTMP}/legacy install | ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${WORLDTMP}/legacy install | ||||
bootstrap-tools: ${_bt}-${_tool} | bootstrap-tools: ${_bt}-${_tool} | ||||
.endfor | .endfor | ||||
.if target(${_bt}-lib/libmd) | |||||
# If we are bootstrapping libmd (e.g. when building on macOS/Linux) add the | |||||
# necessary dependencies: | |||||
${_bt}-usr.bin/sort: ${_bt}-lib/libmd | |||||
${_bt}-usr.bin/xinstall: ${_bt}-lib/libmd | |||||
${_bt}-sbin/md5: ${_bt}-lib/libmd | |||||
.endif | |||||
# | # | ||||
# build-tools: Build special purpose build tools | # build-tools: Build special purpose build tools | ||||
# | # | ||||
.if !defined(NO_SHARE) && ${MK_SYSCONS} != "no" | .if !defined(NO_SHARE) && ${MK_SYSCONS} != "no" | ||||
_share= share/syscons/scrnmaps | _share= share/syscons/scrnmaps | ||||
.endif | .endif | ||||
▲ Show 20 Lines • Show All 1,006 Lines • Show Last 20 Lines |
_config_deps is unused now. It was updated though. Is it needed somewhere?