1998-08-31 01:08:08 +00:00
|
|
|
#
|
1999-08-28 01:35:59 +00:00
|
|
|
# $FreeBSD$
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# Make command line options:
|
2004-12-21 12:21:26 +00:00
|
|
|
# -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
|
|
|
|
# -DNO_CLEAN do not clean at all
|
2013-01-22 21:10:03 +00:00
|
|
|
# -DDB_FROM_SRC use the user/group databases in src/etc instead of
|
|
|
|
# the system database when installing.
|
2004-12-21 12:13:23 +00:00
|
|
|
# -DNO_SHARE do not go into share subdir
|
2016-03-30 23:50:23 +00:00
|
|
|
# -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,OBJ}
|
2000-06-15 10:00:20 +00:00
|
|
|
# -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
|
2001-01-22 23:29:13 +00:00
|
|
|
# -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
|
2009-12-16 02:54:34 +00:00
|
|
|
# -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel
|
2013-01-22 21:10:03 +00:00
|
|
|
# -DNO_ROOT install without using root privilege
|
2014-04-25 19:25:00 +00:00
|
|
|
# -DWITHOUT_CTF do not run the DTrace CTF conversion tools on built objects
|
1998-08-31 01:08:08 +00:00
|
|
|
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
|
2014-06-17 22:23:36 +00:00
|
|
|
# LOCAL_ITOOLS="list of tools" to add additional tools to the ITOOLS list
|
2012-06-15 19:42:49 +00:00
|
|
|
# LOCAL_LIB_DIRS="list of dirs" to add additional dirs to libraries target
|
2012-10-18 12:32:51 +00:00
|
|
|
# LOCAL_MTREE="list of mtree files" to process to allow local directories
|
|
|
|
# to be created before files are installed
|
2020-11-20 20:11:59 +00:00
|
|
|
# LOCAL_LEGACY_DIRS="list of dirs" to add additional dirs to the legacy
|
|
|
|
# target
|
|
|
|
# LOCAL_BSTOOL_DIRS="list of dirs" to add additional dirs to the
|
|
|
|
# bootstrap-tools target
|
2012-01-05 21:50:50 +00:00
|
|
|
# LOCAL_TOOL_DIRS="list of dirs" to add additional dirs to the build-tools
|
2020-11-20 20:11:59 +00:00
|
|
|
# target
|
2016-07-21 06:06:11 +00:00
|
|
|
# LOCAL_XTOOL_DIRS="list of dirs" to add additional dirs to the
|
|
|
|
# cross-tools target
|
2013-01-22 21:10:03 +00:00
|
|
|
# METALOG="path to metadata log" to write permission and ownership
|
2020-11-04 23:26:15 +00:00
|
|
|
# when NO_ROOT is set. (default: ${DESTDIR}/${DISTDIR}/METALOG,
|
|
|
|
# check /etc/make.conf for DISTDIR)
|
2006-09-07 16:41:30 +00:00
|
|
|
# TARGET="machine" to crossbuild world for a different machine type
|
2010-04-14 18:56:07 +00:00
|
|
|
# TARGET_ARCH= may be required when a TARGET supports multiple endians
|
2015-11-05 22:09:00 +00:00
|
|
|
# BUILDENV_SHELL= shell to launch for the buildenv target (def:${SHELL})
|
2013-02-03 10:26:24 +00:00
|
|
|
# WORLD_FLAGS= additional flags to pass to make(1) during buildworld
|
|
|
|
# KERNEL_FLAGS= additional flags to pass to make(1) during buildkernel
|
Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)
Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.
SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.
With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.
- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.
- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.
- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.
- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.
The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.
This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.
- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.
- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.
- Document these changes in build.7
Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks
2015-10-22 00:07:48 +00:00
|
|
|
# SUBDIR_OVERRIDE="list of dirs" to build rather than everything.
|
|
|
|
# All libraries and includes, and some build tools will still build.
|
1998-08-31 01:08:08 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# The intended user-driven targets are:
|
|
|
|
# buildworld - rebuild *everything*, including glue to help do upgrades
|
|
|
|
# installworld- install everything built by "buildworld"
|
2016-02-07 18:40:04 +00:00
|
|
|
# checkworld - run test suite on installed world
|
2006-05-26 18:10:06 +00:00
|
|
|
# doxygen - build API documentation of the kernel
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# Standard targets (not defined here) are documented in the makefiles in
|
|
|
|
# /usr/share/mk. These include:
|
|
|
|
# obj depend all install clean cleandepend cleanobj
|
|
|
|
|
2011-02-10 19:58:21 +00:00
|
|
|
.if !defined(TARGET) || !defined(TARGET_ARCH)
|
|
|
|
.error "Both TARGET and TARGET_ARCH must be defined."
|
|
|
|
.endif
|
|
|
|
|
2018-06-20 17:20:39 +00:00
|
|
|
.if make(showconfig) || make(test-system-*)
|
|
|
|
_MKSHOWCONFIG= t
|
|
|
|
.endif
|
|
|
|
|
2016-05-21 01:32:23 +00:00
|
|
|
SRCDIR?= ${.CURDIR}
|
2015-12-20 05:52:03 +00:00
|
|
|
LOCALBASE?= /usr/local
|
2021-08-01 09:10:49 +00:00
|
|
|
TIME_ENV ?= time env
|
2008-09-19 16:14:42 +00:00
|
|
|
|
2020-04-07 02:46:22 +00:00
|
|
|
.include "share/mk/src.tools.mk"
|
|
|
|
|
2015-11-05 21:48:12 +00:00
|
|
|
# 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)
|
2018-02-25 20:21:30 +00:00
|
|
|
.if exists(${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk)
|
2015-11-05 21:48:12 +00:00
|
|
|
.include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk"
|
2020-01-02 21:34:44 +00:00
|
|
|
.elif exists(/usr/share/toolchains/${CROSS_TOOLCHAIN}.mk)
|
|
|
|
.include "/usr/share/toolchains/${CROSS_TOOLCHAIN}.mk"
|
2018-02-25 20:21:30 +00:00
|
|
|
.elif exists(${CROSS_TOOLCHAIN})
|
|
|
|
.include "${CROSS_TOOLCHAIN}"
|
|
|
|
.else
|
2018-02-26 19:02:11 +00:00
|
|
|
.error CROSS_TOOLCHAIN ${CROSS_TOOLCHAIN} not found
|
2018-02-25 20:21:30 +00:00
|
|
|
.endif
|
2015-11-05 21:48:12 +00:00
|
|
|
CROSSENV+=CROSS_TOOLCHAIN="${CROSS_TOOLCHAIN}"
|
|
|
|
.endif
|
2016-05-21 01:32:04 +00:00
|
|
|
.if defined(CROSS_TOOLCHAIN_PREFIX)
|
|
|
|
CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
XCOMPILERS= CC CXX CPP
|
|
|
|
.for COMPILER in ${XCOMPILERS}
|
|
|
|
.if defined(CROSS_COMPILER_PREFIX)
|
|
|
|
X${COMPILER}?= ${CROSS_COMPILER_PREFIX}${${COMPILER}}
|
|
|
|
.else
|
|
|
|
X${COMPILER}?= ${${COMPILER}}
|
|
|
|
.endif
|
|
|
|
.endfor
|
2016-05-21 01:32:07 +00:00
|
|
|
# If a full path to an external cross compiler is given, don't build
|
|
|
|
# a cross compiler.
|
|
|
|
.if ${XCC:N${CCACHE_BIN}:M/*}
|
2016-07-24 18:50:11 +00:00
|
|
|
MK_CLANG_BOOTSTRAP= no
|
2021-08-24 13:55:31 +00:00
|
|
|
# Make sure sub-makes see the option as disabled so the hack in bsd.sys.mk to
|
|
|
|
# work around incompatible headers in Clang's resource directory is enabled.
|
|
|
|
.MAKEOVERRIDES+= MK_CLANG_BOOTSTRAP
|
2016-05-21 01:32:07 +00:00
|
|
|
.endif
|
|
|
|
|
2017-04-13 22:07:34 +00:00
|
|
|
# Pull in compiler metadata from buildworld/toolchain if possible to avoid
|
|
|
|
# running CC from bsd.compiler.mk.
|
2017-06-23 16:38:46 +00:00
|
|
|
.if make(installworld) || make(install) || make(distributeworld) || \
|
|
|
|
make(stageworld)
|
2018-06-21 02:15:50 +00:00
|
|
|
.-include "${OBJTOP}/toolchain-metadata.mk"
|
|
|
|
.if !defined(_LOADED_TOOLCHAIN_METADATA)
|
2018-06-16 00:35:19 +00:00
|
|
|
.error A build is required first. You may have the wrong MAKEOBJDIRPREFIX set.
|
|
|
|
.endif
|
2017-04-13 22:07:34 +00:00
|
|
|
.endif
|
|
|
|
|
2018-02-07 16:28:26 +00:00
|
|
|
# Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. Pull it from the
|
|
|
|
# tree to be friendlier to foreign OS builds. It's safe to do so unconditionally
|
|
|
|
# here since we will always have the right make, unlike in src/Makefile
|
2018-06-20 16:10:14 +00:00
|
|
|
# Don't include bsd.linker.mk yet until XBINUTILS is handled (after src.opts.mk)
|
|
|
|
_NO_INCLUDE_LINKERMK= t
|
2018-10-23 06:31:25 +00:00
|
|
|
# We also want the X_COMPILER* variables if we are using an external toolchain.
|
|
|
|
_WANT_TOOLCHAIN_CROSS_VARS= t
|
2018-02-07 16:28:26 +00:00
|
|
|
.include "share/mk/bsd.compiler.mk"
|
2018-06-20 16:10:14 +00:00
|
|
|
.undef _NO_INCLUDE_LINKERMK
|
2018-10-23 06:31:25 +00:00
|
|
|
.undef _WANT_TOOLCHAIN_CROSS_VARS
|
2018-06-20 16:10:14 +00:00
|
|
|
# src.opts.mk depends on COMPILER_FEATURES
|
2016-05-21 01:32:23 +00:00
|
|
|
.include "share/mk/src.opts.mk"
|
|
|
|
|
2018-06-20 16:10:14 +00:00
|
|
|
.if ${TARGET} == ${MACHINE}
|
|
|
|
TARGET_CPUTYPE?=${CPUTYPE}
|
|
|
|
.else
|
|
|
|
TARGET_CPUTYPE?=
|
|
|
|
.endif
|
|
|
|
.if !empty(TARGET_CPUTYPE)
|
|
|
|
_TARGET_CPUTYPE=${TARGET_CPUTYPE}
|
|
|
|
.else
|
|
|
|
_TARGET_CPUTYPE=dummy
|
|
|
|
.endif
|
|
|
|
.if ${TARGET} == "arm"
|
|
|
|
.if ${TARGET_ARCH:Marmv[67]*} != "" && ${TARGET_CPUTYPE:M*soft*} == ""
|
|
|
|
TARGET_ABI= gnueabihf
|
|
|
|
.else
|
|
|
|
TARGET_ABI= gnueabi
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
MACHINE_ABI?= unknown
|
2021-12-09 15:59:14 +00:00
|
|
|
MACHINE_TRIPLE?=${MACHINE_ARCH:S/amd64/x86_64/:C/[hs]f$//}-${MACHINE_ABI}-freebsd14.0
|
2018-06-20 16:10:14 +00:00
|
|
|
TARGET_ABI?= unknown
|
2021-12-09 15:59:14 +00:00
|
|
|
TARGET_TRIPLE?= ${TARGET_ARCH:S/amd64/x86_64/:C/[hs]f$//}-${TARGET_ABI}-freebsd14.0
|
2018-06-28 22:24:16 +00:00
|
|
|
KNOWN_ARCHES?= aarch64/arm64 \
|
|
|
|
amd64 \
|
|
|
|
armv6/arm \
|
|
|
|
armv7/arm \
|
|
|
|
i386 \
|
|
|
|
powerpc \
|
|
|
|
powerpc64/powerpc \
|
2020-09-22 23:49:30 +00:00
|
|
|
powerpc64le/powerpc \
|
2018-06-28 22:24:16 +00:00
|
|
|
powerpcspe/powerpc \
|
|
|
|
riscv64/riscv \
|
2020-02-02 11:37:27 +00:00
|
|
|
riscv64sf/riscv
|
2018-06-28 22:24:16 +00:00
|
|
|
|
|
|
|
.if ${TARGET} == ${TARGET_ARCH}
|
|
|
|
_t= ${TARGET}
|
|
|
|
.else
|
|
|
|
_t= ${TARGET_ARCH}/${TARGET}
|
|
|
|
.endif
|
|
|
|
.for _t in ${_t}
|
|
|
|
.if empty(KNOWN_ARCHES:M${_t})
|
|
|
|
.error Unknown target ${TARGET_ARCH}:${TARGET}.
|
|
|
|
.endif
|
|
|
|
.endfor
|
2018-06-20 16:10:14 +00:00
|
|
|
|
2020-08-25 13:29:57 +00:00
|
|
|
.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
|
|
|
|
|
2018-06-27 16:57:51 +00:00
|
|
|
# If all targets are disabled for system llvm then don't expect it to work
|
|
|
|
# for cross-builds.
|
2018-06-28 19:01:53 +00:00
|
|
|
.if !defined(TOOLS_PREFIX) && ${MK_LLVM_TARGET_ALL} == "no" && \
|
2018-06-27 16:57:51 +00:00
|
|
|
${MACHINE} != ${TARGET} && ${MACHINE_ARCH} != ${TARGET_ARCH} && \
|
|
|
|
!make(showconfig)
|
|
|
|
MK_SYSTEM_COMPILER= no
|
|
|
|
MK_SYSTEM_LINKER= no
|
|
|
|
.endif
|
|
|
|
|
2018-06-20 16:10:14 +00:00
|
|
|
# Handle external binutils.
|
|
|
|
.if defined(CROSS_TOOLCHAIN_PREFIX)
|
|
|
|
CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
|
|
|
|
.endif
|
2021-05-21 09:27:27 +00:00
|
|
|
XBINUTILS= AS AR ELFCTL LD NM OBJCOPY RANLIB SIZE STRINGS STRIPBIN
|
2018-06-20 16:10:14 +00:00
|
|
|
.for BINUTIL in ${XBINUTILS}
|
|
|
|
.if defined(CROSS_BINUTILS_PREFIX) && \
|
|
|
|
exists(${CROSS_BINUTILS_PREFIX}/${${BINUTIL}})
|
|
|
|
X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX:C,/*$,,}/${${BINUTIL}}
|
|
|
|
.else
|
|
|
|
X${BINUTIL}?= ${${BINUTIL}}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
# If a full path to an external linker is given, don't build lld.
|
|
|
|
.if ${XLD:M/*}
|
|
|
|
MK_LLD_BOOTSTRAP= no
|
|
|
|
.endif
|
|
|
|
|
2018-10-23 06:31:25 +00:00
|
|
|
# We also want the X_LINKER* variables if we are using an external toolchain.
|
|
|
|
_WANT_TOOLCHAIN_CROSS_VARS= t
|
2018-06-20 16:10:14 +00:00
|
|
|
.include "share/mk/bsd.linker.mk"
|
2018-10-23 06:31:25 +00:00
|
|
|
.undef _WANT_TOOLCHAIN_CROSS_VARS
|
2018-06-20 16:10:14 +00:00
|
|
|
|
|
|
|
# Begin WITH_SYSTEM_COMPILER / WITH_SYSTEM_LD
|
|
|
|
|
|
|
|
# WITH_SYSTEM_COMPILER - Pull in needed values and make a decision.
|
|
|
|
|
2016-05-21 01:32:23 +00:00
|
|
|
# Check if there is a local compiler that can satisfy as an external compiler.
|
|
|
|
# Which compiler is expected to be used?
|
|
|
|
.if ${MK_CLANG_BOOTSTRAP} == "yes"
|
2016-07-24 18:05:05 +00:00
|
|
|
WANT_COMPILER_TYPE= clang
|
2016-07-24 18:28:14 +00:00
|
|
|
.else
|
|
|
|
WANT_COMPILER_TYPE=
|
2016-05-21 01:32:23 +00:00
|
|
|
.endif
|
2018-06-20 16:10:14 +00:00
|
|
|
|
2018-06-20 17:20:39 +00:00
|
|
|
.if !defined(WANT_COMPILER_FREEBSD_VERSION) && !make(showconfig) && \
|
|
|
|
!make(test-system-linker)
|
2016-07-24 18:05:05 +00:00
|
|
|
.if ${WANT_COMPILER_TYPE} == "clang"
|
|
|
|
WANT_COMPILER_FREEBSD_VERSION_FILE= lib/clang/freebsd_cc_version.h
|
|
|
|
WANT_COMPILER_FREEBSD_VERSION!= \
|
2016-05-21 01:32:23 +00:00
|
|
|
awk '$$2 == "FREEBSD_CC_VERSION" {printf("%d\n", $$3)}' \
|
2016-07-24 18:05:05 +00:00
|
|
|
${SRCDIR}/${WANT_COMPILER_FREEBSD_VERSION_FILE} || echo unknown
|
|
|
|
WANT_COMPILER_VERSION_FILE= lib/clang/include/clang/Basic/Version.inc
|
|
|
|
WANT_COMPILER_VERSION!= \
|
2016-05-21 01:32:23 +00:00
|
|
|
awk '$$2 == "CLANG_VERSION" {split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \
|
2016-07-24 18:05:05 +00:00
|
|
|
${SRCDIR}/${WANT_COMPILER_VERSION_FILE} || echo unknown
|
2016-05-21 01:32:23 +00:00
|
|
|
.endif
|
2016-07-24 18:05:05 +00:00
|
|
|
.export WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_VERSION
|
|
|
|
.endif # !defined(WANT_COMPILER_FREEBSD_VERSION)
|
2018-06-20 16:10:14 +00:00
|
|
|
|
2016-07-24 18:05:05 +00:00
|
|
|
# It needs to be the same revision as we would build for the bootstrap.
|
|
|
|
# If the expected vs CC is different then we can't skip.
|
|
|
|
# GCC cannot be used for cross-arch yet. For clang we pass -target later if
|
|
|
|
# TARGET_ARCH!=MACHINE_ARCH.
|
2016-07-24 18:50:11 +00:00
|
|
|
.if ${MK_SYSTEM_COMPILER} == "yes" && \
|
2018-06-20 17:20:39 +00:00
|
|
|
defined(WANT_COMPILER_FREEBSD_VERSION) && \
|
2020-02-29 03:25:51 +00:00
|
|
|
${MK_CLANG_BOOTSTRAP} == "yes" && \
|
2018-06-20 17:20:39 +00:00
|
|
|
!make(xdev*) && \
|
2018-06-19 23:40:36 +00:00
|
|
|
${X_COMPILER_TYPE} == ${WANT_COMPILER_TYPE} && \
|
|
|
|
(${X_COMPILER_TYPE} == "clang" || ${TARGET_ARCH} == ${MACHINE_ARCH}) && \
|
|
|
|
${X_COMPILER_VERSION} == ${WANT_COMPILER_VERSION} && \
|
|
|
|
${X_COMPILER_FREEBSD_VERSION} == ${WANT_COMPILER_FREEBSD_VERSION}
|
2016-05-21 01:32:23 +00:00
|
|
|
# Everything matches, disable the bootstrap compiler.
|
|
|
|
MK_CLANG_BOOTSTRAP= no
|
2016-07-24 18:05:05 +00:00
|
|
|
USING_SYSTEM_COMPILER= yes
|
|
|
|
.endif # ${WANT_COMPILER_TYPE} == ${COMPILER_TYPE}
|
2018-06-20 16:10:14 +00:00
|
|
|
|
|
|
|
# WITH_SYSTEM_LD - Pull in needed values and make a decision.
|
|
|
|
|
|
|
|
# Check if there is a local linker that can satisfy as an external linker.
|
|
|
|
# Which linker is expected to be used?
|
|
|
|
.if ${MK_LLD_BOOTSTRAP} == "yes"
|
|
|
|
WANT_LINKER_TYPE= lld
|
|
|
|
.else
|
|
|
|
WANT_LINKER_TYPE=
|
|
|
|
.endif
|
|
|
|
|
2018-06-20 17:20:39 +00:00
|
|
|
.if !defined(WANT_LINKER_FREEBSD_VERSION) && !make(showconfig) && \
|
|
|
|
!make(test-system-compiler)
|
2018-06-20 16:10:14 +00:00
|
|
|
.if ${WANT_LINKER_TYPE} == "lld"
|
2019-11-19 16:40:46 +00:00
|
|
|
WANT_LINKER_FREEBSD_VERSION_FILE= lib/clang/include/VCSVersion.inc
|
2020-02-19 21:12:59 +00:00
|
|
|
_WANT_LINKER_FREEBSD_VERSION!= \
|
2019-11-19 16:40:46 +00:00
|
|
|
awk '$$2 == "LLD_REVISION" {gsub(/"/, "", $$3); print $$3}' \
|
2018-06-20 16:10:14 +00:00
|
|
|
${SRCDIR}/${WANT_LINKER_FREEBSD_VERSION_FILE} || echo unknown
|
2020-02-19 21:12:59 +00:00
|
|
|
WANT_LINKER_FREEBSD_VERSION=${_WANT_LINKER_FREEBSD_VERSION:C/.*-(.*)/\1/}
|
2018-06-20 16:10:14 +00:00
|
|
|
WANT_LINKER_VERSION_FILE= lib/clang/include/lld/Common/Version.inc
|
|
|
|
WANT_LINKER_VERSION!= \
|
2020-08-21 22:31:45 +00:00
|
|
|
awk '$$2 == "LLD_VERSION_STRING" { gsub("\"", "", $$3); split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \
|
2018-06-20 16:10:14 +00:00
|
|
|
${SRCDIR}/${WANT_LINKER_VERSION_FILE} || echo unknown
|
|
|
|
.else
|
|
|
|
WANT_LINKER_FREEBSD_VERSION_FILE=
|
|
|
|
WANT_LINKER_FREEBSD_VERSION=
|
|
|
|
.endif
|
|
|
|
.export WANT_LINKER_FREEBSD_VERSION WANT_LINKER_VERSION
|
|
|
|
.endif # !defined(WANT_LINKER_FREEBSD_VERSION)
|
|
|
|
|
|
|
|
.if ${MK_SYSTEM_LINKER} == "yes" && \
|
2018-06-20 17:20:39 +00:00
|
|
|
defined(WANT_LINKER_FREEBSD_VERSION) && \
|
2018-06-20 16:10:14 +00:00
|
|
|
(${MK_LLD_BOOTSTRAP} == "yes") && \
|
2018-06-20 17:20:39 +00:00
|
|
|
!make(xdev*) && \
|
2018-06-20 16:10:14 +00:00
|
|
|
${X_LINKER_TYPE} == ${WANT_LINKER_TYPE} && \
|
|
|
|
${X_LINKER_VERSION} == ${WANT_LINKER_VERSION} && \
|
|
|
|
${X_LINKER_FREEBSD_VERSION} == ${WANT_LINKER_FREEBSD_VERSION}
|
|
|
|
# Everything matches, disable the bootstrap linker.
|
|
|
|
MK_LLD_BOOTSTRAP= no
|
|
|
|
USING_SYSTEM_LINKER= yes
|
|
|
|
.endif # ${WANT_LINKER_TYPE} == ${LINKER_TYPE}
|
|
|
|
|
|
|
|
# WITH_SYSTEM_COMPILER / WITH_SYSTEM_LINKER - Handle defaults and debug.
|
2016-07-24 18:05:05 +00:00
|
|
|
USING_SYSTEM_COMPILER?= no
|
2018-06-20 16:10:14 +00:00
|
|
|
USING_SYSTEM_LINKER?= no
|
|
|
|
|
2016-07-24 18:05:05 +00:00
|
|
|
TEST_SYSTEM_COMPILER_VARS= \
|
|
|
|
USING_SYSTEM_COMPILER MK_SYSTEM_COMPILER \
|
2020-02-29 03:25:51 +00:00
|
|
|
MK_CROSS_COMPILER MK_CLANG_BOOTSTRAP \
|
2016-07-24 18:05:05 +00:00
|
|
|
WANT_COMPILER_TYPE WANT_COMPILER_VERSION WANT_COMPILER_VERSION_FILE \
|
|
|
|
WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_FREEBSD_VERSION_FILE \
|
2017-04-13 19:27:46 +00:00
|
|
|
CC COMPILER_TYPE COMPILER_FEATURES COMPILER_VERSION \
|
2017-06-22 21:03:30 +00:00
|
|
|
COMPILER_FREEBSD_VERSION \
|
2018-06-20 16:10:14 +00:00
|
|
|
XCC X_COMPILER_TYPE X_COMPILER_FEATURES X_COMPILER_VERSION \
|
|
|
|
X_COMPILER_FREEBSD_VERSION
|
|
|
|
TEST_SYSTEM_LINKER_VARS= \
|
|
|
|
USING_SYSTEM_LINKER MK_SYSTEM_LINKER \
|
2020-06-07 00:07:21 +00:00
|
|
|
MK_LLD_BOOTSTRAP \
|
2018-06-20 16:10:14 +00:00
|
|
|
WANT_LINKER_TYPE WANT_LINKER_VERSION WANT_LINKER_VERSION_FILE \
|
|
|
|
WANT_LINKER_FREEBSD_VERSION WANT_LINKER_FREEBSD_VERSION_FILE \
|
|
|
|
LD LINKER_TYPE LINKER_FEATURES LINKER_VERSION \
|
|
|
|
LINKER_FREEBSD_VERSION \
|
|
|
|
XLD X_LINKER_TYPE X_LINKER_FEATURES X_LINKER_VERSION \
|
|
|
|
X_LINKER_FREEBSD_VERSION
|
|
|
|
|
|
|
|
.for _t in compiler linker
|
|
|
|
test-system-${_t}: .PHONY
|
|
|
|
.for v in ${TEST_SYSTEM_${_t:tu}_VARS}
|
2016-07-24 18:05:05 +00:00
|
|
|
${_+_}@printf "%-35s= %s\n" "${v}" "${${v}}"
|
|
|
|
.endfor
|
2018-06-20 16:10:14 +00:00
|
|
|
.endfor
|
|
|
|
.if (make(buildworld) || make(buildkernel) || make(kernel-toolchain) || \
|
2016-07-24 18:05:05 +00:00
|
|
|
make(toolchain) || make(_cross-tools))
|
2018-06-20 16:10:14 +00:00
|
|
|
.if ${USING_SYSTEM_COMPILER} == "yes"
|
2016-05-21 01:32:23 +00:00
|
|
|
.info SYSTEM_COMPILER: Determined that CC=${CC} matches the source tree. Not bootstrapping a cross-compiler.
|
2018-06-20 16:10:14 +00:00
|
|
|
.elif ${MK_CLANG_BOOTSTRAP} == "yes"
|
|
|
|
.info SYSTEM_COMPILER: libclang will be built for bootstrapping a cross-compiler.
|
|
|
|
.endif
|
|
|
|
.if ${USING_SYSTEM_LINKER} == "yes"
|
|
|
|
.info SYSTEM_LINKER: Determined that LD=${LD} matches the source tree. Not bootstrapping a cross-linker.
|
|
|
|
.elif ${MK_LLD_BOOTSTRAP} == "yes"
|
|
|
|
.info SYSTEM_LINKER: libclang will be built for bootstrapping a cross-linker.
|
2016-05-21 01:32:23 +00:00
|
|
|
.endif
|
2018-06-20 16:10:14 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
# End WITH_SYSTEM_COMPILER / WITH_SYSTEM_LD
|
2016-05-21 01:32:23 +00:00
|
|
|
|
2017-04-13 22:07:34 +00:00
|
|
|
# Store some compiler metadata for use in installworld where we don't
|
|
|
|
# want to invoke CC at all.
|
2018-06-21 02:15:50 +00:00
|
|
|
_TOOLCHAIN_METADATA_VARS= COMPILER_VERSION \
|
2017-04-13 22:07:34 +00:00
|
|
|
COMPILER_TYPE \
|
|
|
|
COMPILER_FEATURES \
|
2017-06-22 21:03:30 +00:00
|
|
|
COMPILER_FREEBSD_VERSION \
|
2020-04-06 23:38:46 +00:00
|
|
|
COMPILER_RESOURCE_DIR \
|
2017-06-22 21:03:30 +00:00
|
|
|
LINKER_VERSION \
|
2018-01-12 01:09:30 +00:00
|
|
|
LINKER_FEATURES \
|
2018-06-20 16:10:14 +00:00
|
|
|
LINKER_TYPE \
|
|
|
|
LINKER_FREEBSD_VERSION
|
2018-06-21 02:15:50 +00:00
|
|
|
toolchain-metadata.mk: .PHONY .META
|
2017-04-13 22:07:34 +00:00
|
|
|
@: > ${.TARGET}
|
2018-06-21 02:15:50 +00:00
|
|
|
@echo ".info Using cached toolchain metadata from build at $$(hostname) on $$(date)" \
|
2017-04-13 22:07:34 +00:00
|
|
|
> ${.TARGET}
|
2018-06-21 02:15:50 +00:00
|
|
|
@echo "_LOADED_TOOLCHAIN_METADATA=t" >> ${.TARGET}
|
|
|
|
.for v in ${_TOOLCHAIN_METADATA_VARS}
|
2017-04-13 22:07:34 +00:00
|
|
|
@echo "${v}=${${v}}" >> ${.TARGET}
|
2018-06-19 23:39:55 +00:00
|
|
|
@echo "X_${v}=${X_${v}}" >> ${.TARGET}
|
2017-04-13 22:07:34 +00:00
|
|
|
.endfor
|
2018-06-21 02:15:50 +00:00
|
|
|
@echo ".export ${_TOOLCHAIN_METADATA_VARS}" >> ${.TARGET}
|
|
|
|
@echo ".export ${_TOOLCHAIN_METADATA_VARS:C,^,X_,}" >> ${.TARGET}
|
2016-06-03 20:49:49 +00:00
|
|
|
|
2008-09-19 16:14:42 +00:00
|
|
|
|
2015-10-16 21:09:15 +00:00
|
|
|
# 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,
|
|
|
|
# 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
|
|
|
|
# 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
|
|
|
|
# system here would require fine-grained ordering of all components based
|
|
|
|
# on their dependencies.
|
Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)
Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.
SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.
With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.
- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.
- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.
- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.
- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.
The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.
This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.
- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.
- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.
- Document these changes in build.7
Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks
2015-10-22 00:07:48 +00:00
|
|
|
.if !empty(SUBDIR_OVERRIDE)
|
2013-05-01 09:56:09 +00:00
|
|
|
SUBDIR= ${SUBDIR_OVERRIDE}
|
|
|
|
.else
|
2015-02-09 13:41:29 +00:00
|
|
|
SUBDIR= lib libexec
|
2018-06-17 14:13:45 +00:00
|
|
|
# Add LOCAL_LIB_DIRS, but only if they will not be picked up as a SUBDIR
|
|
|
|
# of a LOCAL_DIRS directory. This allows LOCAL_DIRS=foo and
|
|
|
|
# LOCAL_LIB_DIRS=foo/lib to behave as expected.
|
|
|
|
.for _DIR in ${LOCAL_DIRS:M*/} ${LOCAL_DIRS:N*/:S|$|/|}
|
|
|
|
_REDUNDANT_LIB_DIRS+= ${LOCAL_LIB_DIRS:M${_DIR}*}
|
|
|
|
.endfor
|
|
|
|
.for _DIR in ${LOCAL_LIB_DIRS}
|
|
|
|
.if ${_DIR} == ".WAIT" || (empty(_REDUNDANT_LIB_DIRS:M${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile))
|
|
|
|
SUBDIR+= ${_DIR}
|
|
|
|
.endif
|
|
|
|
.endfor
|
2016-02-02 20:50:09 +00:00
|
|
|
.if !defined(NO_ROOT) && (make(installworld) || make(install))
|
2015-10-17 03:51:50 +00:00
|
|
|
# Ensure libraries are installed before progressing.
|
|
|
|
SUBDIR+=.WAIT
|
|
|
|
.endif
|
2006-11-13 05:52:11 +00:00
|
|
|
SUBDIR+=bin
|
2007-04-06 02:13:30 +00:00
|
|
|
.if ${MK_CDDL} != "no"
|
|
|
|
SUBDIR+=cddl
|
|
|
|
.endif
|
2006-11-13 05:52:11 +00:00
|
|
|
SUBDIR+=gnu include
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_KERBEROS} != "no"
|
2004-02-13 21:52:08 +00:00
|
|
|
SUBDIR+=kerberos5
|
1998-08-31 01:08:08 +00:00
|
|
|
.endif
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_RESCUE} != "no"
|
2004-02-13 21:52:08 +00:00
|
|
|
SUBDIR+=rescue
|
1998-08-31 01:08:08 +00:00
|
|
|
.endif
|
2004-02-13 21:52:08 +00:00
|
|
|
SUBDIR+=sbin
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_CRYPT} != "no"
|
2004-02-13 21:52:08 +00:00
|
|
|
SUBDIR+=secure
|
1998-08-31 01:08:08 +00:00
|
|
|
.endif
|
2004-12-21 12:13:23 +00:00
|
|
|
.if !defined(NO_SHARE)
|
2004-02-13 21:52:08 +00:00
|
|
|
SUBDIR+=share
|
2002-04-30 11:46:49 +00:00
|
|
|
.endif
|
2017-11-14 23:02:19 +00:00
|
|
|
.if ${MK_BOOT} != "no"
|
|
|
|
SUBDIR+=stand
|
|
|
|
.endif
|
2006-11-13 05:52:11 +00:00
|
|
|
SUBDIR+=sys usr.bin usr.sbin
|
2013-10-25 05:25:19 +00:00
|
|
|
.if ${MK_TESTS} != "no"
|
|
|
|
SUBDIR+= tests
|
|
|
|
.endif
|
2002-04-30 11:46:49 +00:00
|
|
|
|
2017-12-31 18:53:13 +00:00
|
|
|
# Local directories are built in parallel with the base system directories.
|
|
|
|
# Users may insert a .WAIT directive at the beginning or elsewhere within
|
|
|
|
# the LOCAL_DIRS and LOCAL_LIB_DIRS lists as needed.
|
2014-11-21 18:35:48 +00:00
|
|
|
.for _DIR in ${LOCAL_DIRS}
|
2017-12-31 18:53:13 +00:00
|
|
|
.if ${_DIR} == ".WAIT" || exists(${.CURDIR}/${_DIR}/Makefile)
|
2014-11-21 18:35:48 +00:00
|
|
|
SUBDIR+= ${_DIR}
|
|
|
|
.endif
|
|
|
|
.endfor
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
|
2015-10-16 23:53:37 +00:00
|
|
|
# We must do etc/ last as it hooks into building the man whatis file
|
|
|
|
# by calling 'makedb' in share/man. This is only relevant for
|
|
|
|
# install/distribute so they build the whatis file after every manpage is
|
|
|
|
# installed.
|
2016-02-02 20:50:09 +00:00
|
|
|
.if make(installworld) || make(install)
|
2015-10-17 03:51:50 +00:00
|
|
|
SUBDIR+=.WAIT
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
.endif
|
2015-10-16 23:53:37 +00:00
|
|
|
SUBDIR+=etc
|
|
|
|
|
Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)
Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.
SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.
With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.
- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.
- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.
- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.
- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.
The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.
This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.
- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.
- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.
- Document these changes in build.7
Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks
2015-10-22 00:07:48 +00:00
|
|
|
.endif # !empty(SUBDIR_OVERRIDE)
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
|
2005-02-28 09:23:38 +00:00
|
|
|
.if defined(NOCLEAN)
|
2020-09-08 00:44:35 +00:00
|
|
|
.warning The src.conf WITHOUT_CLEAN option can now be used instead of NOCLEAN.
|
|
|
|
MK_CLEAN:= no
|
|
|
|
.endif
|
|
|
|
.if defined(NO_CLEAN)
|
|
|
|
.info The src.conf WITHOUT_CLEAN option can now be used instead of NO_CLEAN.
|
|
|
|
MK_CLEAN:= no
|
2005-02-28 09:23:38 +00:00
|
|
|
.endif
|
2004-12-21 12:21:26 +00:00
|
|
|
.if defined(NO_CLEANDIR)
|
1998-08-31 01:08:08 +00:00
|
|
|
CLEANDIR= clean cleandepend
|
|
|
|
.else
|
|
|
|
CLEANDIR= cleandir
|
|
|
|
.endif
|
|
|
|
|
2017-05-09 20:21:58 +00:00
|
|
|
.if defined(WORLDFAST)
|
2020-09-08 00:44:35 +00:00
|
|
|
MK_CLEAN:= no
|
2017-11-03 23:22:03 +00:00
|
|
|
NO_OBJWALK= t
|
2017-05-09 20:21:58 +00:00
|
|
|
.endif
|
|
|
|
|
2016-04-14 22:00:33 +00:00
|
|
|
.if ${MK_META_MODE} == "yes"
|
|
|
|
# If filemon is used then we can rely on the build being incremental-safe.
|
|
|
|
# The .meta files will also track the build command and rebuild should
|
|
|
|
# it change.
|
|
|
|
.if empty(.MAKE.MODE:Mnofilemon)
|
2020-09-08 00:44:35 +00:00
|
|
|
MK_CLEAN:= no
|
2016-04-14 22:00:33 +00:00
|
|
|
.endif
|
|
|
|
.endif
|
2017-11-03 23:22:03 +00:00
|
|
|
.if defined(NO_OBJWALK) || ${MK_AUTO_OBJ} == "yes"
|
|
|
|
NO_OBJWALK= t
|
2017-05-09 20:21:38 +00:00
|
|
|
NO_KERNELOBJ= t
|
|
|
|
.endif
|
2017-11-03 23:22:03 +00:00
|
|
|
.if !defined(NO_OBJWALK)
|
2017-05-09 20:21:38 +00:00
|
|
|
_obj= obj
|
|
|
|
.endif
|
2016-04-14 22:00:33 +00:00
|
|
|
|
2012-01-06 00:34:27 +00:00
|
|
|
LOCAL_TOOL_DIRS?=
|
2015-12-01 19:58:08 +00:00
|
|
|
PACKAGEDIR?= ${DESTDIR}/${DISTDIR}
|
2012-01-05 21:50:50 +00:00
|
|
|
|
2015-12-14 23:25:31 +00:00
|
|
|
.if empty(SHELL:M*csh*)
|
2015-11-05 22:09:00 +00:00
|
|
|
BUILDENV_SHELL?=${SHELL}
|
2015-12-14 23:25:31 +00:00
|
|
|
.else
|
2012-01-30 20:19:28 +00:00
|
|
|
BUILDENV_SHELL?=/bin/sh
|
2015-12-14 23:25:31 +00:00
|
|
|
.endif
|
2012-01-30 20:19:28 +00:00
|
|
|
|
2018-06-20 17:20:39 +00:00
|
|
|
.if !defined(_MKSHOWCONFIG)
|
2018-02-20 22:03:08 +00:00
|
|
|
.if !defined(VCS_REVISION) || empty(VCS_REVISION)
|
|
|
|
.if !defined(SVNVERSION_CMD) || empty(SVNVERSION_CMD)
|
2018-02-20 21:48:16 +00:00
|
|
|
. for _D in ${PATH:S,:, ,g}
|
|
|
|
. if exists(${_D}/svnversion)
|
|
|
|
SVNVERSION_CMD?=${_D}/svnversion
|
|
|
|
. endif
|
|
|
|
. if exists(${_D}/svnliteversion)
|
|
|
|
SVNVERSION_CMD?=${_D}/svnliteversion
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
.endif
|
2021-11-28 20:44:13 +00:00
|
|
|
.if defined(SVNVERSION_CMD) && !empty(SVNVERSION_CMD)
|
2017-08-11 19:21:40 +00:00
|
|
|
_VCS_REVISION?= $$(eval ${SVNVERSION_CMD} ${SRCDIR})
|
|
|
|
. if !empty(_VCS_REVISION)
|
|
|
|
VCS_REVISION= $$(echo r${_VCS_REVISION})
|
2018-02-20 21:53:39 +00:00
|
|
|
.export VCS_REVISION
|
2021-11-28 20:44:13 +00:00
|
|
|
. endif
|
|
|
|
.endif
|
2017-08-11 19:21:40 +00:00
|
|
|
.endif
|
1998-08-31 01:08:08 +00:00
|
|
|
|
2020-07-16 20:44:04 +00:00
|
|
|
.if !defined(GIT_CMD) || empty(GIT_CMD)
|
|
|
|
. for _P in /usr/bin /usr/local/bin
|
|
|
|
. if exists(${_P}/git)
|
|
|
|
GIT_CMD= ${_P}/git
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
.export GIT_CMD
|
|
|
|
.endif
|
|
|
|
|
2003-05-04 04:14:10 +00:00
|
|
|
.if !defined(OSRELDATE)
|
2003-08-25 17:48:25 +00:00
|
|
|
.if exists(/usr/include/osreldate.h)
|
2003-05-15 17:59:32 +00:00
|
|
|
OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
|
|
|
|
/usr/include/osreldate.h
|
2003-08-25 17:48:25 +00:00
|
|
|
.else
|
2003-08-27 04:49:43 +00:00
|
|
|
OSRELDATE= 0
|
2003-08-25 17:48:25 +00:00
|
|
|
.endif
|
2015-10-17 04:03:53 +00:00
|
|
|
.export OSRELDATE
|
2003-05-04 04:14:10 +00:00
|
|
|
.endif
|
2006-09-07 16:41:30 +00:00
|
|
|
|
2015-10-17 05:55:45 +00:00
|
|
|
# Set VERSION for CTFMERGE to use via the default CTFFLAGS=-L VERSION.
|
2020-12-16 20:34:38 +00:00
|
|
|
.for _V in BRANCH REVISION
|
|
|
|
.if !defined(_${_V})
|
|
|
|
_${_V}!= eval $$(awk '/^${_V}=/{print}' ${SRCTOP}/sys/conf/newvers.sh); echo $$${_V}
|
|
|
|
.export _${_V}
|
2016-04-21 16:50:45 +00:00
|
|
|
.endif
|
2020-12-16 20:34:38 +00:00
|
|
|
.endfor
|
2016-04-21 16:50:45 +00:00
|
|
|
.if !defined(SRCRELDATE)
|
2013-10-24 22:55:15 +00:00
|
|
|
SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
|
|
|
|
${SRCDIR}/sys/sys/param.h
|
2016-04-21 16:50:45 +00:00
|
|
|
.export SRCRELDATE
|
|
|
|
.endif
|
|
|
|
.if !defined(VERSION)
|
|
|
|
VERSION= FreeBSD ${_REVISION}-${_BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE}
|
2015-10-17 05:55:45 +00:00
|
|
|
.export VERSION
|
2008-05-23 04:22:14 +00:00
|
|
|
.endif
|
|
|
|
|
2015-02-08 18:12:34 +00:00
|
|
|
.if !defined(PKG_VERSION)
|
pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases
The current postfix conversions are:
CURRENT / STABLE / PRERELEASE, 12.x-CURRENT becomes 12.snapYYYYMMDDhhmmss
ALPHAx -> .ax, so 11.3-ALPHA1 becomes 11.3.a1.YYYYMMDDhhmmss
BETAx -> .bx, so 12.1-BETA2 becomes 12.1.b2.YYYYMMDDhhmmss
RCx -> .rcx, so 13.0-RC3 becomes 13.0.rc3.YYYYMMDDhhmmss
RELEASE -> (nothing), so 12.1-RELEASE becomes 12.1
RELEASE-pX -> pX, so 12.1-RELEASE-p1 becomes 12.1p1
Note that for development branches we will start to drop the minor version
component entirely, which more closely matches how these branches are
physically named (stable/NN).
snap is a new prefix that was added to pkg in [0], which is simply a more
verbose version of the current ".s" used.
As noted, build timestamps are also added to ALPHA/BETA/RC versions. This
is largely irrelevant for re@ snapshots because they will only produce one
set of snapshots for each alpha/beta/rc, but external folks may produce
multiple in that timeframe -- at least for alpha. For them, it is
imperative that the builds have a differentiating characteristic like this
rather than multiple builds across multiple revisions being versioned
identically.
[0] https://github.com/freebsd/pkg/pull/1929
Reviewed by: gjb, manu
Submitted by: rene (original, original version)
Differential Revision: https://reviews.freebsd.org/D28167
2021-01-14 12:56:38 +00:00
|
|
|
_STRTIMENOW= %Y%m%d%H%M%S
|
|
|
|
_TIMENOW= ${_STRTIMENOW:gmtime}
|
|
|
|
.if ${_BRANCH:MCURRENT*} || ${_BRANCH:MSTABLE*} || ${_BRANCH:MPRERELEASE*}
|
|
|
|
_REVISION:= ${_REVISION:R}
|
|
|
|
EXTRA_REVISION= .snap${_TIMENOW}
|
2019-06-16 11:53:22 +00:00
|
|
|
.elif ${_BRANCH:MALPHA*}
|
pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases
The current postfix conversions are:
CURRENT / STABLE / PRERELEASE, 12.x-CURRENT becomes 12.snapYYYYMMDDhhmmss
ALPHAx -> .ax, so 11.3-ALPHA1 becomes 11.3.a1.YYYYMMDDhhmmss
BETAx -> .bx, so 12.1-BETA2 becomes 12.1.b2.YYYYMMDDhhmmss
RCx -> .rcx, so 13.0-RC3 becomes 13.0.rc3.YYYYMMDDhhmmss
RELEASE -> (nothing), so 12.1-RELEASE becomes 12.1
RELEASE-pX -> pX, so 12.1-RELEASE-p1 becomes 12.1p1
Note that for development branches we will start to drop the minor version
component entirely, which more closely matches how these branches are
physically named (stable/NN).
snap is a new prefix that was added to pkg in [0], which is simply a more
verbose version of the current ".s" used.
As noted, build timestamps are also added to ALPHA/BETA/RC versions. This
is largely irrelevant for re@ snapshots because they will only produce one
set of snapshots for each alpha/beta/rc, but external folks may produce
multiple in that timeframe -- at least for alpha. For them, it is
imperative that the builds have a differentiating characteristic like this
rather than multiple builds across multiple revisions being versioned
identically.
[0] https://github.com/freebsd/pkg/pull/1929
Reviewed by: gjb, manu
Submitted by: rene (original, original version)
Differential Revision: https://reviews.freebsd.org/D28167
2021-01-14 12:56:38 +00:00
|
|
|
EXTRA_REVISION= .a${_BRANCH:C/ALPHA([0-9]+).*/\1/}.${_TIMENOW}
|
2019-06-16 11:53:22 +00:00
|
|
|
.elif ${_BRANCH:MBETA*}
|
pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases
The current postfix conversions are:
CURRENT / STABLE / PRERELEASE, 12.x-CURRENT becomes 12.snapYYYYMMDDhhmmss
ALPHAx -> .ax, so 11.3-ALPHA1 becomes 11.3.a1.YYYYMMDDhhmmss
BETAx -> .bx, so 12.1-BETA2 becomes 12.1.b2.YYYYMMDDhhmmss
RCx -> .rcx, so 13.0-RC3 becomes 13.0.rc3.YYYYMMDDhhmmss
RELEASE -> (nothing), so 12.1-RELEASE becomes 12.1
RELEASE-pX -> pX, so 12.1-RELEASE-p1 becomes 12.1p1
Note that for development branches we will start to drop the minor version
component entirely, which more closely matches how these branches are
physically named (stable/NN).
snap is a new prefix that was added to pkg in [0], which is simply a more
verbose version of the current ".s" used.
As noted, build timestamps are also added to ALPHA/BETA/RC versions. This
is largely irrelevant for re@ snapshots because they will only produce one
set of snapshots for each alpha/beta/rc, but external folks may produce
multiple in that timeframe -- at least for alpha. For them, it is
imperative that the builds have a differentiating characteristic like this
rather than multiple builds across multiple revisions being versioned
identically.
[0] https://github.com/freebsd/pkg/pull/1929
Reviewed by: gjb, manu
Submitted by: rene (original, original version)
Differential Revision: https://reviews.freebsd.org/D28167
2021-01-14 12:56:38 +00:00
|
|
|
EXTRA_REVISION= .b${_BRANCH:C/BETA([0-9]+).*/\1/}.${_TIMENOW}
|
2019-06-16 11:53:22 +00:00
|
|
|
.elif ${_BRANCH:MRC*}
|
pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases
The current postfix conversions are:
CURRENT / STABLE / PRERELEASE, 12.x-CURRENT becomes 12.snapYYYYMMDDhhmmss
ALPHAx -> .ax, so 11.3-ALPHA1 becomes 11.3.a1.YYYYMMDDhhmmss
BETAx -> .bx, so 12.1-BETA2 becomes 12.1.b2.YYYYMMDDhhmmss
RCx -> .rcx, so 13.0-RC3 becomes 13.0.rc3.YYYYMMDDhhmmss
RELEASE -> (nothing), so 12.1-RELEASE becomes 12.1
RELEASE-pX -> pX, so 12.1-RELEASE-p1 becomes 12.1p1
Note that for development branches we will start to drop the minor version
component entirely, which more closely matches how these branches are
physically named (stable/NN).
snap is a new prefix that was added to pkg in [0], which is simply a more
verbose version of the current ".s" used.
As noted, build timestamps are also added to ALPHA/BETA/RC versions. This
is largely irrelevant for re@ snapshots because they will only produce one
set of snapshots for each alpha/beta/rc, but external folks may produce
multiple in that timeframe -- at least for alpha. For them, it is
imperative that the builds have a differentiating characteristic like this
rather than multiple builds across multiple revisions being versioned
identically.
[0] https://github.com/freebsd/pkg/pull/1929
Reviewed by: gjb, manu
Submitted by: rene (original, original version)
Differential Revision: https://reviews.freebsd.org/D28167
2021-01-14 12:56:38 +00:00
|
|
|
EXTRA_REVISION= .rc${_BRANCH:C/RC([0-9]+).*/\1/}.${_TIMENOW}
|
2019-06-16 11:53:22 +00:00
|
|
|
.elif ${_BRANCH:M*-p*}
|
pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases
The current postfix conversions are:
CURRENT / STABLE / PRERELEASE, 12.x-CURRENT becomes 12.snapYYYYMMDDhhmmss
ALPHAx -> .ax, so 11.3-ALPHA1 becomes 11.3.a1.YYYYMMDDhhmmss
BETAx -> .bx, so 12.1-BETA2 becomes 12.1.b2.YYYYMMDDhhmmss
RCx -> .rcx, so 13.0-RC3 becomes 13.0.rc3.YYYYMMDDhhmmss
RELEASE -> (nothing), so 12.1-RELEASE becomes 12.1
RELEASE-pX -> pX, so 12.1-RELEASE-p1 becomes 12.1p1
Note that for development branches we will start to drop the minor version
component entirely, which more closely matches how these branches are
physically named (stable/NN).
snap is a new prefix that was added to pkg in [0], which is simply a more
verbose version of the current ".s" used.
As noted, build timestamps are also added to ALPHA/BETA/RC versions. This
is largely irrelevant for re@ snapshots because they will only produce one
set of snapshots for each alpha/beta/rc, but external folks may produce
multiple in that timeframe -- at least for alpha. For them, it is
imperative that the builds have a differentiating characteristic like this
rather than multiple builds across multiple revisions being versioned
identically.
[0] https://github.com/freebsd/pkg/pull/1929
Reviewed by: gjb, manu
Submitted by: rene (original, original version)
Differential Revision: https://reviews.freebsd.org/D28167
2021-01-14 12:56:38 +00:00
|
|
|
EXTRA_REVISION= p${_BRANCH:C/.*-p([0-9]+$)/\1/}
|
2015-02-08 18:12:34 +00:00
|
|
|
.endif
|
pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases
The current postfix conversions are:
CURRENT / STABLE / PRERELEASE, 12.x-CURRENT becomes 12.snapYYYYMMDDhhmmss
ALPHAx -> .ax, so 11.3-ALPHA1 becomes 11.3.a1.YYYYMMDDhhmmss
BETAx -> .bx, so 12.1-BETA2 becomes 12.1.b2.YYYYMMDDhhmmss
RCx -> .rcx, so 13.0-RC3 becomes 13.0.rc3.YYYYMMDDhhmmss
RELEASE -> (nothing), so 12.1-RELEASE becomes 12.1
RELEASE-pX -> pX, so 12.1-RELEASE-p1 becomes 12.1p1
Note that for development branches we will start to drop the minor version
component entirely, which more closely matches how these branches are
physically named (stable/NN).
snap is a new prefix that was added to pkg in [0], which is simply a more
verbose version of the current ".s" used.
As noted, build timestamps are also added to ALPHA/BETA/RC versions. This
is largely irrelevant for re@ snapshots because they will only produce one
set of snapshots for each alpha/beta/rc, but external folks may produce
multiple in that timeframe -- at least for alpha. For them, it is
imperative that the builds have a differentiating characteristic like this
rather than multiple builds across multiple revisions being versioned
identically.
[0] https://github.com/freebsd/pkg/pull/1929
Reviewed by: gjb, manu
Submitted by: rene (original, original version)
Differential Revision: https://reviews.freebsd.org/D28167
2021-01-14 12:56:38 +00:00
|
|
|
PKG_VERSION:= ${_REVISION}${EXTRA_REVISION:C/[[:space:]]//g}
|
2015-02-08 18:12:34 +00:00
|
|
|
.endif
|
2019-06-16 11:53:22 +00:00
|
|
|
.endif # !defined(PKG_VERSION)
|
2015-02-08 18:12:34 +00:00
|
|
|
|
2020-08-06 16:13:54 +00:00
|
|
|
.if !defined(PKG_TIMESTAMP)
|
2020-11-02 18:23:50 +00:00
|
|
|
TIMEEPOCHNOW= %s
|
2020-08-06 16:13:54 +00:00
|
|
|
SOURCE_DATE_EPOCH= ${TIMEEPOCHNOW:gmtime}
|
|
|
|
.else
|
|
|
|
SOURCE_DATE_EPOCH= ${PKG_TIMESTAMP}
|
|
|
|
.endif
|
|
|
|
|
2020-08-11 08:42:24 +00:00
|
|
|
PKG_NAME_PREFIX?= FreeBSD
|
|
|
|
PKG_MAINTAINER?= re@FreeBSD.org
|
|
|
|
PKG_WWW?= https://www.FreeBSD.org
|
|
|
|
.export PKG_NAME_PREFIX
|
|
|
|
.export PKG_MAINTAINER
|
|
|
|
.export PKG_WWW
|
|
|
|
|
2018-06-20 17:20:39 +00:00
|
|
|
.if !defined(_MKSHOWCONFIG)
|
2017-10-29 01:21:15 +00:00
|
|
|
_CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} -f /dev/null \
|
|
|
|
-m ${.CURDIR}/share/mk MK_AUTO_OBJ=no -V CPUTYPE
|
2002-08-08 15:43:23 +00:00
|
|
|
.if ${_CPUTYPE} != ${_TARGET_CPUTYPE}
|
2002-08-02 18:04:22 +00:00
|
|
|
.error CPUTYPE global should be set with ?=.
|
|
|
|
.endif
|
2018-06-20 17:20:39 +00:00
|
|
|
.endif
|
Fix cross-building, etc:
1. To cross-build, one now needs to set TARGET_ARCH, and not the
MACHINE_ARCH. MACHINE_ARCH should never be changed manually!
2. Initialize DESTDIR= explicitly for bootstrap-tools, build-tools,
and cross-tools stages. This fixes broken header and library
dependencies problem. We build them in the host environment,
and obviously want them to depend on host headers and libraries.
The problem with broken header dependencies for bootstrap-tools
and cross-tools was already partially solved (see BOOTSTRAPPING
tests in bsd.prog.mk and bsd.lib.mk), but it was still there for
build-tools if the user ran "make world DESTDIR=/foo". Also,
for all of these stages, the library dependencies were broken
because of how bsd.libnames.mk define DPADD members.
We still provide a glue to install bootstrap- and cross-tools
under the ${WORLDTMP}.
Removed PATH overrides for bootstrap-, build-, and cross-tools
stages. There is just no reason why we would need to override
it, and the hacks to clean up the ${WORLDTMP} in the -DNOCLEAN
case are no longer needed with fixes from this step.
That is, we now never use ${WORLDTMP} headers and libraries,
and we don't use any ${WORLDTMP} installed binaries during
these stages. Again, these stages depend solely on the host
environment, including compiler, headers, and libraries.
3. Moved "miniperl" back from cross-tools (it has nothing to do
with a cross-compiler) to build-tools where it belongs. The
change from step 1 let to do this. Also, to make this work,
build-tools targets of "cc_tools" and "miniperl" were modified
to call "depend". Here follow the detailed explanations.
There are two categories of build tools, for now. In the first
category there are "cc_tools" and "miniperl". They occupy the
whole (sub)directory, and nothing needs to be done in this
subdirectory later during the "all" stage. They are also
constructed using system makefiles. We must build the .depend
early in the build-tools stage because:
1) They use (and depend on) the host environment.
2) If we don't do this in build-tools, the "depend" stage of
buildworld will do this for us; wrong library and header
dependencies will be recorded (DESTDIR=${WORLDTMP}) and,
what's worse, the "all" stage may then clobber the
build-architecture format tools (that we built in the
build-tools stage) with the target-architecture format
ones, breaking cross build.
In the second category there are all other build-tools. They
share their directory with the "main" module that needs them
in the "all" stage, and they don't show up themselves in the
.depend file. The portion of this fix was already committed
in gnu/usr.bin/cc/cc_tools/Makefile,v 1.52.
4. "libperl" is no longer a build tool, and "miniperl" is the
stand-alone application. I had to make this change because
build-tools and "all" stages share the same object directory.
Without this change, if we cross compile, libperl.a is first
built for the build architecture during the build-tools stage
(for the purposes of immediate linkage with "miniperl").
Later on, the "all" stage sees this library as up-to-date,
and doesn't rebuild it. The effect is that the wrong format
static libperl library is installed with installworld.
5. Fixed "includes" to install secure/lib/libtelnet headers if
required.
Reviewed by: bde
2001-09-29 13:17:54 +00:00
|
|
|
.if make(buildworld)
|
2005-12-03 05:11:07 +00:00
|
|
|
BUILD_ARCH!= uname -p
|
2020-08-25 13:29:57 +00:00
|
|
|
# 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"
|
Fix cross-building, etc:
1. To cross-build, one now needs to set TARGET_ARCH, and not the
MACHINE_ARCH. MACHINE_ARCH should never be changed manually!
2. Initialize DESTDIR= explicitly for bootstrap-tools, build-tools,
and cross-tools stages. This fixes broken header and library
dependencies problem. We build them in the host environment,
and obviously want them to depend on host headers and libraries.
The problem with broken header dependencies for bootstrap-tools
and cross-tools was already partially solved (see BOOTSTRAPPING
tests in bsd.prog.mk and bsd.lib.mk), but it was still there for
build-tools if the user ran "make world DESTDIR=/foo". Also,
for all of these stages, the library dependencies were broken
because of how bsd.libnames.mk define DPADD members.
We still provide a glue to install bootstrap- and cross-tools
under the ${WORLDTMP}.
Removed PATH overrides for bootstrap-, build-, and cross-tools
stages. There is just no reason why we would need to override
it, and the hacks to clean up the ${WORLDTMP} in the -DNOCLEAN
case are no longer needed with fixes from this step.
That is, we now never use ${WORLDTMP} headers and libraries,
and we don't use any ${WORLDTMP} installed binaries during
these stages. Again, these stages depend solely on the host
environment, including compiler, headers, and libraries.
3. Moved "miniperl" back from cross-tools (it has nothing to do
with a cross-compiler) to build-tools where it belongs. The
change from step 1 let to do this. Also, to make this work,
build-tools targets of "cc_tools" and "miniperl" were modified
to call "depend". Here follow the detailed explanations.
There are two categories of build tools, for now. In the first
category there are "cc_tools" and "miniperl". They occupy the
whole (sub)directory, and nothing needs to be done in this
subdirectory later during the "all" stage. They are also
constructed using system makefiles. We must build the .depend
early in the build-tools stage because:
1) They use (and depend on) the host environment.
2) If we don't do this in build-tools, the "depend" stage of
buildworld will do this for us; wrong library and header
dependencies will be recorded (DESTDIR=${WORLDTMP}) and,
what's worse, the "all" stage may then clobber the
build-architecture format tools (that we built in the
build-tools stage) with the target-architecture format
ones, breaking cross build.
In the second category there are all other build-tools. They
share their directory with the "main" module that needs them
in the "all" stage, and they don't show up themselves in the
.depend file. The portion of this fix was already committed
in gnu/usr.bin/cc/cc_tools/Makefile,v 1.52.
4. "libperl" is no longer a build tool, and "miniperl" is the
stand-alone application. I had to make this change because
build-tools and "all" stages share the same object directory.
Without this change, if we cross compile, libperl.a is first
built for the build architecture during the build-tools stage
(for the purposes of immediate linkage with "miniperl").
Later on, the "all" stage sees this library as up-to-date,
and doesn't rebuild it. The effect is that the wrong format
static libperl library is installed with installworld.
5. Fixed "includes" to install secure/lib/libtelnet headers if
required.
Reviewed by: bde
2001-09-29 13:17:54 +00:00
|
|
|
.error To cross-build, set TARGET_ARCH.
|
|
|
|
.endif
|
|
|
|
.endif
|
2017-11-01 21:22:05 +00:00
|
|
|
WORLDTMP?= ${OBJTOP}/tmp
|
2020-01-12 04:18:36 +00:00
|
|
|
BPATH= ${CCACHE_WRAPPER_PATH_PFX}${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin:${WORLDTMP}/legacy/usr/libexec
|
2020-08-25 13:29:57 +00:00
|
|
|
XPATH= ${WORLDTMP}/bin:${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin
|
2018-11-05 19:51:10 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
# toolchain files (clang, lld, etc.) during make universe/tinderbox
|
|
|
|
STRICTTMPPATH= ${XPATH}:${BPATH}:${UNIVERSE_TOOLCHAIN_PATH}
|
|
|
|
# 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
|
|
|
|
# still allow using the old behaviour (inheriting $PATH) if
|
|
|
|
# BUILD_WITH_STRICT_TMPPATH is set to 0 but this will eventually be removed.
|
2018-11-06 18:06:52 +00:00
|
|
|
|
|
|
|
# Currently strict $PATH can cause build failures and does not work yet with
|
|
|
|
# USING_SYSTEM_LINKER/USING_SYSTEM_COMPILER. Once these issues have been
|
|
|
|
# resolved it will be turned on by default.
|
2018-11-05 22:51:44 +00:00
|
|
|
BUILD_WITH_STRICT_TMPPATH?=0
|
2020-08-25 13:29:57 +00:00
|
|
|
.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
|
2018-11-05 19:51:10 +00:00
|
|
|
.if ${BUILD_WITH_STRICT_TMPPATH} != 0
|
|
|
|
TMPPATH= ${STRICTTMPPATH}
|
|
|
|
.else
|
1998-10-17 11:56:20 +00:00
|
|
|
TMPPATH= ${STRICTTMPPATH}:${PATH}
|
2018-11-05 19:51:10 +00:00
|
|
|
.endif
|
1998-08-31 01:08:08 +00:00
|
|
|
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
#
|
|
|
|
# Avoid running mktemp(1) unless actually needed.
|
|
|
|
# It may not be functional, e.g., due to new ABI
|
|
|
|
# when in the middle of installing over this system.
|
|
|
|
#
|
2015-02-10 22:05:57 +00:00
|
|
|
.if make(distributeworld) || make(installworld) || make(stageworld)
|
2018-11-05 19:51:10 +00:00
|
|
|
.if ${BUILD_WITH_STRICT_TMPPATH} != 0
|
|
|
|
MKTEMP=${WORLDTMP}/legacy/usr/bin/mktemp
|
|
|
|
.if !exists(${MKTEMP})
|
|
|
|
.error "mktemp binary doesn't exist in expected location: ${MKTEMP}"
|
|
|
|
.endif
|
|
|
|
.else
|
|
|
|
MKTEMP=mktemp
|
|
|
|
.endif
|
|
|
|
INSTALLTMP!= ${MKTEMP} -d -u -t install
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
.endif
|
2000-07-19 04:41:59 +00:00
|
|
|
|
2016-01-27 21:10:03 +00:00
|
|
|
.if make(stagekernel) || make(distributekernel)
|
|
|
|
TAGS+= kernel
|
|
|
|
PACKAGE= kernel
|
|
|
|
.endif
|
|
|
|
|
1999-12-20 10:32:11 +00:00
|
|
|
#
|
|
|
|
# Building a world goes through the following stages
|
|
|
|
#
|
2003-04-06 21:46:44 +00:00
|
|
|
# 1. legacy stage [BMAKE]
|
2003-04-06 21:23:02 +00:00
|
|
|
# This stage is responsible for creating compatibility
|
|
|
|
# shims that are needed by the bootstrap-tools,
|
2015-03-25 21:59:36 +00:00
|
|
|
# build-tools and cross-tools stages. These are generally
|
|
|
|
# APIs that tools from one of those three stages need to
|
|
|
|
# build that aren't present on the host.
|
2003-04-06 21:23:02 +00:00
|
|
|
# 1. bootstrap-tools stage [BMAKE]
|
1999-12-20 10:32:11 +00:00
|
|
|
# This stage is responsible for creating programs that
|
|
|
|
# are needed for backward compatibility reasons. They
|
|
|
|
# are not built as cross-tools.
|
2003-04-06 21:23:02 +00:00
|
|
|
# 2. build-tools stage [TMAKE]
|
1999-12-20 10:32:11 +00:00
|
|
|
# This stage is responsible for creating the object
|
|
|
|
# tree and building any tools that are needed during
|
2015-08-12 19:00:47 +00:00
|
|
|
# the build process. Some programs are listed during
|
2015-08-13 22:32:42 +00:00
|
|
|
# this phase because they build binaries to generate
|
2015-08-12 19:00:47 +00:00
|
|
|
# files needed to build these programs. This stage also
|
|
|
|
# builds the 'build-tools' target rather than 'all'.
|
2003-04-06 21:23:02 +00:00
|
|
|
# 3. cross-tools stage [XMAKE]
|
1999-12-20 10:32:11 +00:00
|
|
|
# This stage is responsible for creating any tools that
|
2015-03-25 21:59:36 +00:00
|
|
|
# are needed for building the system. A cross-compiler is one
|
2015-08-12 19:00:47 +00:00
|
|
|
# of them. This differs from build tools in two ways:
|
|
|
|
# 1. the 'all' target is built rather than 'build-tools'
|
|
|
|
# 2. these tools are installed into TMPPATH for stage 4.
|
2000-10-13 01:19:36 +00:00
|
|
|
# 4. world stage [WMAKE]
|
1999-12-20 10:32:11 +00:00
|
|
|
# This stage actually builds the world.
|
2000-10-13 01:19:36 +00:00
|
|
|
# 5. install stage (optional) [IMAKE]
|
1999-12-20 10:32:11 +00:00
|
|
|
# This stage installs a previously built world.
|
|
|
|
#
|
|
|
|
|
2003-04-13 15:43:29 +00:00
|
|
|
BOOTSTRAPPING?= 0
|
2018-04-27 19:50:30 +00:00
|
|
|
# Keep these in sync
|
2021-11-19 07:10:21 +00:00
|
|
|
MINIMUM_SUPPORTED_OSREL?= 1002501
|
|
|
|
MINIMUM_SUPPORTED_REL?= 10.3
|
2003-04-13 15:43:29 +00:00
|
|
|
|
1999-12-20 10:32:11 +00:00
|
|
|
# Common environment for world related stages
|
2017-11-01 21:22:05 +00:00
|
|
|
CROSSENV+= \
|
Fix cross-building, etc:
1. To cross-build, one now needs to set TARGET_ARCH, and not the
MACHINE_ARCH. MACHINE_ARCH should never be changed manually!
2. Initialize DESTDIR= explicitly for bootstrap-tools, build-tools,
and cross-tools stages. This fixes broken header and library
dependencies problem. We build them in the host environment,
and obviously want them to depend on host headers and libraries.
The problem with broken header dependencies for bootstrap-tools
and cross-tools was already partially solved (see BOOTSTRAPPING
tests in bsd.prog.mk and bsd.lib.mk), but it was still there for
build-tools if the user ran "make world DESTDIR=/foo". Also,
for all of these stages, the library dependencies were broken
because of how bsd.libnames.mk define DPADD members.
We still provide a glue to install bootstrap- and cross-tools
under the ${WORLDTMP}.
Removed PATH overrides for bootstrap-, build-, and cross-tools
stages. There is just no reason why we would need to override
it, and the hacks to clean up the ${WORLDTMP} in the -DNOCLEAN
case are no longer needed with fixes from this step.
That is, we now never use ${WORLDTMP} headers and libraries,
and we don't use any ${WORLDTMP} installed binaries during
these stages. Again, these stages depend solely on the host
environment, including compiler, headers, and libraries.
3. Moved "miniperl" back from cross-tools (it has nothing to do
with a cross-compiler) to build-tools where it belongs. The
change from step 1 let to do this. Also, to make this work,
build-tools targets of "cc_tools" and "miniperl" were modified
to call "depend". Here follow the detailed explanations.
There are two categories of build tools, for now. In the first
category there are "cc_tools" and "miniperl". They occupy the
whole (sub)directory, and nothing needs to be done in this
subdirectory later during the "all" stage. They are also
constructed using system makefiles. We must build the .depend
early in the build-tools stage because:
1) They use (and depend on) the host environment.
2) If we don't do this in build-tools, the "depend" stage of
buildworld will do this for us; wrong library and header
dependencies will be recorded (DESTDIR=${WORLDTMP}) and,
what's worse, the "all" stage may then clobber the
build-architecture format tools (that we built in the
build-tools stage) with the target-architecture format
ones, breaking cross build.
In the second category there are all other build-tools. They
share their directory with the "main" module that needs them
in the "all" stage, and they don't show up themselves in the
.depend file. The portion of this fix was already committed
in gnu/usr.bin/cc/cc_tools/Makefile,v 1.52.
4. "libperl" is no longer a build tool, and "miniperl" is the
stand-alone application. I had to make this change because
build-tools and "all" stages share the same object directory.
Without this change, if we cross compile, libperl.a is first
built for the build architecture during the build-tools stage
(for the purposes of immediate linkage with "miniperl").
Later on, the "all" stage sees this library as up-to-date,
and doesn't rebuild it. The effect is that the wrong format
static libperl library is installed with installworld.
5. Fixed "includes" to install secure/lib/libtelnet headers if
required.
Reviewed by: bde
2001-09-29 13:17:54 +00:00
|
|
|
MACHINE_ARCH=${TARGET_ARCH} \
|
2001-10-25 07:28:55 +00:00
|
|
|
MACHINE=${TARGET} \
|
2011-02-22 08:13:49 +00:00
|
|
|
CPUTYPE=${TARGET_CPUTYPE}
|
2016-04-14 21:06:10 +00:00
|
|
|
.if ${MK_META_MODE} != "no"
|
|
|
|
# Don't rebuild build-tools targets during normal build.
|
2017-04-06 18:21:59 +00:00
|
|
|
CROSSENV+= BUILD_TOOLS_META=.NOMETA
|
2016-04-14 21:06:10 +00:00
|
|
|
.endif
|
2014-03-14 19:45:40 +00:00
|
|
|
.if defined(TARGET_CFLAGS)
|
|
|
|
CROSSENV+= ${TARGET_CFLAGS}
|
|
|
|
.endif
|
2019-09-28 14:20:28 +00:00
|
|
|
.if (${TARGET} != ${MACHINE} && !defined(WITH_LOCAL_MODULES)) || \
|
|
|
|
defined(WITHOUT_LOCAL_MODULES)
|
|
|
|
CROSSENV+= LOCAL_MODULES=
|
|
|
|
.endif
|
1999-12-09 16:40:27 +00:00
|
|
|
|
2018-11-05 19:51:10 +00:00
|
|
|
BOOTSTRAPPING_OSRELDATE?=${OSRELDATE}
|
|
|
|
|
2003-04-06 21:23:02 +00:00
|
|
|
# bootstrap-tools stage
|
2004-08-25 22:06:29 +00:00
|
|
|
BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
2018-06-27 16:58:10 +00:00
|
|
|
TOOLS_PREFIX=${TOOLS_PREFIX_UNDEF:U${WORLDTMP}} \
|
2003-04-13 11:42:55 +00:00
|
|
|
PATH=${BPATH}:${PATH} \
|
2003-04-12 15:07:46 +00:00
|
|
|
WORLDTMP=${WORLDTMP} \
|
2014-03-30 23:43:30 +00:00
|
|
|
MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
|
2015-09-26 04:22:18 +00:00
|
|
|
# need to keep this in sync with targets/pseudo/bootstrap-tools/Makefile
|
|
|
|
BSARGS= DESTDIR= \
|
2017-11-03 00:29:42 +00:00
|
|
|
OBJTOP='${WORLDTMP}/obj-tools' \
|
2017-11-02 18:08:36 +00:00
|
|
|
OBJROOT='$${OBJTOP}/' \
|
2017-11-05 00:11:51 +00:00
|
|
|
MAKEOBJDIRPREFIX= \
|
2018-11-05 19:51:10 +00:00
|
|
|
BOOTSTRAPPING=${BOOTSTRAPPING_OSRELDATE} \
|
2017-06-20 22:08:02 +00:00
|
|
|
BWPHASE=${.TARGET:C,^_,,} \
|
2021-08-04 18:17:34 +00:00
|
|
|
-DNO_CPU_CFLAGS \
|
|
|
|
-DNO_LINT \
|
|
|
|
-DNO_PIC \
|
2021-10-11 17:49:48 +00:00
|
|
|
-DNO_SHARED \
|
2021-08-04 18:17:34 +00:00
|
|
|
MK_ASAN=no \
|
|
|
|
MK_CTF=no \
|
|
|
|
MK_CLANG_EXTRAS=no \
|
|
|
|
MK_CLANG_FORMAT=no \
|
|
|
|
MK_CLANG_FULL=no \
|
|
|
|
MK_HTML=no \
|
|
|
|
MK_MAN=no \
|
|
|
|
MK_PROFILE=no \
|
|
|
|
MK_RETPOLINE=no \
|
2021-08-04 18:20:50 +00:00
|
|
|
MK_SSP=no \
|
2021-08-04 18:17:34 +00:00
|
|
|
MK_TESTS=no \
|
|
|
|
MK_UBSAN=no \
|
|
|
|
MK_WERROR=no \
|
|
|
|
MK_INCLUDES=yes \
|
|
|
|
MK_MAN_UTILS=yes
|
1999-12-20 10:32:11 +00:00
|
|
|
|
2017-11-02 18:08:36 +00:00
|
|
|
BMAKE= \
|
2021-08-01 09:10:49 +00:00
|
|
|
${TIME_ENV} ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
|
2015-09-26 04:22:18 +00:00
|
|
|
${BSARGS}
|
2018-06-30 19:36:02 +00:00
|
|
|
.if empty(.MAKEOVERRIDES:MMK_LLVM_TARGET_ALL)
|
|
|
|
BMAKE+= MK_LLVM_TARGET_ALL=no
|
|
|
|
.endif
|
1999-12-20 10:32:11 +00:00
|
|
|
|
2003-04-06 21:23:02 +00:00
|
|
|
# build-tools stage
|
2017-11-01 21:22:05 +00:00
|
|
|
TMAKE= \
|
2021-08-01 09:10:49 +00:00
|
|
|
${TIME_ENV} ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
|
2006-09-08 10:09:02 +00:00
|
|
|
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
|
2004-08-25 22:06:29 +00:00
|
|
|
DESTDIR= \
|
2018-11-05 19:51:10 +00:00
|
|
|
BOOTSTRAPPING=${BOOTSTRAPPING_OSRELDATE} \
|
2017-06-20 22:08:02 +00:00
|
|
|
BWPHASE=${.TARGET:C,^_,,} \
|
2021-08-04 18:17:34 +00:00
|
|
|
-DNO_CPU_CFLAGS \
|
2011-05-11 17:50:19 +00:00
|
|
|
-DNO_LINT \
|
2021-08-04 18:17:34 +00:00
|
|
|
MK_ASAN=no \
|
|
|
|
MK_CTF=no \
|
|
|
|
MK_CLANG_EXTRAS=no \
|
|
|
|
MK_CLANG_FORMAT=no \
|
|
|
|
MK_CLANG_FULL=no \
|
|
|
|
MK_LLDB=no \
|
|
|
|
MK_RETPOLINE=no \
|
2021-08-04 18:20:50 +00:00
|
|
|
MK_SSP=no \
|
2021-08-04 18:17:34 +00:00
|
|
|
MK_TESTS=no \
|
|
|
|
MK_UBSAN=no \
|
|
|
|
MK_WERROR=no
|
1999-12-20 10:32:11 +00:00
|
|
|
|
2003-04-06 21:23:02 +00:00
|
|
|
# cross-tools stage
|
2017-10-31 17:16:46 +00:00
|
|
|
# TOOLS_PREFIX set in BMAKE
|
|
|
|
XMAKE= ${BMAKE} \
|
2006-09-07 20:27:56 +00:00
|
|
|
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
|
2019-11-13 21:49:46 +00:00
|
|
|
MK_CLANG_IS_CC=${MK_CLANG_BOOTSTRAP} \
|
Fix bootstrapping to actually build lldb-tblgen for later use
Because MK_LLDB=no is in BSARGS, the bootstrap-tools recursive make does
not add lldb-tblgen to _clang_tblgen, causing it to not be built. This
means that the build currently always uses the host's lldb-tblgen
(which, whilst currently it appears to work, could in future break if
TableGen backends are added or altered) and, if it doesn't exist (either
because the current FreeBSD system was built with it disabled, or you're
building on macOS/Linux), fails. Linux and macOS cross-builds used to
work simply because LLDB was previously in BROKEN_OPTIONS when building
on non-FreeBSD.
Instead, move MK_LLDB=no from BSARGS to XMAKE. This ensures that the
lib/clang build in cross-tools continues to not build LLDB parts for the
bootstrap toolchain (both to save time/space on FreeBSD, and because our
vendored LLDB does not include the macOS and Linux host files so those
would fail to build).
The DIRDEPS target is updated to move MK_LLDB=no from the BSARGS block
that mirrors Makefile.inc1 to the line that disables additional
toolchain components. The DIRDEPS build likely suffers from the same
issue currently, but having never used it and not being familiar with
how it works I am leaving that as-is. If it does suffer from the same
issue it should be easily reproducible by renaming /usr/bin/lldb-tblgen
or moving it to a directory not in PATH.
Fixes: 31ba4ce8898f ("Allow bootstrapping llvm-tblgen on macOS and Linux")
MFC after: 1 week
Reviewed by: dim, emaste, imp
Differential Revision: https://reviews.freebsd.org/D31531
2021-08-24 13:59:04 +00:00
|
|
|
MK_LLDB=no \
|
2021-09-06 08:49:49 +00:00
|
|
|
MK_LLVM_BINUTILS=no \
|
2020-12-15 18:12:03 +00:00
|
|
|
MK_TESTS=no
|
1999-12-20 10:32:11 +00:00
|
|
|
|
2013-11-09 00:15:36 +00:00
|
|
|
# kernel-tools stage
|
|
|
|
KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
|
|
|
PATH=${BPATH}:${PATH} \
|
2020-08-25 13:29:57 +00:00
|
|
|
WORLDTMP=${WORLDTMP} \
|
|
|
|
MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
|
|
|
|
|
2021-08-01 09:10:49 +00:00
|
|
|
KTMAKE= ${TIME_ENV} \
|
2018-06-27 16:58:10 +00:00
|
|
|
TOOLS_PREFIX=${TOOLS_PREFIX_UNDEF:U${WORLDTMP}} \
|
2013-11-09 00:15:36 +00:00
|
|
|
${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
|
|
|
|
DESTDIR= \
|
2017-11-02 18:08:36 +00:00
|
|
|
OBJTOP='${WORLDTMP}/obj-kernel-tools' \
|
|
|
|
OBJROOT='$${OBJTOP}/' \
|
2017-11-05 00:11:51 +00:00
|
|
|
MAKEOBJDIRPREFIX= \
|
2018-11-05 19:51:10 +00:00
|
|
|
BOOTSTRAPPING=${BOOTSTRAPPING_OSRELDATE} \
|
2021-08-04 18:17:34 +00:00
|
|
|
-DNO_CPU_CFLAGS \
|
|
|
|
-DNO_LINT \
|
|
|
|
-DNO_PIC \
|
|
|
|
-DNO_SHARED \
|
|
|
|
MK_CTF=no \
|
|
|
|
MK_HTML=no \
|
|
|
|
MK_MAN=no \
|
|
|
|
MK_PROFILE=no \
|
2021-08-04 18:20:50 +00:00
|
|
|
MK_SSP=no \
|
2021-08-04 18:17:34 +00:00
|
|
|
MK_RETPOLINE=no \
|
|
|
|
MK_WERROR=no
|
2013-11-09 00:15:36 +00:00
|
|
|
|
1999-12-20 10:32:11 +00:00
|
|
|
# world stage
|
|
|
|
WMAKEENV= ${CROSSENV} \
|
2020-08-25 13:30:14 +00:00
|
|
|
INSTALL="${INSTALL_CMD} -U" \
|
2017-06-19 18:08:20 +00:00
|
|
|
PATH=${TMPPATH} \
|
|
|
|
SYSROOT=${WORLDTMP}
|
2013-06-14 22:32:47 +00:00
|
|
|
|
|
|
|
# make hierarchy
|
2013-08-30 01:32:47 +00:00
|
|
|
HMAKE= PATH=${TMPPATH} ${MAKE} LOCAL_MTREE=${LOCAL_MTREE:Q}
|
2013-06-14 22:32:47 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
HMAKE+= PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT
|
|
|
|
.endif
|
|
|
|
|
2016-05-26 18:52:49 +00:00
|
|
|
CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCXXFLAGS} ${XCFLAGS}" \
|
2014-10-27 23:31:07 +00:00
|
|
|
CPP="${XCPP} ${XCFLAGS}" \
|
2021-05-21 09:27:27 +00:00
|
|
|
AS="${XAS}" AR="${XAR}" ELFCTL="${XELFCTL}" LD="${XLD}" \
|
|
|
|
LLVM_LINK="${XLLVM_LINK}" NM=${XNM} OBJCOPY="${XOBJCOPY}" \
|
2014-10-09 15:52:01 +00:00
|
|
|
RANLIB=${XRANLIB} STRINGS=${XSTRINGS} \
|
2020-08-11 16:46:27 +00:00
|
|
|
SIZE="${XSIZE}" STRIPBIN="${XSTRIPBIN}"
|
2013-05-15 14:30:03 +00:00
|
|
|
|
2016-03-25 22:36:26 +00:00
|
|
|
.if defined(CROSS_BINUTILS_PREFIX) && exists(${CROSS_BINUTILS_PREFIX})
|
2013-05-15 14:30:03 +00:00
|
|
|
# In the case of xdev-build tools, CROSS_BINUTILS_PREFIX won't be a
|
2016-03-25 22:36:26 +00:00
|
|
|
# directory, but the compiler will look in the right place for its
|
2013-05-15 14:30:03 +00:00
|
|
|
# tools so we don't need to tell it where to look.
|
2015-02-18 19:27:51 +00:00
|
|
|
BFLAGS+= -B${CROSS_BINUTILS_PREFIX}
|
2013-05-15 14:30:03 +00:00
|
|
|
.endif
|
2016-03-25 22:36:26 +00:00
|
|
|
|
2016-08-23 15:20:32 +00:00
|
|
|
|
|
|
|
# The internal bootstrap compiler has a default sysroot set by TOOLS_PREFIX
|
|
|
|
# and target set by TARGET/TARGET_ARCH. However, there are several needs to
|
|
|
|
# always pass an explicit --sysroot and -target.
|
|
|
|
# - External compiler needs sysroot and target flags.
|
|
|
|
# - External ld needs sysroot.
|
|
|
|
# - To be clear about the use of a sysroot when using the internal compiler.
|
|
|
|
# - Easier debugging.
|
|
|
|
# - Allowing WITH_SYSTEM_COMPILER+WITH_META_MODE to work together due to
|
|
|
|
# the flip-flopping build command when sometimes using external and
|
|
|
|
# sometimes using internal.
|
|
|
|
# - Allow using lld which has no support for default paths.
|
2016-03-25 22:36:26 +00:00
|
|
|
.if !defined(CROSS_BINUTILS_PREFIX) || !exists(${CROSS_BINUTILS_PREFIX})
|
2015-02-18 19:27:51 +00:00
|
|
|
BFLAGS+= -B${WORLDTMP}/usr/bin
|
2013-05-15 14:30:03 +00:00
|
|
|
.endif
|
2016-08-23 19:29:37 +00:00
|
|
|
.if ${WANT_COMPILER_TYPE} == gcc || \
|
|
|
|
(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc)
|
|
|
|
.elif ${WANT_COMPILER_TYPE} == clang || \
|
|
|
|
(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == clang)
|
2014-10-27 23:31:07 +00:00
|
|
|
XCFLAGS+= -target ${TARGET_TRIPLE}
|
2015-03-26 23:37:03 +00:00
|
|
|
.endif
|
2016-03-25 22:36:26 +00:00
|
|
|
XCFLAGS+= --sysroot=${WORLDTMP}
|
|
|
|
|
|
|
|
.if !empty(BFLAGS)
|
2015-02-26 20:02:29 +00:00
|
|
|
XCFLAGS+= ${BFLAGS}
|
2014-10-09 09:04:01 +00:00
|
|
|
.endif
|
2013-05-15 14:30:03 +00:00
|
|
|
|
2019-11-07 22:58:10 +00:00
|
|
|
.if ${MK_LIB32} == "yes"
|
2019-10-15 21:11:22 +00:00
|
|
|
_LIBCOMPAT= 32
|
2016-03-11 23:56:33 +00:00
|
|
|
.include "Makefile.libcompat"
|
2010-07-13 21:19:59 +00:00
|
|
|
.endif
|
|
|
|
|
2017-06-05 05:17:39 +00:00
|
|
|
# META_MODE normally ignores host file changes since every build updates
|
|
|
|
# timestamps (see NO_META_IGNORE_HOST in sys.mk). There are known times
|
|
|
|
# when the ABI breaks though that we want to force rebuilding WORLDTMP
|
|
|
|
# to get updated host tools.
|
2020-09-08 00:44:35 +00:00
|
|
|
.if ${MK_META_MODE} == "yes" && ${MK_CLEAN} == "no" && \
|
2017-07-08 17:53:00 +00:00
|
|
|
!defined(NO_META_IGNORE_HOST) && !defined(NO_META_IGNORE_HOST_HEADERS) && \
|
2018-06-20 17:20:39 +00:00
|
|
|
!defined(_MKSHOWCONFIG)
|
2017-06-05 05:17:42 +00:00
|
|
|
# r318736 - ino64 major ABI breakage
|
|
|
|
META_MODE_BAD_ABI_VERS+= 1200031
|
2017-06-05 05:17:39 +00:00
|
|
|
|
|
|
|
.if !defined(OBJDIR_HOST_OSRELDATE)
|
2017-11-01 21:22:05 +00:00
|
|
|
.if exists(${OBJTOP}/host-osreldate.h)
|
2017-06-05 05:17:39 +00:00
|
|
|
OBJDIR_HOST_OSRELDATE!= \
|
|
|
|
awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
|
2017-11-01 21:22:05 +00:00
|
|
|
${OBJTOP}/host-osreldate.h
|
2017-10-25 21:46:30 +00:00
|
|
|
.elif exists(${WORLDTMP}/usr/include/osreldate.h)
|
2017-06-05 05:17:39 +00:00
|
|
|
OBJDIR_HOST_OSRELDATE= 0
|
|
|
|
.endif
|
|
|
|
.export OBJDIR_HOST_OSRELDATE
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# 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
|
|
|
|
# is older than the ABI-breakage OSRELDATE of the HOST then we rebuild.
|
2017-10-25 21:46:30 +00:00
|
|
|
.if defined(OBJDIR_HOST_OSRELDATE)
|
2017-06-05 05:17:39 +00:00
|
|
|
.for _ver in ${META_MODE_BAD_ABI_VERS}
|
|
|
|
.if ${OSRELDATE} >= ${_ver} && ${OBJDIR_HOST_OSRELDATE} < ${_ver}
|
|
|
|
_meta_mode_need_rebuild= ${_ver}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
.if defined(_meta_mode_need_rebuild)
|
|
|
|
.info META_MODE: Rebuilding host tools due to ABI breakage in __FreeBSD_version ${_meta_mode_need_rebuild}.
|
|
|
|
NO_META_IGNORE_HOST_HEADERS= 1
|
|
|
|
.export NO_META_IGNORE_HOST_HEADERS
|
2017-10-25 21:46:30 +00:00
|
|
|
.endif # defined(_meta_mode_need_rebuild)
|
|
|
|
.endif # defined(OBJDIR_HOST_OSRELDATE)
|
2020-09-08 00:44:35 +00:00
|
|
|
.endif # ${MK_META_MODE} == "yes" && ${MK_CLEAN} == "no" ...
|
2017-06-05 05:17:39 +00:00
|
|
|
# This is only used for META_MODE+filemon to track what the oldest
|
|
|
|
# __FreeBSD_version is in WORLDTMP. This purposely does NOT have
|
|
|
|
# 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.
|
|
|
|
# Since host files are normally ignored without NO_META_IGNORE_HOST
|
|
|
|
# the file will never be updated unless that flag is specified. This
|
|
|
|
# allows tracking the oldest osreldate to force rebuilds via
|
|
|
|
# META_MODE_BADABI_REVS above.
|
|
|
|
host-osreldate.h: # DO NOT ADD /usr/include/osreldate.h here
|
2020-08-25 13:29:57 +00:00
|
|
|
.if !defined(CROSSBUILD_HOST)
|
2017-06-05 05:17:39 +00:00
|
|
|
@cp -f /usr/include/osreldate.h ${.TARGET}
|
2020-08-25 13:29:57 +00:00
|
|
|
.else
|
|
|
|
@echo "#ifndef __FreeBSD_version" > ${.TARGET}
|
|
|
|
@echo "#define __FreeBSD_version ${OSRELDATE}" >> ${.TARGET}
|
|
|
|
@echo "#endif" >> ${.TARGET}
|
|
|
|
.endif
|
2017-06-05 05:17:39 +00:00
|
|
|
|
2021-08-01 09:10:49 +00:00
|
|
|
WMAKE= ${TIME_ENV} ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
|
2017-06-20 22:08:02 +00:00
|
|
|
BWPHASE=${.TARGET:C,^_,,} \
|
|
|
|
DESTDIR=${WORLDTMP}
|
2004-11-06 03:14:26 +00:00
|
|
|
|
2016-04-05 21:12:03 +00:00
|
|
|
IMAKEENV= ${CROSSENV}
|
2021-08-01 09:10:49 +00:00
|
|
|
IMAKE= ${TIME_ENV} ${IMAKEENV} ${MAKE} -f Makefile.inc1 \
|
2014-03-30 23:43:30 +00:00
|
|
|
${IMAKE_INSTALL} ${IMAKE_MTREE}
|
2004-08-09 11:38:41 +00:00
|
|
|
.if empty(.MAKEFLAGS:M-n)
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \
|
|
|
|
LD_LIBRARY_PATH=${INSTALLTMP} \
|
|
|
|
PATH_LOCALE=${INSTALLTMP}/locale
|
|
|
|
IMAKE+= __MAKE_SHELL=${INSTALLTMP}/sh
|
2004-08-09 11:38:41 +00:00
|
|
|
.else
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP}
|
2004-08-09 11:38:41 +00:00
|
|
|
.endif
|
2018-08-08 07:58:29 +00:00
|
|
|
|
|
|
|
# When generating install media, do not allow user and group information from
|
|
|
|
# the build host to affect the contents of the distribution.
|
2020-03-22 03:10:31 +00:00
|
|
|
.if make(distributeworld) || make(distrib-dirs) || make(distribution) || \
|
|
|
|
make(stageworld)
|
2018-08-08 07:58:29 +00:00
|
|
|
DB_FROM_SRC= yes
|
|
|
|
.endif
|
|
|
|
|
2013-01-15 00:12:34 +00:00
|
|
|
.if defined(DB_FROM_SRC)
|
2019-05-23 18:55:48 +00:00
|
|
|
INSTALLFLAGS+= -N ${.CURDIR}/etc
|
|
|
|
MTREEFLAGS+= -N ${.CURDIR}/etc
|
2013-01-22 21:10:03 +00:00
|
|
|
.endif
|
2013-05-30 14:09:58 +00:00
|
|
|
_INSTALL_DDIR= ${DESTDIR}/${DISTDIR}
|
|
|
|
INSTALL_DDIR= ${_INSTALL_DDIR:S://:/:g:C:/$::}
|
2013-01-22 21:10:03 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
METALOG?= ${DESTDIR}/${DISTDIR}/METALOG
|
2017-06-23 19:03:31 +00:00
|
|
|
METALOG:= ${METALOG:C,//+,/,g}
|
2013-01-22 21:10:03 +00:00
|
|
|
IMAKE+= -DNO_ROOT METALOG=${METALOG}
|
2020-09-17 02:18:21 +00:00
|
|
|
METALOG_INSTALLFLAGS= -U -M ${METALOG} -D ${INSTALL_DDIR}
|
|
|
|
INSTALLFLAGS+= ${METALOG_INSTALLFLAGS}
|
2020-09-17 15:58:42 +00:00
|
|
|
CERTCTLFLAGS= ${METALOG_INSTALLFLAGS}
|
2013-01-22 21:10:03 +00:00
|
|
|
MTREEFLAGS+= -W
|
|
|
|
.endif
|
2015-02-08 16:01:12 +00:00
|
|
|
.if defined(BUILD_PKGS)
|
|
|
|
INSTALLFLAGS+= -h sha256
|
|
|
|
.endif
|
2013-01-22 21:10:03 +00:00
|
|
|
.if defined(DB_FROM_SRC) || defined(NO_ROOT)
|
2020-04-07 02:46:22 +00:00
|
|
|
IMAKE_INSTALL= INSTALL="${INSTALL_CMD} ${INSTALLFLAGS}"
|
|
|
|
IMAKE_MTREE= MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}"
|
2013-01-15 00:12:34 +00:00
|
|
|
.endif
|
2020-09-17 15:58:42 +00:00
|
|
|
.if make(distributeworld)
|
|
|
|
CERTCTLDESTDIR= ${DESTDIR}/${DISTDIR}/base
|
|
|
|
.else
|
|
|
|
CERTCTLDESTDIR= ${DESTDIR}
|
|
|
|
.endif
|
1999-12-10 10:48:20 +00:00
|
|
|
|
2018-06-29 21:15:26 +00:00
|
|
|
DESTDIR_MTREEFLAGS= -deU
|
|
|
|
# When creating worldtmp we don't need to set the directories as owned by root
|
|
|
|
# so we also pass -W
|
|
|
|
WORLDTMP_MTREEFLAGS= -deUW
|
|
|
|
.if defined(NO_ROOT)
|
|
|
|
# When building with -DNO_ROOT we shouldn't be changing the directories
|
|
|
|
# that are created by mtree to be owned by root/wheel.
|
|
|
|
DESTDIR_MTREEFLAGS+= -W
|
|
|
|
.endif
|
2020-04-07 02:46:22 +00:00
|
|
|
DISTR_MTREE= ${MTREE_CMD}
|
2018-11-05 19:51:10 +00:00
|
|
|
.if ${BUILD_WITH_STRICT_TMPPATH} != 0
|
2020-04-07 02:46:22 +00:00
|
|
|
DISTR_MTREE= ${WORLDTMP}/legacy/usr/sbin/mtree
|
2018-11-05 19:51:10 +00:00
|
|
|
.endif
|
2020-04-07 02:46:22 +00:00
|
|
|
WORLDTMP_MTREE= ${DISTR_MTREE} ${WORLDTMP_MTREEFLAGS}
|
|
|
|
DESTDIR_MTREE= ${DISTR_MTREE} ${DESTDIR_MTREEFLAGS}
|
2018-06-29 21:15:26 +00:00
|
|
|
|
2001-01-22 08:07:58 +00:00
|
|
|
# kernel stage
|
2017-06-19 18:08:20 +00:00
|
|
|
KMAKEENV= ${WMAKEENV:NSYSROOT=*}
|
2021-08-01 09:10:49 +00:00
|
|
|
KMAKE= ${TIME_ENV} ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME}
|
2001-01-22 08:07:58 +00:00
|
|
|
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# buildworld
|
|
|
|
#
|
|
|
|
# Attempt to rebuild the entire system, with reasonable chance of
|
|
|
|
# success, regardless of how old your existing system is.
|
|
|
|
#
|
2017-10-29 01:20:47 +00:00
|
|
|
_sanity_check: .PHONY .MAKE
|
2003-02-04 08:15:30 +00:00
|
|
|
.if ${.CURDIR:C/[^,]//g} != ""
|
|
|
|
# The m4 build of sendmail files doesn't like it if ',' is used
|
|
|
|
# anywhere in the path of it's files.
|
|
|
|
@echo
|
|
|
|
@echo "*** Error: path to source tree contains a comma ','"
|
|
|
|
@echo
|
2017-10-29 01:20:47 +00:00
|
|
|
@false
|
|
|
|
.elif ${.CURDIR:M*\:*} != ""
|
|
|
|
# Using ':' leaks into PATH and breaks finding cross-tools.
|
|
|
|
@echo
|
|
|
|
@echo "*** Error: path to source tree contains a colon ':'"
|
|
|
|
@echo
|
|
|
|
@false
|
2003-02-04 08:15:30 +00:00
|
|
|
.endif
|
2017-10-29 01:20:43 +00:00
|
|
|
|
2017-06-24 18:37:51 +00:00
|
|
|
# Our current approach to dependency tracking cannot cope with certain source
|
|
|
|
# tree changes, particularly with respect to removing source files and
|
|
|
|
# replacing generated files. Handle these cases here in an ad-hoc fashion.
|
2017-10-29 01:20:53 +00:00
|
|
|
_cleanobj_fast_depend_hack: .PHONY
|
2020-03-17 14:12:19 +00:00
|
|
|
@echo ">>> Deleting stale dependencies...";
|
2020-03-30 20:20:15 +00:00
|
|
|
sh ${.CURDIR}/tools/build/depend-cleanup.sh ${OBJTOP}
|
2018-12-10 14:50:11 +00:00
|
|
|
|
2017-10-29 01:20:53 +00:00
|
|
|
_worldtmp: .PHONY
|
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> Rebuilding the temporary build tree"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2020-09-08 00:44:35 +00:00
|
|
|
.if ${MK_CLEAN} == "yes"
|
2017-10-29 01:20:53 +00:00
|
|
|
rm -rf ${WORLDTMP}
|
|
|
|
.else
|
2018-11-05 19:51:10 +00:00
|
|
|
# Note: for delete-old we need to set $PATH to also include the host $PATH
|
|
|
|
# since otherwise a partial build with missing symlinks in ${WORLDTMP}/legacy/
|
|
|
|
# will fail to run due to missing binaries. $WMAKE sets PATH to only ${TMPPATH}
|
|
|
|
# so we remove that assingnment from $WMAKE and prepend the new $PATH
|
2018-06-20 17:20:39 +00:00
|
|
|
${_+_}@if [ -e "${WORLDTMP}" ]; then \
|
|
|
|
echo ">>> Deleting stale files in build tree..."; \
|
2018-11-05 19:51:10 +00:00
|
|
|
cd ${.CURDIR}; env PATH=${TMPPATH}:${PATH} ${WMAKE:NPATH=*} \
|
|
|
|
_NO_INCLUDE_COMPILERMK=t -DBATCH_DELETE_OLD_FILES delete-old \
|
|
|
|
delete-old-libs >/dev/null; \
|
2018-06-20 17:20:39 +00:00
|
|
|
fi
|
2017-10-29 01:20:53 +00:00
|
|
|
rm -rf ${WORLDTMP}/legacy/usr/include
|
|
|
|
.if ${USING_SYSTEM_COMPILER} == "yes"
|
|
|
|
.for cc in cc c++
|
|
|
|
if [ -x ${WORLDTMP}/usr/bin/${cc} ]; then \
|
|
|
|
inum=$$(stat -f %i ${WORLDTMP}/usr/bin/${cc}); \
|
|
|
|
find ${WORLDTMP}/usr/bin -inum $${inum} -delete; \
|
|
|
|
fi
|
|
|
|
.endfor
|
|
|
|
.endif # ${USING_SYSTEM_COMPILER} == "yes"
|
2018-06-20 16:10:14 +00:00
|
|
|
.if ${USING_SYSTEM_LINKER} == "yes"
|
|
|
|
@rm -f ${WORLDTMP}/usr/bin/ld ${WORLDTMP}/usr/bin/ld.lld
|
|
|
|
.endif # ${USING_SYSTEM_LINKER} == "yes"
|
2020-09-08 00:44:35 +00:00
|
|
|
.endif # ${MK_CLEAN} == "yes"
|
2017-11-02 21:58:18 +00:00
|
|
|
@mkdir -p ${WORLDTMP}
|
2017-11-02 20:45:04 +00:00
|
|
|
@touch ${WORLDTMP}/${.TARGET}
|
2018-08-20 10:39:53 +00:00
|
|
|
# We can't use mtree to create the worldtmp directories since it may not be
|
|
|
|
# available on the target system (this happens e.g. when building on non-FreeBSD)
|
2021-08-17 19:06:14 +00:00
|
|
|
${_+_}cd ${.CURDIR}/tools/build; \
|
2018-08-20 10:39:53 +00:00
|
|
|
${MAKE} DIRPRFX=tools/build/ DESTDIR=${WORLDTMP}/legacy installdirs
|
2018-11-05 19:51:10 +00:00
|
|
|
# In order to build without inheriting $PATH we need to add symlinks to the host
|
|
|
|
# tools in $WORLDTMP for the tools that we don't build during bootstrap-tools
|
2021-08-17 19:06:14 +00:00
|
|
|
${_+_}cd ${.CURDIR}/tools/build; \
|
2018-11-05 19:51:10 +00:00
|
|
|
${MAKE} DIRPRFX=tools/build/ DESTDIR=${WORLDTMP}/legacy host-symlinks
|
|
|
|
|
2003-04-06 21:46:44 +00:00
|
|
|
_legacy:
|
2003-04-06 03:50:28 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 1.1: legacy release compatibility shims"
|
2003-04-06 03:50:28 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${BMAKE} legacy
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_bootstrap-tools:
|
1999-12-10 10:48:20 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 1.2: bootstrap tools"
|
1999-12-10 10:48:20 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools
|
2020-08-25 13:29:57 +00:00
|
|
|
mkdir -p ${WORLDTMP}/usr ${WORLDTMP}/lib/casper ${WORLDTMP}/lib/geom \
|
|
|
|
${WORLDTMP}/bin
|
2018-08-20 10:39:53 +00:00
|
|
|
${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${WORLDTMP}/usr >/dev/null
|
|
|
|
${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
|
|
|
-p ${WORLDTMP}/usr/include >/dev/null
|
|
|
|
ln -sf ${.CURDIR}/sys ${WORLDTMP}
|
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
|
|
|
${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
|
|
|
|
-p ${WORLDTMP}/usr/lib >/dev/null
|
|
|
|
.endif
|
|
|
|
.for _mtree in ${LOCAL_MTREE}
|
|
|
|
${WORLDTMP_MTREE} -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null
|
|
|
|
.endfor
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_cleanobj:
|
2020-09-08 00:44:35 +00:00
|
|
|
.if ${MK_CLEAN} == "yes"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 2.1: cleaning up the object tree"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2018-10-31 10:45:28 +00:00
|
|
|
# Avoid including bsd.compiler.mk in clean and obj with _NO_INCLUDE_COMPILERMK
|
|
|
|
# since the restricted $PATH might not contain a valid cc binary
|
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t ${CLEANDIR}
|
2019-10-15 21:11:22 +00:00
|
|
|
.if defined(_LIBCOMPAT)
|
2018-10-31 10:45:28 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${LIBCOMPATWMAKE} _NO_INCLUDE_COMPILERMK=t -f Makefile.inc1 ${CLEANDIR}
|
2005-08-05 23:48:58 +00:00
|
|
|
.endif
|
2020-03-18 21:20:10 +00:00
|
|
|
.else
|
2020-03-18 20:12:46 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t _cleanobj_fast_depend_hack
|
2020-09-08 00:44:35 +00:00
|
|
|
.endif # ${MK_CLEAN} == "yes"
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_obj:
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 2.2: rebuilding the object tree"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2018-10-31 10:45:28 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t obj
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_build-tools:
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 2.3: build tools"
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${TMAKE} build-tools
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_cross-tools:
|
1999-11-24 06:04:11 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
1999-12-20 10:32:11 +00:00
|
|
|
@echo ">>> stage 3: cross tools"
|
1999-11-24 06:04:11 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2018-06-21 02:15:50 +00:00
|
|
|
@rm -f ${OBJTOP}/toolchain-metadata.mk
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools
|
2013-11-08 05:11:32 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools
|
2017-06-05 05:17:39 +00:00
|
|
|
_build-metadata:
|
2017-04-13 22:07:34 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2017-06-05 05:17:39 +00:00
|
|
|
@echo ">>> stage 3.1: recording build metadata"
|
2017-04-13 22:07:34 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2018-06-21 02:15:50 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} toolchain-metadata.mk
|
2017-06-05 05:17:39 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} host-osreldate.h
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_includes:
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-11-03 21:09:47 +00:00
|
|
|
@echo ">>> stage 4.1: building includes"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)
Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.
SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.
With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.
- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.
- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.
- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.
- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.
The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.
This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.
- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.
- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.
- Document these changes in build.7
Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks
2015-10-22 00:07:48 +00:00
|
|
|
# Special handling for SUBDIR_OVERRIDE in buildworld as they most likely need
|
|
|
|
# headers from default SUBDIR. Do SUBDIR_OVERRIDE includes last.
|
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} SUBDIR_OVERRIDE= SHARED=symlinks \
|
2016-03-25 22:36:32 +00:00
|
|
|
MK_INCLUDES=yes includes
|
Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)
Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.
SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.
With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.
- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.
- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.
- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.
- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.
The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.
This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.
- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.
- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.
- Document these changes in build.7
Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks
2015-10-22 00:07:48 +00:00
|
|
|
.if !empty(SUBDIR_OVERRIDE) && make(buildworld)
|
2016-03-25 22:36:32 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} MK_INCLUDES=yes SHARED=symlinks includes
|
Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)
Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.
SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.
With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.
- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.
- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.
- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.
- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.
The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.
This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.
- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.
- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.
- Document these changes in build.7
Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks
2015-10-22 00:07:48 +00:00
|
|
|
.endif
|
2021-12-15 22:34:47 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} test-includes
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_libraries:
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 4.2: building libraries"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; \
|
2015-01-02 18:45:03 +00:00
|
|
|
${WMAKE} -DNO_FSCHG MK_HTML=no -DNO_LINT MK_MAN=no \
|
2020-03-27 23:27:54 +00:00
|
|
|
MK_PROFILE=no MK_TESTS=no MK_TESTS_SUPPORT=${MK_TESTS_SUPPORT} \
|
|
|
|
libraries
|
2016-04-21 16:43:36 +00:00
|
|
|
everything: .PHONY
|
1999-12-20 10:32:11 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2019-10-15 21:22:13 +00:00
|
|
|
@echo ">>> stage 4.4: building everything"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2015-12-07 18:45:55 +00:00
|
|
|
${_+_}cd ${.CURDIR}; _PARALLEL_SUBDIR_OK=1 ${WMAKE} all
|
1998-08-31 01:08:08 +00:00
|
|
|
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
WMAKE_TGTS=
|
2017-05-09 20:21:58 +00:00
|
|
|
.if !defined(WORLDFAST)
|
2017-10-29 01:20:43 +00:00
|
|
|
WMAKE_TGTS+= _sanity_check _worldtmp _legacy
|
Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)
Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.
SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.
With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.
- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.
- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.
- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.
- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.
The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.
This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.
- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.
- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.
- Document these changes in build.7
Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks
2015-10-22 00:07:48 +00:00
|
|
|
.if empty(SUBDIR_OVERRIDE)
|
|
|
|
WMAKE_TGTS+= _bootstrap-tools
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
.endif
|
2017-05-09 20:21:38 +00:00
|
|
|
WMAKE_TGTS+= _cleanobj
|
2017-11-03 23:22:03 +00:00
|
|
|
.if !defined(NO_OBJWALK)
|
2017-05-09 20:21:38 +00:00
|
|
|
WMAKE_TGTS+= _obj
|
|
|
|
.endif
|
|
|
|
WMAKE_TGTS+= _build-tools _cross-tools
|
2017-06-05 05:17:39 +00:00
|
|
|
WMAKE_TGTS+= _build-metadata
|
2017-05-09 20:21:58 +00:00
|
|
|
WMAKE_TGTS+= _includes
|
|
|
|
.endif
|
2017-05-09 23:58:07 +00:00
|
|
|
.if !defined(NO_LIBS)
|
2017-05-09 20:21:58 +00:00
|
|
|
WMAKE_TGTS+= _libraries
|
2017-05-09 23:58:07 +00:00
|
|
|
.endif
|
2019-10-15 21:11:22 +00:00
|
|
|
.if defined(_LIBCOMPAT) && empty(SUBDIR_OVERRIDE)
|
2016-03-11 23:56:33 +00:00
|
|
|
WMAKE_TGTS+= build${libcompat}
|
2004-11-06 03:14:26 +00:00
|
|
|
.endif
|
2019-10-15 21:22:13 +00:00
|
|
|
WMAKE_TGTS+= everything
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
|
2019-03-12 07:40:38 +00:00
|
|
|
# record buildworld time in seconds
|
|
|
|
.if make(buildworld)
|
|
|
|
_BUILDWORLD_START!= date '+%s'
|
|
|
|
.export _BUILDWORLD_START
|
|
|
|
.endif
|
|
|
|
|
2016-04-21 16:43:36 +00:00
|
|
|
buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue .PHONY
|
2006-09-07 19:36:16 +00:00
|
|
|
.ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
|
1998-08-31 01:08:08 +00:00
|
|
|
|
2020-08-24 09:20:38 +00:00
|
|
|
_ncpu_cmd=sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo unknown
|
|
|
|
|
2016-04-14 21:04:37 +00:00
|
|
|
buildworld_prologue: .PHONY
|
2006-09-07 19:36:16 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> World build started on `LC_ALL=C date`"
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
|
2016-04-14 21:04:37 +00:00
|
|
|
buildworld_epilogue: .PHONY
|
2006-09-07 19:36:16 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> World build completed on `LC_ALL=C date`"
|
2019-03-12 07:40:38 +00:00
|
|
|
@seconds=$$(($$(date '+%s') - ${_BUILDWORLD_START})); \
|
2019-03-19 19:58:40 +00:00
|
|
|
echo -n ">>> World built in $$seconds seconds, "; \
|
2020-08-24 09:20:38 +00:00
|
|
|
echo "ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
|
2006-09-07 19:36:16 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2006-06-06 16:24:54 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# We need to have this as a target because the indirection between Makefile
|
|
|
|
# and Makefile.inc1 causes the correct PATH to be used, rather than a
|
2006-06-06 18:07:58 +00:00
|
|
|
# modification of the current environment's PATH. In addition, we need
|
|
|
|
# to quote multiword values.
|
2007-05-26 20:17:19 +00:00
|
|
|
#
|
2015-11-05 22:28:31 +00:00
|
|
|
buildenvvars: .PHONY
|
2015-10-17 05:57:29 +00:00
|
|
|
@echo ${WMAKEENV:Q} ${.MAKE.EXPORTED:@v@$v=\"${$v}\"@}
|
2006-06-06 16:24:54 +00:00
|
|
|
|
2014-11-21 18:18:37 +00:00
|
|
|
.if ${.TARGETS:Mbuildenv}
|
|
|
|
.if ${.MAKEFLAGS:M-j}
|
|
|
|
.error The buildenv target is incompatible with -j
|
|
|
|
.endif
|
|
|
|
.endif
|
2015-11-05 22:28:31 +00:00
|
|
|
BUILDENV_DIR?= ${.CURDIR}
|
2017-11-07 15:01:38 +00:00
|
|
|
#
|
|
|
|
# Note: make will report any errors the shell reports. This can
|
|
|
|
# be odd if the last command in an interactive shell generates an
|
|
|
|
# error or is terminated by SIGINT. These reported errors look bad,
|
2021-09-11 12:03:52 +00:00
|
|
|
# but are harmless. Allowing them also allows BUILDENV_SHELL to
|
2017-11-07 15:01:38 +00:00
|
|
|
# be a complex command whose status will be returned to the caller.
|
|
|
|
# Some scripts in tools rely on this behavior to report build errors.
|
|
|
|
#
|
2015-11-05 22:28:31 +00:00
|
|
|
buildenv: .PHONY
|
2005-02-26 22:02:18 +00:00
|
|
|
@echo Entering world for ${TARGET_ARCH}:${TARGET}
|
2015-11-08 00:50:06 +00:00
|
|
|
.if ${BUILDENV_SHELL:M*zsh*}
|
|
|
|
@echo For ZSH you must run: export CPUTYPE=${TARGET_CPUTYPE}
|
|
|
|
.endif
|
2020-08-24 09:20:13 +00:00
|
|
|
@cd ${BUILDENV_DIR} && env ${WMAKEENV} \
|
|
|
|
INSTALL="${INSTALL_CMD} ${INSTALLFLAGS}" \
|
|
|
|
MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}" BUILDENV=1 ${BUILDENV_SHELL}
|
2005-02-26 22:02:18 +00:00
|
|
|
|
2016-03-30 23:50:23 +00:00
|
|
|
TOOLCHAIN_TGTS= ${WMAKE_TGTS:Neverything:Nbuild${libcompat}}
|
2016-04-21 16:43:36 +00:00
|
|
|
toolchain: ${TOOLCHAIN_TGTS} .PHONY
|
2017-10-31 21:51:33 +00:00
|
|
|
KERNEL_TOOLCHAIN_TGTS= ${TOOLCHAIN_TGTS:N_obj:N_cleanobj:N_includes:N_libraries}
|
|
|
|
.if make(kernel-toolchain)
|
|
|
|
.ORDER: ${KERNEL_TOOLCHAIN_TGTS}
|
|
|
|
.endif
|
|
|
|
kernel-toolchain: ${KERNEL_TOOLCHAIN_TGTS} .PHONY
|
2004-03-24 08:26:22 +00:00
|
|
|
|
2004-03-03 19:36:20 +00:00
|
|
|
#
|
2005-11-22 12:02:41 +00:00
|
|
|
# installcheck
|
|
|
|
#
|
|
|
|
# Checks to be sure system is ready for installworld/installkernel.
|
2004-03-03 19:36:20 +00:00
|
|
|
#
|
2016-04-21 16:30:16 +00:00
|
|
|
installcheck: _installcheck_world _installcheck_kernel .PHONY
|
|
|
|
_installcheck_world: .PHONY
|
2018-07-01 10:05:45 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> Install check world"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2016-04-21 16:30:16 +00:00
|
|
|
_installcheck_kernel: .PHONY
|
2018-07-01 10:05:45 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> Install check kernel"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2004-03-03 19:36:20 +00:00
|
|
|
|
2005-11-07 15:03:04 +00:00
|
|
|
#
|
2013-01-15 00:12:34 +00:00
|
|
|
# Require DESTDIR to be set if installing for a different architecture or
|
|
|
|
# using the user/group database in the source tree.
|
2005-11-07 15:03:04 +00:00
|
|
|
#
|
2013-01-15 00:12:34 +00:00
|
|
|
.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE} || \
|
|
|
|
defined(DB_FROM_SRC)
|
2005-11-12 19:28:46 +00:00
|
|
|
.if !make(distributeworld)
|
2013-09-18 00:33:24 +00:00
|
|
|
_installcheck_world: __installcheck_DESTDIR
|
|
|
|
_installcheck_kernel: __installcheck_DESTDIR
|
2016-04-21 16:30:16 +00:00
|
|
|
__installcheck_DESTDIR: .PHONY
|
2005-11-07 15:03:04 +00:00
|
|
|
.if !defined(DESTDIR) || empty(DESTDIR)
|
|
|
|
@echo "ERROR: Please set DESTDIR!"; \
|
|
|
|
false
|
|
|
|
.endif
|
|
|
|
.endif
|
2005-11-12 19:28:46 +00:00
|
|
|
.endif
|
2005-11-07 15:03:04 +00:00
|
|
|
|
2013-01-15 00:12:34 +00:00
|
|
|
.if !defined(DB_FROM_SRC)
|
2013-01-11 23:44:35 +00:00
|
|
|
#
|
|
|
|
# Check for missing UIDs/GIDs.
|
|
|
|
#
|
|
|
|
CHECK_UIDS= auditdistd
|
|
|
|
CHECK_GIDS= audit
|
2018-07-22 16:51:11 +00:00
|
|
|
CHECK_UIDS+= ntpd
|
|
|
|
CHECK_GIDS+= ntpd
|
2013-01-11 23:44:35 +00:00
|
|
|
CHECK_UIDS+= proxy
|
|
|
|
CHECK_GIDS+= proxy authpf
|
2018-07-22 16:51:11 +00:00
|
|
|
CHECK_UIDS+= smmsp
|
|
|
|
CHECK_GIDS+= smmsp
|
2013-09-17 12:59:37 +00:00
|
|
|
CHECK_UIDS+= unbound
|
|
|
|
CHECK_GIDS+= unbound
|
2013-09-18 00:33:24 +00:00
|
|
|
_installcheck_world: __installcheck_UGID
|
2016-04-21 16:30:16 +00:00
|
|
|
__installcheck_UGID: .PHONY
|
2013-01-11 23:44:35 +00:00
|
|
|
.for uid in ${CHECK_UIDS}
|
|
|
|
@if ! `id -u ${uid} >/dev/null 2>&1`; then \
|
|
|
|
echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \
|
|
|
|
false; \
|
|
|
|
fi
|
|
|
|
.endfor
|
|
|
|
.for gid in ${CHECK_GIDS}
|
|
|
|
@if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \
|
|
|
|
echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \
|
|
|
|
false; \
|
|
|
|
fi
|
|
|
|
.endfor
|
2013-01-15 00:12:34 +00:00
|
|
|
.endif
|
2017-05-30 15:51:48 +00:00
|
|
|
#
|
|
|
|
# If installing over the running system (DESTDIR is / or unset) and the install
|
|
|
|
# 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
|
|
|
|
# supported by the currently running kernel), abort the installation.
|
|
|
|
#
|
|
|
|
.if !make(distributeworld) && ${MK_RESCUE} != "no" && \
|
|
|
|
(empty(DESTDIR) || ${DESTDIR} == "/") && empty(BYPASS_INSTALLCHECK_SH)
|
|
|
|
_installcheck_world: __installcheck_sh_check
|
|
|
|
__installcheck_sh_check: .PHONY
|
2017-11-01 21:22:05 +00:00
|
|
|
@if [ "`${OBJTOP}/rescue/rescue/rescue sh -c 'echo OK'`" != \
|
2017-05-30 15:51:48 +00:00
|
|
|
OK ]; then \
|
|
|
|
echo "rescue/sh check failed, installation aborted" >&2; \
|
|
|
|
false; \
|
|
|
|
fi
|
|
|
|
.endif
|
2013-01-11 23:44:35 +00:00
|
|
|
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
#
|
|
|
|
# Required install tools to be saved in a scratch dir for safety.
|
|
|
|
#
|
2009-10-28 07:05:32 +00:00
|
|
|
.if ${MK_ZONEINFO} != "no"
|
2013-01-11 18:37:51 +00:00
|
|
|
_zoneinfo= zic tzsetup
|
2009-10-28 07:05:32 +00:00
|
|
|
.endif
|
2009-03-13 10:09:08 +00:00
|
|
|
|
2020-08-25 13:29:57 +00:00
|
|
|
.if !defined(CROSSBUILD_HOST)
|
|
|
|
_sysctl=sysctl
|
|
|
|
.endif
|
|
|
|
|
2015-08-09 18:15:33 +00:00
|
|
|
ITOOLS= [ awk cap_mkdb cat chflags chmod chown cmp cp \
|
2013-01-22 21:10:03 +00:00
|
|
|
date echo egrep find grep id install ${_install-info} \
|
2015-10-16 22:41:31 +00:00
|
|
|
ln make mkdir mtree mv pwd_mkdb \
|
2021-08-01 13:25:00 +00:00
|
|
|
rm sed services_mkdb sh sort strip ${_sysctl} test time true uname wc \
|
2020-08-25 13:29:57 +00:00
|
|
|
${_zoneinfo} ${LOCAL_ITOOLS}
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
|
2014-12-08 18:29:20 +00:00
|
|
|
# Needed for share/man
|
2016-07-19 18:05:25 +00:00
|
|
|
.if ${MK_MAN_UTILS} != "no"
|
2014-12-08 18:29:20 +00:00
|
|
|
ITOOLS+=makewhatis
|
|
|
|
.endif
|
|
|
|
|
2002-05-14 08:30:40 +00:00
|
|
|
#
|
|
|
|
# distributeworld
|
|
|
|
#
|
|
|
|
# Distributes everything compiled by a `buildworld'.
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# installworld
|
|
|
|
#
|
|
|
|
# Installs everything compiled by a 'buildworld'.
|
|
|
|
#
|
2011-03-02 14:39:26 +00:00
|
|
|
|
|
|
|
# Non-base distributions produced by the base system
|
2018-11-13 19:53:02 +00:00
|
|
|
EXTRA_DISTRIBUTIONS=
|
2019-10-15 21:11:22 +00:00
|
|
|
.if defined(_LIBCOMPAT)
|
2016-03-11 23:56:33 +00:00
|
|
|
EXTRA_DISTRIBUTIONS+= lib${libcompat}
|
2011-03-02 14:39:26 +00:00
|
|
|
.endif
|
2014-06-10 17:04:30 +00:00
|
|
|
.if ${MK_TESTS} != "no"
|
|
|
|
EXTRA_DISTRIBUTIONS+= tests
|
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
|
Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:
r262491:
Add DEBUG_DISTRIBUTIONS, and set it to include base and
EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
distribution does not have corresponding debug information.
Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
and 'packageworld' targets, to reduce the number of occurances
of excluding distributions that do not have .debug files.
r262493:
In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
for dvdrom and cdrom targets. (Later reverted.)
Exclude the *.debug.txz distributions from dvdrom and
cdrom images, but include them for ftp distribution.
r262516:
Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
following output:
eval: ${base....}: Bad substitution
eval: ${doc....}: Bad substitution
eval: ${games....}: Bad substitution
eval: ${lib32....}: Bad substitution
This also follows other naming conventions seen in the
wild.
r267345:
Explicitly set MK_DEBUG_FILES=no, which overrides the
WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
previously experienced.
This change allows us to create the {base,kernel}_debug.txz
distributions without accidentally installing the *.debug
files on the medium itself.
r267397:
Remove evaluations of MK_DEBUG_FILES where not needed.
If DEBUG_DISTRIBUTIONS is empty, which is true if
MK_DEBUG_FILES evaluates to 'no' above, the loop does
nothing.
MFC after: 1 month
Tested on: head@r267801
Reviewed by: brooks [1], emaste, imp [1]
[1] earlier version
Sponsored by: The FreeBSD Foundation
2014-07-01 19:04:04 +00:00
|
|
|
DEBUG_DISTRIBUTIONS=
|
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
2018-11-13 19:53:02 +00:00
|
|
|
DEBUG_DISTRIBUTIONS+= base ${EXTRA_DISTRIBUTIONS:S,tests,,}
|
Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:
r262491:
Add DEBUG_DISTRIBUTIONS, and set it to include base and
EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
distribution does not have corresponding debug information.
Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
and 'packageworld' targets, to reduce the number of occurances
of excluding distributions that do not have .debug files.
r262493:
In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
for dvdrom and cdrom targets. (Later reverted.)
Exclude the *.debug.txz distributions from dvdrom and
cdrom images, but include them for ftp distribution.
r262516:
Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
following output:
eval: ${base....}: Bad substitution
eval: ${doc....}: Bad substitution
eval: ${games....}: Bad substitution
eval: ${lib32....}: Bad substitution
This also follows other naming conventions seen in the
wild.
r267345:
Explicitly set MK_DEBUG_FILES=no, which overrides the
WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
previously experienced.
This change allows us to create the {base,kernel}_debug.txz
distributions without accidentally installing the *.debug
files on the medium itself.
r267397:
Remove evaluations of MK_DEBUG_FILES where not needed.
If DEBUG_DISTRIBUTIONS is empty, which is true if
MK_DEBUG_FILES evaluates to 'no' above, the loop does
nothing.
MFC after: 1 month
Tested on: head@r267801
Reviewed by: brooks [1], emaste, imp [1]
[1] earlier version
Sponsored by: The FreeBSD Foundation
2014-07-01 19:04:04 +00:00
|
|
|
.endif
|
|
|
|
|
2013-01-22 21:10:03 +00:00
|
|
|
MTREE_MAGIC?= mtree 2.0
|
|
|
|
|
2016-04-21 16:43:36 +00:00
|
|
|
distributeworld installworld stageworld: _installcheck_world .PHONY
|
2000-07-19 04:41:59 +00:00
|
|
|
mkdir -p ${INSTALLTMP}
|
2007-12-04 12:55:27 +00:00
|
|
|
progs=$$(for prog in ${ITOOLS}; do \
|
2020-08-25 13:29:57 +00:00
|
|
|
if progpath=`env PATH=${TMPPATH} which $$prog`; then \
|
2007-12-04 12:55:27 +00:00
|
|
|
echo $$progpath; \
|
2007-10-15 13:50:46 +00:00
|
|
|
else \
|
2020-08-25 13:29:57 +00:00
|
|
|
echo "Required tool $$prog not found in PATH ($$PATH)." >&2; \
|
2007-12-04 12:55:27 +00:00
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
done); \
|
2020-08-25 13:29:57 +00:00
|
|
|
if [ -z "${CROSSBUILD_HOST}" ] ; then \
|
|
|
|
libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | \
|
|
|
|
while read line; do \
|
|
|
|
set -- $$line; \
|
|
|
|
if [ "$$2 $$3" != "not found" ]; then \
|
|
|
|
echo $$2; \
|
|
|
|
else \
|
|
|
|
echo "Required library $$1 not found." >&2; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
done); \
|
|
|
|
fi; \
|
2007-12-04 12:55:27 +00:00
|
|
|
cp $$libs $$progs ${INSTALLTMP}
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale
|
2013-01-22 21:10:03 +00:00
|
|
|
.if defined(NO_ROOT)
|
2016-03-04 22:36:56 +00:00
|
|
|
-mkdir -p ${METALOG:H}
|
2013-01-22 21:10:03 +00:00
|
|
|
echo "#${MTREE_MAGIC}" > ${METALOG}
|
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
.if make(distributeworld)
|
|
|
|
.for dist in ${EXTRA_DISTRIBUTIONS}
|
|
|
|
-mkdir ${DESTDIR}/${DISTDIR}/${dist}
|
2018-06-29 21:15:26 +00:00
|
|
|
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.root.dist \
|
2011-03-02 14:39:26 +00:00
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist} >/dev/null
|
2018-06-29 21:15:26 +00:00
|
|
|
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
2011-03-02 14:39:26 +00:00
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
|
2018-06-29 21:15:26 +00:00
|
|
|
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
2011-03-02 14:39:26 +00:00
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null
|
2013-06-07 21:40:02 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
2018-06-29 21:15:26 +00:00
|
|
|
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
|
2013-06-07 21:40:02 +00:00
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null
|
|
|
|
.endif
|
2019-10-15 21:11:22 +00:00
|
|
|
.if defined(_LIBCOMPAT)
|
2018-06-29 21:15:26 +00:00
|
|
|
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
|
2015-10-20 20:35:34 +00:00
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
|
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
2018-06-29 21:15:26 +00:00
|
|
|
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
|
2015-10-20 20:35:34 +00:00
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/usr >/dev/null
|
|
|
|
.endif
|
|
|
|
.endif
|
2014-06-10 17:04:30 +00:00
|
|
|
.if ${MK_TESTS} != "no" && ${dist} == "tests"
|
2014-12-18 18:16:00 +00:00
|
|
|
-mkdir -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE}
|
2018-06-29 21:15:26 +00:00
|
|
|
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
|
2014-12-18 18:16:00 +00:00
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null
|
2015-10-15 01:46:55 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
2018-06-29 21:15:26 +00:00
|
|
|
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
|
2015-10-15 01:46:55 +00:00
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/${TESTSBASE} >/dev/null
|
|
|
|
.endif
|
2014-06-10 17:04:30 +00:00
|
|
|
.endif
|
2013-01-22 21:10:03 +00:00
|
|
|
.if defined(NO_ROOT)
|
2020-04-07 02:46:22 +00:00
|
|
|
${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \
|
2013-01-22 21:10:03 +00:00
|
|
|
sed -e 's#^\./#./${dist}/#' >> ${METALOG}
|
2020-04-07 02:46:22 +00:00
|
|
|
${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \
|
2013-01-22 21:10:03 +00:00
|
|
|
sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
|
2020-04-07 02:46:22 +00:00
|
|
|
${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \
|
2013-01-22 21:10:03 +00:00
|
|
|
sed -e 's#^\./#./${dist}/usr/include/#' >> ${METALOG}
|
2019-10-15 21:11:22 +00:00
|
|
|
.if defined(_LIBCOMPAT)
|
2020-04-07 02:46:22 +00:00
|
|
|
${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist | \
|
2015-10-20 20:35:34 +00:00
|
|
|
sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
|
|
|
|
.endif
|
2013-01-22 21:10:03 +00:00
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
.endfor
|
|
|
|
-mkdir ${DESTDIR}/${DISTDIR}/base
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \
|
2013-01-22 21:10:03 +00:00
|
|
|
METALOG=${METALOG} ${IMAKE_INSTALL} ${IMAKE_MTREE} \
|
|
|
|
DISTBASE=/base DESTDIR=${DESTDIR}/${DISTDIR}/base \
|
2013-08-30 01:32:47 +00:00
|
|
|
LOCAL_MTREE=${LOCAL_MTREE:Q} distrib-dirs
|
2018-08-28 23:56:52 +00:00
|
|
|
${INSTALL_SYMLINK} ${INSTALLFLAGS} usr/src/sys ${INSTALL_DDIR}/base/sys
|
2020-09-01 00:14:40 +00:00
|
|
|
.endif # make(distributeworld)
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \
|
|
|
|
${IMAKEENV} rm -rf ${INSTALLTMP}
|
2011-03-02 14:39:26 +00:00
|
|
|
.if make(distributeworld)
|
|
|
|
.for dist in ${EXTRA_DISTRIBUTIONS}
|
2016-08-10 18:22:42 +00:00
|
|
|
find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -type d -empty -delete
|
2011-03-02 14:39:26 +00:00
|
|
|
.endfor
|
2013-01-22 21:10:03 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
.for dist in base ${EXTRA_DISTRIBUTIONS}
|
|
|
|
@# For each file that exists in this dist, print the corresponding
|
|
|
|
@# line from the METALOG. This relies on the fact that
|
2016-05-03 22:01:48 +00:00
|
|
|
@# a line containing only the filename will sort immediately before
|
2013-01-22 21:10:03 +00:00
|
|
|
@# the relevant mtree line.
|
|
|
|
cd ${DESTDIR}/${DISTDIR}; \
|
|
|
|
find ./${dist} | sort -u ${METALOG} - | \
|
|
|
|
awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \
|
|
|
|
${DESTDIR}/${DISTDIR}/${dist}.meta
|
|
|
|
.endfor
|
Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:
r262491:
Add DEBUG_DISTRIBUTIONS, and set it to include base and
EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
distribution does not have corresponding debug information.
Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
and 'packageworld' targets, to reduce the number of occurances
of excluding distributions that do not have .debug files.
r262493:
In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
for dvdrom and cdrom targets. (Later reverted.)
Exclude the *.debug.txz distributions from dvdrom and
cdrom images, but include them for ftp distribution.
r262516:
Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
following output:
eval: ${base....}: Bad substitution
eval: ${doc....}: Bad substitution
eval: ${games....}: Bad substitution
eval: ${lib32....}: Bad substitution
This also follows other naming conventions seen in the
wild.
r267345:
Explicitly set MK_DEBUG_FILES=no, which overrides the
WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
previously experienced.
This change allows us to create the {base,kernel}_debug.txz
distributions without accidentally installing the *.debug
files on the medium itself.
r267397:
Remove evaluations of MK_DEBUG_FILES where not needed.
If DEBUG_DISTRIBUTIONS is empty, which is true if
MK_DEBUG_FILES evaluates to 'no' above, the loop does
nothing.
MFC after: 1 month
Tested on: head@r267801
Reviewed by: brooks [1], emaste, imp [1]
[1] earlier version
Sponsored by: The FreeBSD Foundation
2014-07-01 19:04:04 +00:00
|
|
|
.for dist in ${DEBUG_DISTRIBUTIONS}
|
2013-07-23 19:34:09 +00:00
|
|
|
@# For each file that exists in this dist, print the corresponding
|
|
|
|
@# line from the METALOG. This relies on the fact that
|
2016-05-03 22:01:48 +00:00
|
|
|
@# a line containing only the filename will sort immediately before
|
2013-07-23 19:34:09 +00:00
|
|
|
@# the relevant mtree line.
|
|
|
|
cd ${DESTDIR}/${DISTDIR}; \
|
|
|
|
find ./${dist}/usr/lib/debug | sort -u ${METALOG} - | \
|
|
|
|
awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \
|
|
|
|
${DESTDIR}/${DISTDIR}/${dist}.debug.meta
|
Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:
r262491:
Add DEBUG_DISTRIBUTIONS, and set it to include base and
EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
distribution does not have corresponding debug information.
Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
and 'packageworld' targets, to reduce the number of occurances
of excluding distributions that do not have .debug files.
r262493:
In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
for dvdrom and cdrom targets. (Later reverted.)
Exclude the *.debug.txz distributions from dvdrom and
cdrom images, but include them for ftp distribution.
r262516:
Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
following output:
eval: ${base....}: Bad substitution
eval: ${doc....}: Bad substitution
eval: ${games....}: Bad substitution
eval: ${lib32....}: Bad substitution
This also follows other naming conventions seen in the
wild.
r267345:
Explicitly set MK_DEBUG_FILES=no, which overrides the
WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
previously experienced.
This change allows us to create the {base,kernel}_debug.txz
distributions without accidentally installing the *.debug
files on the medium itself.
r267397:
Remove evaluations of MK_DEBUG_FILES where not needed.
If DEBUG_DISTRIBUTIONS is empty, which is true if
MK_DEBUG_FILES evaluates to 'no' above, the loop does
nothing.
MFC after: 1 month
Tested on: head@r267801
Reviewed by: brooks [1], emaste, imp [1]
[1] earlier version
Sponsored by: The FreeBSD Foundation
2014-07-01 19:04:04 +00:00
|
|
|
.endfor
|
2013-01-22 21:10:03 +00:00
|
|
|
.endif
|
2020-09-17 15:58:42 +00:00
|
|
|
.endif # make(distributeworld)
|
|
|
|
.if !make(packageworld) && ${MK_CAROOT} != "no"
|
2020-09-17 02:18:21 +00:00
|
|
|
@if which openssl>/dev/null; then \
|
2020-09-21 09:03:32 +00:00
|
|
|
DESTDIR=${CERTCTLDESTDIR} PATH=${TMPPATH}:${PATH} \
|
2020-09-17 15:58:42 +00:00
|
|
|
sh ${SRCTOP}/usr.sbin/certctl/certctl.sh ${CERTCTLFLAGS} rehash \
|
2020-09-17 02:18:21 +00:00
|
|
|
else \
|
|
|
|
echo "No openssl on the host, not rehashing certificates target -- /etc/ssl may not be populated."; \
|
|
|
|
fi
|
2020-09-17 15:58:42 +00:00
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
packageworld: .PHONY
|
2011-03-02 14:39:26 +00:00
|
|
|
.for dist in base ${EXTRA_DISTRIBUTIONS}
|
2013-01-22 21:10:03 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
2015-02-17 23:13:45 +00:00
|
|
|
tar cvf - --exclude usr/lib/debug \
|
|
|
|
@${DESTDIR}/${DISTDIR}/${dist}.meta | \
|
2015-12-01 19:58:08 +00:00
|
|
|
${XZ_CMD} > ${PACKAGEDIR}/${dist}.txz
|
2013-01-22 21:10:03 +00:00
|
|
|
.else
|
2011-03-02 14:39:26 +00:00
|
|
|
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
2015-02-17 23:13:45 +00:00
|
|
|
tar cvf - --exclude usr/lib/debug . | \
|
2015-12-01 19:58:08 +00:00
|
|
|
${XZ_CMD} > ${PACKAGEDIR}/${dist}.txz
|
2013-01-22 21:10:03 +00:00
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
.endfor
|
1998-08-31 01:08:08 +00:00
|
|
|
|
Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:
r262491:
Add DEBUG_DISTRIBUTIONS, and set it to include base and
EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
distribution does not have corresponding debug information.
Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
and 'packageworld' targets, to reduce the number of occurances
of excluding distributions that do not have .debug files.
r262493:
In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
for dvdrom and cdrom targets. (Later reverted.)
Exclude the *.debug.txz distributions from dvdrom and
cdrom images, but include them for ftp distribution.
r262516:
Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
following output:
eval: ${base....}: Bad substitution
eval: ${doc....}: Bad substitution
eval: ${games....}: Bad substitution
eval: ${lib32....}: Bad substitution
This also follows other naming conventions seen in the
wild.
r267345:
Explicitly set MK_DEBUG_FILES=no, which overrides the
WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
previously experienced.
This change allows us to create the {base,kernel}_debug.txz
distributions without accidentally installing the *.debug
files on the medium itself.
r267397:
Remove evaluations of MK_DEBUG_FILES where not needed.
If DEBUG_DISTRIBUTIONS is empty, which is true if
MK_DEBUG_FILES evaluates to 'no' above, the loop does
nothing.
MFC after: 1 month
Tested on: head@r267801
Reviewed by: brooks [1], emaste, imp [1]
[1] earlier version
Sponsored by: The FreeBSD Foundation
2014-07-01 19:04:04 +00:00
|
|
|
.for dist in ${DEBUG_DISTRIBUTIONS}
|
|
|
|
. if defined(NO_ROOT)
|
2013-07-23 19:34:09 +00:00
|
|
|
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
2015-02-17 23:13:45 +00:00
|
|
|
tar cvf - @${DESTDIR}/${DISTDIR}/${dist}.debug.meta | \
|
2015-12-01 19:58:08 +00:00
|
|
|
${XZ_CMD} > ${PACKAGEDIR}/${dist}-dbg.txz
|
Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:
r262491:
Add DEBUG_DISTRIBUTIONS, and set it to include base and
EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
distribution does not have corresponding debug information.
Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
and 'packageworld' targets, to reduce the number of occurances
of excluding distributions that do not have .debug files.
r262493:
In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
for dvdrom and cdrom targets. (Later reverted.)
Exclude the *.debug.txz distributions from dvdrom and
cdrom images, but include them for ftp distribution.
r262516:
Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
following output:
eval: ${base....}: Bad substitution
eval: ${doc....}: Bad substitution
eval: ${games....}: Bad substitution
eval: ${lib32....}: Bad substitution
This also follows other naming conventions seen in the
wild.
r267345:
Explicitly set MK_DEBUG_FILES=no, which overrides the
WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
previously experienced.
This change allows us to create the {base,kernel}_debug.txz
distributions without accidentally installing the *.debug
files on the medium itself.
r267397:
Remove evaluations of MK_DEBUG_FILES where not needed.
If DEBUG_DISTRIBUTIONS is empty, which is true if
MK_DEBUG_FILES evaluates to 'no' above, the loop does
nothing.
MFC after: 1 month
Tested on: head@r267801
Reviewed by: brooks [1], emaste, imp [1]
[1] earlier version
Sponsored by: The FreeBSD Foundation
2014-07-01 19:04:04 +00:00
|
|
|
. else
|
2013-07-23 19:34:09 +00:00
|
|
|
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
2015-02-17 23:13:45 +00:00
|
|
|
tar cvLf - usr/lib/debug | \
|
2015-12-01 19:58:08 +00:00
|
|
|
${XZ_CMD} > ${PACKAGEDIR}/${dist}-dbg.txz
|
Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:
r262491:
Add DEBUG_DISTRIBUTIONS, and set it to include base and
EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
distribution does not have corresponding debug information.
Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
and 'packageworld' targets, to reduce the number of occurances
of excluding distributions that do not have .debug files.
r262493:
In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
for dvdrom and cdrom targets. (Later reverted.)
Exclude the *.debug.txz distributions from dvdrom and
cdrom images, but include them for ftp distribution.
r262516:
Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
following output:
eval: ${base....}: Bad substitution
eval: ${doc....}: Bad substitution
eval: ${games....}: Bad substitution
eval: ${lib32....}: Bad substitution
This also follows other naming conventions seen in the
wild.
r267345:
Explicitly set MK_DEBUG_FILES=no, which overrides the
WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
previously experienced.
This change allows us to create the {base,kernel}_debug.txz
distributions without accidentally installing the *.debug
files on the medium itself.
r267397:
Remove evaluations of MK_DEBUG_FILES where not needed.
If DEBUG_DISTRIBUTIONS is empty, which is true if
MK_DEBUG_FILES evaluates to 'no' above, the loop does
nothing.
MFC after: 1 month
Tested on: head@r267801
Reviewed by: brooks [1], emaste, imp [1]
[1] earlier version
Sponsored by: The FreeBSD Foundation
2014-07-01 19:04:04 +00:00
|
|
|
. endif
|
|
|
|
.endfor
|
2013-07-23 19:34:09 +00:00
|
|
|
|
2019-10-01 15:10:35 +00:00
|
|
|
makeman: .PHONY
|
|
|
|
${_+_}cd ${.CURDIR}/tools/build/options; sh makeman > \
|
|
|
|
${.CURDIR}/share/man/man5/src.conf.5
|
|
|
|
|
2021-12-14 23:55:20 +00:00
|
|
|
# Ensure no regressions in self-includeability of sys/*.h and net*/*.h
|
|
|
|
test-includes: .PHONY
|
|
|
|
${_+_}cd ${.CURDIR}/tools/build/test-includes; \
|
|
|
|
${WMAKEENV} ${MAKE} ${WORLD_FLAGS} DESTDIR=${WORLDTMP} test-includes
|
|
|
|
|
2020-01-12 04:18:36 +00:00
|
|
|
# We can't assume here that ${TMPPATH} will include ${PATH} or /usr/libexec
|
|
|
|
# because we may be building with a STRICTTMPPATH, so we explicitly include
|
|
|
|
# /usr/libexec here for flua. ${TMPPATH} still usefully includes anything else
|
|
|
|
# we may need to function.
|
|
|
|
_sysent_PATH= ${TMPPATH}:/usr/libexec
|
2018-11-08 00:35:00 +00:00
|
|
|
_sysent_dirs= sys/kern
|
|
|
|
_sysent_dirs+= sys/compat/freebsd32
|
|
|
|
_sysent_dirs+= sys/amd64/linux \
|
|
|
|
sys/amd64/linux32 \
|
|
|
|
sys/arm64/linux \
|
|
|
|
sys/i386/linux
|
2020-09-30 00:47:57 +00:00
|
|
|
|
2018-11-08 00:35:00 +00:00
|
|
|
sysent: .PHONY
|
|
|
|
.for _dir in ${_sysent_dirs}
|
2020-09-30 00:47:57 +00:00
|
|
|
sysent-${_dir}: .PHONY
|
2019-11-18 23:28:23 +00:00
|
|
|
@echo "${MAKE} -C ${.CURDIR}/${_dir} sysent"
|
2020-01-12 04:18:36 +00:00
|
|
|
${_+_}@env PATH=${_sysent_PATH} ${MAKE} -C ${.CURDIR}/${_dir} sysent
|
2020-09-30 00:47:57 +00:00
|
|
|
|
|
|
|
sysent: sysent-${_dir}
|
2018-11-08 00:35:00 +00:00
|
|
|
.endfor
|
|
|
|
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# reinstall
|
|
|
|
#
|
|
|
|
# If you have a build server, you can NFS mount the source and obj directories
|
|
|
|
# and do a 'make reinstall' on the *client* to install new binaries from the
|
|
|
|
# most recent server build.
|
|
|
|
#
|
2016-05-18 17:08:29 +00:00
|
|
|
restage reinstall: .MAKE .PHONY
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
1998-09-17 16:32:00 +00:00
|
|
|
@echo ">>> Making hierarchy"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2012-10-18 12:32:51 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \
|
2016-05-10 05:47:25 +00:00
|
|
|
LOCAL_MTREE=${LOCAL_MTREE:Q} hierarchy
|
2016-05-18 17:08:29 +00:00
|
|
|
.if make(restage)
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2016-05-18 17:08:29 +00:00
|
|
|
@echo ">>> Making distribution"
|
2016-05-10 05:47:25 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \
|
2016-05-18 17:08:29 +00:00
|
|
|
LOCAL_MTREE=${LOCAL_MTREE:Q} distribution
|
|
|
|
.endif
|
2016-05-10 05:47:25 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2018-07-01 10:05:45 +00:00
|
|
|
@echo ">>> Installing everything started on `LC_ALL=C date`"
|
2016-05-10 05:47:25 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
|
2019-10-15 21:11:22 +00:00
|
|
|
.if defined(_LIBCOMPAT)
|
2016-05-13 17:44:20 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install${libcompat}
|
2015-02-10 22:05:57 +00:00
|
|
|
.endif
|
2018-07-01 10:05:45 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> Installing everything completed on `LC_ALL=C date`"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2016-01-04 19:19:48 +00:00
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
redistribute: .MAKE .PHONY
|
2002-04-30 11:50:01 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-03-19 17:57:07 +00:00
|
|
|
@echo ">>> Distributing everything"
|
2002-04-30 11:50:01 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
|
2019-10-15 21:11:22 +00:00
|
|
|
.if defined(_LIBCOMPAT)
|
2016-03-11 23:56:33 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute${libcompat} \
|
|
|
|
DISTRIBUTION=lib${libcompat}
|
2005-06-16 18:16:14 +00:00
|
|
|
.endif
|
2000-11-21 04:37:30 +00:00
|
|
|
|
2016-02-03 20:24:21 +00:00
|
|
|
distrib-dirs distribution: .MAKE .PHONY
|
2016-02-03 01:40:07 +00:00
|
|
|
${_+_}cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \
|
|
|
|
${IMAKE_INSTALL} ${IMAKE_MTREE} METALOG=${METALOG} ${.TARGET}
|
2016-02-03 20:24:21 +00:00
|
|
|
.if make(distribution)
|
2015-10-10 14:43:46 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${CROSSENV} PATH=${TMPPATH} \
|
|
|
|
${MAKE} -f Makefile.inc1 ${IMAKE_INSTALL} \
|
2020-04-03 16:19:07 +00:00
|
|
|
METALOG=${METALOG} MK_TESTS=no \
|
|
|
|
MK_TESTS_SUPPORT=${MK_TESTS_SUPPORT} installconfig
|
2016-02-03 20:24:21 +00:00
|
|
|
.endif
|
2015-10-09 22:05:31 +00:00
|
|
|
|
2000-01-09 17:56:40 +00:00
|
|
|
#
|
|
|
|
# buildkernel and installkernel
|
|
|
|
#
|
|
|
|
# Which kernels to build and/or install is specified by setting
|
2001-01-22 07:29:48 +00:00
|
|
|
# KERNCONF. If not defined a GENERIC kernel is built/installed.
|
2001-10-25 07:28:55 +00:00
|
|
|
# Only the existing (depending TARGET) config files are used
|
2000-01-09 17:56:40 +00:00
|
|
|
# for building kernels and only the first of these is designated
|
|
|
|
# as the one being installed.
|
|
|
|
#
|
2001-10-25 07:28:55 +00:00
|
|
|
# Note that we have to use TARGET instead of TARGET_ARCH when
|
Fix cross-building, etc:
1. To cross-build, one now needs to set TARGET_ARCH, and not the
MACHINE_ARCH. MACHINE_ARCH should never be changed manually!
2. Initialize DESTDIR= explicitly for bootstrap-tools, build-tools,
and cross-tools stages. This fixes broken header and library
dependencies problem. We build them in the host environment,
and obviously want them to depend on host headers and libraries.
The problem with broken header dependencies for bootstrap-tools
and cross-tools was already partially solved (see BOOTSTRAPPING
tests in bsd.prog.mk and bsd.lib.mk), but it was still there for
build-tools if the user ran "make world DESTDIR=/foo". Also,
for all of these stages, the library dependencies were broken
because of how bsd.libnames.mk define DPADD members.
We still provide a glue to install bootstrap- and cross-tools
under the ${WORLDTMP}.
Removed PATH overrides for bootstrap-, build-, and cross-tools
stages. There is just no reason why we would need to override
it, and the hacks to clean up the ${WORLDTMP} in the -DNOCLEAN
case are no longer needed with fixes from this step.
That is, we now never use ${WORLDTMP} headers and libraries,
and we don't use any ${WORLDTMP} installed binaries during
these stages. Again, these stages depend solely on the host
environment, including compiler, headers, and libraries.
3. Moved "miniperl" back from cross-tools (it has nothing to do
with a cross-compiler) to build-tools where it belongs. The
change from step 1 let to do this. Also, to make this work,
build-tools targets of "cc_tools" and "miniperl" were modified
to call "depend". Here follow the detailed explanations.
There are two categories of build tools, for now. In the first
category there are "cc_tools" and "miniperl". They occupy the
whole (sub)directory, and nothing needs to be done in this
subdirectory later during the "all" stage. They are also
constructed using system makefiles. We must build the .depend
early in the build-tools stage because:
1) They use (and depend on) the host environment.
2) If we don't do this in build-tools, the "depend" stage of
buildworld will do this for us; wrong library and header
dependencies will be recorded (DESTDIR=${WORLDTMP}) and,
what's worse, the "all" stage may then clobber the
build-architecture format tools (that we built in the
build-tools stage) with the target-architecture format
ones, breaking cross build.
In the second category there are all other build-tools. They
share their directory with the "main" module that needs them
in the "all" stage, and they don't show up themselves in the
.depend file. The portion of this fix was already committed
in gnu/usr.bin/cc/cc_tools/Makefile,v 1.52.
4. "libperl" is no longer a build tool, and "miniperl" is the
stand-alone application. I had to make this change because
build-tools and "all" stages share the same object directory.
Without this change, if we cross compile, libperl.a is first
built for the build architecture during the build-tools stage
(for the purposes of immediate linkage with "miniperl").
Later on, the "all" stage sees this library as up-to-date,
and doesn't rebuild it. The effect is that the wrong format
static libperl library is installed with installworld.
5. Fixed "includes" to install secure/lib/libtelnet headers if
required.
Reviewed by: bde
2001-09-29 13:17:54 +00:00
|
|
|
# we're in kernel-land. Since only TARGET_ARCH is (expected) to
|
2001-10-25 07:28:55 +00:00
|
|
|
# be set to cross-build, we have to make sure TARGET is set
|
2000-01-09 17:56:40 +00:00
|
|
|
# properly.
|
|
|
|
|
2009-01-15 04:19:03 +00:00
|
|
|
.if defined(KERNFAST)
|
|
|
|
NO_KERNELCLEAN= t
|
|
|
|
NO_KERNELCONFIG= t
|
2009-12-16 02:54:34 +00:00
|
|
|
NO_KERNELOBJ= t
|
2009-01-23 18:23:16 +00:00
|
|
|
# Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah
|
|
|
|
.if !defined(KERNCONF) && ${KERNFAST} != "1"
|
|
|
|
KERNCONF=${KERNFAST}
|
|
|
|
.endif
|
2009-01-15 04:19:03 +00:00
|
|
|
.endif
|
2010-07-13 21:19:59 +00:00
|
|
|
.if ${TARGET_ARCH} == "powerpc64"
|
|
|
|
KERNCONF?= GENERIC64
|
2020-11-20 18:42:01 +00:00
|
|
|
.elif ${TARGET_ARCH} == "powerpc64le"
|
|
|
|
KERNCONF?= GENERIC64LE
|
|
|
|
.elif ${TARGET_ARCH} == "powerpcspe"
|
|
|
|
KERNCONF?= MPC85XXSPE
|
2010-07-13 21:19:59 +00:00
|
|
|
.else
|
2001-01-22 07:29:48 +00:00
|
|
|
KERNCONF?= GENERIC
|
2001-01-23 09:52:50 +00:00
|
|
|
.endif
|
2000-09-03 02:58:39 +00:00
|
|
|
INSTKERNNAME?= kernel
|
2000-01-09 17:56:40 +00:00
|
|
|
|
2003-04-16 21:05:06 +00:00
|
|
|
KERNSRCDIR?= ${.CURDIR}/sys
|
|
|
|
KRNLCONFDIR= ${KERNSRCDIR}/${TARGET}/conf
|
2017-11-01 21:22:05 +00:00
|
|
|
KRNLOBJDIR= ${OBJTOP}${KERNSRCDIR:C,^${.CURDIR},,}
|
2001-08-27 12:01:46 +00:00
|
|
|
KERNCONFDIR?= ${KRNLCONFDIR}
|
2000-01-09 17:56:40 +00:00
|
|
|
|
|
|
|
BUILDKERNELS=
|
|
|
|
INSTALLKERNEL=
|
2015-12-01 20:24:58 +00:00
|
|
|
.if defined(NO_INSTALLKERNEL)
|
|
|
|
# All of the BUILDKERNELS loops start at index 1.
|
|
|
|
BUILDKERNELS+= dummy
|
|
|
|
.endif
|
2001-01-22 07:29:48 +00:00
|
|
|
.for _kernel in ${KERNCONF}
|
2018-06-20 17:20:39 +00:00
|
|
|
.if !defined(_MKSHOWCONFIG) && exists(${KERNCONFDIR}/${_kernel})
|
2000-01-09 17:56:40 +00:00
|
|
|
BUILDKERNELS+= ${_kernel}
|
2015-12-01 20:24:58 +00:00
|
|
|
.if empty(INSTALLKERNEL) && !defined(NO_INSTALLKERNEL)
|
2000-01-09 17:56:40 +00:00
|
|
|
INSTALLKERNEL= ${_kernel}
|
|
|
|
.endif
|
2017-10-04 03:39:54 +00:00
|
|
|
.else
|
|
|
|
.if make(buildkernel)
|
|
|
|
.error Missing KERNCONF ${KERNCONFDIR}/${_kernel}
|
|
|
|
.endif
|
2000-01-09 17:56:40 +00:00
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
2018-03-20 18:02:21 +00:00
|
|
|
_cleankernobj_fast_depend_hack: .PHONY
|
2019-10-21 18:40:03 +00:00
|
|
|
# 20191009 r353340 removal of opensolaris_atomic.S (also r353381)
|
|
|
|
.if ${MACHINE} != i386
|
|
|
|
.for f in opensolaris_atomic
|
|
|
|
.for m in opensolaris zfs
|
|
|
|
@if [ -e "${KRNLOBJDIR}/${KERNCONF}/modules${SRCTOP}/sys/modules/${m}/.depend.${f}.o" ] && \
|
|
|
|
grep -q ${f}.S "${KRNLOBJDIR}/${KERNCONF}/modules${SRCTOP}/sys/modules/${m}/.depend.${f}.o"; then \
|
|
|
|
echo "Removing stale dependencies for opensolaris_atomic"; \
|
|
|
|
rm -f ${KRNLOBJDIR}/${KERNCONF}/modules${SRCTOP}/sys/modules/${m}/.depend.${f}.*; \
|
|
|
|
fi
|
|
|
|
.endfor
|
|
|
|
.endfor
|
|
|
|
.endif
|
2018-03-20 18:02:21 +00:00
|
|
|
|
2016-03-11 23:56:33 +00:00
|
|
|
${WMAKE_TGTS:N_worldtmp:Nbuild${libcompat}} ${.ALLTARGETS:M_*:N_worldtmp}: .MAKE .PHONY
|
2014-03-30 22:25:01 +00:00
|
|
|
|
2019-03-16 20:02:57 +00:00
|
|
|
# record kernel(s) build time in seconds
|
|
|
|
.if make(buildkernel)
|
|
|
|
_BUILDKERNEL_START!= date '+%s'
|
|
|
|
.endif
|
|
|
|
|
2000-01-09 17:56:40 +00:00
|
|
|
#
|
|
|
|
# buildkernel
|
|
|
|
#
|
|
|
|
# Builds all kernels defined by BUILDKERNELS.
|
|
|
|
#
|
2015-10-21 05:33:48 +00:00
|
|
|
buildkernel: .MAKE .PHONY
|
2015-12-01 20:24:58 +00:00
|
|
|
.if empty(BUILDKERNELS:Ndummy)
|
2005-02-27 11:48:45 +00:00
|
|
|
@echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \
|
2004-03-04 09:14:30 +00:00
|
|
|
false
|
2000-10-25 04:31:32 +00:00
|
|
|
.endif
|
2000-01-09 17:56:40 +00:00
|
|
|
@echo
|
2015-12-01 20:24:58 +00:00
|
|
|
.for _kernel in ${BUILDKERNELS:Ndummy}
|
2000-01-09 17:56:40 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2001-03-02 16:52:14 +00:00
|
|
|
@echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
|
2000-01-09 17:56:40 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo "===> ${_kernel}"
|
2000-04-27 09:20:18 +00:00
|
|
|
mkdir -p ${KRNLOBJDIR}
|
2000-06-15 10:00:20 +00:00
|
|
|
.if !defined(NO_KERNELCONFIG)
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> stage 1: configuring the kernel"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2000-01-09 17:56:40 +00:00
|
|
|
cd ${KRNLCONFDIR}; \
|
|
|
|
PATH=${TMPPATH} \
|
2001-08-27 12:01:46 +00:00
|
|
|
config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
|
2019-10-19 07:16:20 +00:00
|
|
|
-I '${KERNCONFDIR}' -I '${KRNLCONFDIR}' \
|
|
|
|
'${KERNCONFDIR}/${_kernel}'
|
2001-01-22 23:10:01 +00:00
|
|
|
.endif
|
2020-09-08 00:44:35 +00:00
|
|
|
.if ${MK_CLEAN} == "yes" && !defined(NO_KERNELCLEAN)
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> stage 2.1: cleaning up the object tree"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR}
|
2018-03-20 18:02:21 +00:00
|
|
|
.else
|
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} _cleankernobj_fast_depend_hack
|
2000-06-15 10:00:20 +00:00
|
|
|
.endif
|
2009-12-16 02:54:34 +00:00
|
|
|
.if !defined(NO_KERNELOBJ)
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> stage 2.2: rebuilding the object tree"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj
|
2009-12-16 02:54:34 +00:00
|
|
|
.endif
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> stage 2.3: build tools"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2013-11-09 00:15:36 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${KTMAKE} kernel-tools
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2016-03-30 23:50:23 +00:00
|
|
|
@echo ">>> stage 3.1: building everything"
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ
|
2001-01-21 23:44:41 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2001-03-02 16:52:14 +00:00
|
|
|
@echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
|
2001-01-21 23:44:41 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2019-10-28 20:45:29 +00:00
|
|
|
|
2000-01-09 17:56:40 +00:00
|
|
|
.endfor
|
2019-03-16 20:02:57 +00:00
|
|
|
@seconds=$$(($$(date '+%s') - ${_BUILDKERNEL_START})); \
|
2019-03-19 19:58:40 +00:00
|
|
|
echo -n ">>> Kernel(s) ${BUILDKERNELS} built in $$seconds seconds, "; \
|
2020-08-24 09:20:38 +00:00
|
|
|
echo "ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
|
2019-03-16 20:02:57 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2000-01-09 17:56:40 +00:00
|
|
|
|
2021-01-15 13:43:38 +00:00
|
|
|
.if !make(packages) && !make(update-packages)
|
2016-05-04 21:15:28 +00:00
|
|
|
NO_INSTALLEXTRAKERNELS?= yes
|
2021-01-15 13:43:38 +00:00
|
|
|
.else
|
|
|
|
# packages/update-packages installs kernels to a staging directory then builds
|
|
|
|
# packages from the result to be installed, typically to other systems. It is
|
|
|
|
# less surprising for these targets to honor KERNCONF if multiple kernels are
|
|
|
|
# specified.
|
|
|
|
NO_INSTALLEXTRAKERNELS?= no
|
|
|
|
.endif
|
2016-05-04 21:00:41 +00:00
|
|
|
|
2000-01-09 17:56:40 +00:00
|
|
|
#
|
2004-03-04 09:14:30 +00:00
|
|
|
# installkernel, etc.
|
2000-01-09 17:56:40 +00:00
|
|
|
#
|
|
|
|
# Install the kernel defined by INSTALLKERNEL
|
|
|
|
#
|
2004-03-03 19:36:20 +00:00
|
|
|
installkernel installkernel.debug \
|
2016-04-21 16:30:16 +00:00
|
|
|
reinstallkernel reinstallkernel.debug: _installcheck_kernel .PHONY
|
2015-12-01 20:24:58 +00:00
|
|
|
.if !defined(NO_INSTALLKERNEL)
|
2003-02-07 07:29:57 +00:00
|
|
|
.if empty(INSTALLKERNEL)
|
2005-02-27 11:48:45 +00:00
|
|
|
@echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
|
2004-03-04 09:14:30 +00:00
|
|
|
false
|
2003-02-07 07:29:57 +00:00
|
|
|
.endif
|
2004-03-13 15:46:34 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2018-01-25 21:36:26 +00:00
|
|
|
@echo ">>> Installing kernel ${INSTALLKERNEL} on $$(LC_ALL=C date)"
|
2004-03-13 15:46:34 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2017-11-18 20:01:02 +00:00
|
|
|
${_+_}cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
|
2002-12-02 14:03:40 +00:00
|
|
|
${CROSSENV} PATH=${TMPPATH} \
|
2013-01-29 21:48:10 +00:00
|
|
|
${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
|
2018-01-25 21:36:26 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> Installing kernel ${INSTALLKERNEL} completed on $$(LC_ALL=C date)"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2015-12-01 20:24:58 +00:00
|
|
|
.endif
|
2016-05-04 17:21:34 +00:00
|
|
|
.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
|
2015-09-01 11:59:12 +00:00
|
|
|
.for _kernel in ${BUILDKERNELS:[2..-1]}
|
|
|
|
@echo "--------------------------------------------------------------"
|
2018-01-25 21:36:26 +00:00
|
|
|
@echo ">>> Installing kernel ${_kernel} $$(LC_ALL=C date)"
|
2015-09-01 11:59:12 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2017-11-18 20:01:02 +00:00
|
|
|
${_+_}cd ${KRNLOBJDIR}/${_kernel}; \
|
2015-09-01 11:59:12 +00:00
|
|
|
${CROSSENV} PATH=${TMPPATH} \
|
|
|
|
${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//}
|
2018-01-25 21:36:26 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> Installing kernel ${_kernel} completed on $$(LC_ALL=C date)"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2015-09-01 11:59:12 +00:00
|
|
|
.endfor
|
2015-09-02 15:42:14 +00:00
|
|
|
.endif
|
2000-09-03 02:58:39 +00:00
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
distributekernel distributekernel.debug: .PHONY
|
2015-12-01 20:24:58 +00:00
|
|
|
.if !defined(NO_INSTALLKERNEL)
|
2011-03-02 14:39:26 +00:00
|
|
|
.if empty(INSTALLKERNEL)
|
|
|
|
@echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
|
|
|
|
false
|
2013-05-16 18:37:14 +00:00
|
|
|
.endif
|
|
|
|
mkdir -p ${DESTDIR}/${DISTDIR}
|
|
|
|
.if defined(NO_ROOT)
|
2016-02-05 00:43:42 +00:00
|
|
|
@echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.premeta
|
2011-03-02 14:39:26 +00:00
|
|
|
.endif
|
2017-11-18 20:01:02 +00:00
|
|
|
${_+_}cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
|
2013-05-16 18:37:14 +00:00
|
|
|
${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.premeta/} \
|
|
|
|
${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \
|
2013-05-30 14:09:58 +00:00
|
|
|
DESTDIR=${INSTALL_DDIR}/kernel \
|
2011-03-02 14:39:26 +00:00
|
|
|
${.TARGET:S/distributekernel/install/}
|
2013-05-20 21:16:38 +00:00
|
|
|
.if defined(NO_ROOT)
|
2016-02-05 00:43:42 +00:00
|
|
|
@sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \
|
2013-05-16 18:37:14 +00:00
|
|
|
${DESTDIR}/${DISTDIR}/kernel.meta
|
2013-05-20 21:16:38 +00:00
|
|
|
.endif
|
2015-12-01 20:24:58 +00:00
|
|
|
.endif
|
2016-05-04 17:21:34 +00:00
|
|
|
.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
|
2015-09-01 11:46:13 +00:00
|
|
|
.for _kernel in ${BUILDKERNELS:[2..-1]}
|
2013-05-16 18:37:14 +00:00
|
|
|
.if defined(NO_ROOT)
|
2016-02-05 00:43:42 +00:00
|
|
|
@echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta
|
2013-05-16 18:37:14 +00:00
|
|
|
.endif
|
2017-11-18 20:01:02 +00:00
|
|
|
${_+_}cd ${KRNLOBJDIR}/${_kernel}; \
|
2013-05-16 18:37:14 +00:00
|
|
|
${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.${_kernel}.premeta/} \
|
|
|
|
${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} \
|
2012-01-15 08:36:25 +00:00
|
|
|
KERNEL=${INSTKERNNAME}.${_kernel} \
|
2013-05-30 14:09:58 +00:00
|
|
|
DESTDIR=${INSTALL_DDIR}/kernel.${_kernel} \
|
2012-01-15 08:36:25 +00:00
|
|
|
${.TARGET:S/distributekernel/install/}
|
2013-09-24 19:09:21 +00:00
|
|
|
.if defined(NO_ROOT)
|
2016-02-05 00:43:42 +00:00
|
|
|
@sed -e "s|^./kernel.${_kernel}|.|" \
|
2013-05-16 18:37:14 +00:00
|
|
|
${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta > \
|
|
|
|
${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta
|
2013-09-24 19:09:21 +00:00
|
|
|
.endif
|
2012-01-15 08:36:25 +00:00
|
|
|
.endfor
|
2015-09-02 15:42:14 +00:00
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
packagekernel: .PHONY
|
2013-05-16 18:37:14 +00:00
|
|
|
.if defined(NO_ROOT)
|
2015-12-01 20:24:58 +00:00
|
|
|
.if !defined(NO_INSTALLKERNEL)
|
2013-05-16 18:37:14 +00:00
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel; \
|
2016-01-05 21:05:17 +00:00
|
|
|
tar cvf - --exclude '*.debug' \
|
|
|
|
@${DESTDIR}/${DISTDIR}/kernel.meta | \
|
2015-12-01 19:58:08 +00:00
|
|
|
${XZ_CMD} > ${PACKAGEDIR}/kernel.txz
|
2015-12-01 20:24:58 +00:00
|
|
|
.endif
|
2017-08-11 14:18:11 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
2016-01-05 21:05:17 +00:00
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel; \
|
|
|
|
tar cvf - --include '*/*/*.debug' \
|
|
|
|
@${DESTDIR}/${DISTDIR}/kernel.meta | \
|
|
|
|
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz
|
2017-08-11 14:18:11 +00:00
|
|
|
.endif
|
2016-05-04 17:21:34 +00:00
|
|
|
.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
|
2015-09-01 11:46:13 +00:00
|
|
|
.for _kernel in ${BUILDKERNELS:[2..-1]}
|
2013-05-16 18:37:14 +00:00
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
|
2016-01-05 21:05:17 +00:00
|
|
|
tar cvf - --exclude '*.debug' \
|
|
|
|
@${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \
|
2015-12-01 19:58:08 +00:00
|
|
|
${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz
|
2017-08-11 14:18:11 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
2016-01-05 21:05:17 +00:00
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
|
|
|
|
tar cvf - --include '*/*/*.debug' \
|
|
|
|
@${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \
|
|
|
|
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz
|
2017-08-11 14:18:11 +00:00
|
|
|
.endif
|
2013-05-16 18:37:14 +00:00
|
|
|
.endfor
|
2015-09-02 15:42:14 +00:00
|
|
|
.endif
|
2013-05-16 18:37:14 +00:00
|
|
|
.else
|
2015-12-01 20:24:58 +00:00
|
|
|
.if !defined(NO_INSTALLKERNEL)
|
2012-01-15 08:36:25 +00:00
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel; \
|
2016-01-05 21:05:17 +00:00
|
|
|
tar cvf - --exclude '*.debug' . | \
|
2015-12-01 19:58:08 +00:00
|
|
|
${XZ_CMD} > ${PACKAGEDIR}/kernel.txz
|
2015-12-01 20:24:58 +00:00
|
|
|
.endif
|
2017-08-11 14:18:11 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
2016-01-05 21:05:17 +00:00
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel; \
|
|
|
|
tar cvf - --include '*/*/*.debug' $$(eval find .) | \
|
|
|
|
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz
|
2017-08-11 14:18:11 +00:00
|
|
|
.endif
|
2016-05-04 17:21:34 +00:00
|
|
|
.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
|
2015-09-01 11:46:13 +00:00
|
|
|
.for _kernel in ${BUILDKERNELS:[2..-1]}
|
2012-01-15 08:36:25 +00:00
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
|
2016-01-05 21:05:17 +00:00
|
|
|
tar cvf - --exclude '*.debug' . | \
|
2015-12-01 19:58:08 +00:00
|
|
|
${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz
|
2017-08-11 14:18:11 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
2016-01-05 21:05:17 +00:00
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
|
|
|
|
tar cvf - --include '*/*/*.debug' $$(eval find .) | \
|
|
|
|
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz
|
2017-08-11 14:18:11 +00:00
|
|
|
.endif
|
2012-01-15 08:36:25 +00:00
|
|
|
.endfor
|
2013-05-16 18:37:14 +00:00
|
|
|
.endif
|
2015-09-02 15:42:14 +00:00
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
stagekernel: .PHONY
|
2016-04-21 16:30:25 +00:00
|
|
|
${_+_}${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} distributekernel
|
2016-01-27 21:10:03 +00:00
|
|
|
|
2016-02-24 03:00:06 +00:00
|
|
|
PORTSDIR?= /usr/ports
|
2017-11-01 21:22:05 +00:00
|
|
|
WSTAGEDIR?= ${OBJTOP}/worldstage
|
|
|
|
KSTAGEDIR?= ${OBJTOP}/kernelstage
|
|
|
|
REPODIR?= ${OBJROOT}repo
|
2020-01-19 14:46:28 +00:00
|
|
|
PKG_FORMAT?= txz
|
2021-01-04 15:23:10 +00:00
|
|
|
PKG_REPO_SIGNING_KEY?= # empty
|
2020-08-06 16:14:43 +00:00
|
|
|
PKG_OUTPUT_DIR?= ${PKG_VERSION}
|
2016-01-22 18:06:09 +00:00
|
|
|
|
2016-04-11 18:10:20 +00:00
|
|
|
.ORDER: stage-packages create-packages
|
|
|
|
.ORDER: create-packages create-world-packages
|
|
|
|
.ORDER: create-packages create-kernel-packages
|
|
|
|
.ORDER: create-packages sign-packages
|
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
_pkgbootstrap: .PHONY
|
2018-06-20 17:20:39 +00:00
|
|
|
.if make(*package*) && !exists(${LOCALBASE}/sbin/pkg)
|
2016-01-22 18:06:09 +00:00
|
|
|
@env ASSUME_ALWAYS_YES=YES pkg bootstrap
|
2016-01-28 23:59:34 +00:00
|
|
|
.endif
|
2016-01-22 18:06:09 +00:00
|
|
|
|
2021-12-07 17:02:58 +00:00
|
|
|
#
|
|
|
|
# Allow overriding PKG_ABI, this allow to create kernel packages without having
|
|
|
|
# to build world first.
|
|
|
|
# If it's not provided resolv it from the uname binary in the world stage.
|
|
|
|
#
|
|
|
|
.if !defined(PKG_ABI) && (make(create-world-packages-jobs) || make(create-kernel-packages*) || make(real-update-packages) || make(sign-packages))
|
2020-11-02 18:23:50 +00:00
|
|
|
PKG_ABI!=${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI
|
|
|
|
.endif
|
2021-08-08 01:50:32 +00:00
|
|
|
PKG_BIN_VERSION!=${PKG_CMD} --version </dev/null 2>/dev/null |\
|
|
|
|
awk -F. '/^[0-9.]+$$/ {print $$1 * 10000 + $$2 * 100 + $$3}'
|
2021-07-27 16:44:45 +00:00
|
|
|
.if ${PKG_BIN_VERSION} < 11700
|
|
|
|
PKG_EXT= ${PKG_FORMAT}
|
|
|
|
.else
|
|
|
|
PKG_EXT= pkg
|
|
|
|
.endif
|
2020-11-02 18:23:50 +00:00
|
|
|
|
2021-01-18 19:34:54 +00:00
|
|
|
.if !defined(PKG_VERSION_FROM) && make(real-update-packages)
|
2020-11-02 18:23:50 +00:00
|
|
|
.if defined(PKG_ABI)
|
2021-01-18 20:11:58 +00:00
|
|
|
.if exists(${REPODIR}/${PKG_ABI})
|
2020-11-02 18:23:50 +00:00
|
|
|
PKG_VERSION_FROM!=/usr/bin/readlink ${REPODIR}/${PKG_ABI}/latest
|
2021-01-18 20:11:58 +00:00
|
|
|
PKG_VERSION_FROM_DIR= ${REPODIR}/${PKG_ABI}/${PKG_VERSION_FROM}
|
|
|
|
.else
|
|
|
|
PKG_VERSION_FROM=
|
|
|
|
PKG_VERSION_FROM_DIR=
|
|
|
|
.endif
|
2020-11-02 18:23:50 +00:00
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2021-01-15 13:43:38 +00:00
|
|
|
PKGMAKEARGS+= PKG_VERSION=${PKG_VERSION} \
|
|
|
|
NO_INSTALLEXTRAKERNELS=${NO_INSTALLEXTRAKERNELS}
|
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
packages: .PHONY
|
2021-01-15 13:43:38 +00:00
|
|
|
${_+_}${MAKE} -C ${.CURDIR} ${PKGMAKEARGS} real-packages
|
2016-02-09 19:27:38 +00:00
|
|
|
|
2020-11-02 18:23:50 +00:00
|
|
|
update-packages: .PHONY
|
2021-01-15 13:43:38 +00:00
|
|
|
${_+_}${MAKE} -C ${.CURDIR} ${PKGMAKEARGS} real-update-packages
|
2020-11-02 18:23:50 +00:00
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
package-pkg: .PHONY
|
2016-02-24 03:05:05 +00:00
|
|
|
rm -rf /tmp/ports.${TARGET} || :
|
2016-04-21 16:50:45 +00:00
|
|
|
env ${WMAKEENV:Q} SRCDIR=${.CURDIR} PORTSDIR=${PORTSDIR} REVISION=${_REVISION} \
|
2016-12-16 23:05:47 +00:00
|
|
|
PKG_CMD=${PKG_CMD} PKG_VERSION=${PKG_VERSION} REPODIR=${REPODIR} \
|
|
|
|
WSTAGEDIR=${WSTAGEDIR} \
|
2016-02-24 03:05:05 +00:00
|
|
|
sh ${.CURDIR}/release/scripts/make-pkg-package.sh
|
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
real-packages: stage-packages create-packages sign-packages .PHONY
|
2016-02-08 16:08:13 +00:00
|
|
|
|
2020-11-02 18:23:50 +00:00
|
|
|
real-update-packages: stage-packages .PHONY
|
|
|
|
${_+_}${MAKE} -C ${.CURDIR} PKG_VERSION=${PKG_VERSION} create-packages
|
2021-01-18 20:11:58 +00:00
|
|
|
.if empty(PKG_VERSION_FROM_DIR)
|
|
|
|
@echo "==> Bootstrapping repository, not checking for new packages"
|
|
|
|
.else
|
2020-11-02 18:23:50 +00:00
|
|
|
@echo "==> Checking for new packages (comparing ${PKG_VERSION} to ${PKG_VERSION_FROM})"
|
2021-01-18 20:11:58 +00:00
|
|
|
@for pkg in ${PKG_VERSION_FROM_DIR}/${PKG_NAME_PREFIX}-*; do \
|
2020-11-02 18:23:50 +00:00
|
|
|
pkgname=$$(pkg query -F $${pkg} '%n' | sed 's/${PKG_NAME_PREFIX}-\(.*\)/\1/') ; \
|
2021-07-27 16:44:45 +00:00
|
|
|
newpkgname=${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION}.${PKG_EXT} ; \
|
2020-11-02 18:23:50 +00:00
|
|
|
oldsum=$$(pkg query -F $${pkg} '%X') ; \
|
|
|
|
if [ ! -f ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} ]; then \
|
|
|
|
continue; \
|
|
|
|
fi ; \
|
|
|
|
newsum=$$(pkg query -F ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} '%X') ; \
|
|
|
|
if [ "$${oldsum}" == "$${newsum}" ]; then \
|
2021-07-27 16:44:45 +00:00
|
|
|
echo "==> Keeping old ${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION_FROM}.${PKG_EXT}" ; \
|
2020-11-02 18:23:50 +00:00
|
|
|
rm ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} ; \
|
|
|
|
cp $${pkg} ${REPODIR}/${PKG_ABI}/${PKG_VERSION} ; \
|
|
|
|
else \
|
|
|
|
echo "==> New package $${newpkgname}" ; \
|
|
|
|
fi ; \
|
|
|
|
done
|
2021-01-18 20:11:58 +00:00
|
|
|
.endif
|
2020-11-02 18:23:50 +00:00
|
|
|
${_+_}@cd ${.CURDIR}; \
|
|
|
|
${MAKE} -f Makefile.inc1 PKG_VERSION=${PKG_VERSION} sign-packages
|
|
|
|
|
2017-06-23 18:26:47 +00:00
|
|
|
stage-packages-world: .PHONY
|
|
|
|
@mkdir -p ${WSTAGEDIR}
|
|
|
|
${_+_}@cd ${.CURDIR}; \
|
|
|
|
${MAKE} DESTDIR=${WSTAGEDIR} -DNO_ROOT stageworld
|
|
|
|
|
|
|
|
stage-packages-kernel: .PHONY
|
|
|
|
@mkdir -p ${KSTAGEDIR}
|
2016-01-22 18:06:09 +00:00
|
|
|
${_+_}@cd ${.CURDIR}; \
|
2017-06-23 18:26:33 +00:00
|
|
|
${MAKE} DESTDIR=${KSTAGEDIR} -DNO_ROOT stagekernel
|
2016-02-08 16:08:13 +00:00
|
|
|
|
2017-06-23 18:26:47 +00:00
|
|
|
stage-packages: .PHONY stage-packages-world stage-packages-kernel
|
|
|
|
|
2017-06-23 18:26:51 +00:00
|
|
|
_repodir: .PHONY
|
2016-02-08 16:08:13 +00:00
|
|
|
@mkdir -p ${REPODIR}
|
2017-06-23 18:26:51 +00:00
|
|
|
|
|
|
|
create-packages-world: _pkgbootstrap _repodir .PHONY
|
2016-02-08 16:08:13 +00:00
|
|
|
${_+_}@cd ${.CURDIR}; \
|
2017-06-23 18:27:00 +00:00
|
|
|
${MAKE} -f Makefile.inc1 \
|
|
|
|
DESTDIR=${WSTAGEDIR} \
|
2017-06-23 18:26:51 +00:00
|
|
|
PKG_VERSION=${PKG_VERSION} create-world-packages
|
|
|
|
|
|
|
|
create-packages-kernel: _pkgbootstrap _repodir .PHONY
|
|
|
|
${_+_}@cd ${.CURDIR}; \
|
2017-06-23 18:27:00 +00:00
|
|
|
${MAKE} -f Makefile.inc1 \
|
|
|
|
DESTDIR=${KSTAGEDIR} \
|
2016-01-29 21:42:27 +00:00
|
|
|
PKG_VERSION=${PKG_VERSION} DISTDIR=kernel \
|
2020-08-06 16:13:54 +00:00
|
|
|
SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \
|
2016-01-29 21:42:27 +00:00
|
|
|
create-kernel-packages
|
2016-01-22 18:06:09 +00:00
|
|
|
|
2017-06-23 18:26:51 +00:00
|
|
|
create-packages: .PHONY create-packages-world create-packages-kernel
|
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
create-world-packages: _pkgbootstrap .PHONY
|
2016-04-08 01:57:40 +00:00
|
|
|
@rm -f ${WSTAGEDIR}/*.plist 2>/dev/null || :
|
|
|
|
@cd ${WSTAGEDIR} ; \
|
2018-08-17 21:19:18 +00:00
|
|
|
env -i LC_COLLATE=C sort ${WSTAGEDIR}/${DISTDIR}/METALOG | \
|
2017-11-15 18:03:31 +00:00
|
|
|
awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk
|
2016-04-08 01:57:40 +00:00
|
|
|
@for plist in ${WSTAGEDIR}/*.plist; do \
|
2017-06-23 18:26:54 +00:00
|
|
|
plist=$${plist##*/} ; \
|
|
|
|
pkgname=$${plist%.plist} ; \
|
|
|
|
echo "_PKGS+= $${pkgname}" ; \
|
|
|
|
done > ${WSTAGEDIR}/packages.mk
|
|
|
|
${_+_}@cd ${.CURDIR}; \
|
|
|
|
${MAKE} -f Makefile.inc1 create-world-packages-jobs \
|
2020-08-06 16:13:54 +00:00
|
|
|
SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \
|
2017-06-23 18:26:54 +00:00
|
|
|
.MAKE.JOB.PREFIX=
|
|
|
|
|
|
|
|
.if make(create-world-packages-jobs)
|
|
|
|
.include "${WSTAGEDIR}/packages.mk"
|
|
|
|
.endif
|
|
|
|
|
|
|
|
create-world-packages-jobs: .PHONY
|
|
|
|
.for pkgname in ${_PKGS}
|
|
|
|
create-world-packages-jobs: create-world-package-${pkgname}
|
|
|
|
create-world-package-${pkgname}: .PHONY
|
|
|
|
@sh ${SRCDIR}/release/packages/generate-ucl.sh -o ${pkgname} \
|
|
|
|
-s ${SRCDIR} -u ${WSTAGEDIR}/${pkgname}.ucl
|
|
|
|
@awk -F\" ' \
|
|
|
|
/^name/ { printf("===> Creating %s-", $$2); next } \
|
|
|
|
/^version/ { print $$2; next } \
|
2017-08-11 19:21:40 +00:00
|
|
|
' ${WSTAGEDIR}/${pkgname}.ucl
|
2017-08-09 19:16:54 +00:00
|
|
|
@if [ "${pkgname}" == "runtime" ]; then \
|
2017-08-11 19:21:40 +00:00
|
|
|
sed -i '' -e "s/%VCS_REVISION%/${VCS_REVISION}/" ${WSTAGEDIR}/${pkgname}.ucl ; \
|
2017-08-09 19:16:54 +00:00
|
|
|
fi
|
2019-03-14 22:08:09 +00:00
|
|
|
${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \
|
2020-01-19 14:46:28 +00:00
|
|
|
create -f ${PKG_FORMAT} -M ${WSTAGEDIR}/${pkgname}.ucl \
|
2017-06-23 18:26:54 +00:00
|
|
|
-p ${WSTAGEDIR}/${pkgname}.plist \
|
|
|
|
-r ${WSTAGEDIR} \
|
2020-08-06 16:14:43 +00:00
|
|
|
-o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
|
2017-06-23 18:26:54 +00:00
|
|
|
.endfor
|
2015-03-05 00:13:42 +00:00
|
|
|
|
2017-06-23 18:26:57 +00:00
|
|
|
_default_flavor= -default
|
2018-06-20 17:20:39 +00:00
|
|
|
.if make(*package*) && exists(${KSTAGEDIR}/kernel.meta)
|
2017-08-11 14:19:31 +00:00
|
|
|
. if ${MK_DEBUG_FILES} != "no"
|
2020-05-20 19:45:22 +00:00
|
|
|
_debug=-dbg
|
2017-08-11 14:19:31 +00:00
|
|
|
. endif
|
2018-07-10 21:20:49 +00:00
|
|
|
create-kernel-packages: .PHONY
|
2017-08-11 14:18:11 +00:00
|
|
|
. for flavor in "" ${_debug}
|
2017-06-23 18:26:57 +00:00
|
|
|
create-kernel-packages: create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}
|
|
|
|
create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap .PHONY
|
2016-04-08 01:57:40 +00:00
|
|
|
@cd ${KSTAGEDIR}/${DISTDIR} ; \
|
2017-11-15 18:03:31 +00:00
|
|
|
env -i LC_COLLATE=C sort ${KSTAGEDIR}/kernel.meta | \
|
2016-01-27 21:10:03 +00:00
|
|
|
awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
|
2017-11-15 18:03:31 +00:00
|
|
|
-v kernel=yes -v _kernconf=${INSTALLKERNEL} ; \
|
2016-01-27 21:10:03 +00:00
|
|
|
sed -e "s/%VERSION%/${PKG_VERSION}/" \
|
2016-03-08 19:35:30 +00:00
|
|
|
-e "s/%PKGNAME%/kernel-${INSTALLKERNEL:tl}${flavor}/" \
|
2018-03-14 14:45:57 +00:00
|
|
|
-e "s/%KERNELDIR%/kernel/" \
|
2016-02-16 20:11:00 +00:00
|
|
|
-e "s/%COMMENT%/FreeBSD ${INSTALLKERNEL} kernel ${flavor}/" \
|
|
|
|
-e "s/%DESC%/FreeBSD ${INSTALLKERNEL} kernel ${flavor}/" \
|
2017-08-11 19:21:40 +00:00
|
|
|
-e "s/ %VCS_REVISION%/${VCS_REVISION}/" \
|
2020-08-11 08:42:24 +00:00
|
|
|
-e "s/%PKG_NAME_PREFIX%/${PKG_NAME_PREFIX}/" \
|
|
|
|
-e "s/%PKG_MAINTAINER%/${PKG_MAINTAINER}/" \
|
2020-08-11 10:07:59 +00:00
|
|
|
-e "s|%PKG_WWW%|${PKG_WWW}|" \
|
2016-01-27 21:10:03 +00:00
|
|
|
${SRCDIR}/release/packages/kernel.ucl \
|
2016-04-08 01:57:40 +00:00
|
|
|
> ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl ; \
|
2016-01-27 21:10:03 +00:00
|
|
|
awk -F\" ' \
|
|
|
|
/name/ { printf("===> Creating %s-", $$2); next } \
|
|
|
|
/version/ {print $$2; next } ' \
|
2016-04-08 01:57:40 +00:00
|
|
|
${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl ; \
|
2021-12-07 17:02:58 +00:00
|
|
|
${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \
|
2020-01-19 14:46:28 +00:00
|
|
|
create -f ${PKG_FORMAT} \
|
|
|
|
-M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \
|
2016-04-08 01:57:40 +00:00
|
|
|
-p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \
|
|
|
|
-r ${KSTAGEDIR}/${DISTDIR} \
|
2020-08-06 16:14:43 +00:00
|
|
|
-o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
|
2017-08-10 14:18:58 +00:00
|
|
|
. endfor
|
2016-01-27 21:10:03 +00:00
|
|
|
.endif
|
2016-05-04 17:21:34 +00:00
|
|
|
.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
|
2017-08-10 14:18:58 +00:00
|
|
|
. for _kernel in ${BUILDKERNELS:[2..-1]}
|
|
|
|
. if exists(${KSTAGEDIR}/kernel.${_kernel}.meta)
|
2017-08-11 14:19:31 +00:00
|
|
|
. if ${MK_DEBUG_FILES} != "no"
|
2020-05-20 19:45:22 +00:00
|
|
|
_debug=-dbg
|
2017-08-11 14:19:31 +00:00
|
|
|
. endif
|
2017-08-11 14:18:11 +00:00
|
|
|
. for flavor in "" ${_debug}
|
2017-07-05 19:24:38 +00:00
|
|
|
create-kernel-packages: create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel}
|
|
|
|
create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel}: _pkgbootstrap .PHONY
|
2016-04-08 01:57:40 +00:00
|
|
|
@cd ${KSTAGEDIR}/kernel.${_kernel} ; \
|
2017-11-15 18:03:31 +00:00
|
|
|
env -i LC_COLLATE=C sort ${KSTAGEDIR}/kernel.${_kernel}.meta | \
|
2016-01-27 21:10:03 +00:00
|
|
|
awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
|
2017-11-15 18:03:31 +00:00
|
|
|
-v kernel=yes -v _kernconf=${_kernel} ; \
|
2016-01-27 21:10:03 +00:00
|
|
|
sed -e "s/%VERSION%/${PKG_VERSION}/" \
|
2016-03-08 19:35:30 +00:00
|
|
|
-e "s/%PKGNAME%/kernel-${_kernel:tl}${flavor}/" \
|
2018-03-14 14:45:57 +00:00
|
|
|
-e "s/%KERNELDIR%/kernel.${_kernel}/" \
|
2016-01-27 21:24:45 +00:00
|
|
|
-e "s/%COMMENT%/FreeBSD ${_kernel} kernel ${flavor}/" \
|
|
|
|
-e "s/%DESC%/FreeBSD ${_kernel} kernel ${flavor}/" \
|
2017-08-11 19:21:40 +00:00
|
|
|
-e "s/ %VCS_REVISION%/${VCS_REVISION}/" \
|
2020-08-11 08:42:24 +00:00
|
|
|
-e "s/%PKG_NAME_PREFIX%/${PKG_NAME_PREFIX}/" \
|
|
|
|
-e "s/%PKG_MAINTAINER%/${PKG_MAINTAINER}/" \
|
2020-08-11 10:07:59 +00:00
|
|
|
-e "s|%PKG_WWW%|${PKG_WWW}|" \
|
2016-01-27 21:10:03 +00:00
|
|
|
${SRCDIR}/release/packages/kernel.ucl \
|
2016-04-08 01:57:40 +00:00
|
|
|
> ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \
|
2016-01-27 21:10:03 +00:00
|
|
|
awk -F\" ' \
|
|
|
|
/name/ { printf("===> Creating %s-", $$2); next } \
|
|
|
|
/version/ {print $$2; next } ' \
|
2016-04-08 01:57:40 +00:00
|
|
|
${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \
|
2019-03-27 17:55:39 +00:00
|
|
|
${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \
|
2020-01-19 14:46:28 +00:00
|
|
|
create -f ${PKG_FORMAT} \
|
|
|
|
-M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \
|
2016-04-08 01:57:40 +00:00
|
|
|
-p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \
|
|
|
|
-r ${KSTAGEDIR}/kernel.${_kernel} \
|
2020-08-06 16:14:43 +00:00
|
|
|
-o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
|
2017-08-10 14:18:58 +00:00
|
|
|
. endfor
|
|
|
|
. endif
|
|
|
|
. endfor
|
2016-01-27 21:10:03 +00:00
|
|
|
.endif
|
2015-02-08 18:12:34 +00:00
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
sign-packages: _pkgbootstrap .PHONY
|
2021-05-04 13:39:55 +00:00
|
|
|
printf "version = 2;\n" > ${WSTAGEDIR}/meta
|
2021-07-27 16:44:45 +00:00
|
|
|
.if ${PKG_BIN_VERSION} < 11700
|
|
|
|
printf "packing_format = \"${PKG_FORMAT}\";\n" >> ${WSTAGEDIR}/meta
|
|
|
|
.endif
|
2019-03-27 17:55:39 +00:00
|
|
|
@[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest" ] && \
|
|
|
|
unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest ; \
|
|
|
|
${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname repo \
|
2020-01-19 14:46:28 +00:00
|
|
|
-m ${WSTAGEDIR}/meta \
|
2019-03-27 17:55:39 +00:00
|
|
|
-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \
|
|
|
|
${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \
|
2021-01-04 15:23:10 +00:00
|
|
|
${PKG_REPO_SIGNING_KEY} ; \
|
2019-03-27 17:55:39 +00:00
|
|
|
cd ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI); \
|
2020-08-06 16:14:43 +00:00
|
|
|
ln -s ${PKG_OUTPUT_DIR} latest
|
2016-01-25 16:18:08 +00:00
|
|
|
|
2016-02-07 18:40:04 +00:00
|
|
|
#
|
|
|
|
#
|
|
|
|
# checkworld
|
|
|
|
#
|
|
|
|
# Run test suite on installed world.
|
|
|
|
#
|
|
|
|
checkworld: .PHONY
|
2020-03-30 20:04:55 +00:00
|
|
|
@if [ ! -x "${LOCALBASE}/bin/kyua" ] && [ ! -x "/usr/bin/kyua" ]; then \
|
2016-02-07 18:40:04 +00:00
|
|
|
echo "You need kyua (devel/kyua) to run the test suite." | /usr/bin/fmt; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2017-02-18 21:47:32 +00:00
|
|
|
${_+_}PATH="$$PATH:${LOCALBASE}/bin" kyua test -k ${TESTSBASE}/Kyuafile
|
2016-02-07 18:40:04 +00:00
|
|
|
|
|
|
|
#
|
2006-05-26 18:10:06 +00:00
|
|
|
#
|
|
|
|
# doxygen
|
|
|
|
#
|
|
|
|
# Build the API documentation with doxygen
|
|
|
|
#
|
2015-10-21 05:33:48 +00:00
|
|
|
doxygen: .PHONY
|
2017-02-18 21:41:50 +00:00
|
|
|
@if [ ! -x "${LOCALBASE}/bin/doxygen" ]; then \
|
2006-05-26 18:10:06 +00:00
|
|
|
echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2015-12-01 19:00:43 +00:00
|
|
|
${_+_}cd ${.CURDIR}/tools/kerneldoc/subsys; ${MAKE} obj all
|
2006-05-26 18:10:06 +00:00
|
|
|
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# From here onwards are utility targets used by the 'make world' and
|
|
|
|
# related targets. If your 'world' breaks, you may like to try to fix
|
|
|
|
# the problem and manually run the following targets to attempt to
|
|
|
|
# complete the build. Beware, this is *not* guaranteed to work, you
|
|
|
|
# need to have a pretty good grip on the current state of the system
|
|
|
|
# to attempt to manually finish it. If in doubt, 'make world' again.
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
2015-08-11 17:48:58 +00:00
|
|
|
# legacy: Build compatibility shims for the next three targets. This is a
|
|
|
|
# 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,
|
|
|
|
# build-tools or cross-tools.
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
2016-04-21 16:30:16 +00:00
|
|
|
legacy: .PHONY
|
2016-06-05 23:05:10 +00:00
|
|
|
.if ${BOOTSTRAPPING} < ${MINIMUM_SUPPORTED_OSREL} && ${BOOTSTRAPPING} != 0
|
|
|
|
@echo "ERROR: Source upgrades from versions prior to ${MINIMUM_SUPPORTED_REL} are not supported."; \
|
2008-01-23 22:21:36 +00:00
|
|
|
false
|
|
|
|
.endif
|
2016-10-23 18:00:08 +00:00
|
|
|
|
2020-11-20 20:11:59 +00:00
|
|
|
.for _tool in \
|
|
|
|
tools/build \
|
|
|
|
${LOCAL_LEGACY_DIRS}
|
2016-03-30 23:50:23 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
2017-11-03 23:22:03 +00:00
|
|
|
if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
|
2017-11-01 21:22:05 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${WORLDTMP}/legacy includes; \
|
2016-06-05 23:56:28 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ MK_INCLUDES=no all; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ MK_INCLUDES=no \
|
2017-11-01 21:22:05 +00:00
|
|
|
DESTDIR=${WORLDTMP}/legacy install
|
2003-04-06 03:50:28 +00:00
|
|
|
.endfor
|
|
|
|
|
2003-04-06 21:33:49 +00:00
|
|
|
#
|
2015-03-25 21:59:36 +00:00
|
|
|
# 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
|
|
|
|
# binaries is usually quite narrow. Bootstrap tools use the host's compiler and
|
2018-11-05 19:51:16 +00:00
|
|
|
# libraries, augmented by -legacy, in addition to the libraries built during
|
|
|
|
# bootstrap-tools.
|
2003-04-06 21:33:49 +00:00
|
|
|
#
|
2015-09-25 00:30:53 +00:00
|
|
|
_bt= _bootstrap-tools
|
2015-02-23 05:28:17 +00:00
|
|
|
|
2018-11-05 19:51:10 +00:00
|
|
|
# We want to run the build with only ${WORLDTMP} in $PATH to ensure we don't
|
|
|
|
# accidentally run tools that are incompatible but happen to be in $PATH.
|
|
|
|
# This is especially important when building on Linux/MacOS where many of the
|
|
|
|
# programs used during the build accept different flags or generate different
|
|
|
|
# output. On those platforms we only symlink the tools known to be compatible
|
|
|
|
# (e.g. basic utilities such as mkdir) into ${WORLDTMP} and build all others
|
|
|
|
# from the FreeBSD sources during the bootstrap-tools stage.
|
|
|
|
# We want to build without the user's $PATH starting in the bootstrap-tools
|
|
|
|
# phase so the tools used in that phase (ln, cp, etc) must have already been
|
|
|
|
# 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.
|
|
|
|
# Since they could be Linux or MacOS binaries, too we must only use flags that
|
|
|
|
# are portable across operating systems.
|
|
|
|
|
|
|
|
# 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
|
|
|
|
# $PATH during the bootstrap-tools stage.
|
2020-08-25 13:29:57 +00:00
|
|
|
# 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
|
2018-11-05 19:51:10 +00:00
|
|
|
.if defined(BOOTSTRAP_ALL_TOOLS)
|
|
|
|
# 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}
|
|
|
|
BOOTSTRAPPING_OSRELDATE:= 0
|
|
|
|
.endif
|
|
|
|
|
2020-08-25 13:29:57 +00:00
|
|
|
# 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
|
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_GAMES} != "no"
|
2015-10-02 10:08:11 +00:00
|
|
|
_strfile= usr.bin/fortune/strfile
|
2003-04-06 21:33:49 +00:00
|
|
|
.endif
|
|
|
|
|
2021-01-06 12:45:40 +00:00
|
|
|
# vtfontcvt is used to build font files for loader and to generate
|
|
|
|
# C source for loader built in font (8x16.c).
|
2014-06-12 18:31:32 +00:00
|
|
|
_vtfontcvt= usr.bin/vtfontcvt
|
|
|
|
|
2018-11-05 19:51:10 +00:00
|
|
|
# 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
|
|
|
|
# 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,
|
|
|
|
# please ensure that you also add a .else case where you add the tool to the
|
|
|
|
# _bootstrap_tools_links variable.
|
2021-11-19 07:10:21 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1000033
|
|
|
|
# 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
|
|
|
|
_m4= tools/build/bootstrap-m4 usr.bin/m4
|
|
|
|
${_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}-usr.bin/lex ${_bt}-tools/build/bootstrap-m4
|
|
|
|
_bt_m4_depend=${_bt}-usr.bin/m4
|
|
|
|
_bt_lex_depend=${_bt}-usr.bin/lex ${_bt_m4_depend}
|
|
|
|
.else
|
|
|
|
_bootstrap_tools_links+=m4 lex
|
|
|
|
.endif
|
2009-12-31 00:07:26 +00:00
|
|
|
|
2018-11-05 19:51:16 +00:00
|
|
|
# ELF Tool Chain libraries are needed for ELF tools and dtrace tools.
|
|
|
|
# r296685 fix cross-endian objcopy
|
|
|
|
# r310724 fixed PR 215350, a crash in libdwarf with objects built by GCC 6.2.
|
|
|
|
# r334881 added libdwarf constants used by ctfconvert.
|
|
|
|
# r338478 fixed a crash in objcopy for mips64el objects
|
|
|
|
# r339083 libelf: correct mips64el test to use ELF header
|
2019-05-29 02:26:15 +00:00
|
|
|
# r348347 Add missing powerpc64 relocation support to libdwarf
|
|
|
|
.if ${BOOTSTRAPPING} < 1300030
|
2019-10-28 20:45:29 +00:00
|
|
|
_elftoolchain_libs= lib/libelf lib/libdwarf lib/libzstd
|
2018-11-05 19:51:16 +00:00
|
|
|
${_bt}-lib/libelf: ${_bt_m4_depend}
|
|
|
|
${_bt}-lib/libdwarf: ${_bt_m4_depend}
|
|
|
|
.endif
|
|
|
|
|
2019-11-18 23:28:23 +00:00
|
|
|
# flua is required to regenerate syscall files. It first appeared during the
|
|
|
|
# 13.0-CURRENT cycle, thus needs to be built on -older releases and stable
|
|
|
|
# branches.
|
|
|
|
.if ${BOOTSTRAPPING} < 1300059
|
2020-06-22 03:14:43 +00:00
|
|
|
${_bt}-libexec/flua: ${_bt}-lib/liblua ${_bt}-lib/libucl
|
|
|
|
_flua= lib/liblua lib/libucl libexec/flua
|
2019-11-18 23:28:23 +00:00
|
|
|
.endif
|
|
|
|
|
2017-03-06 20:32:17 +00:00
|
|
|
# r245440 mtree -N support added
|
|
|
|
# r313404 requires sha384.h for libnetbsd, added to libmd in r292782
|
2017-03-05 21:16:50 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1100093
|
|
|
|
_nmtree= lib/libmd \
|
|
|
|
lib/libnetbsd \
|
2013-01-15 00:12:34 +00:00
|
|
|
usr.sbin/nmtree
|
2015-02-23 05:28:17 +00:00
|
|
|
|
2017-03-05 21:16:50 +00:00
|
|
|
${_bt}-lib/libnetbsd: ${_bt}-lib/libmd
|
2015-02-23 05:28:17 +00:00
|
|
|
${_bt}-usr.sbin/nmtree: ${_bt}-lib/libnetbsd
|
2018-11-05 19:51:10 +00:00
|
|
|
.else
|
|
|
|
_bootstrap_tools_links+=mtree
|
2013-01-15 00:12:34 +00:00
|
|
|
.endif
|
|
|
|
|
2021-11-19 07:10:21 +00:00
|
|
|
# r246097: log addition login.conf.db, passwd, pwd.db, and spwd.db with cat -l
|
|
|
|
.if ${BOOTSTRAPPING} < 1000027
|
|
|
|
_cat= bin/cat
|
|
|
|
.else
|
|
|
|
_bootstrap_tools_links+=cat
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# r277259 crunchide: Correct 64-bit section header offset
|
|
|
|
# r281674 crunchide: always include both 32- and 64-bit ELF support
|
|
|
|
.if ${BOOTSTRAPPING} < 1100078
|
|
|
|
_crunchide= usr.sbin/crunch/crunchide
|
|
|
|
.else
|
|
|
|
_bootstrap_tools_links+=crunchide
|
|
|
|
.endif
|
|
|
|
|
2020-09-18 17:17:46 +00:00
|
|
|
# 1300115: Higher WARNS fixes
|
|
|
|
.if ${BOOTSTRAPPING} < 1202502 || \
|
2020-12-04 15:53:37 +00:00
|
|
|
(${BOOTSTRAPPING} > 1300000 && ${BOOTSTRAPPING} < 1300131)
|
2016-05-26 23:20:36 +00:00
|
|
|
_crunchgen= usr.sbin/crunch/crunchgen
|
2018-11-05 19:51:10 +00:00
|
|
|
.else
|
|
|
|
_bootstrap_tools_links+=crunchgen
|
2015-04-17 16:02:49 +00:00
|
|
|
.endif
|
|
|
|
|
2021-11-19 07:10:21 +00:00
|
|
|
# r296926 -P keymap search path, MFC to stable/10 in r298297
|
|
|
|
# Note: kbdcontrol can not be bootstrapped on non-FreeBSD systems
|
|
|
|
.if !defined(CROSSBUILD_HOST)
|
|
|
|
.if (${BOOTSTRAPPING} < 1003501 || \
|
|
|
|
(${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103) || \
|
|
|
|
(!exists(/usr/sbin/kbdcontrol)))
|
|
|
|
_kbdcontrol= usr.sbin/kbdcontrol
|
|
|
|
.else
|
|
|
|
_bootstrap_tools_links+=kbdcontrol
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2021-01-06 17:08:52 +00:00
|
|
|
# 1300102: VHDX support
|
|
|
|
.if ${BOOTSTRAPPING} < 1201520 || \
|
|
|
|
(${BOOTSTRAPPING} > 1300000 && ${BOOTSTRAPPING} < 1300102)
|
|
|
|
_mkimg= usr.bin/mkimg
|
|
|
|
.else
|
|
|
|
_bootstrap_tools_links+=mkimg
|
|
|
|
.endif
|
|
|
|
|
2020-03-26 08:23:09 +00:00
|
|
|
_yacc= usr.bin/yacc
|
2015-02-18 23:10:15 +00:00
|
|
|
|
2014-08-15 21:22:49 +00:00
|
|
|
.if ${MK_BSNMP} != "no"
|
2006-03-31 14:10:35 +00:00
|
|
|
_gensnmptree= usr.sbin/bsnmpd/gensnmptree
|
|
|
|
.endif
|
|
|
|
|
2018-08-23 18:19:21 +00:00
|
|
|
|
2017-04-09 01:35:19 +00:00
|
|
|
# We need to build tblgen when we're building clang or lld, either as
|
|
|
|
# bootstrap tools, or as the part of the normal build.
|
2021-09-06 08:49:49 +00:00
|
|
|
# llvm-tblgen is also needed for various llvm binutils (e.g. objcopy).
|
2017-04-09 01:35:19 +00:00
|
|
|
.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" || \
|
2021-07-05 17:36:02 +00:00
|
|
|
${MK_LLD_BOOTSTRAP} != "no" || ${MK_LLD} != "no" || \
|
2021-09-06 08:49:49 +00:00
|
|
|
${MK_LLDB} != "no" || ${MK_LLVM_BINUTILS} != "no"
|
2011-11-10 20:15:35 +00:00
|
|
|
_clang_tblgen= \
|
Completely revamp the way llvm, clang and lldb are built.
* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.
N.B.: This is work in progress, some details may still be missing.
It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.
The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.
Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.
2016-08-26 22:44:22 +00:00
|
|
|
lib/clang/libllvmminimal \
|
2021-07-05 17:36:02 +00:00
|
|
|
usr.bin/clang/llvm-tblgen
|
2022-01-07 15:34:08 +00:00
|
|
|
.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" || \
|
|
|
|
${MK_LLDB} != "no"
|
2021-07-05 17:36:02 +00:00
|
|
|
_clang_tblgen+= usr.bin/clang/clang-tblgen
|
|
|
|
.endif
|
|
|
|
.if ${MK_LLDB} != "no"
|
|
|
|
_clang_tblgen+= usr.bin/clang/lldb-tblgen
|
|
|
|
.endif
|
Completely revamp the way llvm, clang and lldb are built.
* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.
N.B.: This is work in progress, some details may still be missing.
It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.
The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.
Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.
2016-08-26 22:44:22 +00:00
|
|
|
${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/libllvmminimal
|
|
|
|
${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-lib/clang/libllvmminimal
|
2019-09-02 17:30:00 +00:00
|
|
|
${_bt}-usr.bin/clang/lldb-tblgen: ${_bt}-lib/clang/libllvmminimal
|
2011-11-10 20:15:35 +00:00
|
|
|
.endif
|
|
|
|
|
2021-08-19 17:27:04 +00:00
|
|
|
# C.UTF-8 is always built in share/ctypes and we need localedef for that.
|
2018-11-05 19:51:10 +00:00
|
|
|
_localedef= usr.bin/localedef
|
2020-08-25 13:29:57 +00:00
|
|
|
${_bt}-usr.bin/localedef: ${_bt}-usr.bin/yacc ${_bt_lex_depend}
|
2018-11-05 19:51:10 +00:00
|
|
|
|
2021-08-02 09:49:01 +00:00
|
|
|
.if ${MK_ICONV} != "no"
|
|
|
|
_mkesdb= usr.bin/mkesdb
|
|
|
|
_mkcsmapper= usr.bin/mkcsmapper
|
2021-08-16 08:56:17 +00:00
|
|
|
${_bt}-usr.bin/mkesdb: ${_bt}-usr.bin/yacc ${_bt_lex_depend}
|
|
|
|
${_bt}-usr.bin/mkcsmapper: ${_bt}-usr.bin/yacc ${_bt_lex_depend}
|
2021-08-02 09:49:01 +00:00
|
|
|
.endif
|
|
|
|
|
2017-10-04 03:35:23 +00:00
|
|
|
.if ${MK_KERBEROS} != "no"
|
|
|
|
_kerberos5_bootstrap_tools= \
|
|
|
|
kerberos5/tools/make-roken \
|
|
|
|
kerberos5/lib/libroken \
|
|
|
|
kerberos5/lib/libvers \
|
|
|
|
kerberos5/tools/asn1_compile \
|
|
|
|
kerberos5/tools/slc \
|
|
|
|
usr.bin/compile_et
|
|
|
|
|
|
|
|
.ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g}
|
2018-11-05 19:51:10 +00:00
|
|
|
.for _tool in ${_kerberos5_bootstrap_tools}
|
|
|
|
${_bt}-${_tool}: ${_bt}-usr.bin/yacc ${_bt_lex_depend}
|
|
|
|
.endfor
|
2017-10-04 03:35:23 +00:00
|
|
|
.endif
|
|
|
|
|
2017-01-21 13:17:25 +00:00
|
|
|
${_bt}-usr.bin/mandoc: ${_bt}-lib/libopenbsd
|
2015-05-30 17:41:37 +00:00
|
|
|
|
2018-11-05 19:51:10 +00:00
|
|
|
# The tools listed in _basic_bootstrap_tools will generally not be
|
|
|
|
# bootstrapped unless BOOTSTRAP_ALL_TOOL is set. However, when building on a
|
|
|
|
# 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,
|
|
|
|
# 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
|
|
|
|
# subdirectory and comma-separated list of files.
|
|
|
|
_basic_bootstrap_tools_multilink=usr.bin/grep grep,egrep,fgrep
|
|
|
|
_basic_bootstrap_tools_multilink+=bin/test test,[
|
|
|
|
# bootstrap tools needed by buildworld:
|
2020-08-25 13:29:57 +00:00
|
|
|
_basic_bootstrap_tools+=usr.bin/cut bin/expr usr.bin/gencat usr.bin/join \
|
|
|
|
usr.bin/mktemp bin/realpath bin/rmdir usr.bin/sed usr.bin/sort \
|
2018-11-05 19:51:10 +00:00
|
|
|
usr.bin/truncate usr.bin/tsort
|
2020-08-11 16:46:48 +00:00
|
|
|
# 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
|
|
|
|
# and nawk in ${WORLDTMP}/legacy/bin.
|
|
|
|
_basic_bootstrap_tools_multilink+=usr.bin/awk awk,nawk
|
2018-11-05 19:51:10 +00:00
|
|
|
# file2c is required for building usr.sbin/config:
|
|
|
|
_basic_bootstrap_tools+=usr.bin/file2c
|
|
|
|
# uuencode/uudecode required for share/tabset
|
|
|
|
_basic_bootstrap_tools+=usr.bin/uuencode usr.bin/uudecode
|
|
|
|
# xargs is required by mkioctls
|
|
|
|
_basic_bootstrap_tools+=usr.bin/xargs
|
|
|
|
# cap_mkdb is required for share/termcap:
|
|
|
|
_basic_bootstrap_tools+=usr.bin/cap_mkdb
|
|
|
|
# services_mkdb/pwd_mkdb are required for installworld:
|
|
|
|
_basic_bootstrap_tools+=usr.sbin/services_mkdb usr.sbin/pwd_mkdb
|
2020-08-25 13:29:57 +00:00
|
|
|
# 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
|
2018-11-05 19:51:10 +00:00
|
|
|
# sysctl/chflags are required for installkernel:
|
2020-08-25 13:29:57 +00:00
|
|
|
.if !defined(CROSSBUILD_HOST)
|
2020-10-12 10:42:28 +00:00
|
|
|
_basic_bootstrap_tools+=bin/chflags
|
|
|
|
# Note: sysctl does not bootstrap on FreeBSD < 13 anymore, but that doesn't
|
|
|
|
# matter since we don't need any of the new features for the build.
|
|
|
|
_bootstrap_tools_links+=sysctl
|
2020-08-25 13:29:57 +00:00
|
|
|
.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
|
2018-12-05 10:57:57 +00:00
|
|
|
# mkfifo is used by sys/conf/newvers.sh
|
|
|
|
_basic_bootstrap_tools+=usr.bin/mkfifo
|
2020-10-18 18:35:23 +00:00
|
|
|
# jot is needed for the mkimg tests
|
|
|
|
_basic_bootstrap_tools+=usr.bin/jot
|
2018-11-05 19:51:10 +00:00
|
|
|
|
|
|
|
.if ${MK_BOOT} != "no"
|
|
|
|
# md5 is used by boot/beri (and possibly others)
|
|
|
|
_basic_bootstrap_tools+=sbin/md5
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${MK_ZONEINFO} != "no"
|
|
|
|
_basic_bootstrap_tools+=usr.sbin/zic usr.sbin/tzsetup
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(BOOTSTRAP_ALL_TOOLS)
|
|
|
|
_other_bootstrap_tools+=${_basic_bootstrap_tools}
|
|
|
|
.for _subdir _links in ${_basic_bootstrap_tools_multilink}
|
|
|
|
_other_bootstrap_tools+=${_subdir}
|
|
|
|
.endfor
|
|
|
|
${_bt}-usr.bin/awk: ${_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:
|
|
|
|
${_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
|
|
|
|
# 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
|
|
|
|
# since "make" will usually point to GNU make there.
|
|
|
|
_other_bootstrap_tools+=usr.bin/bmake
|
2020-08-25 13:29:57 +00:00
|
|
|
|
|
|
|
# Avoid dependency on host bz2 headers:
|
|
|
|
_other_bootstrap_tools+=lib/libbz2
|
|
|
|
${_bt}-usr.bin/grep: ${_bt}-lib/libbz2
|
2021-12-06 18:12:46 +00:00
|
|
|
|
|
|
|
# libdwarf depends on libz
|
|
|
|
_other_bootstrap_tools+=lib/libz
|
|
|
|
${_bt}-lib/libdwarf: ${_bt}-lib/libz
|
2021-12-06 23:00:31 +00:00
|
|
|
|
|
|
|
# libroken depends on libcrypt
|
|
|
|
_other_bootstrap_tools+=lib/libcrypt
|
|
|
|
${_bt}-lib/libroken: ${_bt}-lib/libcrypt
|
2018-11-05 19:51:10 +00:00
|
|
|
.else
|
|
|
|
# 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.
|
|
|
|
_bootstrap_tools_links+=${_basic_bootstrap_tools:T}
|
|
|
|
.for _subdir _links in ${_basic_bootstrap_tools_multilink}
|
|
|
|
_bootstrap_tools_links+=${_links:S/,/ /g}
|
|
|
|
.endfor
|
|
|
|
.endif # defined(BOOTSTRAP_ALL_TOOLS)
|
|
|
|
|
|
|
|
# Link the tools that we need for building but don't need to bootstrap because
|
|
|
|
# the host version is known to be compatible into ${WORLDTMP}/legacy
|
|
|
|
# We do this before building any of the bootstrap tools in case they depend on
|
|
|
|
# the presence of any of the links (e.g. as m4/lex/awk)
|
|
|
|
${_bt}-links: .PHONY
|
|
|
|
|
|
|
|
.for _tool in ${_bootstrap_tools_links}
|
2021-08-17 19:25:44 +00:00
|
|
|
${_bt}-link-${_tool}: .PHONY
|
2020-08-07 16:26:56 +00:00
|
|
|
@rm -f "${WORLDTMP}/legacy/bin/${_tool}"; \
|
|
|
|
source_path=`which ${_tool}`; \
|
|
|
|
if [ ! -e "$${source_path}" ] ; then \
|
|
|
|
echo "Cannot find host tool '${_tool}'"; false; \
|
|
|
|
fi; \
|
2020-08-24 16:06:11 +00:00
|
|
|
cp -pf "$${source_path}" "${WORLDTMP}/legacy/bin/${_tool}"
|
2018-11-05 19:51:10 +00:00
|
|
|
${_bt}-links: ${_bt}-link-${_tool}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
bootstrap-tools: ${_bt}-links .PHONY
|
2015-02-23 05:28:17 +00:00
|
|
|
|
2011-05-11 17:50:19 +00:00
|
|
|
# Please document (add comment) why something is in 'bootstrap-tools'.
|
|
|
|
# Try to bound the building of the bootstrap-tool to just the
|
|
|
|
# FreeBSD versions that need the tool built at this stage of the build.
|
2003-07-01 12:57:53 +00:00
|
|
|
.for _tool in \
|
2011-11-10 20:15:35 +00:00
|
|
|
${_clang_tblgen} \
|
2017-10-04 03:35:23 +00:00
|
|
|
${_kerberos5_bootstrap_tools} \
|
2003-07-01 12:57:53 +00:00
|
|
|
${_strfile} \
|
2020-02-29 17:10:54 +00:00
|
|
|
usr.bin/dtc \
|
2013-01-29 22:17:58 +00:00
|
|
|
${_cat} \
|
2016-03-28 19:51:45 +00:00
|
|
|
${_kbdcontrol} \
|
2018-11-05 19:51:16 +00:00
|
|
|
${_elftoolchain_libs} \
|
2017-10-25 21:46:39 +00:00
|
|
|
lib/libopenbsd \
|
|
|
|
usr.bin/mandoc \
|
2003-07-01 12:57:53 +00:00
|
|
|
usr.bin/rpcgen \
|
2009-12-31 00:07:26 +00:00
|
|
|
${_yacc} \
|
2013-05-21 19:32:35 +00:00
|
|
|
${_m4} \
|
2012-05-22 15:59:07 +00:00
|
|
|
${_lex} \
|
2018-11-05 19:51:10 +00:00
|
|
|
${_other_bootstrap_tools} \
|
2003-07-01 12:57:53 +00:00
|
|
|
usr.bin/xinstall \
|
2006-03-09 12:55:02 +00:00
|
|
|
${_gensnmptree} \
|
2020-08-25 13:29:57 +00:00
|
|
|
${_config} \
|
2019-11-18 23:28:23 +00:00
|
|
|
${_flua} \
|
2016-05-26 23:20:36 +00:00
|
|
|
${_crunchide} \
|
|
|
|
${_crunchgen} \
|
2021-01-06 17:08:52 +00:00
|
|
|
${_mkimg} \
|
2014-06-12 18:31:32 +00:00
|
|
|
${_nmtree} \
|
2015-08-08 00:18:32 +00:00
|
|
|
${_vtfontcvt} \
|
2020-11-20 20:11:59 +00:00
|
|
|
${_localedef} \
|
2021-08-02 09:49:01 +00:00
|
|
|
${_mkcsmapper} \
|
|
|
|
${_mkesdb} \
|
2020-11-20 20:11:59 +00:00
|
|
|
${LOCAL_BSTOOL_DIRS}
|
2018-11-05 19:51:10 +00:00
|
|
|
${_bt}-${_tool}: ${_bt}-links .PHONY .MAKE
|
2016-03-30 23:50:23 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
2017-11-03 23:22:03 +00:00
|
|
|
if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
|
2018-11-05 19:51:10 +00:00
|
|
|
if [ "${_tool}" = "usr.bin/lex" ]; then \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ bootstrap; \
|
|
|
|
fi; \
|
2015-12-01 19:00:43 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ all; \
|
2017-11-01 21:22:05 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${WORLDTMP}/legacy install
|
2015-02-23 05:28:17 +00:00
|
|
|
|
|
|
|
bootstrap-tools: ${_bt}-${_tool}
|
1999-12-08 13:45:11 +00:00
|
|
|
.endfor
|
2020-08-25 13:29:57 +00:00
|
|
|
.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
|
|
|
|
|
1999-11-24 06:04:11 +00:00
|
|
|
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
#
|
1999-12-20 10:32:11 +00:00
|
|
|
# build-tools: Build special purpose build tools
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
#
|
2018-01-16 21:43:36 +00:00
|
|
|
.if !defined(NO_SHARE) && ${MK_SYSCONS} != "no"
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
_share= share/syscons/scrnmaps
|
|
|
|
.endif
|
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_RESCUE} != "no"
|
2015-08-12 19:00:47 +00:00
|
|
|
# rescue includes programs that have build-tools targets
|
2015-08-12 19:39:11 +00:00
|
|
|
_rescue=rescue/rescue
|
2003-07-11 17:01:58 +00:00
|
|
|
.endif
|
|
|
|
|
2017-08-27 16:15:37 +00:00
|
|
|
.if ${MK_TCSH} != "no"
|
|
|
|
_tcsh=bin/csh
|
|
|
|
.endif
|
2017-11-13 20:07:08 +00:00
|
|
|
.if ${MK_FILE} != "no"
|
|
|
|
_libmagic=lib/libmagic
|
|
|
|
.endif
|
2017-08-27 16:15:37 +00:00
|
|
|
|
2021-05-31 14:24:04 +00:00
|
|
|
.if ${MK_PMC} != "no"
|
2018-05-26 19:29:19 +00:00
|
|
|
_jevents=lib/libpmc/pmu-events
|
2018-05-24 04:30:06 +00:00
|
|
|
.endif
|
|
|
|
|
2017-10-31 19:02:14 +00:00
|
|
|
# kernel-toolchain skips _cleanobj, so handle cleaning up previous
|
|
|
|
# build-tools directories if needed.
|
2020-09-08 00:44:35 +00:00
|
|
|
.if ${MK_CLEAN} == "yes" && make(kernel-toolchain)
|
2017-10-31 19:02:14 +00:00
|
|
|
_bt_clean= ${CLEANDIR}
|
|
|
|
.endif
|
|
|
|
|
2003-07-01 12:57:53 +00:00
|
|
|
.for _tool in \
|
2017-08-27 16:15:37 +00:00
|
|
|
${_tcsh} \
|
2003-07-01 12:57:53 +00:00
|
|
|
bin/sh \
|
2012-01-05 21:50:50 +00:00
|
|
|
${LOCAL_TOOL_DIRS} \
|
2018-05-24 04:30:06 +00:00
|
|
|
${_jevents} \
|
2021-09-23 01:52:46 +00:00
|
|
|
lib/ncurses/tinfo \
|
2015-08-12 19:21:58 +00:00
|
|
|
${_rescue} \
|
2003-07-01 12:57:53 +00:00
|
|
|
${_share} \
|
|
|
|
usr.bin/awk \
|
2017-11-13 20:07:08 +00:00
|
|
|
${_libmagic} \
|
2020-02-29 03:25:51 +00:00
|
|
|
usr.bin/vi/catalog
|
2015-10-22 05:01:14 +00:00
|
|
|
build-tools_${_tool}: .PHONY
|
2017-10-31 19:02:14 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (${_bt_clean:D${_bt_clean},}obj,build-tools)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
2017-10-31 19:02:14 +00:00
|
|
|
if [ -n "${_bt_clean}" ]; then ${MAKE} DIRPRFX=${_tool}/ ${_bt_clean}; fi; \
|
2017-11-03 23:22:03 +00:00
|
|
|
if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
|
2003-02-24 20:09:16 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ build-tools
|
2015-10-22 05:01:14 +00:00
|
|
|
build-tools: build-tools_${_tool}
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
.endfor
|
|
|
|
|
2013-11-07 04:31:21 +00:00
|
|
|
#
|
|
|
|
# kernel-tools: Build kernel-building tools
|
|
|
|
#
|
2016-04-21 16:30:16 +00:00
|
|
|
kernel-tools: .PHONY
|
2017-11-01 21:22:05 +00:00
|
|
|
mkdir -p ${WORLDTMP}/usr
|
2018-06-29 21:15:26 +00:00
|
|
|
${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
2017-11-01 21:22:05 +00:00
|
|
|
-p ${WORLDTMP}/usr >/dev/null
|
2013-11-07 04:31:21 +00:00
|
|
|
|
1999-12-20 10:32:11 +00:00
|
|
|
#
|
2015-03-25 21:59:36 +00:00
|
|
|
# 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
|
|
|
|
# to begin building the target binaries.
|
1999-12-20 10:32:11 +00:00
|
|
|
#
|
2018-11-06 09:36:59 +00:00
|
|
|
.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BUILD_WITH_STRICT_TMPPATH} != 0
|
2005-12-07 20:01:12 +00:00
|
|
|
.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
|
2003-07-01 12:57:53 +00:00
|
|
|
_btxld= usr.sbin/btxld
|
|
|
|
.endif
|
2008-04-15 05:14:42 +00:00
|
|
|
.endif
|
2002-03-20 18:25:50 +00:00
|
|
|
|
2015-09-21 16:07:22 +00:00
|
|
|
# Rebuild ctfconvert and ctfmerge to avoid difficult-to-diagnose failures
|
|
|
|
# resulting from missing bug fixes or ELF Toolchain updates.
|
|
|
|
.if ${MK_CDDL} != "no"
|
Merge OpenZFS support in to HEAD.
The primary benefit is maintaining a completely shared
code base with the community allowing FreeBSD to receive
new features sooner and with less effort.
I would advise against doing 'zpool upgrade'
or creating indispensable pools using new
features until this change has had a month+
to soak.
Work on merging FreeBSD support in to what was
at the time "ZFS on Linux" began in August 2018.
I first publicly proposed transitioning FreeBSD
to (new) OpenZFS on December 18th, 2018. FreeBSD
support in OpenZFS was finally completed in December
2019. A CFT for downstreaming OpenZFS support in
to FreeBSD was first issued on July 8th. All issues
that were reported have been addressed or, for
a couple of less critical matters there are
pull requests in progress with OpenZFS. iXsystems
has tested and dogfooded extensively internally.
The TrueNAS 12 release is based on OpenZFS with
some additional features that have not yet made
it upstream.
Improvements include:
project quotas, encrypted datasets,
allocation classes, vectorized raidz,
vectorized checksums, various command line
improvements, zstd compression.
Thanks to those who have helped along the way:
Ryan Moeller, Allan Jude, Zack Welch, and many
others.
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25872
2020-08-25 02:21:27 +00:00
|
|
|
_dtrace_tools= cddl/lib/libctf cddl/lib/libspl cddl/usr.bin/ctfconvert \
|
2015-09-21 16:07:22 +00:00
|
|
|
cddl/usr.bin/ctfmerge
|
|
|
|
.endif
|
|
|
|
|
2014-04-18 17:03:58 +00:00
|
|
|
# If we're given an XAS, don't build binutils.
|
2014-12-30 18:42:53 +00:00
|
|
|
.if ${XAS:M/*} == ""
|
2015-08-17 10:48:55 +00:00
|
|
|
.if ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no"
|
2014-12-01 17:49:42 +00:00
|
|
|
_elftctools= lib/libelftc \
|
2016-02-12 21:12:47 +00:00
|
|
|
lib/libpe \
|
2021-05-21 09:27:27 +00:00
|
|
|
usr.bin/elfctl \
|
2021-12-01 00:51:01 +00:00
|
|
|
usr.bin/elfdump \
|
2018-06-21 14:28:20 +00:00
|
|
|
usr.bin/objcopy \
|
2014-12-01 17:49:42 +00:00
|
|
|
usr.bin/nm \
|
|
|
|
usr.bin/size \
|
|
|
|
usr.bin/strings
|
2015-01-23 21:34:08 +00:00
|
|
|
# These are not required by the build, but can be useful for developers who
|
|
|
|
# cross-build on a FreeBSD 10 host:
|
|
|
|
_elftctools+= usr.bin/addr2line
|
2014-12-01 17:49:42 +00:00
|
|
|
.endif
|
2015-08-17 10:48:55 +00:00
|
|
|
.elif ${TARGET_ARCH} != ${MACHINE_ARCH} && ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no"
|
2015-03-17 19:35:50 +00:00
|
|
|
# If cross-building with an external binutils we still need to build strip for
|
|
|
|
# the target (for at least crunchide).
|
|
|
|
_elftctools= lib/libelftc \
|
2016-02-12 21:12:47 +00:00
|
|
|
lib/libpe \
|
2021-05-21 09:27:27 +00:00
|
|
|
usr.bin/elfctl \
|
2021-12-01 00:51:01 +00:00
|
|
|
usr.bin/elfdump \
|
2018-06-21 14:28:20 +00:00
|
|
|
usr.bin/objcopy
|
2011-05-19 05:13:25 +00:00
|
|
|
.endif
|
|
|
|
|
2014-04-18 17:03:58 +00:00
|
|
|
.if ${MK_CLANG_BOOTSTRAP} != "no"
|
2011-11-09 19:00:27 +00:00
|
|
|
_clang= usr.bin/clang
|
2017-04-09 01:35:19 +00:00
|
|
|
.endif
|
|
|
|
.if ${MK_LLD_BOOTSTRAP} != "no"
|
|
|
|
_lld= usr.bin/clang/lld
|
|
|
|
.endif
|
|
|
|
.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_LLD_BOOTSTRAP} != "no"
|
2011-11-10 20:15:35 +00:00
|
|
|
_clang_libs= lib/clang
|
2011-05-19 05:13:25 +00:00
|
|
|
.endif
|
2015-05-20 09:36:25 +00:00
|
|
|
.if ${MK_USB} != "no"
|
2017-11-14 23:02:19 +00:00
|
|
|
_usb_tools= stand/usb/tools
|
2015-05-20 09:36:25 +00:00
|
|
|
.endif
|
2011-05-19 05:13:25 +00:00
|
|
|
|
2018-11-05 19:51:10 +00:00
|
|
|
.if ${BUILD_WITH_STRICT_TMPPATH} != 0 || defined(BOOTSTRAP_ALL_TOOLS)
|
|
|
|
_ar=usr.bin/ar
|
|
|
|
.endif
|
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
cross-tools: .MAKE .PHONY
|
2003-07-01 12:57:53 +00:00
|
|
|
.for _tool in \
|
2016-07-21 06:06:11 +00:00
|
|
|
${LOCAL_XTOOL_DIRS} \
|
2018-11-05 19:51:10 +00:00
|
|
|
${_ar} \
|
2010-08-21 15:39:06 +00:00
|
|
|
${_clang_libs} \
|
|
|
|
${_clang} \
|
2017-01-25 21:05:48 +00:00
|
|
|
${_lld} \
|
2014-12-01 17:49:42 +00:00
|
|
|
${_elftctools} \
|
2015-09-21 16:07:22 +00:00
|
|
|
${_dtrace_tools} \
|
2003-07-01 12:57:53 +00:00
|
|
|
${_btxld} \
|
2015-05-20 09:36:25 +00:00
|
|
|
${_usb_tools}
|
2016-03-30 23:50:23 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
2017-11-03 23:22:03 +00:00
|
|
|
if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
|
2015-12-01 19:00:43 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ all; \
|
2017-11-01 21:22:05 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${WORLDTMP} install
|
1999-12-20 10:32:11 +00:00
|
|
|
.endfor
|
|
|
|
|
2017-10-25 21:46:36 +00:00
|
|
|
#
|
2015-04-30 00:17:32 +00:00
|
|
|
# native-xtools is the current target for qemu-user cross builds of ports
|
|
|
|
# via poudriere and the imgact_binmisc kernel module.
|
2017-10-25 21:46:36 +00:00
|
|
|
# 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
|
|
|
|
# already built. It then installs the static tools to NXBDESTDIR for Poudriere
|
|
|
|
# to pickup.
|
|
|
|
#
|
2017-11-01 21:22:13 +00:00
|
|
|
NXBOBJROOT= ${OBJROOT}${MACHINE}.${MACHINE_ARCH}/nxb/
|
2017-11-10 19:53:07 +00:00
|
|
|
NXBOBJTOP= ${NXBOBJROOT}${NXB_TARGET}.${NXB_TARGET_ARCH}
|
2017-10-29 01:21:29 +00:00
|
|
|
NXTP?= /nxb-bin
|
|
|
|
.if ${NXTP:N/*}
|
|
|
|
.error NXTP variable should be an absolute path
|
|
|
|
.endif
|
|
|
|
NXBDESTDIR?= ${DESTDIR}${NXTP}
|
2017-10-25 21:46:36 +00:00
|
|
|
|
|
|
|
# This is the list of tools to be built/installed as static and where
|
|
|
|
# appropriate to build for the given TARGET.TARGET_ARCH.
|
|
|
|
NXBDIRS+= \
|
2014-11-16 20:10:37 +00:00
|
|
|
bin/cat \
|
|
|
|
bin/chmod \
|
|
|
|
bin/cp \
|
2017-08-27 16:15:37 +00:00
|
|
|
${_tcsh} \
|
2014-11-16 23:31:23 +00:00
|
|
|
bin/echo \
|
2014-11-16 20:10:37 +00:00
|
|
|
bin/expr \
|
2014-11-16 23:31:23 +00:00
|
|
|
bin/hostname \
|
2014-11-16 20:10:37 +00:00
|
|
|
bin/ln \
|
|
|
|
bin/ls \
|
|
|
|
bin/mkdir \
|
2014-11-16 23:31:23 +00:00
|
|
|
bin/mv \
|
2014-11-16 20:10:37 +00:00
|
|
|
bin/ps \
|
|
|
|
bin/realpath \
|
|
|
|
bin/rm \
|
|
|
|
bin/rmdir \
|
2014-11-13 22:25:22 +00:00
|
|
|
bin/sh \
|
2014-11-16 20:10:37 +00:00
|
|
|
bin/sleep \
|
2014-11-13 22:25:22 +00:00
|
|
|
sbin/md5 \
|
2014-11-16 20:10:37 +00:00
|
|
|
sbin/sysctl \
|
2017-10-25 21:46:36 +00:00
|
|
|
usr.bin/addr2line \
|
|
|
|
usr.bin/ar \
|
2014-08-18 21:04:44 +00:00
|
|
|
usr.bin/awk \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/basename \
|
2014-08-18 21:04:44 +00:00
|
|
|
usr.bin/bmake \
|
2014-11-13 22:25:22 +00:00
|
|
|
usr.bin/bzip2 \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/cmp \
|
2017-10-25 21:46:36 +00:00
|
|
|
usr.bin/diff \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/dirname \
|
2018-06-21 14:28:20 +00:00
|
|
|
usr.bin/objcopy \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/env \
|
2014-11-13 22:25:22 +00:00
|
|
|
usr.bin/fetch \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/find \
|
|
|
|
usr.bin/grep \
|
2014-11-13 22:25:22 +00:00
|
|
|
usr.bin/gzip \
|
2019-06-20 13:24:58 +00:00
|
|
|
usr.bin/head \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/id \
|
2014-08-18 21:04:44 +00:00
|
|
|
usr.bin/lex \
|
2016-11-10 16:27:34 +00:00
|
|
|
usr.bin/limits \
|
2017-10-25 21:46:36 +00:00
|
|
|
usr.bin/mandoc \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/mktemp \
|
|
|
|
usr.bin/mt \
|
2017-10-25 21:46:36 +00:00
|
|
|
usr.bin/nm \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/patch \
|
2017-02-03 16:27:23 +00:00
|
|
|
usr.bin/readelf \
|
2014-08-18 21:04:44 +00:00
|
|
|
usr.bin/sed \
|
2017-10-25 21:46:36 +00:00
|
|
|
usr.bin/size \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/sort \
|
2017-10-25 21:46:36 +00:00
|
|
|
usr.bin/strings \
|
2014-11-13 22:25:22 +00:00
|
|
|
usr.bin/tar \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/touch \
|
|
|
|
usr.bin/tr \
|
|
|
|
usr.bin/true \
|
|
|
|
usr.bin/uniq \
|
2014-11-13 22:25:22 +00:00
|
|
|
usr.bin/unzip \
|
2019-05-08 15:17:36 +00:00
|
|
|
usr.bin/wc \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/xargs \
|
|
|
|
usr.bin/xinstall \
|
2014-11-13 22:25:22 +00:00
|
|
|
usr.bin/xz \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/yacc \
|
|
|
|
usr.sbin/chown
|
2017-10-25 21:46:36 +00:00
|
|
|
|
2017-11-10 19:53:07 +00:00
|
|
|
SUBDIR_DEPEND_usr.bin/clang= lib/clang
|
2017-10-25 21:46:36 +00:00
|
|
|
.if ${MK_CLANG} != "no"
|
|
|
|
NXBDIRS+= lib/clang
|
|
|
|
NXBDIRS+= usr.bin/clang
|
2017-11-10 19:53:07 +00:00
|
|
|
.endif
|
|
|
|
# XXX: native-xtools passes along ${NXBDIRS} in SUBDIR_OVERRIDE that needs
|
|
|
|
# to be evaluated after NXBDIRS is set.
|
|
|
|
.if make(install) && !empty(SUBDIR_OVERRIDE)
|
|
|
|
SUBDIR= ${SUBDIR_OVERRIDE}
|
|
|
|
.endif
|
2017-10-25 21:46:36 +00:00
|
|
|
|
|
|
|
NXBMAKEARGS+= \
|
2017-11-01 21:22:05 +00:00
|
|
|
OBJTOP=${NXBOBJTOP:Q} \
|
|
|
|
OBJROOT=${NXBOBJROOT:Q} \
|
2017-10-25 21:46:36 +00:00
|
|
|
-DNO_SHARED \
|
|
|
|
-DNO_CPU_CFLAGS \
|
|
|
|
-DNO_PIC \
|
2019-05-08 15:17:36 +00:00
|
|
|
MK_CASPER=no \
|
2017-10-25 21:46:36 +00:00
|
|
|
MK_CLANG_EXTRAS=no \
|
2020-06-24 17:03:42 +00:00
|
|
|
MK_CLANG_FORMAT=no \
|
2017-10-25 21:46:36 +00:00
|
|
|
MK_CLANG_FULL=no \
|
|
|
|
MK_CTF=no \
|
|
|
|
MK_DEBUG_FILES=no \
|
|
|
|
MK_HTML=no \
|
|
|
|
MK_LLDB=no \
|
|
|
|
MK_MAN=no \
|
|
|
|
MK_MAN_UTILS=yes \
|
|
|
|
MK_OFED=no \
|
|
|
|
MK_OPENSSH=no \
|
|
|
|
MK_PROFILE=no \
|
2018-10-21 00:27:59 +00:00
|
|
|
MK_RETPOLINE=no \
|
2017-10-25 21:46:36 +00:00
|
|
|
MK_SENDMAIL=no \
|
2021-08-04 18:20:50 +00:00
|
|
|
MK_SSP=no \
|
2017-10-25 21:46:36 +00:00
|
|
|
MK_TESTS=no \
|
2021-01-06 17:55:06 +00:00
|
|
|
MK_WERROR=no \
|
2017-10-25 21:46:36 +00:00
|
|
|
MK_ZFS=no
|
|
|
|
|
2021-08-03 15:20:57 +00:00
|
|
|
NXBMAKEENV+= \
|
|
|
|
MAKEOBJDIRPREFIX=
|
|
|
|
|
2021-10-13 09:21:28 +00:00
|
|
|
# This should match all of the knobs in lib/Makefile that it takes to avoid
|
|
|
|
# descending into lib/clang!
|
|
|
|
NXBTNOTOOLS= MK_CLANG=no MK_LLD=no MK_LLDB=no MK_LLVM_BINUTILS=no
|
|
|
|
|
2017-11-10 19:53:07 +00:00
|
|
|
.if make(native-xtools*) && \
|
|
|
|
(!defined(NXB_TARGET) || !defined(NXB_TARGET_ARCH))
|
|
|
|
.error Missing NXB_TARGET / NXB_TARGET_ARCH
|
|
|
|
.endif
|
2017-10-25 21:46:36 +00:00
|
|
|
# For 'toolchain' we want to produce native binaries that themselves generate
|
|
|
|
# native binaries.
|
|
|
|
NXBTMAKE= ${NXBMAKEENV} ${MAKE} ${NXBMAKEARGS:N-DNO_PIC:N-DNO_SHARED} \
|
|
|
|
TARGET=${MACHINE} TARGET_ARCH=${MACHINE_ARCH}
|
|
|
|
# For 'everything' we want to produce native binaries (hence -target to
|
|
|
|
# be MACHINE) that themselves generate TARGET.TARGET_ARCH binaries.
|
|
|
|
# TARGET/TARGET_ARCH are still passed along from user.
|
2017-11-10 19:53:07 +00:00
|
|
|
#
|
|
|
|
# Use the toolchain we create as an external toolchain.
|
|
|
|
.if ${USING_SYSTEM_COMPILER} == "yes" || ${XCC:N${CCACHE_BIN}:M/*}
|
|
|
|
NXBMAKE+= XCC="${XCC}" \
|
|
|
|
XCXX="${XCXX}" \
|
|
|
|
XCPP="${XCPP}"
|
|
|
|
.else
|
|
|
|
NXBMAKE+= XCC="${NXBOBJTOP}/tmp/usr/bin/cc" \
|
|
|
|
XCXX="${NXBOBJTOP}/tmp/usr/bin/c++" \
|
|
|
|
XCPP="${NXBOBJTOP}/tmp/usr/bin/cpp"
|
|
|
|
.endif
|
|
|
|
NXBMAKE+= ${NXBMAKEENV} ${MAKE} -f Makefile.inc1 ${NXBMAKEARGS} \
|
2020-03-24 23:25:54 +00:00
|
|
|
MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH} \
|
2017-11-10 19:53:07 +00:00
|
|
|
TARGET=${NXB_TARGET} TARGET_ARCH=${NXB_TARGET_ARCH} \
|
2017-10-25 21:46:36 +00:00
|
|
|
TARGET_TRIPLE=${MACHINE_TRIPLE:Q}
|
2017-11-10 19:53:07 +00:00
|
|
|
# NXBDIRS is improperly based on MACHINE rather than NXB_TARGET. Need to
|
2020-02-29 03:25:51 +00:00
|
|
|
# invoke a sub-make to reevaluate MK_CLANG, etc, for NXBDIRS.
|
2017-11-10 19:53:07 +00:00
|
|
|
NXBMAKE+= SUBDIR_OVERRIDE='$${NXBDIRS:M*}'
|
|
|
|
# Need to avoid the -isystem logic when using clang as an external toolchain
|
|
|
|
# even if the TARGET being built for wants GCC.
|
|
|
|
NXBMAKE+= WANT_COMPILER_TYPE='$${X_COMPILER_TYPE}'
|
2017-10-25 21:46:36 +00:00
|
|
|
native-xtools: .PHONY
|
2020-02-29 03:25:51 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${NXBTMAKE} _cleanobj
|
2017-10-25 21:46:36 +00:00
|
|
|
# Build the bootstrap/host/cross tools that produce native binaries
|
2020-02-29 03:25:51 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${NXBTMAKE} kernel-toolchain
|
2017-10-25 21:46:36 +00:00
|
|
|
# Populate includes/libraries sysroot that produce native binaries.
|
|
|
|
# This is split out from 'toolchain' above mostly so that target LLVM
|
|
|
|
# libraries have a proper LLVM_DEFAULT_TARGET_TRIPLE without
|
2021-10-13 09:21:28 +00:00
|
|
|
# polluting the cross-compiler build. The LLVM libs are skipped
|
2017-10-25 21:46:36 +00:00
|
|
|
# here to avoid the problem but are kept in 'toolchain' so that
|
|
|
|
# needed build tools are built.
|
2021-10-13 09:21:28 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${NXBTMAKE} _includes ${NXBTNOTOOLS}
|
|
|
|
${_+_}cd ${.CURDIR}; ${NXBTMAKE} _libraries ${NXBTNOTOOLS}
|
2017-11-03 23:22:03 +00:00
|
|
|
.if !defined(NO_OBJWALK)
|
2017-11-10 19:53:07 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${NXBMAKE} _obj
|
2017-10-25 21:46:36 +00:00
|
|
|
.endif
|
2017-11-10 19:53:07 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${NXBMAKE} everything
|
2017-10-29 01:21:29 +00:00
|
|
|
@echo ">> native-xtools done. Use 'make native-xtools-install' to install to a given DESTDIR"
|
|
|
|
|
|
|
|
native-xtools-install: .PHONY
|
2017-10-25 21:46:36 +00:00
|
|
|
mkdir -p ${NXBDESTDIR}/bin ${NXBDESTDIR}/sbin ${NXBDESTDIR}/usr
|
2018-06-29 21:15:26 +00:00
|
|
|
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
2017-10-25 21:46:36 +00:00
|
|
|
-p ${NXBDESTDIR}/usr >/dev/null
|
2018-06-29 21:15:26 +00:00
|
|
|
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
2017-10-25 21:46:36 +00:00
|
|
|
-p ${NXBDESTDIR}/usr/include >/dev/null
|
2017-11-10 19:53:07 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${NXBMAKE} \
|
2017-10-25 21:46:36 +00:00
|
|
|
DESTDIR=${NXBDESTDIR} \
|
|
|
|
-DNO_ROOT \
|
|
|
|
install
|
2014-08-18 21:04:44 +00:00
|
|
|
|
1999-11-24 06:04:11 +00:00
|
|
|
#
|
1999-12-08 13:45:11 +00:00
|
|
|
# hierarchy - ensure that all the needed directories are present
|
1999-11-24 06:04:11 +00:00
|
|
|
#
|
2015-10-21 05:33:48 +00:00
|
|
|
hierarchy hier: .MAKE .PHONY
|
2015-12-01 19:00:43 +00:00
|
|
|
${_+_}cd ${.CURDIR}/etc; ${HMAKE} distrib-dirs
|
1998-08-31 01:08:08 +00:00
|
|
|
|
|
|
|
#
|
1999-12-08 13:45:11 +00:00
|
|
|
# libraries - build all libraries, and install them under ${DESTDIR}.
|
1999-11-24 06:04:11 +00:00
|
|
|
#
|
2002-04-12 19:46:25 +00:00
|
|
|
# The list of libraries with dependents (${_prebuild_libs}) and their
|
|
|
|
# interdependencies (__L) are built automatically by the
|
|
|
|
# ${.CURDIR}/tools/make_libdeps.sh script.
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
2015-10-21 05:33:48 +00:00
|
|
|
libraries: .MAKE .PHONY
|
2015-12-01 19:00:43 +00:00
|
|
|
${_+_}cd ${.CURDIR}; \
|
|
|
|
${MAKE} -f Makefile.inc1 _prereq_libs; \
|
|
|
|
${MAKE} -f Makefile.inc1 _startup_libs; \
|
|
|
|
${MAKE} -f Makefile.inc1 _prebuild_libs; \
|
2013-07-06 00:13:08 +00:00
|
|
|
${MAKE} -f Makefile.inc1 _generic_libs
|
2002-04-12 19:46:25 +00:00
|
|
|
|
2007-05-19 03:34:59 +00:00
|
|
|
#
|
|
|
|
# static libgcc.a prerequisite for shared libc
|
|
|
|
#
|
2016-11-04 19:35:49 +00:00
|
|
|
_prereq_libs= lib/libcompiler_rt
|
2016-10-20 21:29:59 +00:00
|
|
|
.if ${MK_SSP} != "no"
|
2020-01-04 20:19:25 +00:00
|
|
|
_prereq_libs+= lib/libssp_nonshared
|
2016-10-20 21:29:59 +00:00
|
|
|
.endif
|
2021-08-02 08:48:21 +00:00
|
|
|
.if ${MK_ASAN} != "no"
|
|
|
|
_prereq_libs+= lib/libclang_rt/asan
|
|
|
|
_prereq_libs+= lib/libclang_rt/asan-preinit
|
|
|
|
_prereq_libs+= lib/libclang_rt/asan_cxx
|
|
|
|
.endif
|
|
|
|
.if ${MK_UBSAN} != "no"
|
|
|
|
_prereq_libs+= lib/libclang_rt/ubsan_minimal
|
|
|
|
_prereq_libs+= lib/libclang_rt/ubsan_standalone
|
|
|
|
_prereq_libs+= lib/libclang_rt/ubsan_standalone_cxx
|
|
|
|
.endif
|
2007-05-19 03:34:59 +00:00
|
|
|
|
2002-04-16 14:38:15 +00:00
|
|
|
# These dependencies are not automatically generated:
|
|
|
|
#
|
2020-02-29 12:43:43 +00:00
|
|
|
# lib/csu and lib/libc must be built before
|
2007-05-19 03:34:59 +00:00
|
|
|
# all shared libraries for ELF.
|
2002-04-16 14:38:15 +00:00
|
|
|
#
|
2018-12-04 18:51:28 +00:00
|
|
|
_startup_libs= lib/csu
|
2007-05-19 03:34:59 +00:00
|
|
|
_startup_libs+= lib/libc
|
2013-11-17 22:52:17 +00:00
|
|
|
_startup_libs+= lib/libc_nonshared
|
2021-01-30 17:56:35 +00:00
|
|
|
.if ${MK_CXX} != "no"
|
2011-11-25 20:59:04 +00:00
|
|
|
_startup_libs+= lib/libcxxrt
|
|
|
|
.endif
|
2007-05-19 03:34:59 +00:00
|
|
|
|
2016-11-04 19:35:49 +00:00
|
|
|
_prereq_libs+= lib/libgcc_eh lib/libgcc_s
|
|
|
|
_startup_libs+= lib/libgcc_eh lib/libgcc_s
|
|
|
|
|
|
|
|
lib/libgcc_s__L: lib/libc__L
|
|
|
|
lib/libgcc_s__L: lib/libc_nonshared__L
|
2021-01-30 17:56:35 +00:00
|
|
|
.if ${MK_CXX} != "no"
|
2016-11-04 19:35:49 +00:00
|
|
|
lib/libcxxrt__L: lib/libgcc_s__L
|
|
|
|
.endif
|
1998-08-31 01:08:08 +00:00
|
|
|
|
2012-03-22 08:48:42 +00:00
|
|
|
_prebuild_libs= ${_kerberos5_lib_libasn1} \
|
|
|
|
${_kerberos5_lib_libhdb} \
|
|
|
|
${_kerberos5_lib_libheimbase} \
|
2011-09-27 07:14:12 +00:00
|
|
|
${_kerberos5_lib_libheimntlm} \
|
2015-05-20 18:56:29 +00:00
|
|
|
${_libsqlite3} \
|
2012-03-22 08:48:42 +00:00
|
|
|
${_kerberos5_lib_libheimipcc} \
|
2010-01-26 10:00:26 +00:00
|
|
|
${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \
|
|
|
|
${_kerberos5_lib_libroken} \
|
2012-03-22 08:48:42 +00:00
|
|
|
${_kerberos5_lib_libwind} \
|
2012-03-23 03:16:35 +00:00
|
|
|
lib/libbz2 ${_libcom_err} lib/libcrypt \
|
2013-04-20 08:13:35 +00:00
|
|
|
lib/libelf lib/libexpat \
|
2014-11-06 22:53:50 +00:00
|
|
|
lib/libfigpar \
|
2014-03-14 02:58:48 +00:00
|
|
|
${_lib_libgssapi} \
|
2020-10-24 17:08:59 +00:00
|
|
|
lib/libjail \
|
2013-12-02 08:21:28 +00:00
|
|
|
lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \
|
2019-09-18 07:57:56 +00:00
|
|
|
lib/libzstd \
|
2016-02-25 18:23:40 +00:00
|
|
|
${_lib_casper} \
|
2021-09-23 01:52:46 +00:00
|
|
|
lib/ncurses/tinfo \
|
2021-01-04 16:29:40 +00:00
|
|
|
lib/ncurses/ncurses \
|
2021-11-24 18:56:38 +00:00
|
|
|
lib/ncurses/form \
|
2021-01-20 14:01:25 +00:00
|
|
|
lib/libopie lib/libpam/libpam lib/libthr \
|
2015-02-04 06:53:45 +00:00
|
|
|
${_lib_libradius} lib/libsbuf lib/libtacplus \
|
2014-10-03 20:36:09 +00:00
|
|
|
lib/libgeom \
|
2012-07-30 23:14:24 +00:00
|
|
|
${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \
|
2014-10-03 20:36:09 +00:00
|
|
|
${_cddl_lib_libuutil} \
|
2014-05-22 05:33:50 +00:00
|
|
|
${_cddl_lib_libavl} \
|
Merge OpenZFS support in to HEAD.
The primary benefit is maintaining a completely shared
code base with the community allowing FreeBSD to receive
new features sooner and with less effort.
I would advise against doing 'zpool upgrade'
or creating indispensable pools using new
features until this change has had a month+
to soak.
Work on merging FreeBSD support in to what was
at the time "ZFS on Linux" began in August 2018.
I first publicly proposed transitioning FreeBSD
to (new) OpenZFS on December 18th, 2018. FreeBSD
support in OpenZFS was finally completed in December
2019. A CFT for downstreaming OpenZFS support in
to FreeBSD was first issued on July 8th. All issues
that were reported have been addressed or, for
a couple of less critical matters there are
pull requests in progress with OpenZFS. iXsystems
has tested and dogfooded extensively internally.
The TrueNAS 12 release is based on OpenZFS with
some additional features that have not yet made
it upstream.
Improvements include:
project quotas, encrypted datasets,
allocation classes, vectorized raidz,
vectorized checksums, various command line
improvements, zstd compression.
Thanks to those who have helped along the way:
Ryan Moeller, Allan Jude, Zack Welch, and many
others.
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25872
2020-08-25 02:21:27 +00:00
|
|
|
${_cddl_lib_libicp} \
|
|
|
|
${_cddl_lib_libicp_rescue} \
|
|
|
|
${_cddl_lib_libspl} \
|
|
|
|
${_cddl_lib_libtpool} \
|
2018-08-11 20:32:50 +00:00
|
|
|
${_cddl_lib_libzfs_core} ${_cddl_lib_libzfs} \
|
Merge OpenZFS support in to HEAD.
The primary benefit is maintaining a completely shared
code base with the community allowing FreeBSD to receive
new features sooner and with less effort.
I would advise against doing 'zpool upgrade'
or creating indispensable pools using new
features until this change has had a month+
to soak.
Work on merging FreeBSD support in to what was
at the time "ZFS on Linux" began in August 2018.
I first publicly proposed transitioning FreeBSD
to (new) OpenZFS on December 18th, 2018. FreeBSD
support in OpenZFS was finally completed in December
2019. A CFT for downstreaming OpenZFS support in
to FreeBSD was first issued on July 8th. All issues
that were reported have been addressed or, for
a couple of less critical matters there are
pull requests in progress with OpenZFS. iXsystems
has tested and dogfooded extensively internally.
The TrueNAS 12 release is based on OpenZFS with
some additional features that have not yet made
it upstream.
Improvements include:
project quotas, encrypted datasets,
allocation classes, vectorized raidz,
vectorized checksums, various command line
improvements, zstd compression.
Thanks to those who have helped along the way:
Ryan Moeller, Allan Jude, Zack Welch, and many
others.
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25872
2020-08-25 02:21:27 +00:00
|
|
|
${_cddl_lib_libzutil} \
|
loader: zfs should support bootonce an nextboot
bootonce feature is temporary, one time boot, activated by
"bectl activate -t BE", "bectl activate -T BE" will reset the bootonce flag.
By default, the bootonce setting is reset on attempt to boot and the next
boot will use previously active BE.
By setting zfs_bootonce_activate="YES" in rc.conf, the bootonce BE will
be set permanently active.
bootonce dataset name is recorded in boot pool labels, bootenv area.
in case of nextboot, the nextboot_enable boolean variable is recorded in
freebsd:nvstore nvlist, also stored in boot pool label bootenv area.
On boot, the loader will process /boot/nextboot.conf if nextboot_enable
is "YES", and will set nextboot_enable to "NO", preventing /boot/nextboot.conf
processing on next boot.
bootonce and nextboot features are usable in both UEFI and BIOS boot.
To use bootonce/nextboot features, the boot loader needs to be updated on disk;
if loader.efi is stored on ESP, then ESP needs to be updated and
for BIOS boot, stage2 (zfsboot or gptzfsboot) needs to be updated
(gpart or other tools).
At this time, only lua loader is updated.
Sponsored by: Netflix, Klara Inc.
Differential Revision: https://reviews.freebsd.org/D25512
2020-09-21 09:01:10 +00:00
|
|
|
${_cddl_lib_libctf} ${_cddl_lib_libzfsbootenv} \
|
2018-06-25 19:55:15 +00:00
|
|
|
lib/libufs \
|
2013-12-01 09:41:06 +00:00
|
|
|
lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \
|
2018-10-12 05:42:38 +00:00
|
|
|
${_secure_lib_libcrypto} ${_secure_lib_libssl} \
|
|
|
|
${_lib_libldns} ${_secure_lib_libssh}
|
2016-04-14 01:17:03 +00:00
|
|
|
|
2016-09-27 18:08:38 +00:00
|
|
|
.if ${MK_DIALOG} != "no"
|
|
|
|
_prebuild_libs+= gnu/lib/libdialog
|
2021-09-23 01:52:46 +00:00
|
|
|
gnu/lib/libdialog__L: lib/msun__L lib/ncurses/tinfo__L lib/ncurses/ncurses__L
|
2016-09-27 18:08:38 +00:00
|
|
|
.endif
|
|
|
|
|
2020-08-04 03:43:28 +00:00
|
|
|
.if ${MK_GOOGLETEST} != "no"
|
|
|
|
_prebuild_libs+= lib/libregex
|
|
|
|
.endif
|
|
|
|
|
2021-01-30 17:56:35 +00:00
|
|
|
.if ${MK_CXX} != "no"
|
2015-03-17 15:16:36 +00:00
|
|
|
_prebuild_libs+= lib/libc++
|
|
|
|
.endif
|
|
|
|
|
2020-04-25 20:24:41 +00:00
|
|
|
lib/libgeom__L: lib/libexpat__L lib/libsbuf__L
|
2015-11-27 18:58:26 +00:00
|
|
|
lib/libkvm__L: lib/libelf__L
|
2014-10-03 20:36:09 +00:00
|
|
|
|
2015-02-04 06:53:45 +00:00
|
|
|
.if ${MK_RADIUS_SUPPORT} != "no"
|
|
|
|
_lib_libradius= lib/libradius
|
|
|
|
.endif
|
|
|
|
|
2021-10-07 03:01:05 +00:00
|
|
|
lib/ncurses/ncurses__L: lib/ncurses/tinfo__L
|
2021-11-24 18:56:38 +00:00
|
|
|
lib/ncurses/form__L: lib/ncurses/ncurses__L
|
2021-10-07 03:01:05 +00:00
|
|
|
|
2011-03-21 09:58:24 +00:00
|
|
|
.if ${MK_OFED} != "no"
|
2018-06-16 15:05:05 +00:00
|
|
|
_prebuild_libs+= \
|
|
|
|
lib/ofed/libibverbs \
|
|
|
|
lib/ofed/libibmad \
|
|
|
|
lib/ofed/libibumad \
|
|
|
|
lib/ofed/complib \
|
|
|
|
lib/ofed/libmlx5
|
2017-11-24 09:01:08 +00:00
|
|
|
|
2018-06-16 15:05:05 +00:00
|
|
|
lib/ofed/libibmad__L: lib/ofed/libibumad__L
|
|
|
|
lib/ofed/complib__L: lib/libthr__L
|
|
|
|
lib/ofed/libmlx5__L: lib/ofed/libibverbs__L lib/libthr__L
|
2011-03-21 09:58:24 +00:00
|
|
|
.endif
|
|
|
|
|
2013-12-02 08:21:28 +00:00
|
|
|
.if ${MK_CASPER} != "no"
|
2016-02-25 18:23:40 +00:00
|
|
|
_lib_casper= lib/libcasper
|
2013-12-02 08:21:28 +00:00
|
|
|
.endif
|
|
|
|
|
2013-12-01 09:41:06 +00:00
|
|
|
lib/libpjdlog__L: lib/libutil__L
|
2016-02-25 18:23:40 +00:00
|
|
|
lib/libcasper__L: lib/libnv__L
|
2020-06-22 03:44:01 +00:00
|
|
|
lib/liblzma__L: lib/libmd__L lib/libthr__L
|
2019-09-20 09:45:38 +00:00
|
|
|
lib/libzstd__L: lib/libthr__L
|
2013-12-01 09:41:06 +00:00
|
|
|
|
2020-03-26 08:23:09 +00:00
|
|
|
_generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib}
|
2017-11-10 07:52:58 +00:00
|
|
|
.if ${MK_IPFILTER} != "no"
|
|
|
|
_generic_libs+= sbin/ipf/libipf
|
|
|
|
.endif
|
2012-06-15 19:40:59 +00:00
|
|
|
.for _DIR in ${LOCAL_LIB_DIRS}
|
2017-12-31 18:53:13 +00:00
|
|
|
.if ${_DIR} == ".WAIT" || (empty(_generic_libs:M${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile))
|
2012-06-15 19:40:59 +00:00
|
|
|
_generic_libs+= ${_DIR}
|
|
|
|
.endif
|
|
|
|
.endfor
|
2002-04-16 14:38:15 +00:00
|
|
|
|
2006-10-07 19:26:46 +00:00
|
|
|
lib/libopie__L lib/libtacplus__L: lib/libmd__L
|
2002-04-16 14:38:15 +00:00
|
|
|
|
2007-04-06 02:13:30 +00:00
|
|
|
.if ${MK_CDDL} != "no"
|
2011-02-27 19:44:10 +00:00
|
|
|
_cddl_lib_libumem= cddl/lib/libumem
|
2012-07-30 23:14:24 +00:00
|
|
|
_cddl_lib_libnvpair= cddl/lib/libnvpair
|
2014-05-22 05:33:50 +00:00
|
|
|
_cddl_lib_libavl= cddl/lib/libavl
|
2014-10-03 20:36:09 +00:00
|
|
|
_cddl_lib_libuutil= cddl/lib/libuutil
|
Merge OpenZFS support in to HEAD.
The primary benefit is maintaining a completely shared
code base with the community allowing FreeBSD to receive
new features sooner and with less effort.
I would advise against doing 'zpool upgrade'
or creating indispensable pools using new
features until this change has had a month+
to soak.
Work on merging FreeBSD support in to what was
at the time "ZFS on Linux" began in August 2018.
I first publicly proposed transitioning FreeBSD
to (new) OpenZFS on December 18th, 2018. FreeBSD
support in OpenZFS was finally completed in December
2019. A CFT for downstreaming OpenZFS support in
to FreeBSD was first issued on July 8th. All issues
that were reported have been addressed or, for
a couple of less critical matters there are
pull requests in progress with OpenZFS. iXsystems
has tested and dogfooded extensively internally.
The TrueNAS 12 release is based on OpenZFS with
some additional features that have not yet made
it upstream.
Improvements include:
project quotas, encrypted datasets,
allocation classes, vectorized raidz,
vectorized checksums, various command line
improvements, zstd compression.
Thanks to those who have helped along the way:
Ryan Moeller, Allan Jude, Zack Welch, and many
others.
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25872
2020-08-25 02:21:27 +00:00
|
|
|
_cddl_lib_libspl= cddl/lib/libspl
|
|
|
|
|
2021-11-26 14:27:19 +00:00
|
|
|
cddl/lib/libavl__L: cddl/lib/libspl__L
|
|
|
|
cddl/lib/libnvpair__L: cddl/lib/libspl__L
|
Merge OpenZFS support in to HEAD.
The primary benefit is maintaining a completely shared
code base with the community allowing FreeBSD to receive
new features sooner and with less effort.
I would advise against doing 'zpool upgrade'
or creating indispensable pools using new
features until this change has had a month+
to soak.
Work on merging FreeBSD support in to what was
at the time "ZFS on Linux" began in August 2018.
I first publicly proposed transitioning FreeBSD
to (new) OpenZFS on December 18th, 2018. FreeBSD
support in OpenZFS was finally completed in December
2019. A CFT for downstreaming OpenZFS support in
to FreeBSD was first issued on July 8th. All issues
that were reported have been addressed or, for
a couple of less critical matters there are
pull requests in progress with OpenZFS. iXsystems
has tested and dogfooded extensively internally.
The TrueNAS 12 release is based on OpenZFS with
some additional features that have not yet made
it upstream.
Improvements include:
project quotas, encrypted datasets,
allocation classes, vectorized raidz,
vectorized checksums, various command line
improvements, zstd compression.
Thanks to those who have helped along the way:
Ryan Moeller, Allan Jude, Zack Welch, and many
others.
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25872
2020-08-25 02:21:27 +00:00
|
|
|
cddl/lib/libuutil__L: cddl/lib/libavl__L cddl/lib/libspl__L
|
|
|
|
|
2017-07-25 20:43:37 +00:00
|
|
|
.if ${MK_ZFS} != "no"
|
Merge OpenZFS support in to HEAD.
The primary benefit is maintaining a completely shared
code base with the community allowing FreeBSD to receive
new features sooner and with less effort.
I would advise against doing 'zpool upgrade'
or creating indispensable pools using new
features until this change has had a month+
to soak.
Work on merging FreeBSD support in to what was
at the time "ZFS on Linux" began in August 2018.
I first publicly proposed transitioning FreeBSD
to (new) OpenZFS on December 18th, 2018. FreeBSD
support in OpenZFS was finally completed in December
2019. A CFT for downstreaming OpenZFS support in
to FreeBSD was first issued on July 8th. All issues
that were reported have been addressed or, for
a couple of less critical matters there are
pull requests in progress with OpenZFS. iXsystems
has tested and dogfooded extensively internally.
The TrueNAS 12 release is based on OpenZFS with
some additional features that have not yet made
it upstream.
Improvements include:
project quotas, encrypted datasets,
allocation classes, vectorized raidz,
vectorized checksums, various command line
improvements, zstd compression.
Thanks to those who have helped along the way:
Ryan Moeller, Allan Jude, Zack Welch, and many
others.
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25872
2020-08-25 02:21:27 +00:00
|
|
|
_cddl_lib_libicp= cddl/lib/libicp
|
|
|
|
_cddl_lib_libicp_rescue= cddl/lib/libicp_rescue
|
|
|
|
_cddl_lib_libtpool= cddl/lib/libtpool
|
|
|
|
_cddl_lib_libzutil= cddl/lib/libzutil
|
2013-03-05 08:09:53 +00:00
|
|
|
_cddl_lib_libzfs_core= cddl/lib/libzfs_core
|
2018-08-11 20:32:50 +00:00
|
|
|
_cddl_lib_libzfs= cddl/lib/libzfs
|
loader: zfs should support bootonce an nextboot
bootonce feature is temporary, one time boot, activated by
"bectl activate -t BE", "bectl activate -T BE" will reset the bootonce flag.
By default, the bootonce setting is reset on attempt to boot and the next
boot will use previously active BE.
By setting zfs_bootonce_activate="YES" in rc.conf, the bootonce BE will
be set permanently active.
bootonce dataset name is recorded in boot pool labels, bootenv area.
in case of nextboot, the nextboot_enable boolean variable is recorded in
freebsd:nvstore nvlist, also stored in boot pool label bootenv area.
On boot, the loader will process /boot/nextboot.conf if nextboot_enable
is "YES", and will set nextboot_enable to "NO", preventing /boot/nextboot.conf
processing on next boot.
bootonce and nextboot features are usable in both UEFI and BIOS boot.
To use bootonce/nextboot features, the boot loader needs to be updated on disk;
if loader.efi is stored on ESP, then ESP needs to be updated and
for BIOS boot, stage2 (zfsboot or gptzfsboot) needs to be updated
(gpart or other tools).
At this time, only lua loader is updated.
Sponsored by: Netflix, Klara Inc.
Differential Revision: https://reviews.freebsd.org/D25512
2020-09-21 09:01:10 +00:00
|
|
|
_cddl_lib_libzfsbootenv= cddl/lib/libzfsbootenv
|
2018-08-11 22:45:39 +00:00
|
|
|
|
Merge OpenZFS support in to HEAD.
The primary benefit is maintaining a completely shared
code base with the community allowing FreeBSD to receive
new features sooner and with less effort.
I would advise against doing 'zpool upgrade'
or creating indispensable pools using new
features until this change has had a month+
to soak.
Work on merging FreeBSD support in to what was
at the time "ZFS on Linux" began in August 2018.
I first publicly proposed transitioning FreeBSD
to (new) OpenZFS on December 18th, 2018. FreeBSD
support in OpenZFS was finally completed in December
2019. A CFT for downstreaming OpenZFS support in
to FreeBSD was first issued on July 8th. All issues
that were reported have been addressed or, for
a couple of less critical matters there are
pull requests in progress with OpenZFS. iXsystems
has tested and dogfooded extensively internally.
The TrueNAS 12 release is based on OpenZFS with
some additional features that have not yet made
it upstream.
Improvements include:
project quotas, encrypted datasets,
allocation classes, vectorized raidz,
vectorized checksums, various command line
improvements, zstd compression.
Thanks to those who have helped along the way:
Ryan Moeller, Allan Jude, Zack Welch, and many
others.
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25872
2020-08-25 02:21:27 +00:00
|
|
|
cddl/lib/libtpool__L: cddl/lib/libspl__L
|
|
|
|
|
2021-10-16 16:29:28 +00:00
|
|
|
cddl/lib/libzutil__L: cddl/lib/libavl__L lib/libgeom__L lib/msun__L cddl/lib/libtpool__L
|
Merge OpenZFS support in to HEAD.
The primary benefit is maintaining a completely shared
code base with the community allowing FreeBSD to receive
new features sooner and with less effort.
I would advise against doing 'zpool upgrade'
or creating indispensable pools using new
features until this change has had a month+
to soak.
Work on merging FreeBSD support in to what was
at the time "ZFS on Linux" began in August 2018.
I first publicly proposed transitioning FreeBSD
to (new) OpenZFS on December 18th, 2018. FreeBSD
support in OpenZFS was finally completed in December
2019. A CFT for downstreaming OpenZFS support in
to FreeBSD was first issued on July 8th. All issues
that were reported have been addressed or, for
a couple of less critical matters there are
pull requests in progress with OpenZFS. iXsystems
has tested and dogfooded extensively internally.
The TrueNAS 12 release is based on OpenZFS with
some additional features that have not yet made
it upstream.
Improvements include:
project quotas, encrypted datasets,
allocation classes, vectorized raidz,
vectorized checksums, various command line
improvements, zstd compression.
Thanks to those who have helped along the way:
Ryan Moeller, Allan Jude, Zack Welch, and many
others.
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25872
2020-08-25 02:21:27 +00:00
|
|
|
|
2021-10-16 16:29:28 +00:00
|
|
|
cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L cddl/lib/libspl__L cddl/lib/libzutil__L
|
2018-08-11 22:45:39 +00:00
|
|
|
|
|
|
|
cddl/lib/libzfs__L: cddl/lib/libzfs_core__L lib/msun__L lib/libutil__L
|
|
|
|
cddl/lib/libzfs__L: lib/libthr__L lib/libmd__L lib/libz__L cddl/lib/libumem__L
|
|
|
|
cddl/lib/libzfs__L: cddl/lib/libuutil__L cddl/lib/libavl__L lib/libgeom__L
|
Merge OpenZFS support in to HEAD.
The primary benefit is maintaining a completely shared
code base with the community allowing FreeBSD to receive
new features sooner and with less effort.
I would advise against doing 'zpool upgrade'
or creating indispensable pools using new
features until this change has had a month+
to soak.
Work on merging FreeBSD support in to what was
at the time "ZFS on Linux" began in August 2018.
I first publicly proposed transitioning FreeBSD
to (new) OpenZFS on December 18th, 2018. FreeBSD
support in OpenZFS was finally completed in December
2019. A CFT for downstreaming OpenZFS support in
to FreeBSD was first issued on July 8th. All issues
that were reported have been addressed or, for
a couple of less critical matters there are
pull requests in progress with OpenZFS. iXsystems
has tested and dogfooded extensively internally.
The TrueNAS 12 release is based on OpenZFS with
some additional features that have not yet made
it upstream.
Improvements include:
project quotas, encrypted datasets,
allocation classes, vectorized raidz,
vectorized checksums, various command line
improvements, zstd compression.
Thanks to those who have helped along the way:
Ryan Moeller, Allan Jude, Zack Welch, and many
others.
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25872
2020-08-25 02:21:27 +00:00
|
|
|
cddl/lib/libzfs__L: cddl/lib/libnvpair__L cddl/lib/libzutil__L
|
2020-08-27 13:26:36 +00:00
|
|
|
cddl/lib/libzfs__L: secure/lib/libcrypto__L
|
2018-08-11 22:45:39 +00:00
|
|
|
|
loader: zfs should support bootonce an nextboot
bootonce feature is temporary, one time boot, activated by
"bectl activate -t BE", "bectl activate -T BE" will reset the bootonce flag.
By default, the bootonce setting is reset on attempt to boot and the next
boot will use previously active BE.
By setting zfs_bootonce_activate="YES" in rc.conf, the bootonce BE will
be set permanently active.
bootonce dataset name is recorded in boot pool labels, bootenv area.
in case of nextboot, the nextboot_enable boolean variable is recorded in
freebsd:nvstore nvlist, also stored in boot pool label bootenv area.
On boot, the loader will process /boot/nextboot.conf if nextboot_enable
is "YES", and will set nextboot_enable to "NO", preventing /boot/nextboot.conf
processing on next boot.
bootonce and nextboot features are usable in both UEFI and BIOS boot.
To use bootonce/nextboot features, the boot loader needs to be updated on disk;
if loader.efi is stored on ESP, then ESP needs to be updated and
for BIOS boot, stage2 (zfsboot or gptzfsboot) needs to be updated
(gpart or other tools).
At this time, only lua loader is updated.
Sponsored by: Netflix, Klara Inc.
Differential Revision: https://reviews.freebsd.org/D25512
2020-09-21 09:01:10 +00:00
|
|
|
cddl/lib/libzfsbootenv__L: cddl/lib/libzfs__L
|
|
|
|
lib/libbe__L: cddl/lib/libzfs__L cddl/lib/libzfsbootenv__L
|
2017-07-25 20:43:37 +00:00
|
|
|
.endif
|
2014-10-05 22:13:13 +00:00
|
|
|
_cddl_lib_libctf= cddl/lib/libctf
|
2007-04-06 02:13:30 +00:00
|
|
|
_cddl_lib= cddl/lib
|
Merge OpenZFS support in to HEAD.
The primary benefit is maintaining a completely shared
code base with the community allowing FreeBSD to receive
new features sooner and with less effort.
I would advise against doing 'zpool upgrade'
or creating indispensable pools using new
features until this change has had a month+
to soak.
Work on merging FreeBSD support in to what was
at the time "ZFS on Linux" began in August 2018.
I first publicly proposed transitioning FreeBSD
to (new) OpenZFS on December 18th, 2018. FreeBSD
support in OpenZFS was finally completed in December
2019. A CFT for downstreaming OpenZFS support in
to FreeBSD was first issued on July 8th. All issues
that were reported have been addressed or, for
a couple of less critical matters there are
pull requests in progress with OpenZFS. iXsystems
has tested and dogfooded extensively internally.
The TrueNAS 12 release is based on OpenZFS with
some additional features that have not yet made
it upstream.
Improvements include:
project quotas, encrypted datasets,
allocation classes, vectorized raidz,
vectorized checksums, various command line
improvements, zstd compression.
Thanks to those who have helped along the way:
Ryan Moeller, Allan Jude, Zack Welch, and many
others.
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25872
2020-08-25 02:21:27 +00:00
|
|
|
cddl/lib/libctf__L: lib/libz__L cddl/lib/libspl__L
|
2007-04-06 02:13:30 +00:00
|
|
|
.endif
|
2020-02-06 17:51:48 +00:00
|
|
|
# cddl/lib/libdtrace requires lib/libproc and lib/librtld_db
|
2016-07-30 03:05:23 +00:00
|
|
|
_prebuild_libs+= lib/libprocstat lib/libproc lib/librtld_db
|
2016-07-30 03:43:55 +00:00
|
|
|
lib/libprocstat__L: lib/libelf__L lib/libkvm__L lib/libutil__L
|
2016-07-30 03:05:23 +00:00
|
|
|
lib/libproc__L: lib/libprocstat__L
|
|
|
|
lib/librtld_db__L: lib/libprocstat__L
|
2007-04-06 02:13:30 +00:00
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_CRYPT} != "no"
|
|
|
|
.if ${MK_OPENSSL} != "no"
|
2006-10-07 19:26:46 +00:00
|
|
|
_secure_lib_libcrypto= secure/lib/libcrypto
|
|
|
|
_secure_lib_libssl= secure/lib/libssl
|
2005-11-10 18:07:07 +00:00
|
|
|
lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L
|
2018-10-12 13:01:17 +00:00
|
|
|
secure/lib/libcrypto__L: lib/libthr__L
|
2013-09-10 22:26:11 +00:00
|
|
|
.if ${MK_LDNS} != "no"
|
|
|
|
_lib_libldns= lib/libldns
|
2018-10-12 13:01:17 +00:00
|
|
|
lib/libldns__L: secure/lib/libssl__L
|
2013-09-10 22:26:11 +00:00
|
|
|
.endif
|
2010-01-23 19:29:42 +00:00
|
|
|
.if ${MK_OPENSSH} != "no"
|
|
|
|
_secure_lib_libssh= secure/lib/libssh
|
|
|
|
secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L
|
2013-09-10 22:26:11 +00:00
|
|
|
.if ${MK_LDNS} != "no"
|
|
|
|
secure/lib/libssh__L: lib/libldns__L
|
|
|
|
.endif
|
2017-01-02 20:29:50 +00:00
|
|
|
.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no"
|
2010-01-26 10:00:26 +00:00
|
|
|
secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \
|
|
|
|
kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \
|
|
|
|
lib/libmd__L kerberos5/lib/libroken__L
|
2004-05-12 07:02:17 +00:00
|
|
|
.endif
|
1999-12-17 11:23:56 +00:00
|
|
|
.endif
|
2002-06-21 08:54:03 +00:00
|
|
|
.endif
|
2006-10-07 19:26:46 +00:00
|
|
|
_secure_lib= secure/lib
|
2002-04-16 14:38:15 +00:00
|
|
|
.endif
|
1999-12-17 11:23:56 +00:00
|
|
|
|
2011-09-27 07:14:12 +00:00
|
|
|
.if ${MK_KERBEROS} != "no"
|
|
|
|
kerberos5/lib/libasn1__L: lib/libcom_err__L kerberos5/lib/libroken__L
|
|
|
|
kerberos5/lib/libhdb__L: kerberos5/lib/libasn1__L lib/libcom_err__L \
|
2012-03-22 08:48:42 +00:00
|
|
|
kerberos5/lib/libkrb5__L kerberos5/lib/libroken__L \
|
2015-05-20 18:56:29 +00:00
|
|
|
kerberos5/lib/libwind__L lib/libsqlite3__L
|
2012-03-22 08:48:42 +00:00
|
|
|
kerberos5/lib/libheimntlm__L: secure/lib/libcrypto__L kerberos5/lib/libkrb5__L \
|
|
|
|
kerberos5/lib/libroken__L lib/libcom_err__L
|
2011-09-27 07:14:12 +00:00
|
|
|
kerberos5/lib/libhx509__L: kerberos5/lib/libasn1__L lib/libcom_err__L \
|
2012-03-22 08:48:42 +00:00
|
|
|
secure/lib/libcrypto__L kerberos5/lib/libroken__L kerberos5/lib/libwind__L
|
2011-09-27 07:14:12 +00:00
|
|
|
kerberos5/lib/libkrb5__L: kerberos5/lib/libasn1__L lib/libcom_err__L \
|
|
|
|
lib/libcrypt__L secure/lib/libcrypto__L kerberos5/lib/libhx509__L \
|
2012-03-22 08:48:42 +00:00
|
|
|
kerberos5/lib/libroken__L kerberos5/lib/libwind__L \
|
|
|
|
kerberos5/lib/libheimbase__L kerberos5/lib/libheimipcc__L
|
2011-09-27 07:14:12 +00:00
|
|
|
kerberos5/lib/libroken__L: lib/libcrypt__L
|
2012-03-22 08:48:42 +00:00
|
|
|
kerberos5/lib/libwind__L: kerberos5/lib/libroken__L lib/libcom_err__L
|
|
|
|
kerberos5/lib/libheimbase__L: lib/libthr__L
|
|
|
|
kerberos5/lib/libheimipcc__L: kerberos5/lib/libroken__L kerberos5/lib/libheimbase__L lib/libthr__L
|
2011-09-27 07:14:12 +00:00
|
|
|
.endif
|
|
|
|
|
2015-05-30 16:00:33 +00:00
|
|
|
lib/libsqlite3__L: lib/libthr__L
|
|
|
|
|
2010-01-23 19:29:42 +00:00
|
|
|
.if ${MK_GSSAPI} != "no"
|
|
|
|
_lib_libgssapi= lib/libgssapi
|
|
|
|
.endif
|
|
|
|
|
2006-10-07 19:26:46 +00:00
|
|
|
.if ${MK_KERBEROS} != "no"
|
|
|
|
_kerberos5_lib= kerberos5/lib
|
|
|
|
_kerberos5_lib_libasn1= kerberos5/lib/libasn1
|
2011-09-27 07:14:12 +00:00
|
|
|
_kerberos5_lib_libhdb= kerberos5/lib/libhdb
|
2012-03-22 08:48:42 +00:00
|
|
|
_kerberos5_lib_libheimbase= kerberos5/lib/libheimbase
|
2006-10-07 19:26:46 +00:00
|
|
|
_kerberos5_lib_libkrb5= kerberos5/lib/libkrb5
|
2008-05-07 13:53:12 +00:00
|
|
|
_kerberos5_lib_libhx509= kerberos5/lib/libhx509
|
2006-10-07 19:26:46 +00:00
|
|
|
_kerberos5_lib_libroken= kerberos5/lib/libroken
|
2008-05-07 13:53:12 +00:00
|
|
|
_kerberos5_lib_libheimntlm= kerberos5/lib/libheimntlm
|
2015-05-20 18:56:29 +00:00
|
|
|
_libsqlite3= lib/libsqlite3
|
2012-03-22 08:48:42 +00:00
|
|
|
_kerberos5_lib_libheimipcc= kerberos5/lib/libheimipcc
|
|
|
|
_kerberos5_lib_libwind= kerberos5/lib/libwind
|
2012-03-23 03:16:35 +00:00
|
|
|
_libcom_err= lib/libcom_err
|
2004-04-27 15:00:29 +00:00
|
|
|
.endif
|
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_NIS} != "no"
|
2006-10-07 19:26:46 +00:00
|
|
|
_lib_libypclnt= lib/libypclnt
|
2004-11-13 20:40:32 +00:00
|
|
|
.endif
|
|
|
|
|
2006-10-07 19:26:46 +00:00
|
|
|
.if ${MK_OPENSSL} == "no"
|
2011-05-17 19:11:47 +00:00
|
|
|
lib/libradius__L: lib/libmd__L
|
2006-10-07 19:26:46 +00:00
|
|
|
.endif
|
2002-04-16 14:38:15 +00:00
|
|
|
|
_Really_, _Really_ fix buildworld by moving the conditionals down, fixing some
typos, and fixing the dependency when MK_LIBCPLUSPLUS != no
- `:D` operator evaluation is immediate, i.e. like .if defined(..). So r283159
was in effect a no-op commit.
- Fix dependency in MK_LIBCPLUSPLUS case in two ways:
-- lib/libc++ was the wrong dependency. It should have been libcxxrt.
-- lib/libc++ was missing __L, so again it was depending on the directory, not
the relevant .PHONY target.
Tested with: make tinderbox (amd64, arm, sparc64) and JFLAG=-j16
In collaboration with: bdrewery, imp, peter
BIG pointyhat to: ngie (for trying to commit things at 6am while staying up all
night working on other tasks)
2015-05-21 05:02:08 +00:00
|
|
|
lib/libproc__L: \
|
|
|
|
${_cddl_lib_libctf:D${_cddl_lib_libctf}__L} lib/libelf__L lib/librtld_db__L lib/libutil__L
|
2021-01-30 17:56:35 +00:00
|
|
|
.if ${MK_CXX} != "no"
|
_Really_, _Really_ fix buildworld by moving the conditionals down, fixing some
typos, and fixing the dependency when MK_LIBCPLUSPLUS != no
- `:D` operator evaluation is immediate, i.e. like .if defined(..). So r283159
was in effect a no-op commit.
- Fix dependency in MK_LIBCPLUSPLUS case in two ways:
-- lib/libc++ was the wrong dependency. It should have been libcxxrt.
-- lib/libc++ was missing __L, so again it was depending on the directory, not
the relevant .PHONY target.
Tested with: make tinderbox (amd64, arm, sparc64) and JFLAG=-j16
In collaboration with: bdrewery, imp, peter
BIG pointyhat to: ngie (for trying to commit things at 6am while staying up all
night working on other tasks)
2015-05-21 05:02:08 +00:00
|
|
|
lib/libproc__L: lib/libcxxrt__L
|
|
|
|
.endif
|
|
|
|
|
2007-05-19 03:34:59 +00:00
|
|
|
.for _lib in ${_prereq_libs}
|
2013-07-06 00:13:08 +00:00
|
|
|
${_lib}__PL: .PHONY .MAKE
|
2018-06-20 17:20:39 +00:00
|
|
|
.if !defined(_MKSHOWCONFIG) && exists(${.CURDIR}/${_lib})
|
2016-03-30 23:50:23 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_lib} (obj,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_lib}; \
|
2017-11-03 23:22:03 +00:00
|
|
|
if [ -z "${NO_OBJWALK}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; fi; \
|
2014-04-25 19:25:26 +00:00
|
|
|
${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \
|
2015-12-01 19:00:43 +00:00
|
|
|
DIRPRFX=${_lib}/ all; \
|
2014-04-25 19:25:26 +00:00
|
|
|
${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \
|
2013-11-08 14:20:22 +00:00
|
|
|
DIRPRFX=${_lib}/ install
|
2007-05-19 03:34:59 +00:00
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
2016-04-14 01:17:03 +00:00
|
|
|
.for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
|
2013-07-06 00:13:08 +00:00
|
|
|
${_lib}__L: .PHONY .MAKE
|
2018-06-20 17:20:39 +00:00
|
|
|
.if !defined(_MKSHOWCONFIG) && exists(${.CURDIR}/${_lib})
|
2016-03-30 23:50:23 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_lib} (obj,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_lib}; \
|
2017-11-03 23:22:03 +00:00
|
|
|
if [ -z "${NO_OBJWALK}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; fi; \
|
2015-12-01 19:00:43 +00:00
|
|
|
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ all; \
|
2014-03-30 22:24:53 +00:00
|
|
|
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ install
|
1999-01-07 06:26:33 +00:00
|
|
|
.endif
|
1999-07-07 04:46:46 +00:00
|
|
|
.endfor
|
1998-09-01 00:39:02 +00:00
|
|
|
|
2007-05-26 20:17:19 +00:00
|
|
|
_prereq_libs: ${_prereq_libs:S/$/__PL/}
|
2002-04-12 19:46:25 +00:00
|
|
|
_startup_libs: ${_startup_libs:S/$/__L/}
|
|
|
|
_prebuild_libs: ${_prebuild_libs:S/$/__L/}
|
|
|
|
_generic_libs: ${_generic_libs:S/$/__L/}
|
|
|
|
|
bsd.subdir.mk: Only recurse on called targets, rather than dependencies.
This is to fix 'make all' causing it to recurse on both 'all' and 'buildconfig'
due to 'buildconfig' being in ALL_SUBDIR_TARGETS and being a dependency of
'all'.
This now adds all of the '*includes', '*files' targets as subdir targets,
allowing them to recurse.
This also removes the need for some 'realinstall' hacks in bsd.subdir.mk since
it no longer recurses; only 'install' will recurse and call the proper
'beforeinstall', 'realinstall', and 'afterinstall' in each sub-directory.
This fixes 'make includes' and 'make files' to not be a rerolled ${MAKE}
sub-shell but to rather just recurse on 'inclues' and 'files'. This avoids
various issues such as the one fixed in r289462. As such revert Makefile.inc1
back to using 'includes' which avoids an extra tree walk and parallelizes
the includes phases better.
Makefile.inc1 includes a guard so that 'make all' will not use SUBDIR_PARALLEL,
added in r289438. This is so users do not get a probably broken build if they
run 'make all' from the top-level. Before the change in this commit, the
workaround for 'make everything' was 'par-all' which would depend on 'all' and
cause a proper parallel recursion. Now that will not work so a new
_PARALLEL_SUBUDIR_OK is used to allow it.
This is still part of an effort to combine bsd.(files|incs|confs).mk and move
some of its logic out of bsd.subdir.mk, as attempted in r289282 and reverted in
r289331. This commit fixes the problems found there which was mostly double
recursing during 'includes' which would recurse on itself and 'buildincludes'
and 'installincludes', all in parallel. The logic is still in bsd.subdir.mk
for now.
I've been cautious about this commit but have experienced no breakage on the
tree except for the 'par-all' case which was already a hack. If something foo
is depending on something bar that should recurse, it is very likely that the
foo target is being recursed on already meaning that bar will still effectively
recurse once sub-directories call foo.
Discussed on: arch@
MFC after: never
Sponsored by: EMC / Isilon Storage Division
2015-12-02 01:50:22 +00:00
|
|
|
# Enable SUBDIR_PARALLEL when not calling 'make all', unless called from
|
2015-12-07 18:45:55 +00:00
|
|
|
# 'everything' with _PARALLEL_SUBDIR_OK set. This is because it is unlikely
|
bsd.subdir.mk: Only recurse on called targets, rather than dependencies.
This is to fix 'make all' causing it to recurse on both 'all' and 'buildconfig'
due to 'buildconfig' being in ALL_SUBDIR_TARGETS and being a dependency of
'all'.
This now adds all of the '*includes', '*files' targets as subdir targets,
allowing them to recurse.
This also removes the need for some 'realinstall' hacks in bsd.subdir.mk since
it no longer recurses; only 'install' will recurse and call the proper
'beforeinstall', 'realinstall', and 'afterinstall' in each sub-directory.
This fixes 'make includes' and 'make files' to not be a rerolled ${MAKE}
sub-shell but to rather just recurse on 'inclues' and 'files'. This avoids
various issues such as the one fixed in r289462. As such revert Makefile.inc1
back to using 'includes' which avoids an extra tree walk and parallelizes
the includes phases better.
Makefile.inc1 includes a guard so that 'make all' will not use SUBDIR_PARALLEL,
added in r289438. This is so users do not get a probably broken build if they
run 'make all' from the top-level. Before the change in this commit, the
workaround for 'make everything' was 'par-all' which would depend on 'all' and
cause a proper parallel recursion. Now that will not work so a new
_PARALLEL_SUBUDIR_OK is used to allow it.
This is still part of an effort to combine bsd.(files|incs|confs).mk and move
some of its logic out of bsd.subdir.mk, as attempted in r289282 and reverted in
r289331. This commit fixes the problems found there which was mostly double
recursing during 'includes' which would recurse on itself and 'buildincludes'
and 'installincludes', all in parallel. The logic is still in bsd.subdir.mk
for now.
I've been cautious about this commit but have experienced no breakage on the
tree except for the 'par-all' case which was already a hack. If something foo
is depending on something bar that should recurse, it is very likely that the
foo target is being recursed on already meaning that bar will still effectively
recurse once sub-directories call foo.
Discussed on: arch@
MFC after: never
Sponsored by: EMC / Isilon Storage Division
2015-12-02 01:50:22 +00:00
|
|
|
# that running 'make all' from the top-level, especially with a SUBDIR_OVERRIDE
|
|
|
|
# or LOCAL_DIRS set, will have a reliable build if SUBDIRs are built in
|
|
|
|
# parallel. This is safe for the world stage of buildworld though since it has
|
|
|
|
# already built libraries in a proper order and installed includes into
|
|
|
|
# WORLDTMP. Special handling is done for SUBDIR ordering for 'install*' to
|
|
|
|
# avoid trashing a system if it crashes mid-install.
|
2015-12-07 18:45:55 +00:00
|
|
|
.if !make(all) || defined(_PARALLEL_SUBDIR_OK)
|
2015-10-17 03:51:50 +00:00
|
|
|
SUBDIR_PARALLEL=
|
|
|
|
.endif
|
1998-08-31 01:08:08 +00:00
|
|
|
|
|
|
|
.include <bsd.subdir.mk>
|
2005-07-23 14:23:30 +00:00
|
|
|
|
2007-05-16 08:46:35 +00:00
|
|
|
.if make(check-old) || make(check-old-dirs) || \
|
|
|
|
make(check-old-files) || make(check-old-libs) || \
|
|
|
|
make(delete-old) || make(delete-old-dirs) || \
|
|
|
|
make(delete-old-files) || make(delete-old-libs)
|
2005-07-30 18:02:20 +00:00
|
|
|
|
2005-07-23 14:23:30 +00:00
|
|
|
#
|
|
|
|
# check for / delete old files section
|
|
|
|
#
|
|
|
|
|
|
|
|
.include "ObsoleteFiles.inc"
|
|
|
|
|
|
|
|
OLD_LIBS_MESSAGE="Please be sure no application still uses those libraries, \
|
|
|
|
else you can not start such an application. Consult UPDATING for more \
|
|
|
|
information regarding how to cope with the removal/revision bump of a \
|
|
|
|
specific library."
|
|
|
|
|
|
|
|
.if !defined(BATCH_DELETE_OLD_FILES)
|
|
|
|
RM_I=-i
|
2005-07-30 18:02:20 +00:00
|
|
|
.else
|
|
|
|
RM_I=-v
|
2005-07-23 14:23:30 +00:00
|
|
|
.endif
|
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
delete-old-files: .PHONY
|
2005-07-23 14:23:30 +00:00
|
|
|
@echo ">>> Removing old files (only deletes safe to delete libs)"
|
|
|
|
# Ask for every old file if the user really wants to remove it.
|
2005-08-23 07:58:55 +00:00
|
|
|
# It's annoying, but better safe than sorry.
|
2011-04-01 20:59:23 +00:00
|
|
|
# NB: We cannot pass the list of OLD_FILES as a parameter because the
|
|
|
|
# argument list will get too long. Using .for/.endfor make "loops" will make
|
|
|
|
# the Makefile parser segfault.
|
|
|
|
@exec 3<&0; \
|
2013-10-29 17:46:26 +00:00
|
|
|
cd ${.CURDIR}; \
|
2011-04-01 20:59:23 +00:00
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
2018-10-23 13:00:11 +00:00
|
|
|
-V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | sort | \
|
2011-04-01 20:59:23 +00:00
|
|
|
while read file; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
2007-05-19 20:34:29 +00:00
|
|
|
chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
|
2011-04-01 20:59:23 +00:00
|
|
|
rm ${RM_I} "${DESTDIR}/$${file}" <&3; \
|
2006-02-18 16:58:21 +00:00
|
|
|
fi; \
|
2015-10-16 04:07:27 +00:00
|
|
|
for ext in debug symbols; do \
|
|
|
|
if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \
|
|
|
|
"${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
|
|
|
|
rm ${RM_I} "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" \
|
|
|
|
<&3; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
2007-05-16 20:16:06 +00:00
|
|
|
done
|
2005-08-07 13:47:25 +00:00
|
|
|
# Remove catpages without corresponding manpages.
|
2010-01-14 23:27:23 +00:00
|
|
|
@exec 3<&0; \
|
2018-10-23 13:00:11 +00:00
|
|
|
find ${DESTDIR}/usr/share/man/cat* ! -type d 2>/dev/null | sort | \
|
2005-11-12 19:31:30 +00:00
|
|
|
sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
|
|
|
|
while read catpage; do \
|
|
|
|
read manpage; \
|
|
|
|
if [ ! -e "$${manpage}" ]; then \
|
2011-04-01 20:59:23 +00:00
|
|
|
rm ${RM_I} $${catpage} <&3; \
|
2005-11-12 19:31:30 +00:00
|
|
|
fi; \
|
2005-08-07 13:47:25 +00:00
|
|
|
done
|
2005-07-23 14:23:30 +00:00
|
|
|
@echo ">>> Old files removed"
|
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
check-old-files: .PHONY
|
2005-07-23 14:23:30 +00:00
|
|
|
@echo ">>> Checking for old files"
|
2013-10-29 17:46:26 +00:00
|
|
|
@cd ${.CURDIR}; \
|
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
2011-04-01 20:59:23 +00:00
|
|
|
-V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \
|
|
|
|
while read file; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
2007-05-13 18:15:50 +00:00
|
|
|
echo "${DESTDIR}/$${file}"; \
|
|
|
|
fi; \
|
2015-10-16 04:07:27 +00:00
|
|
|
for ext in debug symbols; do \
|
|
|
|
if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
|
|
|
|
echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
2018-10-23 13:00:11 +00:00
|
|
|
done | sort
|
2005-08-07 13:47:25 +00:00
|
|
|
# Check for catpages without corresponding manpages.
|
2017-10-10 13:06:11 +00:00
|
|
|
@find ${DESTDIR}/usr/share/man/cat* ! -type d 2>/dev/null | \
|
2005-11-12 19:31:30 +00:00
|
|
|
sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
|
|
|
|
while read catpage; do \
|
|
|
|
read manpage; \
|
|
|
|
if [ ! -e "$${manpage}" ]; then \
|
2011-04-01 20:59:23 +00:00
|
|
|
echo $${catpage}; \
|
2005-11-12 19:31:30 +00:00
|
|
|
fi; \
|
2018-10-23 13:00:11 +00:00
|
|
|
done | sort
|
2005-07-23 14:23:30 +00:00
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
delete-old-libs: .PHONY
|
2005-07-23 14:23:30 +00:00
|
|
|
@echo ">>> Removing old libraries"
|
|
|
|
@echo "${OLD_LIBS_MESSAGE}" | fmt
|
2011-04-01 20:59:23 +00:00
|
|
|
@exec 3<&0; \
|
2013-10-29 17:46:26 +00:00
|
|
|
cd ${.CURDIR}; \
|
2011-04-01 20:59:23 +00:00
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
2018-10-23 13:00:11 +00:00
|
|
|
-V OLD_LIBS | xargs -n1 | sort | \
|
2011-04-01 20:59:23 +00:00
|
|
|
while read file; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
2007-05-19 20:34:29 +00:00
|
|
|
chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
|
2011-04-01 20:59:23 +00:00
|
|
|
rm ${RM_I} "${DESTDIR}/$${file}" <&3; \
|
2006-02-18 16:58:21 +00:00
|
|
|
fi; \
|
2013-10-21 10:09:48 +00:00
|
|
|
for ext in debug symbols; do \
|
|
|
|
if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \
|
|
|
|
"${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
|
|
|
|
rm ${RM_I} "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" \
|
|
|
|
<&3; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
2007-05-16 20:16:06 +00:00
|
|
|
done
|
2005-07-23 14:23:30 +00:00
|
|
|
@echo ">>> Old libraries removed"
|
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
check-old-libs: .PHONY
|
2005-07-23 14:23:30 +00:00
|
|
|
@echo ">>> Checking for old libraries"
|
2013-10-29 17:46:26 +00:00
|
|
|
@cd ${.CURDIR}; \
|
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
2011-04-01 20:59:23 +00:00
|
|
|
-V OLD_LIBS | xargs -n1 | \
|
|
|
|
while read file; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
2007-05-13 18:15:50 +00:00
|
|
|
echo "${DESTDIR}/$${file}"; \
|
|
|
|
fi; \
|
2013-10-21 10:09:48 +00:00
|
|
|
for ext in debug symbols; do \
|
|
|
|
if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
|
|
|
|
echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
2018-10-23 13:00:11 +00:00
|
|
|
done | sort
|
2005-07-23 14:23:30 +00:00
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
delete-old-dirs: .PHONY
|
2005-07-23 14:23:30 +00:00
|
|
|
@echo ">>> Removing old directories"
|
2013-10-29 17:46:26 +00:00
|
|
|
@cd ${.CURDIR}; \
|
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
2013-10-01 22:53:27 +00:00
|
|
|
-V OLD_DIRS | xargs -n1 | sort -r | \
|
2011-04-01 20:59:23 +00:00
|
|
|
while read dir; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -d "${DESTDIR}/$${dir}" ]; then \
|
|
|
|
rmdir -v "${DESTDIR}/$${dir}" || true; \
|
|
|
|
elif [ -L "${DESTDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
|
2006-02-18 16:58:21 +00:00
|
|
|
fi; \
|
2016-11-30 19:06:47 +00:00
|
|
|
if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
|
|
|
|
rmdir -v "${DESTDIR}${DEBUGDIR}/$${dir}" || true; \
|
|
|
|
elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please remove everything manually."; \
|
|
|
|
fi; \
|
2007-05-16 20:16:06 +00:00
|
|
|
done
|
2005-07-23 14:23:30 +00:00
|
|
|
@echo ">>> Old directories removed"
|
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
check-old-dirs: .PHONY
|
2005-07-23 14:23:30 +00:00
|
|
|
@echo ">>> Checking for old directories"
|
2013-10-29 17:46:26 +00:00
|
|
|
@cd ${.CURDIR}; \
|
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
2018-10-23 13:00:11 +00:00
|
|
|
-V OLD_DIRS | xargs -n1 | sort -r | \
|
2011-04-01 20:59:23 +00:00
|
|
|
while read dir; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -d "${DESTDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}/$${dir}"; \
|
|
|
|
elif [ -L "${DESTDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
|
2006-02-18 16:58:21 +00:00
|
|
|
fi; \
|
2016-11-30 19:06:47 +00:00
|
|
|
if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}${DEBUGDIR}/$${dir}"; \
|
|
|
|
elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please remove everything manually."; \
|
|
|
|
fi; \
|
2007-05-16 20:16:06 +00:00
|
|
|
done
|
2005-07-23 14:23:30 +00:00
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
delete-old: delete-old-files delete-old-dirs .PHONY
|
2016-08-12 13:52:51 +00:00
|
|
|
@echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'."
|
2005-07-23 14:23:30 +00:00
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
check-old: check-old-files check-old-libs check-old-dirs .PHONY
|
2016-08-12 13:52:51 +00:00
|
|
|
@echo "To remove old files and directories run '${MAKE_CMD} delete-old'."
|
|
|
|
@echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'."
|
2005-07-23 14:23:30 +00:00
|
|
|
|
2005-07-30 18:02:20 +00:00
|
|
|
.endif
|
|
|
|
|
2006-03-18 14:30:23 +00:00
|
|
|
#
|
|
|
|
# showconfig - show build configuration.
|
|
|
|
#
|
2016-04-21 16:30:16 +00:00
|
|
|
showconfig: .PHONY
|
2017-06-08 00:41:25 +00:00
|
|
|
@(${MAKE} -n -f ${.CURDIR}/sys/conf/kern.opts.mk -V dummy -dg1 UPDATE_DEPENDFILE=no NO_OBJ=yes; \
|
|
|
|
${MAKE} -n -f ${.CURDIR}/share/mk/src.opts.mk -V dummy -dg1 UPDATE_DEPENDFILE=no NO_OBJ=yes) 2>&1 | grep ^MK_ | sort -u
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2011-02-11 02:37:47 +00:00
|
|
|
.if !empty(KRNLOBJDIR) && !empty(KERNCONF)
|
|
|
|
DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/
|
|
|
|
|
|
|
|
.if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE)
|
2018-06-20 17:20:39 +00:00
|
|
|
.if !defined(_MKSHOWCONFIG) && exists(${KERNCONFDIR}/${KERNCONF})
|
2011-02-11 02:37:47 +00:00
|
|
|
FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ {print $$2}' \
|
2014-05-03 09:24:20 +00:00
|
|
|
'${KERNCONFDIR}/${KERNCONF}' ; echo
|
2011-02-11 02:37:47 +00:00
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !defined(DTBOUTPUTPATH) || !exists(${DTBOUTPUTPATH})
|
|
|
|
DTBOUTPUTPATH= ${.CURDIR}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build 'standalone' Device Tree Blob
|
|
|
|
#
|
2016-04-21 16:30:16 +00:00
|
|
|
builddtb: .PHONY
|
2014-04-30 18:02:04 +00:00
|
|
|
@PATH=${TMPPATH} MACHINE=${TARGET} \
|
2020-08-25 13:30:09 +00:00
|
|
|
sh ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \
|
2014-04-30 18:02:04 +00:00
|
|
|
"${FDT_DTS_FILE}" ${DTBOUTPUTPATH}
|
2009-03-13 07:23:58 +00:00
|
|
|
|
|
|
|
###############
|
|
|
|
|
2015-11-09 23:36:46 +00:00
|
|
|
# cleanworld
|
|
|
|
# In the following, the first 'rm' in a series will usually remove all
|
|
|
|
# files and directories. If it does not, then there are probably some
|
|
|
|
# files with file flags set, so this unsets them and tries the 'rm' a
|
|
|
|
# second time. There are situations where this target will be cleaning
|
|
|
|
# some directories via more than one method, but that duplication is
|
|
|
|
# needed to correctly handle all the possible situations. Removing all
|
|
|
|
# files without file flags set in the first 'rm' instance saves time,
|
|
|
|
# because 'chflags' will need to operate on fewer files afterwards.
|
|
|
|
#
|
|
|
|
# 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
|
2017-10-31 01:45:14 +00:00
|
|
|
# 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.
|
2015-11-09 23:36:46 +00:00
|
|
|
#
|
2017-11-01 21:22:10 +00:00
|
|
|
.if make(cleanworld)
|
|
|
|
BW_CANONICALOBJDIR:=${OBJTOP}/
|
|
|
|
.elif make(cleanuniverse)
|
|
|
|
BW_CANONICALOBJDIR:=${OBJROOT}
|
|
|
|
.if ${MK_UNIFIED_OBJDIR} == "no"
|
|
|
|
.error ${.TARGETS} only supported with WITH_UNIFIED_OBJDIR enabled.
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
cleanworld cleanuniverse: .PHONY
|
2017-11-10 02:09:33 +00:00
|
|
|
.if !empty(BW_CANONICALOBJDIR) && exists(${BW_CANONICALOBJDIR}) && \
|
|
|
|
${.CURDIR:tA} != ${BW_CANONICALOBJDIR:tA}
|
2017-11-01 21:22:10 +00:00
|
|
|
-rm -rf ${BW_CANONICALOBJDIR}*
|
2015-11-09 23:36:46 +00:00
|
|
|
-chflags -R 0 ${BW_CANONICALOBJDIR}
|
2017-11-01 21:22:10 +00:00
|
|
|
rm -rf ${BW_CANONICALOBJDIR}*
|
2015-11-09 23:36:46 +00:00
|
|
|
.endif
|
2017-11-11 01:10:08 +00:00
|
|
|
.if make(cleanworld) && ${MK_AUTO_OBJ} == "no" && \
|
|
|
|
(empty(BW_CANONICALOBJDIR) || ${.CURDIR:tA} == ${BW_CANONICALOBJDIR:tA})
|
2015-11-09 23:36:57 +00:00
|
|
|
.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR}
|
2015-11-09 23:36:46 +00:00
|
|
|
# To be safe in this case, fall back to a 'make cleandir'
|
|
|
|
${_+_}@cd ${.CURDIR}; ${MAKE} cleandir
|
|
|
|
.endif
|
2017-10-31 01:45:14 +00:00
|
|
|
.endif
|
2015-11-09 23:36:46 +00:00
|
|
|
|
2014-07-23 22:18:43 +00:00
|
|
|
.if ${TARGET} == ${MACHINE} && ${TARGET_ARCH} == ${MACHINE_ARCH}
|
2011-02-11 02:37:47 +00:00
|
|
|
XDEV_CPUTYPE?=${CPUTYPE}
|
|
|
|
.else
|
|
|
|
XDEV_CPUTYPE?=${TARGET_CPUTYPE}
|
|
|
|
.endif
|
|
|
|
|
2015-01-02 18:45:03 +00:00
|
|
|
NOFUN=-DNO_FSCHG MK_HTML=no -DNO_LINT \
|
2014-04-25 19:25:26 +00:00
|
|
|
MK_MAN=no MK_NLS=no MK_PROFILE=no \
|
2021-01-06 17:55:06 +00:00
|
|
|
MK_KERBEROS=no MK_RESCUE=no MK_TESTS=no MK_WERROR=no \
|
2014-07-23 22:18:43 +00:00
|
|
|
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
|
2011-02-11 02:37:47 +00:00
|
|
|
CPUTYPE=${XDEV_CPUTYPE}
|
2011-02-11 04:03:39 +00:00
|
|
|
|
2014-07-23 22:18:43 +00:00
|
|
|
XDDIR=${TARGET_ARCH}-freebsd
|
2014-04-04 17:58:33 +00:00
|
|
|
XDTP?=/usr/${XDDIR}
|
|
|
|
.if ${XDTP:N/*}
|
|
|
|
.error XDTP variable should be an absolute path
|
|
|
|
.endif
|
|
|
|
|
2017-11-01 21:22:13 +00:00
|
|
|
CDBOBJROOT= ${OBJROOT}${MACHINE}.${MACHINE_ARCH}/xdev/
|
|
|
|
CDBOBJTOP= ${CDBOBJROOT}${XDDIR}
|
|
|
|
CDBENV= \
|
2013-02-04 09:34:25 +00:00
|
|
|
INSTALL="sh ${.CURDIR}/tools/install.sh"
|
2009-03-13 07:23:58 +00:00
|
|
|
CDENV= ${CDBENV} \
|
2014-04-03 07:28:36 +00:00
|
|
|
TOOLS_PREFIX=${XDTP}
|
2017-11-01 21:22:13 +00:00
|
|
|
CDMAKEARGS= \
|
|
|
|
OBJTOP=${CDBOBJTOP:Q} \
|
|
|
|
OBJROOT=${CDBOBJROOT:Q}
|
|
|
|
CD2MAKEARGS= ${CDMAKEARGS}
|
2017-02-18 00:08:13 +00:00
|
|
|
|
|
|
|
.if ${WANT_COMPILER_TYPE} == gcc || \
|
|
|
|
(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc)
|
|
|
|
# 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
|
|
|
|
# is added before the port PREFIX library path.
|
|
|
|
CD2CFLAGS+= -isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib
|
|
|
|
# GCC requires -B to find /usr/lib/crti.o when using a cross-compiler
|
|
|
|
# combined with --sysroot.
|
|
|
|
CD2CFLAGS+= -B${XDDESTDIR}/usr/lib
|
|
|
|
# Force using libc++ for external GCC.
|
2018-01-24 18:08:37 +00:00
|
|
|
.if defined(X_COMPILER_TYPE) && \
|
|
|
|
${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800
|
2017-02-18 00:08:13 +00:00
|
|
|
CD2CXXFLAGS+= -isystem ${XDDESTDIR}/usr/include/c++/v1 -std=c++11 \
|
|
|
|
-nostdinc++
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
CD2CFLAGS+= --sysroot=${XDDESTDIR}/
|
|
|
|
CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CXXFLAGS} ${CD2CFLAGS}" \
|
2014-04-03 07:28:36 +00:00
|
|
|
CPP="${CPP} ${CD2CFLAGS}" \
|
2014-07-23 22:18:43 +00:00
|
|
|
MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH}
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2017-11-01 21:22:05 +00:00
|
|
|
CDTMP= ${OBJTOP}/${XDDIR}/tmp
|
2017-11-01 21:22:13 +00:00
|
|
|
CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${CDMAKEARGS} ${NOFUN}
|
|
|
|
CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} \
|
|
|
|
${MAKE} ${CD2MAKEARGS} ${NOFUN}
|
2017-02-17 22:51:21 +00:00
|
|
|
.if ${MK_META_MODE} != "no"
|
|
|
|
# Don't rebuild build-tools targets during normal build.
|
2017-04-06 18:21:59 +00:00
|
|
|
CD2MAKE+= BUILD_TOOLS_META=.NOMETA
|
2017-02-17 22:51:21 +00:00
|
|
|
.endif
|
2017-10-29 01:21:49 +00:00
|
|
|
XDDESTDIR=${DESTDIR}${XDTP}
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2014-07-10 18:28:12 +00:00
|
|
|
.ORDER: xdev-build xdev-install xdev-links
|
2016-04-21 16:30:16 +00:00
|
|
|
xdev: xdev-build xdev-install .PHONY
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2013-03-31 08:31:06 +00:00
|
|
|
.ORDER: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools
|
2016-04-21 16:30:16 +00:00
|
|
|
xdev-build: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools .PHONY
|
2013-03-31 08:31:06 +00:00
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
_xb-worldtmp: .PHONY
|
2013-03-31 08:31:06 +00:00
|
|
|
mkdir -p ${CDTMP}/usr
|
2018-06-29 21:15:26 +00:00
|
|
|
${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
2013-03-31 08:31:06 +00:00
|
|
|
-p ${CDTMP}/usr >/dev/null
|
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
_xb-bootstrap-tools: .PHONY
|
2013-03-31 08:31:06 +00:00
|
|
|
.for _tool in \
|
2014-12-08 07:33:11 +00:00
|
|
|
${_clang_tblgen} \
|
2017-02-17 22:51:34 +00:00
|
|
|
${_yacc}
|
2016-03-30 23:50:23 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
2017-11-03 23:22:03 +00:00
|
|
|
if [ -z "${NO_OBJWALK}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ obj; fi; \
|
2015-12-01 19:00:43 +00:00
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ all; \
|
2013-03-31 08:31:06 +00:00
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install
|
|
|
|
.endfor
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
_xb-build-tools: .PHONY
|
2011-02-11 04:03:39 +00:00
|
|
|
${_+_}@cd ${.CURDIR}; \
|
2017-11-01 21:22:13 +00:00
|
|
|
${CDBENV} ${MAKE} ${CDMAKEARGS} -f Makefile.inc1 ${NOFUN} build-tools
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2017-10-29 01:21:52 +00:00
|
|
|
XDEVDIRS= \
|
2017-10-31 23:48:57 +00:00
|
|
|
${_clang_libs} \
|
2017-10-29 01:21:46 +00:00
|
|
|
${_lld} \
|
2014-12-01 17:49:42 +00:00
|
|
|
${_elftctools} \
|
2013-03-31 08:31:06 +00:00
|
|
|
usr.bin/ar \
|
2020-02-29 03:25:51 +00:00
|
|
|
${_clang}
|
2017-10-29 01:21:52 +00:00
|
|
|
|
|
|
|
_xb-cross-tools: .PHONY
|
|
|
|
.for _tool in ${XDEVDIRS}
|
2016-03-30 23:50:23 +00:00
|
|
|
${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,all)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
2017-11-03 23:22:03 +00:00
|
|
|
if [ -z "${NO_OBJWALK}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ obj; fi; \
|
2009-03-13 07:23:58 +00:00
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ all
|
|
|
|
.endfor
|
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
_xi-mtree: .PHONY
|
2009-03-13 07:23:58 +00:00
|
|
|
${_+_}@${ECHODIR} "mtree populating ${XDDESTDIR}"
|
|
|
|
mkdir -p ${XDDESTDIR}
|
2018-06-29 21:15:26 +00:00
|
|
|
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.root.dist \
|
2009-03-13 07:23:58 +00:00
|
|
|
-p ${XDDESTDIR} >/dev/null
|
2018-06-29 21:15:26 +00:00
|
|
|
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
2009-03-13 07:23:58 +00:00
|
|
|
-p ${XDDESTDIR}/usr >/dev/null
|
2018-06-29 21:15:26 +00:00
|
|
|
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
2009-03-13 07:23:58 +00:00
|
|
|
-p ${XDDESTDIR}/usr/include >/dev/null
|
2019-10-15 21:11:22 +00:00
|
|
|
.if defined(_LIBCOMPAT)
|
2018-06-29 21:15:26 +00:00
|
|
|
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
|
2015-10-20 20:35:34 +00:00
|
|
|
-p ${XDDESTDIR}/usr >/dev/null
|
|
|
|
.endif
|
2014-07-21 21:26:10 +00:00
|
|
|
.if ${MK_TESTS} != "no"
|
2014-12-18 18:16:00 +00:00
|
|
|
mkdir -p ${XDDESTDIR}${TESTSBASE}
|
2018-06-29 21:15:26 +00:00
|
|
|
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
|
2014-12-18 18:16:00 +00:00
|
|
|
-p ${XDDESTDIR}${TESTSBASE} >/dev/null
|
2014-07-21 21:26:10 +00:00
|
|
|
.endif
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2014-07-10 18:28:12 +00:00
|
|
|
.ORDER: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries
|
2016-04-21 16:30:16 +00:00
|
|
|
xdev-install: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries .PHONY
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
_xi-cross-tools: .PHONY
|
2009-03-13 07:23:58 +00:00
|
|
|
@echo "_xi-cross-tools"
|
2017-10-29 01:21:52 +00:00
|
|
|
.for _tool in ${XDEVDIRS}
|
2009-03-13 07:23:58 +00:00
|
|
|
${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \
|
|
|
|
cd ${.CURDIR}/${_tool}; \
|
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR}
|
|
|
|
.endfor
|
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
_xi-includes: .PHONY
|
2017-11-03 23:22:03 +00:00
|
|
|
.if !defined(NO_OBJWALK)
|
2017-10-29 01:21:42 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 _obj \
|
|
|
|
DESTDIR=${XDDESTDIR}
|
|
|
|
.endif
|
bsd.subdir.mk: Only recurse on called targets, rather than dependencies.
This is to fix 'make all' causing it to recurse on both 'all' and 'buildconfig'
due to 'buildconfig' being in ALL_SUBDIR_TARGETS and being a dependency of
'all'.
This now adds all of the '*includes', '*files' targets as subdir targets,
allowing them to recurse.
This also removes the need for some 'realinstall' hacks in bsd.subdir.mk since
it no longer recurses; only 'install' will recurse and call the proper
'beforeinstall', 'realinstall', and 'afterinstall' in each sub-directory.
This fixes 'make includes' and 'make files' to not be a rerolled ${MAKE}
sub-shell but to rather just recurse on 'inclues' and 'files'. This avoids
various issues such as the one fixed in r289462. As such revert Makefile.inc1
back to using 'includes' which avoids an extra tree walk and parallelizes
the includes phases better.
Makefile.inc1 includes a guard so that 'make all' will not use SUBDIR_PARALLEL,
added in r289438. This is so users do not get a probably broken build if they
run 'make all' from the top-level. Before the change in this commit, the
workaround for 'make everything' was 'par-all' which would depend on 'all' and
cause a proper parallel recursion. Now that will not work so a new
_PARALLEL_SUBUDIR_OK is used to allow it.
This is still part of an effort to combine bsd.(files|incs|confs).mk and move
some of its logic out of bsd.subdir.mk, as attempted in r289282 and reverted in
r289331. This commit fixes the problems found there which was mostly double
recursing during 'includes' which would recurse on itself and 'buildincludes'
and 'installincludes', all in parallel. The logic is still in bsd.subdir.mk
for now.
I've been cautious about this commit but have experienced no breakage on the
tree except for the 'par-all' case which was already a hack. If something foo
is depending on something bar that should recurse, it is very likely that the
foo target is being recursed on already meaning that bar will still effectively
recurse once sub-directories call foo.
Discussed on: arch@
MFC after: never
Sponsored by: EMC / Isilon Storage Division
2015-12-02 01:50:22 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 includes \
|
2009-03-13 07:23:58 +00:00
|
|
|
DESTDIR=${XDDESTDIR}
|
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
_xi-libraries: .PHONY
|
2009-03-13 07:23:58 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 libraries \
|
|
|
|
DESTDIR=${XDDESTDIR}
|
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
xdev-links: .PHONY
|
2009-03-13 07:23:58 +00:00
|
|
|
${_+_}cd ${XDDESTDIR}/usr/bin; \
|
2014-07-10 18:28:12 +00:00
|
|
|
mkdir -p ../../../../usr/bin; \
|
2009-03-13 07:23:58 +00:00
|
|
|
for i in *; do \
|
|
|
|
ln -sf ../../${XDTP}/usr/bin/$$i \
|
|
|
|
../../../../usr/bin/${XDDIR}-$$i; \
|
|
|
|
ln -sf ../../${XDTP}/usr/bin/$$i \
|
2017-08-01 14:54:25 +00:00
|
|
|
../../../../usr/bin/${XDDIR}${_REVISION}-$$i; \
|
2009-03-13 07:23:58 +00:00
|
|
|
done
|