Changeset View
Changeset View
Standalone View
Standalone View
head/Makefile
Show First 20 Lines • Show All 507 Lines • ▼ Show 20 Lines | |||||
TARGET_ARCHES_arm64?= aarch64 | TARGET_ARCHES_arm64?= aarch64 | ||||
TARGET_ARCHES_mips?= mips mips64 ${EXTRA_ARCHES_mips} | TARGET_ARCHES_mips?= mips mips64 ${EXTRA_ARCHES_mips} | ||||
TARGET_ARCHES_powerpc?= powerpc powerpc64 ${EXTRA_ARCHES_powerpc} | TARGET_ARCHES_powerpc?= powerpc powerpc64 ${EXTRA_ARCHES_powerpc} | ||||
TARGET_ARCHES_riscv?= riscv64 riscv64sf | TARGET_ARCHES_riscv?= riscv64 riscv64sf | ||||
.for target in ${TARGETS} | .for target in ${TARGETS} | ||||
TARGET_ARCHES_${target}?= ${target} | TARGET_ARCHES_${target}?= ${target} | ||||
.endfor | .endfor | ||||
# Remove architectures only supported by external toolchain from | .if defined(USE_GCC_TOOLCHAINS) | ||||
# universe if required toolchain packages are missing. | TOOLCHAINS_amd64= amd64-gcc6 | ||||
# Note: We no longer have targets that require an external toolchain, but for | TOOLCHAINS_arm64= aarch64-gcc6 | ||||
# now keep this block in case a new non-LLVM architecture is added and to reuse | TOOLCHAINS_i386= i386-gcc6 | ||||
# it for a future extenal GCC make universe variant. | TOOLCHAINS_mips= mips-gcc6 | ||||
_external_toolchain_targets= | TOOLCHAINS_powerpc= powerpc-gcc6 powerpc64-gcc6 | ||||
.for target in ${_external_toolchain_targets} | TOOLCHAIN_powerpc64= powerpc64-gcc6 | ||||
.if ${_UNIVERSE_TARGETS:M${target}} | .endif | ||||
# If a target is using an external toolchain, set MAKE_PARAMS to enable use | |||||
# of the toolchain. If the external toolchain is missing, exclude the target | |||||
# from universe. | |||||
.for target in ${_UNIVERSE_TARGETS} | |||||
.if !empty(TOOLCHAINS_${target}) | |||||
.for toolchain in ${TOOLCHAINS_${target}} | .for toolchain in ${TOOLCHAINS_${target}} | ||||
.if !exists(/usr/local/share/toolchains/${toolchain}.mk) | .if !exists(/usr/local/share/toolchains/${toolchain}.mk) | ||||
_UNIVERSE_TARGETS:= ${_UNIVERSE_TARGETS:N${target}} | _UNIVERSE_TARGETS:= ${_UNIVERSE_TARGETS:N${target}} | ||||
universe: universe_${toolchain}_skip .PHONY | universe: universe_${toolchain}_skip .PHONY | ||||
universe_epilogue: universe_${toolchain}_skip .PHONY | universe_epilogue: universe_${toolchain}_skip .PHONY | ||||
universe_${toolchain}_skip: universe_prologue .PHONY | universe_${toolchain}_skip: universe_prologue .PHONY | ||||
@echo ">> ${target} skipped - install ${toolchain} port or package to build" | @echo ">> ${target} skipped - install ${toolchain} port or package to build" | ||||
.endif | .endif | ||||
.endfor | .endfor | ||||
.for arch in ${TARGET_ARCHES_${target}} | |||||
TOOLCHAIN_${arch}?= ${TOOLCHAINS_${target}:[1]} | |||||
MAKE_PARAMS_${arch}?= CROSS_TOOLCHAIN=${TOOLCHAIN_${arch}} | |||||
.endfor | |||||
.endif | .endif | ||||
.endfor | .endfor | ||||
UNIVERSE_TARGET?= buildworld | UNIVERSE_TARGET?= buildworld | ||||
KERNSRCDIR?= ${.CURDIR}/sys | KERNSRCDIR?= ${.CURDIR}/sys | ||||
targets: .PHONY | targets: .PHONY | ||||
@echo "Supported TARGET/TARGET_ARCH pairs for world and kernel targets" | @echo "Supported TARGET/TARGET_ARCH pairs for world and kernel targets" | ||||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
universe_${target}_worlds: .PHONY | universe_${target}_worlds: .PHONY | ||||
.if !make(targets) && !make(universe-toolchain) | .if !make(targets) && !make(universe-toolchain) | ||||
.for target_arch in ${TARGET_ARCHES_${target}} | .for target_arch in ${TARGET_ARCHES_${target}} | ||||
.if !defined(_need_clang_${target}_${target_arch}) | .if !defined(_need_clang_${target}_${target_arch}) | ||||
_need_clang_${target}_${target_arch} != \ | _need_clang_${target}_${target_arch} != \ | ||||
env TARGET=${target} TARGET_ARCH=${target_arch} \ | env TARGET=${target} TARGET_ARCH=${target_arch} \ | ||||
${SUB_MAKE} -C ${.CURDIR} -f Makefile.inc1 test-system-compiler \ | ${SUB_MAKE} -C ${.CURDIR} -f Makefile.inc1 test-system-compiler \ | ||||
${MAKE_PARAMS_${target}} -V MK_CLANG_BOOTSTRAP 2>/dev/null || \ | ${MAKE_PARAMS_${target_arch}} -V MK_CLANG_BOOTSTRAP 2>/dev/null || \ | ||||
echo unknown | echo unknown | ||||
.export _need_clang_${target}_${target_arch} | .export _need_clang_${target}_${target_arch} | ||||
.endif | .endif | ||||
.if !defined(_need_lld_${target}_${target_arch}) | .if !defined(_need_lld_${target}_${target_arch}) | ||||
_need_lld_${target}_${target_arch} != \ | _need_lld_${target}_${target_arch} != \ | ||||
env TARGET=${target} TARGET_ARCH=${target_arch} \ | env TARGET=${target} TARGET_ARCH=${target_arch} \ | ||||
${SUB_MAKE} -C ${.CURDIR} -f Makefile.inc1 test-system-linker \ | ${SUB_MAKE} -C ${.CURDIR} -f Makefile.inc1 test-system-linker \ | ||||
${MAKE_PARAMS_${target}} -V MK_LLD_BOOTSTRAP 2>/dev/null || \ | ${MAKE_PARAMS_${target_arch}} -V MK_LLD_BOOTSTRAP 2>/dev/null || \ | ||||
echo unknown | echo unknown | ||||
.export _need_lld_${target}_${target_arch} | .export _need_lld_${target}_${target_arch} | ||||
.endif | .endif | ||||
# Setup env for each arch to use the one clang. | # Setup env for each arch to use the one clang. | ||||
.if defined(_need_clang_${target}_${target_arch}) && \ | .if defined(_need_clang_${target}_${target_arch}) && \ | ||||
${_need_clang_${target}_${target_arch}} == "yes" | ${_need_clang_${target}_${target_arch}} == "yes" | ||||
# No check on existing XCC or CROSS_BINUTILS_PREFIX, etc, is needed since | # No check on existing XCC or CROSS_BINUTILS_PREFIX, etc, is needed since | ||||
# we use the test-system-compiler logic to determine if clang needs to be | # we use the test-system-compiler logic to determine if clang needs to be | ||||
# built. It will be no from that logic if already using an external | # built. It will be no from that logic if already using an external | ||||
# toolchain or /usr/bin/cc. | # toolchain or /usr/bin/cc. | ||||
# XXX: Passing HOST_OBJTOP into the PATH would allow skipping legacy, | # XXX: Passing HOST_OBJTOP into the PATH would allow skipping legacy, | ||||
# bootstrap-tools, and cross-tools. Need to ensure each tool actually | # bootstrap-tools, and cross-tools. Need to ensure each tool actually | ||||
# supports all TARGETS though. | # supports all TARGETS though. | ||||
# For now we only pass UNIVERSE_TOOLCHAIN_PATH which will be added at the end | # For now we only pass UNIVERSE_TOOLCHAIN_PATH which will be added at the end | ||||
# of STRICTTMPPATH to ensure that the target-specific binaries come first. | # of STRICTTMPPATH to ensure that the target-specific binaries come first. | ||||
MAKE_PARAMS_${target}+= \ | MAKE_PARAMS_${target_arch}+= \ | ||||
XCC="${HOST_OBJTOP}/tmp/usr/bin/cc" \ | XCC="${HOST_OBJTOP}/tmp/usr/bin/cc" \ | ||||
XCXX="${HOST_OBJTOP}/tmp/usr/bin/c++" \ | XCXX="${HOST_OBJTOP}/tmp/usr/bin/c++" \ | ||||
XCPP="${HOST_OBJTOP}/tmp/usr/bin/cpp" \ | XCPP="${HOST_OBJTOP}/tmp/usr/bin/cpp" \ | ||||
UNIVERSE_TOOLCHAIN_PATH=${HOST_OBJTOP}/tmp/usr/bin | UNIVERSE_TOOLCHAIN_PATH=${HOST_OBJTOP}/tmp/usr/bin | ||||
.endif | .endif | ||||
.if defined(_need_lld_${target}_${target_arch}) && \ | .if defined(_need_lld_${target}_${target_arch}) && \ | ||||
${_need_lld_${target}_${target_arch}} == "yes" | ${_need_lld_${target}_${target_arch}} == "yes" | ||||
MAKE_PARAMS_${target}+= \ | MAKE_PARAMS_${target_arch}+= \ | ||||
XLD="${HOST_OBJTOP}/tmp/usr/bin/ld" | XLD="${HOST_OBJTOP}/tmp/usr/bin/ld" | ||||
.endif | .endif | ||||
.endfor | .endfor | ||||
.endif # !make(targets) | .endif # !make(targets) | ||||
.if ${__DO_WORLDS} == "yes" | .if ${__DO_WORLDS} == "yes" | ||||
universe_${target}_done: universe_${target}_worlds .PHONY | universe_${target}_done: universe_${target}_worlds .PHONY | ||||
.for target_arch in ${TARGET_ARCHES_${target}} | .for target_arch in ${TARGET_ARCHES_${target}} | ||||
universe_${target}_worlds: universe_${target}_${target_arch} .PHONY | universe_${target}_worlds: universe_${target}_${target_arch} .PHONY | ||||
.if (defined(_need_clang_${target}_${target_arch}) && \ | .if (defined(_need_clang_${target}_${target_arch}) && \ | ||||
${_need_clang_${target}_${target_arch}} == "yes") || \ | ${_need_clang_${target}_${target_arch}} == "yes") || \ | ||||
(defined(_need_lld_${target}_${target_arch}) && \ | (defined(_need_lld_${target}_${target_arch}) && \ | ||||
${_need_lld_${target}_${target_arch}} == "yes") | ${_need_lld_${target}_${target_arch}} == "yes") | ||||
universe_${target}_${target_arch}: universe-toolchain | universe_${target}_${target_arch}: universe-toolchain | ||||
universe_${target}_prologue: universe-toolchain | universe_${target}_prologue: universe-toolchain | ||||
.endif | .endif | ||||
universe_${target}_${target_arch}: universe_${target}_prologue .MAKE .PHONY | universe_${target}_${target_arch}: universe_${target}_prologue .MAKE .PHONY | ||||
@echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`" | @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`" | ||||
@(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ | @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ | ||||
${SUB_MAKE} ${JFLAG} ${UNIVERSE_TARGET} \ | ${SUB_MAKE} ${JFLAG} ${UNIVERSE_TARGET} \ | ||||
TARGET=${target} \ | TARGET=${target} \ | ||||
TARGET_ARCH=${target_arch} \ | TARGET_ARCH=${target_arch} \ | ||||
${MAKE_PARAMS_${target}} \ | ${MAKE_PARAMS_${target_arch}} \ | ||||
> _.${target}.${target_arch}.${UNIVERSE_TARGET} 2>&1 || \ | > _.${target}.${target_arch}.${UNIVERSE_TARGET} 2>&1 || \ | ||||
(echo "${target}.${target_arch} ${UNIVERSE_TARGET} failed," \ | (echo "${target}.${target_arch} ${UNIVERSE_TARGET} failed," \ | ||||
"check _.${target}.${target_arch}.${UNIVERSE_TARGET} for details" | \ | "check _.${target}.${target_arch}.${UNIVERSE_TARGET} for details" | \ | ||||
${MAKEFAIL})) | ${MAKEFAIL})) | ||||
@echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} completed on `LC_ALL=C date`" | @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} completed on `LC_ALL=C date`" | ||||
.endfor | .endfor | ||||
.endif # ${__DO_WORLDS} == "yes" | .endif # ${__DO_WORLDS} == "yes" | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
.endif | .endif | ||||
universe_kernconfs_${TARGET_ARCH_${kernel}}: universe_kernconf_${TARGET}_${kernel} | universe_kernconfs_${TARGET_ARCH_${kernel}}: universe_kernconf_${TARGET}_${kernel} | ||||
universe_kernconf_${TARGET}_${kernel}: .MAKE | universe_kernconf_${TARGET}_${kernel}: .MAKE | ||||
@echo ">> ${TARGET}.${TARGET_ARCH_${kernel}} ${kernel} kernel started on `LC_ALL=C date`" | @echo ">> ${TARGET}.${TARGET_ARCH_${kernel}} ${kernel} kernel started on `LC_ALL=C date`" | ||||
@(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ | @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ | ||||
${SUB_MAKE} ${JFLAG} buildkernel \ | ${SUB_MAKE} ${JFLAG} buildkernel \ | ||||
TARGET=${TARGET} \ | TARGET=${TARGET} \ | ||||
TARGET_ARCH=${TARGET_ARCH_${kernel}} \ | TARGET_ARCH=${TARGET_ARCH_${kernel}} \ | ||||
${MAKE_PARAMS_${TARGET}} \ | ${MAKE_PARAMS_${TARGET_ARCH}} \ | ||||
KERNCONF=${kernel} \ | KERNCONF=${kernel} \ | ||||
> _.${TARGET}.${kernel} 2>&1 || \ | > _.${TARGET}.${kernel} 2>&1 || \ | ||||
(echo "${TARGET} ${kernel} kernel failed," \ | (echo "${TARGET} ${kernel} kernel failed," \ | ||||
"check _.${TARGET}.${kernel} for details"| ${MAKEFAIL})) | "check _.${TARGET}.${kernel} for details"| ${MAKEFAIL})) | ||||
@echo ">> ${TARGET}.${TARGET_ARCH_${kernel}} ${kernel} kernel completed on `LC_ALL=C date`" | @echo ">> ${TARGET}.${TARGET_ARCH_${kernel}} ${kernel} kernel completed on `LC_ALL=C date`" | ||||
.endfor | .endfor | ||||
.for target_arch in ${TARGET_ARCHES_${TARGET}} | .for target_arch in ${TARGET_ARCHES_${TARGET}} | ||||
universe_kernconfs: universe_kernconfs_${target_arch} .PHONY | universe_kernconfs: universe_kernconfs_${target_arch} .PHONY | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |