Changeset View
Changeset View
Standalone View
Standalone View
head/Makefile.inc1
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
# Standard targets (not defined here) are documented in the makefiles in | # Standard targets (not defined here) are documented in the makefiles in | ||||
# /usr/share/mk. These include: | # /usr/share/mk. These include: | ||||
# obj depend all install clean cleandepend cleanobj | # obj depend all install clean cleandepend cleanobj | ||||
.if !defined(TARGET) || !defined(TARGET_ARCH) | .if !defined(TARGET) || !defined(TARGET_ARCH) | ||||
.error "Both TARGET and TARGET_ARCH must be defined." | .error "Both TARGET and TARGET_ARCH must be defined." | ||||
.endif | .endif | ||||
# Cross toolchain changes must be in effect before bsd.compiler.mk | |||||
# so that gets the right CC, and pass CROSS_TOOLCHAIN to submakes. | |||||
.if defined(CROSS_TOOLCHAIN) | |||||
LOCALBASE?= /usr/local | |||||
.include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk" | |||||
CROSSENV+=CROSS_TOOLCHAIN="${CROSS_TOOLCHAIN}" | |||||
.endif | |||||
.include <bsd.compiler.mk> # don't depend on src.opts.mk doing it | |||||
.include "share/mk/src.opts.mk" | .include "share/mk/src.opts.mk" | ||||
.include <bsd.arch.inc.mk> | |||||
.include <bsd.compiler.mk> | |||||
# We must do lib/ and libexec/ before bin/ in case of a mid-install error to | # We must do lib/ and libexec/ before bin/ in case of a mid-install error to | ||||
# keep the users system reasonably usable. For static->dynamic root upgrades, | # keep the users system reasonably usable. For static->dynamic root upgrades, | ||||
# we don't want to install a dynamic binary without rtld and the needed | # we don't want to install a dynamic binary without rtld and the needed | ||||
# libraries. More commonly, for dynamic root, we don't want to install a | # libraries. More commonly, for dynamic root, we don't want to install a | ||||
# binary that requires a newer library version that hasn't been installed yet. | # binary that requires a newer library version that hasn't been installed yet. | ||||
# This ordering is not a guarantee though. The only guarantee of a working | # This ordering is not a guarantee though. The only guarantee of a working | ||||
# system here would require fine-grained ordering of all components based | # system here would require fine-grained ordering of all components based | ||||
▲ Show 20 Lines • Show All 187 Lines • ▼ Show 20 Lines | |||||
# This stage actually builds the world. | # This stage actually builds the world. | ||||
# 5. install stage (optional) [IMAKE] | # 5. install stage (optional) [IMAKE] | ||||
# This stage installs a previously built world. | # This stage installs a previously built world. | ||||
# | # | ||||
BOOTSTRAPPING?= 0 | BOOTSTRAPPING?= 0 | ||||
# Common environment for world related stages | # Common environment for world related stages | ||||
CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \ | CROSSENV+= MAKEOBJDIRPREFIX=${OBJTREE} \ | ||||
MACHINE_ARCH=${TARGET_ARCH} \ | MACHINE_ARCH=${TARGET_ARCH} \ | ||||
MACHINE=${TARGET} \ | MACHINE=${TARGET} \ | ||||
CPUTYPE=${TARGET_CPUTYPE} | CPUTYPE=${TARGET_CPUTYPE} | ||||
.if ${MK_GROFF} != "no" | .if ${MK_GROFF} != "no" | ||||
CROSSENV+= GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \ | CROSSENV+= GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \ | ||||
GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \ | GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \ | ||||
GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac | GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac | ||||
.endif | .endif | ||||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | WMAKEENV= ${CROSSENV} \ | ||||
PATH=${TMPPATH} | PATH=${TMPPATH} | ||||
# make hierarchy | # make hierarchy | ||||
HMAKE= PATH=${TMPPATH} ${MAKE} LOCAL_MTREE=${LOCAL_MTREE:Q} | HMAKE= PATH=${TMPPATH} ${MAKE} LOCAL_MTREE=${LOCAL_MTREE:Q} | ||||
.if defined(NO_ROOT) | .if defined(NO_ROOT) | ||||
HMAKE+= PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT | HMAKE+= PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT | ||||
.endif | .endif | ||||
.if defined(CROSS_TOOLCHAIN) | |||||
LOCALBASE?= /usr/local | |||||
.include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk" | |||||
.endif | |||||
.if defined(CROSS_TOOLCHAIN_PREFIX) | .if defined(CROSS_TOOLCHAIN_PREFIX) | ||||
CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} | CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} | ||||
CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} | CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} | ||||
.endif | .endif | ||||
# If we do not have a bootstrap binutils (because the in-tree one does not | # If we do not have a bootstrap binutils (because the in-tree one does not | ||||
# support the target architecture), provide a default cross-binutils prefix. | # support the target architecture), provide a default cross-binutils prefix. | ||||
# This allows aarch64 builds, for example, to automatically use the | # This allows aarch64 builds, for example, to automatically use the | ||||
Show All 20 Lines | |||||
.for BINUTIL in ${XBINUTILS} | .for BINUTIL in ${XBINUTILS} | ||||
.if defined(CROSS_BINUTILS_PREFIX) && \ | .if defined(CROSS_BINUTILS_PREFIX) && \ | ||||
exists(${CROSS_BINUTILS_PREFIX}${${BINUTIL}}) | exists(${CROSS_BINUTILS_PREFIX}${${BINUTIL}}) | ||||
X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${${BINUTIL}} | X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${${BINUTIL}} | ||||
.else | .else | ||||
X${BINUTIL}?= ${${BINUTIL}} | X${BINUTIL}?= ${${BINUTIL}} | ||||
.endif | .endif | ||||
.endfor | .endfor | ||||
WMAKEENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCFLAGS} ${XCXXFLAGS}" \ | CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCFLAGS} ${XCXXFLAGS}" \ | ||||
DEPFLAGS="${DEPFLAGS}" \ | DEPFLAGS="${DEPFLAGS}" \ | ||||
CPP="${XCPP} ${XCFLAGS}" \ | CPP="${XCPP} ${XCFLAGS}" \ | ||||
AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \ | AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \ | ||||
OBJDUMP=${XOBJDUMP} OBJCOPY="${XOBJCOPY}" \ | OBJDUMP=${XOBJDUMP} OBJCOPY="${XOBJCOPY}" \ | ||||
RANLIB=${XRANLIB} STRINGS=${XSTRINGS} \ | RANLIB=${XRANLIB} STRINGS=${XSTRINGS} \ | ||||
SIZE="${XSIZE}" | SIZE="${XSIZE}" | ||||
.if ${XCC:M/*} | .if ${XCC:M/*} | ||||
▲ Show 20 Lines • Show All 1,959 Lines • Show Last 20 Lines |