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
|
2000-08-07 14:35:49 +00:00
|
|
|
# -DNO_PORTSUPDATE do not update ports in ${MAKE} update
|
2013-01-22 21:10:03 +00:00
|
|
|
# -DNO_ROOT install without using root privilege
|
2000-08-07 14:35:49 +00:00
|
|
|
# -DNO_DOCUPDATE do not update doc in ${MAKE} update
|
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
|
2012-01-05 21:50:50 +00:00
|
|
|
# LOCAL_TOOL_DIRS="list of dirs" to add additional dirs to the build-tools
|
|
|
|
# list
|
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
|
|
|
|
# when NO_ROOT is set. (default: ${DESTDIR}/METALOG)
|
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
|
2013-05-28 21:57:55 +00:00
|
|
|
# update - convenient way to update your source tree (eg: svn/svnup)
|
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
|
|
|
|
|
2016-05-21 01:32:23 +00:00
|
|
|
SRCDIR?= ${.CURDIR}
|
2015-12-20 05:52:03 +00:00
|
|
|
LOCALBASE?= /usr/local
|
2008-09-19 16:14:42 +00:00
|
|
|
|
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)
|
|
|
|
.include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk"
|
|
|
|
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
|
|
|
|
MK_GCC_BOOTSTRAP= no
|
2016-05-21 01:32:07 +00:00
|
|
|
.endif
|
|
|
|
|
2016-05-21 01:32:23 +00:00
|
|
|
# Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early.
|
|
|
|
.include <bsd.compiler.mk>
|
|
|
|
.include "share/mk/src.opts.mk"
|
|
|
|
|
|
|
|
# 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-05-21 01:32:23 +00:00
|
|
|
.elif ${MK_GCC_BOOTSTRAP} == "yes"
|
2016-07-24 18:05:05 +00:00
|
|
|
WANT_COMPILER_TYPE= gcc
|
2016-07-24 18:28:14 +00:00
|
|
|
.else
|
|
|
|
WANT_COMPILER_TYPE=
|
2016-05-21 01:32:23 +00:00
|
|
|
.endif
|
2016-07-24 18:05:05 +00:00
|
|
|
.if !defined(WANT_COMPILER_FREEBSD_VERSION)
|
|
|
|
.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
|
|
|
|
.elif ${WANT_COMPILER_TYPE} == "gcc"
|
|
|
|
WANT_COMPILER_FREEBSD_VERSION_FILE= gnu/usr.bin/cc/cc_tools/freebsd-native.h
|
|
|
|
WANT_COMPILER_FREEBSD_VERSION!= \
|
2016-05-21 01:32:23 +00:00
|
|
|
awk '$$2 == "FBSD_CC_VER" {printf("%d\n", $$3)}' \
|
2016-07-24 18:05:05 +00:00
|
|
|
${SRCDIR}/${WANT_COMPILER_FREEBSD_VERSION_FILE} || echo unknown
|
|
|
|
WANT_COMPILER_VERSION_FILE= contrib/gcc/BASE-VER
|
|
|
|
WANT_COMPILER_VERSION!= \
|
2016-05-21 01:32:23 +00:00
|
|
|
awk -F. '{print $$1 * 10000 + $$2 * 100 + $$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)
|
|
|
|
# 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" && \
|
2016-07-24 18:05:05 +00:00
|
|
|
(${MK_CLANG_BOOTSTRAP} == "yes" || ${MK_GCC_BOOTSTRAP} == "yes") && \
|
|
|
|
!make(showconfig) && !make(native-xtools) && !make(xdev*) && \
|
|
|
|
${WANT_COMPILER_TYPE} == ${COMPILER_TYPE} && \
|
|
|
|
(${COMPILER_TYPE} == "clang" || ${TARGET_ARCH} == ${MACHINE_ARCH}) && \
|
|
|
|
${COMPILER_VERSION} == ${WANT_COMPILER_VERSION} && \
|
|
|
|
${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
|
|
|
|
MK_GCC_BOOTSTRAP= no
|
2016-07-24 18:05:05 +00:00
|
|
|
USING_SYSTEM_COMPILER= yes
|
|
|
|
.endif # ${WANT_COMPILER_TYPE} == ${COMPILER_TYPE}
|
|
|
|
USING_SYSTEM_COMPILER?= no
|
|
|
|
TEST_SYSTEM_COMPILER_VARS= \
|
|
|
|
USING_SYSTEM_COMPILER MK_SYSTEM_COMPILER \
|
|
|
|
MK_CROSS_COMPILER MK_CLANG_BOOTSTRAP MK_GCC_BOOTSTRAP \
|
|
|
|
WANT_COMPILER_TYPE WANT_COMPILER_VERSION WANT_COMPILER_VERSION_FILE \
|
|
|
|
WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_FREEBSD_VERSION_FILE \
|
|
|
|
CC COMPILER_TYPE COMPILER_VERSION COMPILER_FREEBSD_VERSION
|
|
|
|
test-system-compiler: .PHONY
|
|
|
|
.for v in ${TEST_SYSTEM_COMPILER_VARS}
|
|
|
|
${_+_}@printf "%-35s= %s\n" "${v}" "${${v}}"
|
|
|
|
.endfor
|
|
|
|
.if ${USING_SYSTEM_COMPILER} == "yes" && \
|
|
|
|
(make(buildworld) || make(buildkernel) || make(kernel-toolchain) || \
|
|
|
|
make(toolchain) || make(_cross-tools))
|
2016-05-21 01:32:23 +00:00
|
|
|
.info SYSTEM_COMPILER: Determined that CC=${CC} matches the source tree. Not bootstrapping a cross-compiler.
|
|
|
|
.endif
|
|
|
|
|
2016-06-03 20:49:49 +00:00
|
|
|
# For installworld need to ensure that the looked-up compiler metadata is
|
|
|
|
# passed along rather than trying to run cc from the restricted
|
|
|
|
# STRICTTMPPATH.
|
|
|
|
.if ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no"
|
2016-06-04 17:38:17 +00:00
|
|
|
.if !defined(X_COMPILER_TYPE)
|
2016-06-03 20:49:49 +00:00
|
|
|
CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \
|
|
|
|
COMPILER_TYPE=${COMPILER_TYPE} \
|
|
|
|
COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION}
|
2016-06-04 17:17:10 +00:00
|
|
|
.else
|
|
|
|
CROSSENV+= COMPILER_VERSION=${X_COMPILER_VERSION} \
|
|
|
|
COMPILER_TYPE=${X_COMPILER_TYPE} \
|
|
|
|
COMPILER_FREEBSD_VERSION=${X_COMPILER_FREEBSD_VERSION}
|
|
|
|
.endif
|
2016-06-03 20:49:49 +00:00
|
|
|
.endif
|
|
|
|
|
2016-05-23 16:24:34 +00:00
|
|
|
# Handle external binutils.
|
|
|
|
.if defined(CROSS_TOOLCHAIN_PREFIX)
|
|
|
|
CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
|
|
|
|
.endif
|
|
|
|
# If we do not have a bootstrap binutils (because the in-tree one does not
|
|
|
|
# support the target architecture), provide a default cross-binutils prefix.
|
|
|
|
# This allows aarch64 builds, for example, to automatically use the
|
|
|
|
# aarch64-binutils port or package.
|
|
|
|
.if !make(showconfig)
|
|
|
|
.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \
|
|
|
|
!defined(CROSS_BINUTILS_PREFIX)
|
|
|
|
CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/
|
|
|
|
.if !exists(${CROSS_BINUTILS_PREFIX})
|
|
|
|
.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX.
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.endif
|
2016-07-27 14:58:15 +00:00
|
|
|
XBINUTILS= AS AR LD NM OBJCOPY RANLIB SIZE STRINGS
|
2016-05-23 16:24:34 +00:00
|
|
|
.for BINUTIL in ${XBINUTILS}
|
|
|
|
.if defined(CROSS_BINUTILS_PREFIX) && \
|
|
|
|
exists(${CROSS_BINUTILS_PREFIX}${${BINUTIL}})
|
|
|
|
X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${${BINUTIL}}
|
|
|
|
.else
|
|
|
|
X${BINUTIL}?= ${${BINUTIL}}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
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
|
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
|
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
|
2011-03-21 09:58:24 +00:00
|
|
|
.if ${MK_OFED} != "no"
|
|
|
|
SUBDIR+=contrib/ofed
|
|
|
|
.endif
|
2002-04-30 11:46:49 +00:00
|
|
|
|
2014-11-21 18:35:48 +00:00
|
|
|
# Local directories are last, since it is nice to at least get the base
|
|
|
|
# system rebuilt before you do them.
|
|
|
|
.for _DIR in ${LOCAL_DIRS}
|
2004-02-13 21:52:08 +00:00
|
|
|
.if exists(${.CURDIR}/${_DIR}/Makefile)
|
2014-11-21 18:35:48 +00:00
|
|
|
SUBDIR+= ${_DIR}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
# 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|$|/|}
|
|
|
|
_REDUNDENT_LIB_DIRS+= ${LOCAL_LIB_DIRS:M${_DIR}*}
|
|
|
|
.endfor
|
|
|
|
.for _DIR in ${LOCAL_LIB_DIRS}
|
|
|
|
.if empty(_REDUNDENT_LIB_DIRS:M${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile)
|
|
|
|
SUBDIR+= ${_DIR}
|
2014-12-16 20:45:17 +00:00
|
|
|
.else
|
|
|
|
.warning ${_DIR} not added to SUBDIR list. See UPDATING 20141121.
|
1998-08-31 01:08:08 +00:00
|
|
|
.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)
|
2015-10-22 01:32:11 +00:00
|
|
|
.warning NOCLEAN option is deprecated. Use NO_CLEAN instead.
|
2005-02-28 09:23:38 +00:00
|
|
|
NO_CLEAN= ${NOCLEAN}
|
|
|
|
.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
|
|
|
|
|
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)
|
|
|
|
NO_CLEAN= t
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
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
|
|
|
|
2016-04-13 01:47:04 +00:00
|
|
|
.if !defined(SVN) || empty(SVN)
|
|
|
|
. for _P in /usr/bin /usr/local/bin
|
|
|
|
. for _S in svn svnlite
|
|
|
|
. if exists(${_P}/${_S})
|
|
|
|
SVN= ${_P}/${_S}
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. endfor
|
|
|
|
.endif
|
2009-06-14 15:16:24 +00:00
|
|
|
SVNFLAGS?= -r HEAD
|
1998-08-31 01:08:08 +00:00
|
|
|
|
1999-12-10 10:48:20 +00:00
|
|
|
MAKEOBJDIRPREFIX?= /usr/obj
|
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.
|
2016-04-21 16:50:45 +00:00
|
|
|
.if !defined(_REVISION)
|
|
|
|
_REVISION!= MK_AUTO_OBJ=no ${MAKE} -C ${SRCDIR}/release -V REVISION
|
|
|
|
.export _REVISION
|
|
|
|
.endif
|
|
|
|
.if !defined(_BRANCH)
|
|
|
|
_BRANCH!= MK_AUTO_OBJ=no ${MAKE} -C ${SRCDIR}/release -V BRANCH
|
|
|
|
.export _BRANCH
|
|
|
|
.endif
|
|
|
|
.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)
|
2016-05-27 20:33:14 +00:00
|
|
|
.if ${_BRANCH:MSTABLE*} || ${_BRANCH:MCURRENT*} || ${_BRANCH:MALPHA*}
|
2015-03-15 14:41:26 +00:00
|
|
|
TIMENOW= %Y%m%d%H%M%S
|
|
|
|
EXTRA_REVISION= .s${TIMENOW:gmtime}
|
2015-02-08 18:12:34 +00:00
|
|
|
.endif
|
2016-04-21 16:50:45 +00:00
|
|
|
.if ${_BRANCH:M*-p*}
|
|
|
|
EXTRA_REVISION= _${_BRANCH:C/.*-p([0-9]+$)/\1/}
|
2015-02-08 18:12:34 +00:00
|
|
|
.endif
|
2016-04-21 16:50:45 +00:00
|
|
|
PKG_VERSION= ${_REVISION}${EXTRA_REVISION}
|
2015-02-08 18:12:34 +00:00
|
|
|
.endif
|
|
|
|
|
2015-12-14 09:52:09 +00:00
|
|
|
KNOWN_ARCHES?= aarch64/arm64 \
|
|
|
|
amd64 \
|
|
|
|
arm \
|
|
|
|
armeb/arm \
|
|
|
|
armv6/arm \
|
|
|
|
i386 \
|
|
|
|
i386/pc98 \
|
|
|
|
mips \
|
|
|
|
mipsel/mips \
|
|
|
|
mips64el/mips \
|
2016-05-19 02:58:30 +00:00
|
|
|
mipsn32el/mips \
|
2015-12-14 09:52:09 +00:00
|
|
|
mips64/mips \
|
|
|
|
mipsn32/mips \
|
|
|
|
powerpc \
|
|
|
|
powerpc64/powerpc \
|
|
|
|
riscv64/riscv \
|
|
|
|
sparc64
|
2015-12-11 22:55:23 +00:00
|
|
|
|
2006-09-07 16:41:30 +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
|
|
|
|
|
|
|
|
.if ${TARGET} == ${MACHINE}
|
2002-08-02 18:04:22 +00:00
|
|
|
TARGET_CPUTYPE?=${CPUTYPE}
|
2002-04-11 13:43:50 +00:00
|
|
|
.else
|
2002-07-31 03:56:03 +00:00
|
|
|
TARGET_CPUTYPE?=
|
2002-04-11 13:43:50 +00:00
|
|
|
.endif
|
2006-09-07 16:41:30 +00:00
|
|
|
|
2002-08-08 15:43:23 +00:00
|
|
|
.if !empty(TARGET_CPUTYPE)
|
|
|
|
_TARGET_CPUTYPE=${TARGET_CPUTYPE}
|
|
|
|
.else
|
|
|
|
_TARGET_CPUTYPE=dummy
|
|
|
|
.endif
|
2016-03-08 21:26:25 +00:00
|
|
|
_CPUTYPE!= MK_AUTO_OBJ=no MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} \
|
Further fix the case mentioned in rev. 1.302. The
intent was (and still is) that if a user has say
CPUTYPE=i686 set in /etc/make.conf, we don't print
the assignment type warning unless TARGET_CPUTYPE
is overridden.
Unfortunately, the implementation was buggy, and
only recent changes to bsd.cpu.mk that swapped
canonical and alias values of some CPU types made
the bug apparent.
Here's what happens here.
- CPUTYPE=i686 is set in /etc/make.conf,
- bsd.cpu.mk reset it to "pentiumpro",
- Makefile.inc1 compares this canonical value
with the result of the following test,
make -f /dev/null CPUTYPE=pentiumpro -V CPUTYPE
and expects the result to be "pentiumpro" too,
but "i686" is returned, here's why. We have two
CPUTYPE variables, global, set to "i686" in
/etc/make.conf, and command-line (of a higher
precedence), set to "pentiumpro".
The following part of bsd.cpu.mk,
. elif ${CPUTYPE} == "i686"
CPUTYPE = pentiumpro
which is responsible for converting aliases to
canonical values, sees the value of the CPUTYPE
command-line variable first, "pentiumpro", and
no conversion is done -- the net effect is that
CPUTYPE global stays with its old value "i686",
and "make -V CPUTYPE" (which prints variables
in the global context) returns "i686".
The fix was to pass the CPUTYPE in the test above
as an environment variable instead of as a command
line variable, i.e.,
CPUTYPE=pentiumpro make -f /dev/null -V CPUTYPE
This time, CPUTYPE global is still set to "i686"
initially (by /etc/make.conf), and an envieronment
variable CPUTYPE (of a lower precedence) is set
to "pentiumpro". The .elif sees it's set to
"i686" and resets it to "pentiumpro", and so
"make -V" returns "pentiumpro".
NB: these various types of make(1) variables can
be very painful, especially when combined with
"make -V".
2004-12-22 22:00:01 +00:00
|
|
|
-f /dev/null -m ${.CURDIR}/share/mk -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
|
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
|
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 ${MACHINE_ARCH} != ${BUILD_ARCH}
|
|
|
|
.error To cross-build, set TARGET_ARCH.
|
|
|
|
.endif
|
|
|
|
.endif
|
2010-09-08 19:53:16 +00:00
|
|
|
.if ${MACHINE} == ${TARGET} && ${MACHINE_ARCH} == ${TARGET_ARCH} && !defined(CROSS_BUILD_TESTING)
|
1999-12-11 17:05:36 +00:00
|
|
|
OBJTREE= ${MAKEOBJDIRPREFIX}
|
|
|
|
.else
|
2010-06-24 16:32:20 +00:00
|
|
|
OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}
|
1999-12-11 17:05:36 +00:00
|
|
|
.endif
|
2005-03-02 16:40:51 +00:00
|
|
|
WORLDTMP= ${OBJTREE}${.CURDIR}/tmp
|
Step 1 of eliminating the "games" distribution: Move binaries to /usr/bin;
update paths; and include everything in the "base" distribution.
The "games" distribution being optional made sense when there were more
games and we had small disks; but the "games-like" games were moved into
the ports tree a dozen years ago and the remaining "utility-like" games
occupy less than 0.001% of my laptop's small hard drive. Meanwhile every
new user is confronted by the question "do you want games installed" when
they they try to install FreeBSD.
The next steps will be:
2. Removing punch card (bcd, ppt), phase-of-moon (pom), clock (grdc), and
caesar cipher (caesar, rot13) utilities. I intend to keep fortune, factor,
morse, number, primes, and random, since there is evidence that those are
still being used.
3. Merging src/games into src/usr.bin.
This change will not be MFCed.
Reviewed by: jmg
Discussed at: EuroBSDCon
Approved by: gjb (release-affecting changes)
2015-02-12 05:35:00 +00:00
|
|
|
BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin
|
|
|
|
XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin
|
2003-04-13 11:42:55 +00:00
|
|
|
STRICTTMPPATH= ${BPATH}:${XPATH}
|
1998-10-17 11:56:20 +00:00
|
|
|
TMPPATH= ${STRICTTMPPATH}:${PATH}
|
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)
|
2001-12-23 22:49:06 +00:00
|
|
|
INSTALLTMP!= /usr/bin/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
|
2016-06-05 23:05:10 +00:00
|
|
|
# Keep these in sync
|
|
|
|
MINIMUM_SUPPORTED_OSREL?= 900044
|
|
|
|
MINIMUM_SUPPORTED_REL?= 9.1
|
2003-04-13 15:43:29 +00:00
|
|
|
|
1999-12-20 10:32:11 +00:00
|
|
|
# Common environment for world related stages
|
2015-11-05 21:48:12 +00:00
|
|
|
CROSSENV+= MAKEOBJDIRPREFIX=${OBJTREE} \
|
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.
|
|
|
|
CROSSENV+= BUILD_TOOLS_META=.NOMETA_CMP
|
|
|
|
.endif
|
2011-02-22 08:13:49 +00:00
|
|
|
.if ${MK_GROFF} != "no"
|
|
|
|
CROSSENV+= GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \
|
|
|
|
GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \
|
|
|
|
GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac
|
|
|
|
.endif
|
2014-03-14 19:45:40 +00:00
|
|
|
.if defined(TARGET_CFLAGS)
|
|
|
|
CROSSENV+= ${TARGET_CFLAGS}
|
|
|
|
.endif
|
1999-12-09 16:40:27 +00:00
|
|
|
|
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" \
|
2016-04-14 21:09:03 +00:00
|
|
|
TOOLS_PREFIX=${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= \
|
2002-11-13 13:49:29 +00:00
|
|
|
BOOTSTRAPPING=${OSRELDATE} \
|
2014-08-19 15:04:32 +00:00
|
|
|
SSP_CFLAGS= \
|
2015-01-02 18:45:03 +00:00
|
|
|
MK_HTML=no NO_LINT=yes MK_MAN=no \
|
2014-04-25 19:25:26 +00:00
|
|
|
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
|
2014-05-10 16:38:03 +00:00
|
|
|
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
|
2014-12-18 18:26:10 +00:00
|
|
|
MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
|
2015-03-25 20:57:08 +00:00
|
|
|
MK_LLDB=no MK_TESTS=no \
|
2015-09-25 00:30:53 +00:00
|
|
|
MK_INCLUDES=yes
|
1999-12-20 10:32:11 +00:00
|
|
|
|
2015-09-26 04:22:18 +00:00
|
|
|
BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \
|
|
|
|
${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
|
|
|
|
${BSARGS}
|
1999-12-20 10:32:11 +00:00
|
|
|
|
2003-04-06 21:23:02 +00:00
|
|
|
# build-tools stage
|
2003-04-05 20:30:30 +00:00
|
|
|
TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
|
2013-02-03 10:26:24 +00:00
|
|
|
${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= \
|
2011-05-11 17:50:19 +00:00
|
|
|
BOOTSTRAPPING=${OSRELDATE} \
|
2014-08-19 15:04:32 +00:00
|
|
|
SSP_CFLAGS= \
|
2011-05-11 17:50:19 +00:00
|
|
|
-DNO_LINT \
|
2014-12-18 18:26:10 +00:00
|
|
|
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
|
|
|
|
MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
|
|
|
|
MK_LLDB=no MK_TESTS=no
|
1999-12-20 10:32:11 +00:00
|
|
|
|
2003-04-06 21:23:02 +00:00
|
|
|
# cross-tools stage
|
2006-03-17 18:54:44 +00:00
|
|
|
XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
|
2006-09-07 20:27:56 +00:00
|
|
|
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
|
2014-03-30 22:24:53 +00:00
|
|
|
MK_GDB=no 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} \
|
2015-10-17 05:55:45 +00:00
|
|
|
WORLDTMP=${WORLDTMP}
|
2013-11-09 00:15:36 +00:00
|
|
|
KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOBJDIRPREFIX=${WORLDTMP} \
|
|
|
|
${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
|
|
|
|
DESTDIR= \
|
|
|
|
BOOTSTRAPPING=${OSRELDATE} \
|
2014-08-19 15:04:32 +00:00
|
|
|
SSP_CFLAGS= \
|
2015-01-02 18:45:03 +00:00
|
|
|
MK_HTML=no -DNO_LINT MK_MAN=no \
|
2014-04-25 19:25:26 +00:00
|
|
|
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
|
2014-05-10 16:38:03 +00:00
|
|
|
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no
|
2013-11-09 00:15:36 +00:00
|
|
|
|
1999-12-20 10:32:11 +00:00
|
|
|
# world stage
|
|
|
|
WMAKEENV= ${CROSSENV} \
|
2000-01-11 16:23:51 +00:00
|
|
|
INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
1999-12-10 10:48:20 +00:00
|
|
|
PATH=${TMPPATH}
|
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}" \
|
2013-05-15 14:30:03 +00:00
|
|
|
AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \
|
2016-07-27 14:58:15 +00:00
|
|
|
OBJCOPY="${XOBJCOPY}" \
|
2014-10-09 15:52:01 +00:00
|
|
|
RANLIB=${XRANLIB} STRINGS=${XSTRINGS} \
|
|
|
|
SIZE="${XSIZE}"
|
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
|
2014-10-01 08:26:51 +00:00
|
|
|
.if ${TARGET} == "arm"
|
2016-05-18 22:50:25 +00:00
|
|
|
.if ${TARGET_ARCH:Marmv6*} != "" && ${TARGET_CPUTYPE:M*soft*} == ""
|
2014-03-23 12:49:25 +00:00
|
|
|
TARGET_ABI= gnueabihf
|
2014-10-01 12:47:25 +00:00
|
|
|
.else
|
|
|
|
TARGET_ABI= gnueabi
|
2013-05-15 14:30:03 +00:00
|
|
|
.endif
|
2014-03-30 23:43:30 +00:00
|
|
|
.endif
|
2016-08-23 19:29:37 +00:00
|
|
|
.if ${WANT_COMPILER_TYPE} == gcc || \
|
|
|
|
(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc)
|
2016-06-15 23:58:03 +00:00
|
|
|
# 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.
|
2016-05-29 06:20:15 +00:00
|
|
|
XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib
|
2016-08-23 19:29:37 +00:00
|
|
|
# GCC requires -B to find /usr/lib/crti.o when using a cross-compiler
|
|
|
|
# combined with --sysroot.
|
|
|
|
XCFLAGS+= -B${WORLDTMP}/usr/lib
|
2016-05-29 06:20:15 +00:00
|
|
|
# Force using libc++ for external GCC.
|
2016-06-15 23:58:03 +00:00
|
|
|
# XXX: This should be checking MK_GNUCXX == no
|
2016-06-29 01:50:30 +00:00
|
|
|
.if ${X_COMPILER_VERSION} >= 40800
|
2016-05-29 06:20:15 +00:00
|
|
|
XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \
|
|
|
|
-nostdinc++ -L${WORLDTMP}/../lib/libc++
|
2016-06-29 01:50:30 +00:00
|
|
|
.endif
|
2016-08-23 19:29:37 +00:00
|
|
|
.elif ${WANT_COMPILER_TYPE} == clang || \
|
|
|
|
(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == clang)
|
2014-03-30 23:43:30 +00:00
|
|
|
TARGET_ABI?= unknown
|
2016-07-11 21:55:56 +00:00
|
|
|
TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd12.0
|
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
|
|
|
|
2016-03-11 23:56:33 +00:00
|
|
|
.if ${MK_LIB32} != "no" && (${TARGET_ARCH} == "amd64" || \
|
|
|
|
${TARGET_ARCH} == "powerpc64")
|
|
|
|
LIBCOMPAT= 32
|
|
|
|
.include "Makefile.libcompat"
|
2016-03-12 23:25:05 +00:00
|
|
|
.elif ${MK_LIBSOFT} != "no" && ${TARGET_ARCH} == "armv6"
|
|
|
|
LIBCOMPAT= SOFT
|
|
|
|
.include "Makefile.libcompat"
|
2010-07-13 21:19:59 +00:00
|
|
|
.endif
|
|
|
|
|
2016-03-11 03:38:10 +00:00
|
|
|
WMAKE= ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 DESTDIR=${WORLDTMP}
|
2004-11-06 03:14:26 +00:00
|
|
|
|
2016-04-05 21:12:03 +00:00
|
|
|
IMAKEENV= ${CROSSENV}
|
2013-01-15 00:12:34 +00:00
|
|
|
IMAKE= ${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
|
2013-01-15 00:12:34 +00:00
|
|
|
.if defined(DB_FROM_SRC)
|
2013-01-22 21:10:03 +00:00
|
|
|
INSTALLFLAGS+= -N ${.CURDIR}/etc
|
|
|
|
MTREEFLAGS+= -N ${.CURDIR}/etc
|
|
|
|
.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
|
|
|
|
IMAKE+= -DNO_ROOT METALOG=${METALOG}
|
2013-05-30 14:09:58 +00:00
|
|
|
INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR}
|
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)
|
|
|
|
IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}"
|
2014-01-30 22:26:51 +00:00
|
|
|
IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}"
|
2013-01-15 00:12:34 +00:00
|
|
|
.endif
|
1999-12-10 10:48:20 +00:00
|
|
|
|
2001-01-22 08:07:58 +00:00
|
|
|
# kernel stage
|
2002-09-17 01:49:00 +00:00
|
|
|
KMAKEENV= ${WMAKEENV}
|
2013-04-12 17:57:40 +00:00
|
|
|
KMAKE= ${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.
|
|
|
|
#
|
2015-10-21 05:33:48 +00:00
|
|
|
_worldtmp: .PHONY
|
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
|
2004-03-04 09:14:30 +00:00
|
|
|
false
|
2003-02-04 08:15:30 +00:00
|
|
|
.endif
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
1999-12-10 10:48:20 +00:00
|
|
|
@echo ">>> Rebuilding the temporary build tree"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-12-21 12:21:26 +00:00
|
|
|
.if !defined(NO_CLEAN)
|
1998-08-31 01:08:08 +00:00
|
|
|
rm -rf ${WORLDTMP}
|
2016-03-11 23:56:33 +00:00
|
|
|
.if defined(LIBCOMPAT)
|
|
|
|
rm -rf ${LIBCOMPATTMP}
|
2005-08-05 23:48:58 +00:00
|
|
|
.endif
|
2002-04-11 14:49:32 +00:00
|
|
|
.else
|
2003-04-06 23:46:02 +00:00
|
|
|
rm -rf ${WORLDTMP}/legacy/usr/include
|
2016-01-11 20:27:05 +00:00
|
|
|
# XXX - These can depend on any header file.
|
2016-01-08 22:59:49 +00:00
|
|
|
rm -f ${OBJTREE}${.CURDIR}/lib/libsysdecode/ioctl.c
|
2008-02-05 08:56:18 +00:00
|
|
|
rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c
|
1999-12-10 10:48:20 +00:00
|
|
|
.endif
|
2003-04-13 14:34:17 +00:00
|
|
|
.for _dir in \
|
2016-02-25 18:23:40 +00:00
|
|
|
lib lib/casper usr legacy/bin legacy/usr
|
2003-04-13 14:34:17 +00:00
|
|
|
mkdir -p ${WORLDTMP}/${_dir}
|
1999-12-08 13:45:11 +00:00
|
|
|
.endfor
|
2009-03-15 13:14:06 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${WORLDTMP}/legacy/usr >/dev/null
|
2011-02-22 08:13:49 +00:00
|
|
|
.if ${MK_GROFF} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.groff.dist \
|
|
|
|
-p ${WORLDTMP}/legacy/usr >/dev/null
|
|
|
|
.endif
|
2016-06-09 21:57:34 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
|
|
|
-p ${WORLDTMP}/legacy/usr/include >/dev/null
|
2009-03-15 13:14:06 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${WORLDTMP}/usr >/dev/null
|
2003-05-18 20:22:26 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
2004-03-14 16:44:27 +00:00
|
|
|
-p ${WORLDTMP}/usr/include >/dev/null
|
2001-03-22 09:54:25 +00:00
|
|
|
ln -sf ${.CURDIR}/sys ${WORLDTMP}
|
2013-06-07 21:40:02 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
|
|
|
# We could instead disable debug files for these build stages
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
|
|
|
|
-p ${WORLDTMP}/legacy/usr/lib >/dev/null
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
|
|
|
|
-p ${WORLDTMP}/usr/lib >/dev/null
|
|
|
|
.endif
|
2016-03-11 23:56:33 +00:00
|
|
|
.if defined(LIBCOMPAT)
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
|
2015-10-20 20:35:34 +00:00
|
|
|
-p ${WORLDTMP}/usr >/dev/null
|
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
2016-03-11 23:56:33 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
|
2015-10-20 20:35:34 +00:00
|
|
|
-p ${WORLDTMP}/legacy/usr/lib/debug/usr >/dev/null
|
2016-03-11 23:56:33 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
|
2015-10-20 20:35:34 +00:00
|
|
|
-p ${WORLDTMP}/usr/lib/debug/usr >/dev/null
|
|
|
|
.endif
|
|
|
|
.endif
|
2013-10-25 05:25:19 +00:00
|
|
|
.if ${MK_TESTS} != "no"
|
2014-12-18 18:16:00 +00:00
|
|
|
mkdir -p ${WORLDTMP}${TESTSBASE}
|
2013-10-25 05:25:19 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
|
2014-12-18 18:16:00 +00:00
|
|
|
-p ${WORLDTMP}${TESTSBASE} >/dev/null
|
2015-10-15 01:46:55 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
2015-10-15 21:21:41 +00:00
|
|
|
mkdir -p ${WORLDTMP}/usr/lib/debug/${TESTSBASE}
|
2015-10-15 01:46:55 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
|
|
|
|
-p ${WORLDTMP}/usr/lib/debug/${TESTSBASE} >/dev/null
|
|
|
|
.endif
|
2013-10-25 05:25:19 +00:00
|
|
|
.endif
|
2012-10-18 12:32:51 +00:00
|
|
|
.for _mtree in ${LOCAL_MTREE}
|
|
|
|
mtree -deU -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null
|
|
|
|
.endfor
|
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
|
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:
|
2004-12-21 12:21:26 +00:00
|
|
|
.if !defined(NO_CLEAN)
|
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 "--------------------------------------------------------------"
|
2015-10-17 03:51:50 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR}
|
2016-03-11 23:56:33 +00:00
|
|
|
.if defined(LIBCOMPAT)
|
|
|
|
${_+_}cd ${.CURDIR}; ${LIBCOMPATWMAKE} -f Makefile.inc1 ${CLEANDIR}
|
2005-08-05 23:48:58 +00:00
|
|
|
.endif
|
1999-01-04 12:05:59 +00:00
|
|
|
.endif
|
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 "--------------------------------------------------------------"
|
2015-10-17 03:51:50 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} 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 "--------------------------------------------------------------"
|
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
|
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
|
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 \
|
2014-10-22 03:39:11 +00:00
|
|
|
MK_PROFILE=no MK_TESTS=no MK_TESTS_SUPPORT=${MK_TESTS} libraries
|
2016-04-21 16:43:36 +00:00
|
|
|
everything: .PHONY
|
1999-12-20 10:32:11 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2016-03-30 23:50:23 +00:00
|
|
|
@echo ">>> stage 4.3: 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=
|
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
|
|
|
WMAKE_TGTS+= _worldtmp _legacy
|
|
|
|
.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
|
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
|
|
|
WMAKE_TGTS+= _cleanobj _obj _build-tools _cross-tools
|
2016-02-24 17:20:22 +00:00
|
|
|
WMAKE_TGTS+= _includes _libraries
|
|
|
|
WMAKE_TGTS+= everything
|
2016-03-11 23:56:33 +00:00
|
|
|
.if defined(LIBCOMPAT) && empty(SUBDIR_OVERRIDE)
|
|
|
|
WMAKE_TGTS+= build${libcompat}
|
2004-11-06 03:14:26 +00:00
|
|
|
.endif
|
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
|
|
|
|
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
|
|
|
|
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`"
|
|
|
|
@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}
|
|
|
|
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
|
2015-11-05 22:28:31 +00:00
|
|
|
@cd ${BUILDENV_DIR} && env ${WMAKEENV} BUILDENV=1 ${BUILDENV_SHELL} \
|
|
|
|
|| true
|
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
|
|
|
|
kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries} .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
|
|
|
|
_installcheck_kernel: .PHONY
|
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
|
|
|
|
.if ${MK_SENDMAIL} != "no"
|
|
|
|
CHECK_UIDS+= smmsp
|
|
|
|
CHECK_GIDS+= smmsp
|
|
|
|
.endif
|
|
|
|
.if ${MK_PF} != "no"
|
|
|
|
CHECK_UIDS+= proxy
|
|
|
|
CHECK_GIDS+= proxy authpf
|
|
|
|
.endif
|
2013-09-17 12:59:37 +00:00
|
|
|
.if ${MK_UNBOUND} != "no"
|
|
|
|
CHECK_UIDS+= unbound
|
|
|
|
CHECK_GIDS+= unbound
|
|
|
|
.endif
|
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
|
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
|
|
|
|
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 \
|
2014-12-17 20:02:07 +00:00
|
|
|
rm sed services_mkdb sh strip sysctl test true uname wc ${_zoneinfo} \
|
2014-06-17 22:23:36 +00:00
|
|
|
${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
|
2012-09-03 18:17:21 +00:00
|
|
|
EXTRA_DISTRIBUTIONS= doc
|
2016-03-11 23:56:33 +00:00
|
|
|
.if defined(LIBCOMPAT)
|
|
|
|
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"
|
2015-02-10 01:35:26 +00:00
|
|
|
DEBUG_DISTRIBUTIONS+= base ${EXTRA_DISTRIBUTIONS:S,doc,,: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 \
|
2007-10-15 13:50:46 +00:00
|
|
|
if progpath=`which $$prog`; then \
|
2007-12-04 12:55:27 +00:00
|
|
|
echo $$progpath; \
|
2007-10-15 13:50:46 +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
|
|
|
echo "Required tool $$prog not found in PATH." >&2; \
|
2007-10-15 13:50:46 +00:00
|
|
|
exit 1; \
|
|
|
|
fi; \
|
2007-12-04 12:55:27 +00:00
|
|
|
done); \
|
|
|
|
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); \
|
|
|
|
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}
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \
|
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist} >/dev/null
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null
|
2013-06-07 21:40:02 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
|
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null
|
|
|
|
.endif
|
2016-03-11 23:56:33 +00:00
|
|
|
.if defined(LIBCOMPAT)
|
|
|
|
mtree -deU -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"
|
2016-03-11 23:56:33 +00:00
|
|
|
mtree -deU -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}
|
2014-06-10 17:04:30 +00:00
|
|
|
mtree -deU -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"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
|
|
|
|
-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)
|
2014-01-30 22:26:51 +00:00
|
|
|
${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \
|
2013-01-22 21:10:03 +00:00
|
|
|
sed -e 's#^\./#./${dist}/#' >> ${METALOG}
|
2014-01-30 22:26:51 +00:00
|
|
|
${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \
|
2013-01-22 21:10:03 +00:00
|
|
|
sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
|
2014-01-30 22:26:51 +00:00
|
|
|
${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \
|
2013-01-22 21:10:03 +00:00
|
|
|
sed -e 's#^\./#./${dist}/usr/include/#' >> ${METALOG}
|
2016-03-11 23:56:33 +00:00
|
|
|
.if defined(LIBCOMPAT)
|
|
|
|
${IMAKEENV} 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
|
2011-03-02 14:39:26 +00:00
|
|
|
.endif
|
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
|
2011-03-02 14:39:26 +00:00
|
|
|
.endif
|
|
|
|
|
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
|
|
|
|
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 "--------------------------------------------------------------"
|
|
|
|
@echo ">>> Installing everything"
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
|
2016-05-13 17:44:20 +00:00
|
|
|
.if defined(LIBCOMPAT)
|
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install${libcompat}
|
2015-02-10 22:05:57 +00:00
|
|
|
.endif
|
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
|
2016-03-11 23:56:33 +00:00
|
|
|
.if defined(LIBCOMPAT)
|
|
|
|
${_+_}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} \
|
2016-02-16 02:14:09 +00:00
|
|
|
METALOG=${METALOG} MK_TESTS=no 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
|
|
|
|
.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
|
|
|
|
KRNLOBJDIR= ${OBJTREE}${KERNSRCDIR}
|
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}
|
2001-08-27 12:01:46 +00:00
|
|
|
.if 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
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
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
|
|
|
|
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} \
|
2014-05-03 09:24:20 +00:00
|
|
|
-I '${KERNCONFDIR}' '${KERNCONFDIR}/${_kernel}'
|
2001-01-22 23:10:01 +00:00
|
|
|
.endif
|
2004-12-21 12:21:26 +00:00
|
|
|
.if !defined(NO_CLEAN) && !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}
|
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 "--------------------------------------------------------------"
|
2000-01-09 17:56:40 +00:00
|
|
|
.endfor
|
|
|
|
|
2016-05-04 21:15:28 +00:00
|
|
|
NO_INSTALLEXTRAKERNELS?= yes
|
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 "--------------------------------------------------------------"
|
2011-05-05 00:43:55 +00:00
|
|
|
@echo ">>> Installing kernel ${INSTALLKERNEL}"
|
2004-03-13 15:46:34 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2000-09-17 21:02:58 +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//}
|
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 "--------------------------------------------------------------"
|
|
|
|
@echo ">>> Installing kernel ${_kernel}"
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
cd ${KRNLOBJDIR}/${_kernel}; \
|
|
|
|
${CROSSENV} PATH=${TMPPATH} \
|
|
|
|
${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//}
|
|
|
|
.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
|
|
|
|
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
|
2012-01-15 08:36:25 +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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
2016-03-22 21:02:04 +00:00
|
|
|
WSTAGEDIR?= ${MAKEOBJDIRPREFIX}${.CURDIR}/${TARGET}.${TARGET_ARCH}/worldstage
|
|
|
|
KSTAGEDIR?= ${MAKEOBJDIRPREFIX}${.CURDIR}/${TARGET}.${TARGET_ARCH}/kernelstage
|
|
|
|
REPODIR?= ${MAKEOBJDIRPREFIX}${.CURDIR}/repo
|
2016-01-25 16:18:08 +00:00
|
|
|
PKGSIGNKEY?= # empty
|
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
|
2016-01-28 23:59:34 +00:00
|
|
|
.if !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
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
packages: .PHONY
|
2016-04-21 16:30:25 +00:00
|
|
|
${_+_}${MAKE} -C ${.CURDIR} PKG_VERSION=${PKG_VERSION} real-packages
|
2016-02-09 19:27:38 +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-02-24 03:05:05 +00:00
|
|
|
PKG_VERSION=${PKG_VERSION} REPODIR=${REPODIR} WSTAGEDIR=${WSTAGEDIR} \
|
|
|
|
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
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
stage-packages: .PHONY
|
2016-04-08 01:57:40 +00:00
|
|
|
@mkdir -p ${REPODIR} ${WSTAGEDIR} ${KSTAGEDIR}
|
2016-01-22 18:06:09 +00:00
|
|
|
${_+_}@cd ${.CURDIR}; \
|
2016-04-05 23:24:17 +00:00
|
|
|
${MAKE} DESTDIR=${WSTAGEDIR} -DNO_ROOT -B stageworld ; \
|
|
|
|
${MAKE} DESTDIR=${KSTAGEDIR} -DNO_ROOT -B stagekernel
|
2016-02-08 16:08:13 +00:00
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
create-packages: _pkgbootstrap .PHONY
|
2016-02-08 16:08:13 +00:00
|
|
|
@mkdir -p ${REPODIR}
|
|
|
|
${_+_}@cd ${.CURDIR}; \
|
2016-04-05 23:24:17 +00:00
|
|
|
${MAKE} DESTDIR=${WSTAGEDIR} \
|
2016-01-29 21:42:27 +00:00
|
|
|
PKG_VERSION=${PKG_VERSION} create-world-packages ; \
|
2016-04-05 23:24:17 +00:00
|
|
|
${MAKE} DESTDIR=${KSTAGEDIR} \
|
2016-01-29 21:42:27 +00:00
|
|
|
PKG_VERSION=${PKG_VERSION} DISTDIR=kernel \
|
|
|
|
create-kernel-packages
|
2016-01-22 18:06:09 +00:00
|
|
|
|
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} ; \
|
2015-03-05 00:13:42 +00:00
|
|
|
awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
|
2016-04-08 01:57:40 +00:00
|
|
|
${WSTAGEDIR}/METALOG
|
|
|
|
@for plist in ${WSTAGEDIR}/*.plist; do \
|
2015-03-05 00:13:42 +00:00
|
|
|
plist=$${plist##*/} ; \
|
2016-02-04 15:32:03 +00:00
|
|
|
pkgname=$${plist%.plist} ; \
|
|
|
|
sh ${SRCDIR}/release/packages/generate-ucl.sh -o $${pkgname} \
|
2016-04-08 01:57:40 +00:00
|
|
|
-s ${SRCDIR} -u ${WSTAGEDIR}/$${pkgname}.ucl ; \
|
2015-03-05 00:13:42 +00:00
|
|
|
done
|
2016-04-08 01:57:40 +00:00
|
|
|
@for plist in ${WSTAGEDIR}/*.plist; do \
|
2015-03-05 00:13:42 +00:00
|
|
|
plist=$${plist##*/} ; \
|
|
|
|
pkgname=$${plist%.plist} ; \
|
2015-11-17 21:10:15 +00:00
|
|
|
awk -F\" ' \
|
|
|
|
/^name/ { printf("===> Creating %s-", $$2); next } \
|
|
|
|
/^version/ { print $$2; next } \
|
2016-04-08 01:57:40 +00:00
|
|
|
' ${WSTAGEDIR}/$${pkgname}.ucl ; \
|
|
|
|
pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
|
|
|
|
create -M ${WSTAGEDIR}/$${pkgname}.ucl \
|
|
|
|
-p ${WSTAGEDIR}/$${pkgname}.plist \
|
|
|
|
-r ${WSTAGEDIR} \
|
|
|
|
-o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} ; \
|
2015-03-05 00:13:42 +00:00
|
|
|
done
|
|
|
|
|
2016-04-21 16:30:16 +00:00
|
|
|
create-kernel-packages: _pkgbootstrap .PHONY
|
2016-04-08 01:57:40 +00:00
|
|
|
.if exists(${KSTAGEDIR}/kernel.meta)
|
2016-03-08 19:35:30 +00:00
|
|
|
.for flavor in "" -debug
|
2016-04-08 01:57:40 +00:00
|
|
|
@cd ${KSTAGEDIR}/${DISTDIR} ; \
|
2016-01-27 21:10:03 +00:00
|
|
|
awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
|
2016-02-16 20:11:00 +00:00
|
|
|
-v kernel=yes -v _kernconf=${INSTALLKERNEL} \
|
2016-04-08 01:57:40 +00:00
|
|
|
${KSTAGEDIR}/kernel.meta ; \
|
2016-01-27 21:10:03 +00:00
|
|
|
cap_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VCAP_MKDB_ENDIAN` ; \
|
|
|
|
pwd_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VPWD_MKDB_ENDIAN` ; \
|
|
|
|
sed -e "s/%VERSION%/${PKG_VERSION}/" \
|
2016-03-08 19:35:30 +00:00
|
|
|
-e "s/%PKGNAME%/kernel-${INSTALLKERNEL:tl}${flavor}/" \
|
2016-02-16 20:11:00 +00:00
|
|
|
-e "s/%COMMENT%/FreeBSD ${INSTALLKERNEL} kernel ${flavor}/" \
|
|
|
|
-e "s/%DESC%/FreeBSD ${INSTALLKERNEL} kernel ${flavor}/" \
|
2016-01-27 21:10:03 +00:00
|
|
|
-e "s/%CAP_MKDB_ENDIAN%/$${cap_arg}/g" \
|
|
|
|
-e "s/%PWD_MKDB_ENDIAN%/$${pwd_arg}/g" \
|
|
|
|
${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 ; \
|
2016-03-02 21:04:17 +00:00
|
|
|
pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
|
2016-04-08 01:57:40 +00:00
|
|
|
create -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \
|
|
|
|
-p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \
|
|
|
|
-r ${KSTAGEDIR}/${DISTDIR} \
|
2016-02-09 19:27:38 +00:00
|
|
|
-o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}
|
2015-02-08 18:12:34 +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"
|
2016-01-27 21:10:03 +00:00
|
|
|
.for _kernel in ${BUILDKERNELS:[2..-1]}
|
2016-04-08 01:57:40 +00:00
|
|
|
.if exists(${KSTAGEDIR}/kernel.${_kernel}.meta)
|
2016-03-08 19:35:30 +00:00
|
|
|
.for flavor in "" -debug
|
2016-04-08 01:57:40 +00:00
|
|
|
@cd ${KSTAGEDIR}/kernel.${_kernel} ; \
|
2016-01-27 21:10:03 +00:00
|
|
|
awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
|
|
|
|
-v kernel=yes -v _kernconf=${_kernel} \
|
2016-04-08 01:57:40 +00:00
|
|
|
${KSTAGEDIR}/kernel.${_kernel}.meta ; \
|
2016-01-27 21:10:03 +00:00
|
|
|
cap_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VCAP_MKDB_ENDIAN` ; \
|
|
|
|
pwd_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VPWD_MKDB_ENDIAN` ; \
|
|
|
|
sed -e "s/%VERSION%/${PKG_VERSION}/" \
|
2016-03-08 19:35:30 +00:00
|
|
|
-e "s/%PKGNAME%/kernel-${_kernel:tl}${flavor}/" \
|
2016-01-27 21:24:45 +00:00
|
|
|
-e "s/%COMMENT%/FreeBSD ${_kernel} kernel ${flavor}/" \
|
|
|
|
-e "s/%DESC%/FreeBSD ${_kernel} kernel ${flavor}/" \
|
2016-01-27 21:10:03 +00:00
|
|
|
-e "s/%CAP_MKDB_ENDIAN%/$${cap_arg}/g" \
|
|
|
|
-e "s/%PWD_MKDB_ENDIAN%/$${pwd_arg}/g" \
|
|
|
|
${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 ; \
|
2016-03-02 21:04:17 +00:00
|
|
|
pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
|
2016-04-08 01:57:40 +00:00
|
|
|
create -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \
|
|
|
|
-p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \
|
|
|
|
-r ${KSTAGEDIR}/kernel.${_kernel} \
|
2016-02-09 19:27:38 +00:00
|
|
|
-o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}
|
2015-02-08 18:12:34 +00:00
|
|
|
.endfor
|
2016-01-27 21:10:03 +00:00
|
|
|
.endif
|
2015-02-08 18:12:34 +00:00
|
|
|
.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
|
2016-02-09 19:27:38 +00:00
|
|
|
@[ -L "${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest" ] && \
|
|
|
|
unlink ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest ; \
|
2016-02-09 20:12:26 +00:00
|
|
|
pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh repo \
|
2016-02-09 19:27:38 +00:00
|
|
|
-o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \
|
|
|
|
${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \
|
|
|
|
${PKGSIGNKEY} ; \
|
2016-02-09 20:12:26 +00:00
|
|
|
ln -s ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \
|
2016-02-09 19:27:38 +00:00
|
|
|
${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/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
|
|
|
|
@if [ ! -x ${LOCALBASE}/bin/kyua ]; then \
|
|
|
|
echo "You need kyua (devel/kyua) to run the test suite." | /usr/bin/fmt; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
${_+_}${LOCALBASE}/bin/kyua test -k ${TESTSBASE}/Kyuafile
|
|
|
|
|
|
|
|
#
|
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
|
2015-12-20 05:52:03 +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
|
|
|
#
|
|
|
|
# update
|
|
|
|
#
|
2013-05-28 21:57:55 +00:00
|
|
|
# Update the source tree(s), by running svn/svnup to update to the
|
1998-08-31 01:08:08 +00:00
|
|
|
# latest copy.
|
|
|
|
#
|
2016-04-21 16:30:16 +00:00
|
|
|
update: .PHONY
|
2009-06-14 15:16:24 +00:00
|
|
|
.if defined(SVN_UPDATE)
|
2013-05-28 23:43:47 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> Updating ${.CURDIR} using Subversion"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2015-12-01 19:00:43 +00:00
|
|
|
@(cd ${.CURDIR}; ${SVN} update ${SVNFLAGS})
|
1998-08-31 01:08:08 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# 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
|
|
|
#
|
2015-08-11 15:43:09 +00:00
|
|
|
|
|
|
|
# ELF Tool Chain libraries are needed for ELF tools and dtrace tools.
|
2016-03-12 19:08:13 +00:00
|
|
|
# r296685 fix cross-endian objcopy
|
|
|
|
.if ${BOOTSTRAPPING} < 1100102
|
2015-09-25 00:30:53 +00:00
|
|
|
_elftoolchain_libs= lib/libelf lib/libdwarf
|
2015-08-11 15:43:09 +00:00
|
|
|
.endif
|
|
|
|
|
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
|
2015-08-11 15:43:09 +00:00
|
|
|
.for _tool in tools/build ${_elftoolchain_libs}
|
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}; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ obj; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \
|
2016-06-05 23:56:28 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ MK_INCLUDES=no all; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ MK_INCLUDES=no \
|
|
|
|
DESTDIR=${MAKEOBJDIRPREFIX}/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
|
|
|
|
# libraries, augmented by -legacy.
|
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
|
|
|
|
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
|
|
|
|
|
2015-06-21 22:45:53 +00:00
|
|
|
.if ${MK_GCC} != "no" && ${MK_CXX} != "no"
|
2005-02-27 11:22:58 +00:00
|
|
|
_gperf= gnu/usr.bin/gperf
|
2003-04-30 10:58:52 +00:00
|
|
|
.endif
|
2011-02-22 08:13:49 +00:00
|
|
|
|
|
|
|
.if ${MK_GROFF} != "no"
|
2015-05-01 20:08:25 +00:00
|
|
|
_groff= gnu/usr.bin/groff \
|
|
|
|
usr.bin/soelim
|
2003-05-31 21:29:38 +00:00
|
|
|
.endif
|
2003-04-30 10:58:52 +00:00
|
|
|
|
2014-06-30 00:20:12 +00:00
|
|
|
.if ${MK_VT} != "no"
|
2014-06-12 18:31:32 +00:00
|
|
|
_vtfontcvt= usr.bin/vtfontcvt
|
|
|
|
.endif
|
|
|
|
|
2016-01-08 21:07:34 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1000033
|
2015-11-04 07:20:55 +00:00
|
|
|
_libopenbsd= lib/libopenbsd
|
2015-05-30 19:29:19 +00:00
|
|
|
_m4= usr.bin/m4
|
2016-01-08 21:07:34 +00:00
|
|
|
_lex= usr.bin/lex
|
2013-05-21 19:32:35 +00:00
|
|
|
|
2015-11-04 07:20:55 +00:00
|
|
|
${_bt}-usr.bin/m4: ${_bt}-lib/libopenbsd
|
2016-01-08 21:07:34 +00:00
|
|
|
${_bt}-usr.bin/lex: ${_bt}-usr.bin/m4
|
2009-12-31 00:07:26 +00:00
|
|
|
.endif
|
|
|
|
|
2013-01-21 23:12:50 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1000026
|
2013-01-15 00:12:34 +00:00
|
|
|
_nmtree= lib/libnetbsd \
|
|
|
|
usr.sbin/nmtree
|
2015-02-23 05:28:17 +00:00
|
|
|
|
|
|
|
${_bt}-usr.sbin/nmtree: ${_bt}-lib/libnetbsd
|
2013-01-15 00:12:34 +00:00
|
|
|
.endif
|
|
|
|
|
2013-01-29 22:17:58 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1000027
|
|
|
|
_cat= bin/cat
|
|
|
|
.endif
|
|
|
|
|
2016-03-04 16:03:15 +00:00
|
|
|
# r264059 support for status=
|
|
|
|
.if ${BOOTSTRAPPING} < 1100017
|
|
|
|
_dd= bin/dd
|
|
|
|
.endif
|
|
|
|
|
2015-05-19 14:05:15 +00:00
|
|
|
# r277259 crunchide: Correct 64-bit section header offset
|
|
|
|
# r281674 crunchide: always include both 32- and 64-bit ELF support
|
2015-08-12 16:43:15 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1100078
|
2016-05-26 23:20:36 +00:00
|
|
|
_crunchide= usr.sbin/crunch/crunchide
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# r285986 crunchen: use STRIPBIN rather than STRIP
|
|
|
|
# 1100113: Support MK_AUTO_OBJ
|
2016-09-01 23:22:31 +00:00
|
|
|
# 1200006: META_MODE fixes
|
2016-05-26 23:20:36 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1100078 || \
|
2016-09-01 23:22:31 +00:00
|
|
|
(${MK_AUTO_OBJ} == "yes" && ${BOOTSTRAPPING} < 1100114) || \
|
|
|
|
(${MK_META_MODE} == "yes" && ${BOOTSTRAPPING} < 1200006)
|
2016-05-26 23:20:36 +00:00
|
|
|
_crunchgen= usr.sbin/crunch/crunchgen
|
2015-04-17 16:02:49 +00:00
|
|
|
.endif
|
|
|
|
|
2016-04-21 13:14:55 +00:00
|
|
|
# r296926 -P keymap search path, MFC to stable/10 in r298297
|
|
|
|
.if ${BOOTSTRAPPING} < 1003501 || \
|
|
|
|
(${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103)
|
2016-03-28 19:51:45 +00:00
|
|
|
_kbdcontrol= usr.sbin/kbdcontrol
|
|
|
|
.endif
|
|
|
|
|
2015-02-18 23:10:15 +00:00
|
|
|
_yacc= lib/liby \
|
|
|
|
usr.bin/yacc
|
2015-02-23 05:28:17 +00:00
|
|
|
|
|
|
|
${_bt}-usr.bin/yacc: ${_bt}-lib/liby
|
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
|
|
|
|
|
2014-08-18 21:04:44 +00:00
|
|
|
# We need to build tblgen when we're building clang either as
|
2014-04-18 17:03:58 +00:00
|
|
|
# the bootstrap compiler, or as the part of the normal build.
|
|
|
|
.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no"
|
2011-11-10 20:15:35 +00:00
|
|
|
_clang_tblgen= \
|
|
|
|
lib/clang/libllvmsupport \
|
|
|
|
lib/clang/libllvmtablegen \
|
2015-12-31 14:39:45 +00:00
|
|
|
usr.bin/clang/llvm-tblgen \
|
2011-11-10 20:15:35 +00:00
|
|
|
usr.bin/clang/clang-tblgen
|
2015-02-23 05:28:17 +00:00
|
|
|
|
|
|
|
${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/libllvmtablegen ${_bt}-lib/clang/libllvmsupport
|
2015-12-31 14:39:45 +00:00
|
|
|
${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-lib/clang/libllvmtablegen ${_bt}-lib/clang/libllvmsupport
|
2011-11-10 20:15:35 +00:00
|
|
|
.endif
|
|
|
|
|
2014-02-28 18:29:09 +00:00
|
|
|
# Default to building the GPL DTC, but build the BSDL one if users explicitly
|
2013-01-22 17:49:51 +00:00
|
|
|
# request it.
|
2013-01-22 19:40:26 +00:00
|
|
|
_dtc= usr.bin/dtc
|
2013-01-22 17:49:51 +00:00
|
|
|
.if ${MK_GPL_DTC} != "no"
|
2010-06-13 13:02:43 +00:00
|
|
|
_dtc= gnu/usr.bin/dtc
|
|
|
|
.endif
|
|
|
|
|
2012-03-22 08:48:42 +00:00
|
|
|
.if ${MK_KERBEROS} != "no"
|
|
|
|
_kerberos5_bootstrap_tools= \
|
|
|
|
kerberos5/tools/make-roken \
|
|
|
|
kerberos5/lib/libroken \
|
|
|
|
kerberos5/lib/libvers \
|
|
|
|
kerberos5/tools/asn1_compile \
|
2013-05-11 13:44:11 +00:00
|
|
|
kerberos5/tools/slc \
|
|
|
|
usr.bin/compile_et
|
2015-02-23 05:28:17 +00:00
|
|
|
|
2015-04-21 10:17:25 +00:00
|
|
|
.ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g}
|
2012-03-22 08:48:42 +00:00
|
|
|
.endif
|
|
|
|
|
2016-03-05 05:08:57 +00:00
|
|
|
# r283777 makewhatis(1) replaced with mandoc version which builds a database.
|
|
|
|
.if ${MK_MANDOCDB} != "no" && ${BOOTSTRAPPING} < 1100075
|
2015-11-04 07:20:55 +00:00
|
|
|
_libopenbsd?= lib/libopenbsd
|
2015-05-30 19:29:19 +00:00
|
|
|
_makewhatis= lib/libsqlite3 \
|
2015-06-03 13:43:04 +00:00
|
|
|
usr.bin/mandoc
|
2015-11-04 07:20:55 +00:00
|
|
|
${_bt}-usr.bin/mandoc: ${_bt}-lib/libopenbsd ${_bt}-lib/libsqlite3
|
2015-05-30 17:41:37 +00:00
|
|
|
.endif
|
|
|
|
|
2015-02-23 05:28:17 +00:00
|
|
|
bootstrap-tools: .PHONY
|
|
|
|
|
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} \
|
2012-03-22 08:48:42 +00:00
|
|
|
${_kerberos5_bootstrap_tools} \
|
2003-07-01 12:57:53 +00:00
|
|
|
${_strfile} \
|
|
|
|
${_gperf} \
|
|
|
|
${_groff} \
|
2010-06-13 13:02:43 +00:00
|
|
|
${_dtc} \
|
2013-01-29 22:17:58 +00:00
|
|
|
${_cat} \
|
2016-03-04 16:03:15 +00:00
|
|
|
${_dd} \
|
2016-03-28 19:51:45 +00:00
|
|
|
${_kbdcontrol} \
|
2005-02-19 10:25:42 +00:00
|
|
|
usr.bin/lorder \
|
2015-11-04 07:20:55 +00:00
|
|
|
${_libopenbsd} \
|
2015-05-30 17:41:37 +00:00
|
|
|
${_makewhatis} \
|
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} \
|
2003-07-01 12:57:53 +00:00
|
|
|
usr.bin/xinstall \
|
2006-03-09 12:55:02 +00:00
|
|
|
${_gensnmptree} \
|
2013-01-15 00:12:34 +00:00
|
|
|
usr.sbin/config \
|
2016-05-26 23:20:36 +00:00
|
|
|
${_crunchide} \
|
|
|
|
${_crunchgen} \
|
2014-06-12 18:31:32 +00:00
|
|
|
${_nmtree} \
|
2015-08-08 00:18:32 +00:00
|
|
|
${_vtfontcvt} \
|
|
|
|
usr.bin/localedef
|
2015-02-23 05:28:17 +00:00
|
|
|
${_bt}-${_tool}: .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}; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ obj; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ all; \
|
2003-04-13 11:42:55 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
|
2015-02-23 05:28:17 +00:00
|
|
|
|
|
|
|
bootstrap-tools: ${_bt}-${_tool}
|
1999-12-08 13:45:11 +00:00
|
|
|
.endfor
|
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
|
|
|
#
|
2004-12-21 12:13:23 +00:00
|
|
|
.if !defined(NO_SHARE)
|
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
|
|
|
|
|
2012-11-20 03:21:26 +00:00
|
|
|
.if ${MK_GCC} != "no"
|
2012-02-29 22:58:51 +00:00
|
|
|
_gcc_tools= gnu/usr.bin/cc/cc_tools
|
|
|
|
.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
|
|
|
|
|
2003-07-01 12:57:53 +00:00
|
|
|
.for _tool in \
|
|
|
|
bin/csh \
|
|
|
|
bin/sh \
|
2012-01-05 21:50:50 +00:00
|
|
|
${LOCAL_TOOL_DIRS} \
|
2007-01-20 07:48:10 +00:00
|
|
|
lib/ncurses/ncurses \
|
2007-03-09 12:11:58 +00:00
|
|
|
lib/ncurses/ncursesw \
|
2015-08-12 19:21:58 +00:00
|
|
|
${_rescue} \
|
2003-07-01 12:57:53 +00:00
|
|
|
${_share} \
|
|
|
|
usr.bin/awk \
|
2004-08-09 10:51:01 +00:00
|
|
|
lib/libmagic \
|
Add the BSD-licensed Citrus iconv to the base system with default off
setting. It can be built by setting the WITH_ICONV knob. While this
knob is unset, the library part, the binaries, the header file and
the metadata files will not be built or installed so it makes no impact
on the system if left turned off.
This work is based on the iconv implementation in NetBSD but a great
number of improvements and feature additions have been included:
- Some utilities have been added. There is a conversion table generator,
which can compare conversion tables to reference data generated by
GNU libiconv. This helps ensuring conversion compatibility.
- UTF-16 surrogate support and some endianness issues have been fixed.
- The rather chaotic Makefiles to build metadata have been refactored
and cleaned up, now it is easy to read and it is also easier to add
support for new encodings.
- A bunch of new encodings and encoding aliases have been added.
- Support for 1->2, 1->3 and 1->4 mappings, which is needed for
transliterating with flying accents as GNU does, like "u.
- Lots of warnings have been fixed, the major part of the code is
now WARNS=6 clean.
- New section 1 and section 5 manual pages have been added.
- Some GNU-specific calls have been implemented:
iconvlist(), iconvctl(), iconv_canonicalize(), iconv_open_into()
- Support for GNU's //IGNORE suffix has been added.
- The "-" argument for stdin is now recognized in iconv(1) as per POSIX.
- The Big5 conversion module has been fixed.
- The iconv.h header files is supposed to be compatible with the
GNU version, i.e. sources should build with base iconv.h and
GNU libiconv. It also includes a macro magic to deal with the
char ** and const char ** incompatibility.
- GNU compatibility: "" or "char" means the current local
encoding in use
- Various cleanups and style(9) fixes.
Approved by: delphij (mentor)
Obtained from: The NetBSD Project
Sponsored by: Google Summer of Code 2009
2011-02-25 00:04:39 +00:00
|
|
|
usr.bin/mkesdb_static \
|
2013-08-11 20:03:12 +00:00
|
|
|
usr.bin/mkcsmapper_static \
|
|
|
|
usr.bin/vi/catalog
|
2015-10-22 05:01:14 +00:00
|
|
|
build-tools_${_tool}: .PHONY
|
2004-09-07 15:19:40 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ obj; \
|
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
|
2004-01-31 08:15:57 +00:00
|
|
|
.for _tool in \
|
2012-03-22 08:48:42 +00:00
|
|
|
${_gcc_tools}
|
2015-10-22 05:01:14 +00:00
|
|
|
build-tools_${_tool}: .PHONY
|
2016-03-30 23:50:23 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,all)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ obj; \
|
2004-01-31 08:15:57 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ all
|
2015-10-22 05:01:14 +00:00
|
|
|
build-tools: build-tools_${_tool}
|
2004-01-31 08:15:57 +00:00
|
|
|
.endfor
|
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
|
|
|
|
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
|
2013-11-07 22:50:42 +00:00
|
|
|
mkdir -p ${MAKEOBJDIRPREFIX}/usr
|
2013-11-07 04:31:21 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
2013-11-07 22:50:42 +00:00
|
|
|
-p ${MAKEOBJDIRPREFIX}/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
|
|
|
#
|
2014-04-13 05:21:30 +00:00
|
|
|
.if ${TARGET_ARCH} != ${MACHINE_ARCH}
|
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"
|
2015-09-28 12:38:57 +00:00
|
|
|
_dtrace_tools= cddl/lib/libctf 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/*} == ""
|
|
|
|
.if ${MK_BINUTILS_BOOTSTRAP} != "no"
|
2011-05-19 05:13:25 +00:00
|
|
|
_binutils= gnu/usr.bin/binutils
|
2014-12-30 18:42:53 +00:00
|
|
|
.endif
|
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 \
|
2014-12-01 17:49:42 +00:00
|
|
|
usr.bin/elfcopy \
|
|
|
|
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 \
|
2015-03-17 19:35:50 +00:00
|
|
|
usr.bin/elfcopy
|
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
|
2011-11-10 20:15:35 +00:00
|
|
|
_clang_libs= lib/clang
|
2011-05-19 05:13:25 +00:00
|
|
|
.endif
|
2014-04-18 17:03:58 +00:00
|
|
|
.if ${MK_GCC_BOOTSTRAP} != "no"
|
2013-10-29 12:34:11 +00:00
|
|
|
_cc= gnu/usr.bin/cc
|
|
|
|
.endif
|
2015-05-20 09:36:25 +00:00
|
|
|
.if ${MK_USB} != "no"
|
|
|
|
_usb_tools= sys/boot/usb/tools
|
|
|
|
.endif
|
2011-05-19 05:13:25 +00:00
|
|
|
|
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} \
|
2010-08-21 15:39:06 +00:00
|
|
|
${_clang_libs} \
|
|
|
|
${_clang} \
|
2011-05-19 05:13:25 +00:00
|
|
|
${_binutils} \
|
2014-12-01 17:49:42 +00:00
|
|
|
${_elftctools} \
|
2015-09-21 16:07:22 +00:00
|
|
|
${_dtrace_tools} \
|
2011-05-19 05:13:25 +00:00
|
|
|
${_cc} \
|
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}; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ obj; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ all; \
|
2002-05-12 16:01:00 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
|
1999-12-20 10:32:11 +00:00
|
|
|
.endfor
|
|
|
|
|
2015-10-24 01:39:31 +00:00
|
|
|
NXBDESTDIR= ${OBJTREE}/nxb-bin
|
2014-08-18 21:04:44 +00:00
|
|
|
NXBENV= MAKEOBJDIRPREFIX=${OBJTREE}/nxb \
|
|
|
|
INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
2015-04-30 02:08:36 +00:00
|
|
|
PATH=${PATH}:${OBJTREE}/gperf_for_gcc/usr/bin
|
2014-08-18 21:04:44 +00:00
|
|
|
NXBMAKE= ${NXBENV} ${MAKE} \
|
2015-12-31 14:39:45 +00:00
|
|
|
LLVM_TBLGEN=${NXBDESTDIR}/usr/bin/llvm-tblgen \
|
2015-10-24 01:39:31 +00:00
|
|
|
CLANG_TBLGEN=${NXBDESTDIR}/usr/bin/clang-tblgen \
|
2014-08-18 21:04:44 +00:00
|
|
|
MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH} \
|
|
|
|
MK_GDB=no MK_TESTS=no \
|
2014-08-19 15:04:32 +00:00
|
|
|
SSP_CFLAGS= \
|
2015-01-02 18:45:03 +00:00
|
|
|
MK_HTML=no NO_LINT=yes MK_MAN=no \
|
2014-08-18 21:04:44 +00:00
|
|
|
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
|
|
|
|
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
|
2014-12-18 18:26:10 +00:00
|
|
|
MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
|
2015-12-23 21:55:54 +00:00
|
|
|
MK_LLDB=no MK_DEBUG_FILES=no
|
2014-08-18 21:04:44 +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.
|
|
|
|
# For non-clang enabled targets that are still using the in tree gcc
|
|
|
|
# we must build a gperf binary for one instance of its Makefiles. On
|
|
|
|
# clang-enabled systems, the gperf binary is obsolete.
|
2015-10-21 05:33:48 +00:00
|
|
|
native-xtools: .PHONY
|
2015-04-30 00:17:32 +00:00
|
|
|
.if ${MK_GCC_BOOTSTRAP} != "no"
|
|
|
|
mkdir -p ${OBJTREE}/gperf_for_gcc/usr/bin
|
2016-03-30 23:50:23 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_gperf} (obj,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_gperf}; \
|
|
|
|
${NXBMAKE} DIRPRFX=${_gperf}/ obj; \
|
|
|
|
${NXBMAKE} DIRPRFX=${_gperf}/ all; \
|
2015-04-30 00:17:32 +00:00
|
|
|
${NXBMAKE} DIRPRFX=${_gperf}/ DESTDIR=${OBJTREE}/gperf_for_gcc install
|
|
|
|
.endif
|
2015-10-24 01:39:31 +00:00
|
|
|
mkdir -p ${NXBDESTDIR}/bin ${NXBDESTDIR}/sbin ${NXBDESTDIR}/usr
|
2014-08-18 21:04:44 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
2015-10-24 01:39:31 +00:00
|
|
|
-p ${NXBDESTDIR}/usr >/dev/null
|
2014-08-18 21:04:44 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
2015-10-24 01:39:31 +00:00
|
|
|
-p ${NXBDESTDIR}/usr/include >/dev/null
|
2015-10-23 23:07:45 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
|
2015-10-24 01:39:31 +00:00
|
|
|
-p ${NXBDESTDIR}/usr/lib >/dev/null
|
2015-10-23 23:07:45 +00:00
|
|
|
.endif
|
2014-08-18 21:04:44 +00:00
|
|
|
.for _tool in \
|
2014-11-16 20:10:37 +00:00
|
|
|
bin/cat \
|
|
|
|
bin/chmod \
|
|
|
|
bin/cp \
|
2014-11-13 22:25:22 +00:00
|
|
|
bin/csh \
|
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-08-18 21:04:44 +00:00
|
|
|
${_clang_tblgen} \
|
|
|
|
usr.bin/ar \
|
|
|
|
${_binutils} \
|
2014-12-01 17:49:42 +00:00
|
|
|
${_elftctools} \
|
2014-08-18 21:04:44 +00:00
|
|
|
${_cc} \
|
|
|
|
${_gcc_tools} \
|
|
|
|
${_clang_libs} \
|
|
|
|
${_clang} \
|
2014-11-13 22:25:22 +00:00
|
|
|
sbin/md5 \
|
2014-11-16 20:10:37 +00:00
|
|
|
sbin/sysctl \
|
|
|
|
gnu/usr.bin/diff \
|
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 \
|
|
|
|
usr.bin/dirname \
|
|
|
|
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 \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/id \
|
2014-08-18 21:04:44 +00:00
|
|
|
usr.bin/lex \
|
|
|
|
usr.bin/lorder \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/mktemp \
|
|
|
|
usr.bin/mt \
|
|
|
|
usr.bin/patch \
|
2014-08-18 21:04:44 +00:00
|
|
|
usr.bin/sed \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/sort \
|
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 \
|
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
|
2016-03-30 23:50:23 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
|
|
|
${NXBMAKE} DIRPRFX=${_tool}/ obj; \
|
|
|
|
${NXBMAKE} DIRPRFX=${_tool}/ all; \
|
2015-10-24 01:39:31 +00:00
|
|
|
${NXBMAKE} DIRPRFX=${_tool}/ DESTDIR=${NXBDESTDIR} install
|
2014-08-18 21:04:44 +00:00
|
|
|
.endfor
|
|
|
|
|
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
|
|
|
|
#
|
2010-11-11 15:48:27 +00:00
|
|
|
_prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc lib/libcompiler_rt
|
2007-05-19 03:34:59 +00:00
|
|
|
|
2002-04-16 14:38:15 +00:00
|
|
|
# These dependencies are not automatically generated:
|
|
|
|
#
|
2007-05-19 03:34:59 +00:00
|
|
|
# gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before
|
|
|
|
# all shared libraries for ELF.
|
2002-04-16 14:38:15 +00:00
|
|
|
#
|
2007-05-19 03:34:59 +00:00
|
|
|
_startup_libs= gnu/lib/csu
|
2015-05-12 17:53:22 +00:00
|
|
|
_startup_libs+= lib/csu
|
2007-05-19 03:34:59 +00:00
|
|
|
_startup_libs+= gnu/lib/libgcc
|
2010-11-11 15:48:27 +00:00
|
|
|
_startup_libs+= lib/libcompiler_rt
|
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
|
2011-11-26 03:26:06 +00:00
|
|
|
.if ${MK_LIBCPLUSPLUS} != "no"
|
2011-11-25 20:59:04 +00:00
|
|
|
_startup_libs+= lib/libcxxrt
|
|
|
|
.endif
|
2007-05-19 03:34:59 +00:00
|
|
|
|
|
|
|
gnu/lib/libgcc__L: lib/libc__L
|
2013-11-17 22:52:17 +00:00
|
|
|
gnu/lib/libgcc__L: lib/libc_nonshared__L
|
2012-03-17 22:12:09 +00:00
|
|
|
.if ${MK_LIBCPLUSPLUS} != "no"
|
|
|
|
lib/libcxxrt__L: gnu/lib/libgcc__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} \
|
2013-12-02 08:21:28 +00:00
|
|
|
lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \
|
2016-02-25 18:23:40 +00:00
|
|
|
${_lib_casper} \
|
2007-03-09 12:11:58 +00:00
|
|
|
lib/ncurses/ncurses lib/ncurses/ncursesw \
|
2016-04-14 01:17:03 +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} \
|
2013-03-05 08:09:53 +00:00
|
|
|
${_cddl_lib_libzfs_core} \
|
2014-10-05 22:13:13 +00:00
|
|
|
${_cddl_lib_libctf} \
|
2013-12-01 09:41:06 +00:00
|
|
|
lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \
|
2013-09-10 22:26:11 +00:00
|
|
|
${_secure_lib_libcrypto} ${_lib_libldns} \
|
2014-11-07 00:59:40 +00:00
|
|
|
${_secure_lib_libssh} ${_secure_lib_libssl} \
|
|
|
|
gnu/lib/libdialog
|
2016-04-14 01:17:03 +00:00
|
|
|
|
2014-07-10 21:11:48 +00:00
|
|
|
.if ${MK_GNUCXX} != "no"
|
2014-03-30 22:24:37 +00:00
|
|
|
_prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++
|
2014-04-28 23:16:46 +00:00
|
|
|
gnu/lib/libstdc++__L: lib/msun__L
|
2014-07-23 22:18:43 +00:00
|
|
|
gnu/lib/libsupc++__L: gnu/lib/libstdc++__L
|
2014-03-30 22:24:37 +00:00
|
|
|
.endif
|
2002-07-01 17:51:43 +00:00
|
|
|
|
2015-03-17 15:16:36 +00:00
|
|
|
.if ${MK_LIBCPLUSPLUS} != "no"
|
|
|
|
_prebuild_libs+= lib/libc++
|
|
|
|
.endif
|
|
|
|
|
2014-10-03 20:36:09 +00:00
|
|
|
lib/libgeom__L: lib/libexpat__L
|
2015-11-27 18:58:26 +00:00
|
|
|
lib/libkvm__L: lib/libelf__L
|
2014-10-03 20:36:09 +00:00
|
|
|
|
2008-03-29 17:44:40 +00:00
|
|
|
.if ${MK_LIBTHR} != "no"
|
|
|
|
_lib_libthr= lib/libthr
|
2007-10-01 18:22:32 +00:00
|
|
|
.endif
|
|
|
|
|
2015-02-04 06:53:45 +00:00
|
|
|
.if ${MK_RADIUS_SUPPORT} != "no"
|
|
|
|
_lib_libradius= lib/libradius
|
|
|
|
.endif
|
|
|
|
|
2011-03-21 09:58:24 +00:00
|
|
|
.if ${MK_OFED} != "no"
|
2016-03-04 22:37:09 +00:00
|
|
|
_ofed_lib= contrib/ofed/usr.lib
|
|
|
|
_prebuild_libs+= contrib/ofed/usr.lib/libosmcomp
|
|
|
|
_prebuild_libs+= contrib/ofed/usr.lib/libopensm
|
|
|
|
_prebuild_libs+= contrib/ofed/usr.lib/libibcommon
|
|
|
|
_prebuild_libs+= contrib/ofed/usr.lib/libibverbs
|
|
|
|
_prebuild_libs+= contrib/ofed/usr.lib/libibumad
|
|
|
|
|
|
|
|
contrib/ofed/usr.lib/libopensm__L: lib/libthr__L
|
|
|
|
contrib/ofed/usr.lib/libosmcomp__L: lib/libthr__L
|
|
|
|
contrib/ofed/usr.lib/libibumad__L: contrib/ofed/usr.lib/libibcommon__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
|
2015-02-09 06:20:34 +00:00
|
|
|
lib/liblzma__L: lib/libthr__L
|
2013-12-01 09:41:06 +00:00
|
|
|
|
2011-03-21 09:58:24 +00:00
|
|
|
_generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib}
|
2012-06-15 19:40:59 +00:00
|
|
|
.for _DIR in ${LOCAL_LIB_DIRS}
|
2016-03-04 22:37:16 +00:00
|
|
|
.if exists(${.CURDIR}/${_DIR}/Makefile) && empty(_generic_libs:M${_DIR})
|
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
|
2013-03-05 08:09:53 +00:00
|
|
|
_cddl_lib_libzfs_core= cddl/lib/libzfs_core
|
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
|
2013-03-05 22:51:11 +00:00
|
|
|
cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L
|
2014-10-03 20:36:09 +00:00
|
|
|
cddl/lib/libzfs__L: lib/libgeom__L
|
2014-10-05 22:13:13 +00:00
|
|
|
cddl/lib/libctf__L: lib/libz__L
|
2007-04-06 02:13:30 +00:00
|
|
|
.endif
|
2015-05-20 13:05:33 +00:00
|
|
|
# cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built
|
|
|
|
# on select architectures though (see cddl/lib/Makefile)
|
2015-08-23 23:12:30 +00:00
|
|
|
.if ${MACHINE_CPUARCH} != "sparc64"
|
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
|
2015-05-20 13:05:33 +00:00
|
|
|
.endif
|
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
|
2013-09-10 22:26:11 +00:00
|
|
|
.if ${MK_LDNS} != "no"
|
|
|
|
_lib_libldns= lib/libldns
|
|
|
|
lib/libldns__L: secure/lib/libcrypto__L
|
|
|
|
.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
|
2010-01-23 19:29:42 +00:00
|
|
|
.if ${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
|
|
|
|
.if ${MK_CXX} != "no"
|
|
|
|
.if ${MK_LIBCPLUSPLUS} != "no"
|
|
|
|
lib/libproc__L: lib/libcxxrt__L
|
|
|
|
.else # This implies MK_GNUCXX != "no"; see lib/libproc
|
|
|
|
lib/libproc__L: gnu/lib/libsupc++__L
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2014-11-08 04:24:54 +00:00
|
|
|
gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L
|
2014-11-07 00:59:40 +00:00
|
|
|
|
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
|
2007-05-19 03:34:59 +00:00
|
|
|
.if 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}; \
|
|
|
|
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \
|
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
|
1999-11-24 06:04:11 +00:00
|
|
|
.if 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}; \
|
|
|
|
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \
|
|
|
|
${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} \
|
2013-10-01 22:53:27 +00:00
|
|
|
-V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \
|
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; \
|
2005-11-12 19:31:30 +00:00
|
|
|
find ${DESTDIR}/usr/share/man/cat* ! -type d | \
|
|
|
|
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; \
|
2007-05-16 20:16:06 +00:00
|
|
|
done
|
2005-08-07 13:47:25 +00:00
|
|
|
# Check for catpages without corresponding manpages.
|
2005-11-12 19:31:30 +00:00
|
|
|
@find ${DESTDIR}/usr/share/man/cat* ! -type d | \
|
|
|
|
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; \
|
2005-08-07 13:47:25 +00:00
|
|
|
done
|
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} \
|
|
|
|
-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-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; \
|
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-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; \
|
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} \
|
2011-04-01 20:59:23 +00:00
|
|
|
-V OLD_DIRS | xargs -n1 | \
|
|
|
|
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; \
|
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
|
2014-10-21 20:29:51 +00:00
|
|
|
@(${MAKE} -n -f ${.CURDIR}/sys/conf/kern.opts.mk -V dummy -dg1; \
|
|
|
|
${MAKE} -n -f ${.CURDIR}/share/mk/src.opts.mk -V dummy -dg1) 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)
|
|
|
|
.if exists(${KERNCONFDIR}/${KERNCONF})
|
|
|
|
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} \
|
2014-02-28 18:29:09 +00:00
|
|
|
${.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
|
|
|
|
# in this makefile.
|
|
|
|
#
|
2015-11-09 23:36:57 +00:00
|
|
|
BW_CANONICALOBJDIR:=${OBJTREE}${.CURDIR}
|
2015-11-09 23:36:46 +00:00
|
|
|
cleanworld: .PHONY
|
|
|
|
.if exists(${BW_CANONICALOBJDIR}/)
|
|
|
|
-rm -rf ${BW_CANONICALOBJDIR}/*
|
|
|
|
-chflags -R 0 ${BW_CANONICALOBJDIR}
|
|
|
|
rm -rf ${BW_CANONICALOBJDIR}/*
|
|
|
|
.endif
|
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
|
|
|
|
|
2014-07-23 22:18:43 +00:00
|
|
|
.if defined(TARGET) && defined(TARGET_ARCH)
|
2009-03-13 07:23:58 +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 \
|
2014-05-10 16:37:53 +00:00
|
|
|
MK_KERBEROS=no MK_RESCUE=no MK_TESTS=no MK_WARNS=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
|
|
|
|
|
2013-02-04 09:34:25 +00:00
|
|
|
CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \
|
|
|
|
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}
|
2013-03-31 08:54:04 +00:00
|
|
|
CD2CFLAGS=-isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib \
|
2014-04-03 07:28:36 +00:00
|
|
|
--sysroot=${XDDESTDIR}/ -B${XDDESTDIR}/usr/libexec \
|
|
|
|
-B${XDDESTDIR}/usr/bin -B${XDDESTDIR}/usr/lib
|
|
|
|
CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CFLAGS}" \
|
|
|
|
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
|
|
|
|
2013-03-31 08:31:06 +00:00
|
|
|
CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp
|
|
|
|
CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN}
|
2013-10-16 16:46:25 +00:00
|
|
|
CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} ${NOFUN}
|
2014-04-03 22:22:10 +00:00
|
|
|
XDDESTDIR=${DESTDIR}/${XDTP}
|
2009-03-15 23:52:13 +00:00
|
|
|
.if !defined(OSREL)
|
|
|
|
OSREL!= uname -r | sed -e 's/[-(].*//'
|
|
|
|
.endif
|
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
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-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} \
|
|
|
|
${_gperf}
|
2016-03-30 23:50:23 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ obj; \
|
|
|
|
${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}; \
|
2009-03-13 07:23:58 +00:00
|
|
|
${CDBENV} ${MAKE} -f Makefile.inc1 ${NOFUN} build-tools
|
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
_xb-cross-tools: .PHONY
|
2009-03-13 07:23:58 +00:00
|
|
|
.for _tool in \
|
2014-04-01 06:46:59 +00:00
|
|
|
${_binutils} \
|
2014-12-01 17:49:42 +00:00
|
|
|
${_elftctools} \
|
2013-03-31 08:31:06 +00:00
|
|
|
usr.bin/ar \
|
|
|
|
${_clang_libs} \
|
2014-04-01 06:46:59 +00:00
|
|
|
${_clang} \
|
|
|
|
${_cc}
|
2016-03-30 23:50:23 +00:00
|
|
|
${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,all)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ obj; \
|
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}
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \
|
|
|
|
-p ${XDDESTDIR} >/dev/null
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${XDDESTDIR}/usr >/dev/null
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
|
|
|
-p ${XDDESTDIR}/usr/include >/dev/null
|
2016-03-11 23:56:33 +00:00
|
|
|
.if defined(LIBCOMPAT)
|
|
|
|
mtree -deU -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}
|
2014-07-21 21:26:10 +00:00
|
|
|
mtree -deU -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"
|
|
|
|
.for _tool in \
|
2014-04-01 06:46:59 +00:00
|
|
|
${_binutils} \
|
2014-12-01 17:49:42 +00:00
|
|
|
${_elftctools} \
|
2013-03-31 08:31:06 +00:00
|
|
|
usr.bin/ar \
|
2014-04-01 06:46:59 +00:00
|
|
|
${_clang_libs} \
|
|
|
|
${_clang} \
|
|
|
|
${_cc}
|
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
|
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 \
|
|
|
|
../../../../usr/bin/${XDDIR}${OSREL}-$$i; \
|
|
|
|
done
|
2011-11-26 00:30:39 +00:00
|
|
|
.else
|
2016-04-21 16:30:16 +00:00
|
|
|
xdev xdev-build xdev-install xdev-links: .PHONY
|
2014-07-23 22:18:43 +00:00
|
|
|
@echo "*** Error: Both TARGET and TARGET_ARCH must be defined for \"${.TARGET}\" target"
|
2009-03-13 07:23:58 +00:00
|
|
|
.endif
|