1998-08-31 02:08:08 +01:00
|
|
|
#
|
1999-08-28 02:35:59 +01:00
|
|
|
# $FreeBSD$
|
1998-08-31 02:08:08 +01: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-31 00:50:23 +01:00
|
|
|
# -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,OBJ}
|
2000-06-15 11:00:20 +01: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 15:35:49 +01: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 15:35:49 +01:00
|
|
|
# -DNO_DOCUPDATE do not update doc in ${MAKE} update
|
2014-04-25 20:25:00 +01:00
|
|
|
# -DWITHOUT_CTF do not run the DTrace CTF conversion tools on built objects
|
1998-08-31 02:08:08 +01:00
|
|
|
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
|
2014-06-17 23:23:36 +01:00
|
|
|
# LOCAL_ITOOLS="list of tools" to add additional tools to the ITOOLS list
|
2012-06-15 20:42:49 +01:00
|
|
|
# LOCAL_LIB_DIRS="list of dirs" to add additional dirs to libraries target
|
2012-10-18 13:32:51 +01: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 07:06:11 +01: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 17:41:30 +01:00
|
|
|
# TARGET="machine" to crossbuild world for a different machine type
|
2010-04-14 19:56:07 +01: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 01:07:48 +01: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 02:08:08 +01: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 19:10:06 +01:00
|
|
|
# doxygen - build API documentation of the kernel
|
2013-05-28 22:57:55 +01:00
|
|
|
# update - convenient way to update your source tree (eg: svn/svnup)
|
1998-08-31 02:08:08 +01: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 02:32:23 +01:00
|
|
|
SRCDIR?= ${.CURDIR}
|
2015-12-20 05:52:03 +00:00
|
|
|
LOCALBASE?= /usr/local
|
2008-09-19 17:14:42 +01: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 02:32:04 +01: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 02:32:07 +01: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 19:50:11 +01:00
|
|
|
MK_CLANG_BOOTSTRAP= no
|
|
|
|
MK_GCC_BOOTSTRAP= no
|
2016-05-21 02:32:07 +01:00
|
|
|
.endif
|
|
|
|
|
2017-04-13 23:07:34 +01:00
|
|
|
MAKEOBJDIRPREFIX?= /usr/obj
|
|
|
|
.if ${MACHINE} == ${TARGET} && ${MACHINE_ARCH} == ${TARGET_ARCH} && !defined(CROSS_BUILD_TESTING)
|
|
|
|
OBJTREE= ${MAKEOBJDIRPREFIX}
|
|
|
|
.else
|
|
|
|
OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Pull in compiler metadata from buildworld/toolchain if possible to avoid
|
|
|
|
# running CC from bsd.compiler.mk.
|
|
|
|
.if make(installworld) || make(install)
|
|
|
|
.-include "${OBJTREE}${.CURDIR}/compiler-metadata.mk"
|
|
|
|
.endif
|
|
|
|
|
2016-05-21 02:32:23 +01: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 19:05:05 +01:00
|
|
|
WANT_COMPILER_TYPE= clang
|
2016-05-21 02:32:23 +01:00
|
|
|
.elif ${MK_GCC_BOOTSTRAP} == "yes"
|
2016-07-24 19:05:05 +01:00
|
|
|
WANT_COMPILER_TYPE= gcc
|
2016-07-24 19:28:14 +01:00
|
|
|
.else
|
|
|
|
WANT_COMPILER_TYPE=
|
2016-05-21 02:32:23 +01:00
|
|
|
.endif
|
2016-07-24 19:05:05 +01: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 02:32:23 +01:00
|
|
|
awk '$$2 == "FREEBSD_CC_VERSION" {printf("%d\n", $$3)}' \
|
2016-07-24 19:05:05 +01: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 02:32:23 +01:00
|
|
|
awk '$$2 == "CLANG_VERSION" {split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \
|
2016-07-24 19:05:05 +01: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 02:32:23 +01:00
|
|
|
awk '$$2 == "FBSD_CC_VER" {printf("%d\n", $$3)}' \
|
2016-07-24 19:05:05 +01:00
|
|
|
${SRCDIR}/${WANT_COMPILER_FREEBSD_VERSION_FILE} || echo unknown
|
|
|
|
WANT_COMPILER_VERSION_FILE= contrib/gcc/BASE-VER
|
|
|
|
WANT_COMPILER_VERSION!= \
|
2016-05-21 02:32:23 +01:00
|
|
|
awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3}' \
|
2016-07-24 19:05:05 +01:00
|
|
|
${SRCDIR}/${WANT_COMPILER_VERSION_FILE} || echo unknown
|
2016-05-21 02:32:23 +01:00
|
|
|
.endif
|
2016-07-24 19:05:05 +01: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 19:50:11 +01:00
|
|
|
.if ${MK_SYSTEM_COMPILER} == "yes" && \
|
2016-07-24 19:05:05 +01: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 02:32:23 +01:00
|
|
|
# Everything matches, disable the bootstrap compiler.
|
|
|
|
MK_CLANG_BOOTSTRAP= no
|
|
|
|
MK_GCC_BOOTSTRAP= no
|
2016-07-24 19:05:05 +01: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 \
|
2017-04-13 20:27:46 +01:00
|
|
|
CC COMPILER_TYPE COMPILER_FEATURES COMPILER_VERSION \
|
|
|
|
COMPILER_FREEBSD_VERSION
|
2016-07-24 19:05:05 +01:00
|
|
|
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 02:32:23 +01:00
|
|
|
.info SYSTEM_COMPILER: Determined that CC=${CC} matches the source tree. Not bootstrapping a cross-compiler.
|
|
|
|
.endif
|
|
|
|
|
2016-06-03 21:49:49 +01: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 18:38:17 +01:00
|
|
|
.if !defined(X_COMPILER_TYPE)
|
2016-06-03 21:49:49 +01:00
|
|
|
CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \
|
|
|
|
COMPILER_TYPE=${COMPILER_TYPE} \
|
2017-04-13 20:27:46 +01:00
|
|
|
COMPILER_FEATURES=${COMPILER_FEATURES} \
|
2016-06-03 21:49:49 +01:00
|
|
|
COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION}
|
2016-06-04 18:17:10 +01:00
|
|
|
.else
|
|
|
|
CROSSENV+= COMPILER_VERSION=${X_COMPILER_VERSION} \
|
2017-04-13 20:27:46 +01:00
|
|
|
COMPILER_FEATURES=${X_COMPILER_FEATURES} \
|
2016-06-04 18:17:10 +01:00
|
|
|
COMPILER_TYPE=${X_COMPILER_TYPE} \
|
|
|
|
COMPILER_FREEBSD_VERSION=${X_COMPILER_FREEBSD_VERSION}
|
|
|
|
.endif
|
2016-06-03 21:49:49 +01:00
|
|
|
.endif
|
2017-04-13 23:07:34 +01:00
|
|
|
# Store some compiler metadata for use in installworld where we don't
|
|
|
|
# want to invoke CC at all.
|
|
|
|
_COMPILER_METADATA_VARS= COMPILER_VERSION \
|
|
|
|
COMPILER_TYPE \
|
|
|
|
COMPILER_FEATURES \
|
|
|
|
COMPILER_FREEBSD_VERSION
|
|
|
|
compiler-metadata.mk: .PHONY .META
|
|
|
|
@: > ${.TARGET}
|
|
|
|
@echo ".info Using cached compiler metadata from build at $$(hostname) on $$(date)" \
|
|
|
|
> ${.TARGET}
|
|
|
|
.for v in ${_COMPILER_METADATA_VARS}
|
|
|
|
@echo "${v}=${${v}}" >> ${.TARGET}
|
|
|
|
.endfor
|
|
|
|
@echo ".export ${_COMPILER_METADATA_VARS}" >> ${.TARGET}
|
2016-06-03 21:49:49 +01:00
|
|
|
|
2016-05-23 17:24:34 +01: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.
|
2017-04-08 00:37:22 +01:00
|
|
|
# This allows riscv64 builds, for example, to automatically use the
|
|
|
|
# riscv64-binutils port or package.
|
2016-05-23 17:24:34 +01:00
|
|
|
.if !make(showconfig)
|
|
|
|
.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \
|
2017-04-09 02:35:19 +01:00
|
|
|
${MK_LLD_BOOTSTRAP} == "no" && \
|
2016-05-23 17:24:34 +01:00
|
|
|
!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 15:58:15 +01:00
|
|
|
XBINUTILS= AS AR LD NM OBJCOPY RANLIB SIZE STRINGS
|
2016-05-23 17:24:34 +01: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 17:14:42 +01:00
|
|
|
|
2015-10-16 22:09:15 +01: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 01:07:48 +01:00
|
|
|
.if !empty(SUBDIR_OVERRIDE)
|
2013-05-01 10:56:09 +01: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 04:51:50 +01:00
|
|
|
# Ensure libraries are installed before progressing.
|
|
|
|
SUBDIR+=.WAIT
|
|
|
|
.endif
|
2006-11-13 05:52:11 +00:00
|
|
|
SUBDIR+=bin
|
2007-04-06 03:13:30 +01: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 02:08:08 +01: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 02:08:08 +01: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 02:08:08 +01: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 12:46:49 +01:00
|
|
|
.endif
|
2006-11-13 05:52:11 +00:00
|
|
|
SUBDIR+=sys usr.bin usr.sbin
|
2013-10-25 06:25:19 +01: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 12:46:49 +01: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|$|/|}
|
2017-02-04 01:21:48 +00:00
|
|
|
_REDUNDANT_LIB_DIRS+= ${LOCAL_LIB_DIRS:M${_DIR}*}
|
2014-11-21 18:35:48 +00:00
|
|
|
.endfor
|
|
|
|
.for _DIR in ${LOCAL_LIB_DIRS}
|
2017-02-04 01:21:48 +00:00
|
|
|
.if empty(_REDUNDANT_LIB_DIRS:M${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile)
|
2014-11-21 18:35:48 +00:00
|
|
|
SUBDIR+= ${_DIR}
|
1998-08-31 02:08:08 +01: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 18:55:27 +01:00
|
|
|
|
2015-10-17 00:53:37 +01: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 04:51:50 +01: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 18:55:27 +01:00
|
|
|
.endif
|
2015-10-17 00:53:37 +01: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 01:07:48 +01: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 18:55:27 +01:00
|
|
|
|
2005-02-28 09:23:38 +00:00
|
|
|
.if defined(NOCLEAN)
|
2015-10-22 02:32:11 +01: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 02:08:08 +01:00
|
|
|
CLEANDIR= clean cleandepend
|
|
|
|
.else
|
|
|
|
CLEANDIR= cleandir
|
|
|
|
.endif
|
|
|
|
|
2017-05-09 21:21:58 +01:00
|
|
|
.if defined(WORLDFAST)
|
|
|
|
NO_CLEAN= t
|
|
|
|
NO_OBJ= t
|
|
|
|
.endif
|
|
|
|
|
2016-04-14 23:00:33 +01: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
|
2017-05-09 21:21:38 +01:00
|
|
|
.if defined(NO_OBJ) || ${MK_AUTO_OBJ} == "yes"
|
|
|
|
NO_OBJ= t
|
|
|
|
NO_KERNELOBJ= t
|
|
|
|
.endif
|
|
|
|
.if !defined(NO_OBJ)
|
|
|
|
_obj= obj
|
|
|
|
.endif
|
2016-04-14 23:00:33 +01:00
|
|
|
|
2012-01-06 00:34:27 +00:00
|
|
|
LOCAL_TOOL_DIRS?=
|
2015-12-01 19:58:08 +00:00
|
|
|
PACKAGEDIR?= ${DESTDIR}/${DISTDIR}
|
2012-01-05 21:50:50 +00:00
|
|
|
|
2015-12-14 23:25:31 +00:00
|
|
|
.if empty(SHELL:M*csh*)
|
2015-11-05 22:09:00 +00:00
|
|
|
BUILDENV_SHELL?=${SHELL}
|
2015-12-14 23:25:31 +00:00
|
|
|
.else
|
2012-01-30 20:19:28 +00:00
|
|
|
BUILDENV_SHELL?=/bin/sh
|
2015-12-14 23:25:31 +00:00
|
|
|
.endif
|
2012-01-30 20:19:28 +00:00
|
|
|
|
2016-04-13 02:47:04 +01: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 16:16:24 +01:00
|
|
|
SVNFLAGS?= -r HEAD
|
1998-08-31 02:08:08 +01:00
|
|
|
|
2003-05-04 05:14:10 +01:00
|
|
|
.if !defined(OSRELDATE)
|
2003-08-25 18:48:25 +01:00
|
|
|
.if exists(/usr/include/osreldate.h)
|
2003-05-15 18:59:32 +01:00
|
|
|
OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
|
|
|
|
/usr/include/osreldate.h
|
2003-08-25 18:48:25 +01:00
|
|
|
.else
|
2003-08-27 05:49:43 +01:00
|
|
|
OSRELDATE= 0
|
2003-08-25 18:48:25 +01:00
|
|
|
.endif
|
2015-10-17 05:03:53 +01:00
|
|
|
.export OSRELDATE
|
2003-05-04 05:14:10 +01:00
|
|
|
.endif
|
2006-09-07 17:41:30 +01:00
|
|
|
|
2015-10-17 06:55:45 +01:00
|
|
|
# Set VERSION for CTFMERGE to use via the default CTFFLAGS=-L VERSION.
|
2016-04-21 17:50:45 +01: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 23:55:15 +01:00
|
|
|
SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
|
|
|
|
${SRCDIR}/sys/sys/param.h
|
2016-04-21 17:50:45 +01:00
|
|
|
.export SRCRELDATE
|
|
|
|
.endif
|
|
|
|
.if !defined(VERSION)
|
|
|
|
VERSION= FreeBSD ${_REVISION}-${_BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE}
|
2015-10-17 06:55:45 +01:00
|
|
|
.export VERSION
|
2008-05-23 05:22:14 +01:00
|
|
|
.endif
|
|
|
|
|
2015-02-08 18:12:34 +00:00
|
|
|
.if !defined(PKG_VERSION)
|
2016-05-27 21:33:14 +01: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 17:50:45 +01: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 17:50:45 +01: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 \
|
|
|
|
mips \
|
|
|
|
mipsel/mips \
|
|
|
|
mips64el/mips \
|
2016-05-19 03:58:30 +01:00
|
|
|
mipsn32el/mips \
|
2015-12-14 09:52:09 +00:00
|
|
|
mips64/mips \
|
|
|
|
mipsn32/mips \
|
2016-10-31 15:33:58 +00:00
|
|
|
mipshf/mips \
|
|
|
|
mipselhf/mips \
|
|
|
|
mips64elhf/mips \
|
|
|
|
mips64hf/mips \
|
2015-12-14 09:52:09 +00:00
|
|
|
powerpc \
|
|
|
|
powerpc64/powerpc \
|
Create a new MACHINE_ARCH for Freescale PowerPC e500v2
Summary:
The Freescale e500v2 PowerPC core does not use a standard FPU.
Instead, it uses a Signal Processing Engine (SPE)--a DSP-style vector processor
unit, which doubles as a FPU. The PowerPC SPE ABI is incompatible with the
stock powerpc ABI, so a new MACHINE_ARCH was created to deal with this.
Additionaly, the SPE opcodes overlap with Altivec, so these are mutually
exclusive. Taking advantage of this fact, a new file, powerpc/booke/spe.c, was
created with the same function set as in powerpc/powerpc/altivec.c, so it
becomes effectively a drop-in replacement. setjmp/longjmp were modified to save
the upper 32-bits of the now-64-bit GPRs (upper 32-bits are only accessible by
the SPE).
Note: This does _not_ support the SPE in the e500v1, as the e500v1 SPE does not
support double-precision floating point.
Also, without a new MACHINE_ARCH it would be impossible to provide binary
packages which utilize the SPE.
Additionally, no work has been done to support ports, work is needed for this.
This also means no newer gcc can yet be used. However, gcc's powerpc support
has been refactored which would make adding a powerpcspe-freebsd target very
easy.
Test Plan:
This was lightly tested on a RouterBoard RB800 and an AmigaOne A1222
(P1022-based) board, compiled against the new ABI. Base system utilities
(/bin/sh, /bin/ls, etc) still function appropriately, the system is able to boot
multiuser.
Reviewed By: bdrewery, imp
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D5683
2016-10-22 02:57:15 +01:00
|
|
|
powerpcspe/powerpc \
|
2015-12-14 09:52:09 +00:00
|
|
|
riscv64/riscv \
|
2016-11-16 15:21:32 +00:00
|
|
|
riscv64sf/riscv \
|
2015-12-14 09:52:09 +00:00
|
|
|
sparc64
|
2015-12-11 22:55:23 +00:00
|
|
|
|
2006-09-07 17:41:30 +01: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 19:04:22 +01:00
|
|
|
TARGET_CPUTYPE?=${CPUTYPE}
|
2002-04-11 14:43:50 +01:00
|
|
|
.else
|
2002-07-31 04:56:03 +01:00
|
|
|
TARGET_CPUTYPE?=
|
2002-04-11 14:43:50 +01:00
|
|
|
.endif
|
2006-09-07 17:41:30 +01:00
|
|
|
|
2002-08-08 16:43:23 +01: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 16:43:23 +01:00
|
|
|
.if ${_CPUTYPE} != ${_TARGET_CPUTYPE}
|
2002-08-02 19:04:22 +01: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 14:17:54 +01: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 14:17:54 +01:00
|
|
|
.if ${MACHINE_ARCH} != ${BUILD_ARCH}
|
|
|
|
.error To cross-build, set TARGET_ARCH.
|
|
|
|
.endif
|
|
|
|
.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 12:42:55 +01:00
|
|
|
STRICTTMPPATH= ${BPATH}:${XPATH}
|
1998-10-17 12:56:20 +01:00
|
|
|
TMPPATH= ${STRICTTMPPATH}:${PATH}
|
1998-08-31 02:08:08 +01: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 05:41:59 +01: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 22:46:44 +01:00
|
|
|
# 1. legacy stage [BMAKE]
|
2003-04-06 22:23:02 +01: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 22:23:02 +01: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 22:23:02 +01: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 20:00:47 +01:00
|
|
|
# the build process. Some programs are listed during
|
2015-08-13 23:32:42 +01:00
|
|
|
# this phase because they build binaries to generate
|
2015-08-12 20:00:47 +01:00
|
|
|
# files needed to build these programs. This stage also
|
|
|
|
# builds the 'build-tools' target rather than 'all'.
|
2003-04-06 22:23:02 +01: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 20:00:47 +01: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 02:19:36 +01:00
|
|
|
# 4. world stage [WMAKE]
|
1999-12-20 10:32:11 +00:00
|
|
|
# This stage actually builds the world.
|
2000-10-13 02:19:36 +01:00
|
|
|
# 5. install stage (optional) [IMAKE]
|
1999-12-20 10:32:11 +00:00
|
|
|
# This stage installs a previously built world.
|
|
|
|
#
|
|
|
|
|
2003-04-13 16:43:29 +01:00
|
|
|
BOOTSTRAPPING?= 0
|
2016-10-23 19:00:08 +01:00
|
|
|
# Keep these in sync -- see below for special case exception
|
2016-06-06 00:05:10 +01:00
|
|
|
MINIMUM_SUPPORTED_OSREL?= 900044
|
|
|
|
MINIMUM_SUPPORTED_REL?= 9.1
|
2003-04-13 16:43:29 +01: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 14:17:54 +01:00
|
|
|
MACHINE_ARCH=${TARGET_ARCH} \
|
2001-10-25 08:28:55 +01:00
|
|
|
MACHINE=${TARGET} \
|
2011-02-22 08:13:49 +00:00
|
|
|
CPUTYPE=${TARGET_CPUTYPE}
|
2016-04-14 22:06:10 +01:00
|
|
|
.if ${MK_META_MODE} != "no"
|
|
|
|
# Don't rebuild build-tools targets during normal build.
|
2017-04-06 19:21:59 +01:00
|
|
|
CROSSENV+= BUILD_TOOLS_META=.NOMETA
|
2016-04-14 22:06:10 +01:00
|
|
|
.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 22:23:02 +01:00
|
|
|
# bootstrap-tools stage
|
2004-08-25 23:06:29 +01:00
|
|
|
BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
2016-04-14 22:09:03 +01:00
|
|
|
TOOLS_PREFIX=${WORLDTMP} \
|
2003-04-13 12:42:55 +01:00
|
|
|
PATH=${BPATH}:${PATH} \
|
2003-04-12 16:07:46 +01:00
|
|
|
WORLDTMP=${WORLDTMP} \
|
2014-03-31 00:43:30 +01:00
|
|
|
MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
|
2015-09-26 05:22:18 +01: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 16:04:32 +01:00
|
|
|
SSP_CFLAGS= \
|
2015-01-02 18:45:03 +00:00
|
|
|
MK_HTML=no NO_LINT=yes MK_MAN=no \
|
2014-04-25 20:25:26 +01:00
|
|
|
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
|
2014-05-10 17:38:03 +01: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 01:30:53 +01:00
|
|
|
MK_INCLUDES=yes
|
1999-12-20 10:32:11 +00:00
|
|
|
|
2015-09-26 05:22:18 +01:00
|
|
|
BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \
|
|
|
|
${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
|
|
|
|
${BSARGS}
|
1999-12-20 10:32:11 +00:00
|
|
|
|
2003-04-06 22:23:02 +01:00
|
|
|
# build-tools stage
|
2003-04-05 21:30:30 +01:00
|
|
|
TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
|
2013-02-03 10:26:24 +00:00
|
|
|
${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
|
2006-09-08 11:09:02 +01:00
|
|
|
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
|
2004-08-25 23:06:29 +01:00
|
|
|
DESTDIR= \
|
2011-05-11 18:50:19 +01:00
|
|
|
BOOTSTRAPPING=${OSRELDATE} \
|
2014-08-19 16:04:32 +01:00
|
|
|
SSP_CFLAGS= \
|
2011-05-11 18:50:19 +01: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 22:23:02 +01:00
|
|
|
# cross-tools stage
|
2006-03-17 18:54:44 +00:00
|
|
|
XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
|
2006-09-07 21:27:56 +01:00
|
|
|
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
|
2017-01-27 20:49:43 +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 06:55:45 +01: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 16:04:32 +01:00
|
|
|
SSP_CFLAGS= \
|
2015-01-02 18:45:03 +00:00
|
|
|
MK_HTML=no -DNO_LINT MK_MAN=no \
|
2014-04-25 20:25:26 +01:00
|
|
|
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
|
2014-05-10 17:38:03 +01: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 23:32:47 +01:00
|
|
|
|
|
|
|
# make hierarchy
|
2013-08-30 02:32:47 +01:00
|
|
|
HMAKE= PATH=${TMPPATH} ${MAKE} LOCAL_MTREE=${LOCAL_MTREE:Q}
|
2013-06-14 23:32:47 +01:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
HMAKE+= PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT
|
|
|
|
.endif
|
|
|
|
|
2016-05-26 19:52:49 +01:00
|
|
|
CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCXXFLAGS} ${XCFLAGS}" \
|
2014-10-27 23:31:07 +00:00
|
|
|
CPP="${XCPP} ${XCFLAGS}" \
|
2016-11-01 21:27:42 +00:00
|
|
|
AS="${XAS}" AR="${XAR}" LD="${XLD}" LLVM_LINK="${XLLVM_LINK}" \
|
|
|
|
NM=${XNM} OBJCOPY="${XOBJCOPY}" \
|
2014-10-09 16:52:01 +01:00
|
|
|
RANLIB=${XRANLIB} STRINGS=${XSTRINGS} \
|
|
|
|
SIZE="${XSIZE}"
|
2013-05-15 15:30:03 +01:00
|
|
|
|
2016-03-25 22:36:26 +00:00
|
|
|
.if defined(CROSS_BINUTILS_PREFIX) && exists(${CROSS_BINUTILS_PREFIX})
|
2013-05-15 15:30:03 +01: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 15:30:03 +01: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 15:30:03 +01:00
|
|
|
.endif
|
2016-03-25 22:36:26 +00:00
|
|
|
|
2016-08-23 16:20:32 +01: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 15:30:03 +01:00
|
|
|
.endif
|
2014-10-01 09:26:51 +01:00
|
|
|
.if ${TARGET} == "arm"
|
2016-05-18 23:50:25 +01:00
|
|
|
.if ${TARGET_ARCH:Marmv6*} != "" && ${TARGET_CPUTYPE:M*soft*} == ""
|
2014-03-23 12:49:25 +00:00
|
|
|
TARGET_ABI= gnueabihf
|
2014-10-01 13:47:25 +01:00
|
|
|
.else
|
|
|
|
TARGET_ABI= gnueabi
|
2013-05-15 15:30:03 +01:00
|
|
|
.endif
|
2014-03-31 00:43:30 +01:00
|
|
|
.endif
|
2016-08-23 20:29:37 +01:00
|
|
|
.if ${WANT_COMPILER_TYPE} == gcc || \
|
|
|
|
(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc)
|
2016-06-16 00:58:03 +01: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 07:20:15 +01:00
|
|
|
XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib
|
2016-08-23 20:29:37 +01: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 07:20:15 +01:00
|
|
|
# Force using libc++ for external GCC.
|
2016-06-16 00:58:03 +01:00
|
|
|
# XXX: This should be checking MK_GNUCXX == no
|
2016-06-29 02:50:30 +01:00
|
|
|
.if ${X_COMPILER_VERSION} >= 40800
|
2016-05-29 07:20:15 +01:00
|
|
|
XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \
|
2016-12-10 18:29:39 +00:00
|
|
|
-nostdinc++
|
2016-06-29 02:50:30 +01:00
|
|
|
.endif
|
2016-08-23 20:29:37 +01:00
|
|
|
.elif ${WANT_COMPILER_TYPE} == clang || \
|
|
|
|
(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == clang)
|
2014-03-31 00:43:30 +01:00
|
|
|
TARGET_ABI?= unknown
|
2016-07-11 22:55:56 +01: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 10:04:01 +01:00
|
|
|
.endif
|
2013-05-15 15:30:03 +01:00
|
|
|
|
2016-03-11 23:56:33 +00:00
|
|
|
.if ${MK_LIB32} != "no" && (${TARGET_ARCH} == "amd64" || \
|
2017-05-08 19:51:13 +01:00
|
|
|
${TARGET_ARCH} == "powerpc64" || ${TARGET_ARCH:Mmips64*} != "")
|
2016-03-11 23:56:33 +00:00
|
|
|
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 22:19:59 +01: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 22:12:03 +01:00
|
|
|
IMAKEENV= ${CROSSENV}
|
2013-01-15 00:12:34 +00:00
|
|
|
IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \
|
2014-03-31 00:43:30 +01:00
|
|
|
${IMAKE_INSTALL} ${IMAKE_MTREE}
|
2004-08-09 12:38:41 +01: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 12:38:41 +01: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 12:38:41 +01: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 15:09:58 +01: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 15:09:58 +01: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 02:49:00 +01:00
|
|
|
KMAKEENV= ${WMAKEENV}
|
2013-04-12 18:57:40 +01:00
|
|
|
KMAKE= ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME}
|
2001-01-22 08:07:58 +00:00
|
|
|
|
1998-08-31 02:08:08 +01:00
|
|
|
#
|
|
|
|
# buildworld
|
|
|
|
#
|
|
|
|
# Attempt to rebuild the entire system, with reasonable chance of
|
|
|
|
# success, regardless of how old your existing system is.
|
|
|
|
#
|
2015-10-21 06:33:48 +01: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 02:08:08 +01:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
1999-12-10 10:48:20 +00:00
|
|
|
@echo ">>> Rebuilding the temporary build tree"
|
1998-08-31 02:08:08 +01:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-12-21 12:21:26 +00:00
|
|
|
.if !defined(NO_CLEAN)
|
1998-08-31 02:08:08 +01:00
|
|
|
rm -rf ${WORLDTMP}
|
2016-03-11 23:56:33 +00:00
|
|
|
.if defined(LIBCOMPAT)
|
|
|
|
rm -rf ${LIBCOMPATTMP}
|
2005-08-06 00:48:58 +01:00
|
|
|
.endif
|
2002-04-11 15:49:32 +01:00
|
|
|
.else
|
2003-04-07 00:46:02 +01:00
|
|
|
rm -rf ${WORLDTMP}/legacy/usr/include
|
1999-12-10 10:48:20 +00:00
|
|
|
.endif
|
2017-05-26 01:51:05 +01:00
|
|
|
# Dependencies cannot cope with certain source tree changes, particularly
|
|
|
|
# with respect to removing source files and replacing generated files.
|
|
|
|
# Handle these cases here in an ad-hoc fashion.
|
2017-05-26 17:03:28 +01:00
|
|
|
# 20160829 remove stale dependencies for ptrace stub, rewritten in C
|
|
|
|
# in r305012
|
|
|
|
.for f in ptrace
|
|
|
|
.if exists(${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.o)
|
|
|
|
@if egrep -q '/${f}.[sS]' \
|
|
|
|
${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.o; then \
|
|
|
|
echo Removing stale dependencies for ${f} syscall wrappers; \
|
|
|
|
rm -f ${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.* \
|
|
|
|
${OBJTREE}${.CURDIR}/world32/${.CURDIR}/lib/libc/.depend.${f}.*; \
|
|
|
|
fi
|
|
|
|
.endif
|
|
|
|
.endfor
|
2017-05-26 01:51:05 +01:00
|
|
|
# 20170523 remove stale generated asm files for functions which are no longer
|
|
|
|
# syscalls after r302092 (pipe) and r318736 (others)
|
|
|
|
.for f in getdents lstat mknod pipe stat
|
|
|
|
.if exists(${OBJTREE}${.CURDIR}/lib/libc/${f}.s) || \
|
|
|
|
exists(${OBJTREE}${.CURDIR}/lib/libc/${f}.S)
|
|
|
|
@echo Removing stale generated ${f} syscall files
|
|
|
|
@rm -f ${OBJTREE}${.CURDIR}/lib/libc/${f}.* \
|
|
|
|
${OBJTREE}${.CURDIR}/lib/libc/.depend.${f}.* \
|
|
|
|
${OBJTREE}${.CURDIR}/world32/${.CURDIR}/lib/libc/${f}.* \
|
|
|
|
${OBJTREE}${.CURDIR}/world32/${.CURDIR}/lib/libc/.depend.${f}.*
|
|
|
|
.endif
|
|
|
|
.endfor
|
2003-04-13 15:34:17 +01:00
|
|
|
.for _dir in \
|
2016-02-25 18:23:40 +00:00
|
|
|
lib lib/casper usr legacy/bin legacy/usr
|
2003-04-13 15:34:17 +01: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
|
2016-06-09 22:57:34 +01: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 21:22:26 +01: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 22:40:02 +01: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 21:35:34 +01: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 21:35:34 +01: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 21:35:34 +01:00
|
|
|
-p ${WORLDTMP}/usr/lib/debug/usr >/dev/null
|
|
|
|
.endif
|
|
|
|
.endif
|
2013-10-25 06:25:19 +01:00
|
|
|
.if ${MK_TESTS} != "no"
|
2014-12-18 18:16:00 +00:00
|
|
|
mkdir -p ${WORLDTMP}${TESTSBASE}
|
2013-10-25 06:25:19 +01: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 02:46:55 +01:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
2015-10-15 22:21:41 +01:00
|
|
|
mkdir -p ${WORLDTMP}/usr/lib/debug/${TESTSBASE}
|
2015-10-15 02:46:55 +01:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
|
|
|
|
-p ${WORLDTMP}/usr/lib/debug/${TESTSBASE} >/dev/null
|
|
|
|
.endif
|
2013-10-25 06:25:19 +01:00
|
|
|
.endif
|
2012-10-18 13:32:51 +01:00
|
|
|
.for _mtree in ${LOCAL_MTREE}
|
|
|
|
mtree -deU -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null
|
|
|
|
.endfor
|
2003-04-06 22:46:44 +01:00
|
|
|
_legacy:
|
2003-04-06 04:50:28 +01:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 07:43:24 +01:00
|
|
|
@echo ">>> stage 1.1: legacy release compatibility shims"
|
2003-04-06 04:50:28 +01:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 12:38:41 +01: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 18:55:27 +01:00
|
|
|
_bootstrap-tools:
|
1999-12-10 10:48:20 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 07:43:24 +01:00
|
|
|
@echo ">>> stage 1.2: bootstrap tools"
|
1999-12-10 10:48:20 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 12:38:41 +01: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 18:55:27 +01:00
|
|
|
_cleanobj:
|
2004-12-21 12:21:26 +00:00
|
|
|
.if !defined(NO_CLEAN)
|
1998-08-31 02:08:08 +01:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 07:43:24 +01:00
|
|
|
@echo ">>> stage 2.1: cleaning up the object tree"
|
1998-08-31 02:08:08 +01:00
|
|
|
@echo "--------------------------------------------------------------"
|
2015-10-17 04:51:50 +01: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-06 00:48:58 +01: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 18:55:27 +01:00
|
|
|
_obj:
|
1998-08-31 02:08:08 +01:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 07:43:24 +01:00
|
|
|
@echo ">>> stage 2.2: rebuilding the object tree"
|
1998-08-31 02:08:08 +01:00
|
|
|
@echo "--------------------------------------------------------------"
|
2015-10-17 04:51:50 +01: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 18:55:27 +01: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 07:43:24 +01: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 12:38:41 +01: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 18:55:27 +01: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 "--------------------------------------------------------------"
|
2017-04-13 23:07:34 +01:00
|
|
|
@rm -f ${.OBJDIR}/compiler-metadata.mk
|
2004-08-09 12:38:41 +01:00
|
|
|
${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools
|
2013-11-08 05:11:32 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools
|
2017-04-13 23:07:34 +01:00
|
|
|
_compiler-metadata:
|
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> stage 3.1: recording compiler metadata"
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} compiler-metadata.mk
|
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 18:55:27 +01:00
|
|
|
_includes:
|
1998-08-31 02:08:08 +01:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-11-03 21:09:47 +00:00
|
|
|
@echo ">>> stage 4.1: building includes"
|
1998-08-31 02:08:08 +01: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 01:07:48 +01: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 01:07:48 +01: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 01:07:48 +01: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 18:55:27 +01:00
|
|
|
_libraries:
|
1998-08-31 02:08:08 +01:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 07:43:24 +01:00
|
|
|
@echo ">>> stage 4.2: building libraries"
|
1998-08-31 02:08:08 +01:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 12:38:41 +01: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 04:39:11 +01:00
|
|
|
MK_PROFILE=no MK_TESTS=no MK_TESTS_SUPPORT=${MK_TESTS} libraries
|
2016-04-21 17:43:36 +01:00
|
|
|
everything: .PHONY
|
1999-12-20 10:32:11 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2016-03-31 00:50:23 +01:00
|
|
|
@echo ">>> stage 4.3: building everything"
|
1998-08-31 02:08:08 +01:00
|
|
|
@echo "--------------------------------------------------------------"
|
2015-12-07 18:45:55 +00:00
|
|
|
${_+_}cd ${.CURDIR}; _PARALLEL_SUBDIR_OK=1 ${WMAKE} all
|
1998-08-31 02:08:08 +01: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 18:55:27 +01:00
|
|
|
WMAKE_TGTS=
|
2017-05-09 21:21:58 +01:00
|
|
|
.if !defined(WORLDFAST)
|
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 01:07:48 +01: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 18:55:27 +01:00
|
|
|
.endif
|
2017-05-09 21:21:38 +01:00
|
|
|
WMAKE_TGTS+= _cleanobj
|
|
|
|
.if !defined(NO_OBJ)
|
|
|
|
WMAKE_TGTS+= _obj
|
|
|
|
.endif
|
|
|
|
WMAKE_TGTS+= _build-tools _cross-tools
|
2017-04-13 23:07:34 +01:00
|
|
|
WMAKE_TGTS+= _compiler-metadata
|
2017-05-09 21:21:58 +01:00
|
|
|
WMAKE_TGTS+= _includes
|
|
|
|
.endif
|
2017-05-10 00:58:07 +01:00
|
|
|
.if !defined(NO_LIBS)
|
2017-05-09 21:21:58 +01:00
|
|
|
WMAKE_TGTS+= _libraries
|
2017-05-10 00:58:07 +01:00
|
|
|
.endif
|
2016-02-24 17:20:22 +00:00
|
|
|
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 18:55:27 +01:00
|
|
|
|
2016-04-21 17:43:36 +01:00
|
|
|
buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue .PHONY
|
2006-09-07 20:36:16 +01:00
|
|
|
.ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
|
1998-08-31 02:08:08 +01:00
|
|
|
|
2016-04-14 22:04:37 +01:00
|
|
|
buildworld_prologue: .PHONY
|
2006-09-07 20:36:16 +01:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> World build started on `LC_ALL=C date`"
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
|
2016-04-14 22:04:37 +01:00
|
|
|
buildworld_epilogue: .PHONY
|
2006-09-07 20:36:16 +01:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> World build completed on `LC_ALL=C date`"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2006-06-06 17:24:54 +01: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 19:07:58 +01:00
|
|
|
# modification of the current environment's PATH. In addition, we need
|
|
|
|
# to quote multiword values.
|
2007-05-26 21:17:19 +01:00
|
|
|
#
|
2015-11-05 22:28:31 +00:00
|
|
|
buildenvvars: .PHONY
|
2015-10-17 06:57:29 +01:00
|
|
|
@echo ${WMAKEENV:Q} ${.MAKE.EXPORTED:@v@$v=\"${$v}\"@}
|
2006-06-06 17:24:54 +01: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-31 00:50:23 +01:00
|
|
|
TOOLCHAIN_TGTS= ${WMAKE_TGTS:Neverything:Nbuild${libcompat}}
|
2016-04-21 17:43:36 +01: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 17:30:16 +01: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 01:33:24 +01:00
|
|
|
_installcheck_world: __installcheck_DESTDIR
|
|
|
|
_installcheck_kernel: __installcheck_DESTDIR
|
2016-04-21 17:30:16 +01: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 13:59:37 +01:00
|
|
|
.if ${MK_UNBOUND} != "no"
|
|
|
|
CHECK_UIDS+= unbound
|
|
|
|
CHECK_GIDS+= unbound
|
|
|
|
.endif
|
2013-09-18 01:33:24 +01:00
|
|
|
_installcheck_world: __installcheck_UGID
|
2016-04-21 17:30:16 +01:00
|
|
|
__installcheck_UGID: .PHONY
|
2013-01-11 23:44:35 +00:00
|
|
|
.for uid in ${CHECK_UIDS}
|
|
|
|
@if ! `id -u ${uid} >/dev/null 2>&1`; then \
|
|
|
|
echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \
|
|
|
|
false; \
|
|
|
|
fi
|
|
|
|
.endfor
|
|
|
|
.for gid in ${CHECK_GIDS}
|
|
|
|
@if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \
|
|
|
|
echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \
|
|
|
|
false; \
|
|
|
|
fi
|
|
|
|
.endfor
|
2013-01-15 00:12:34 +00:00
|
|
|
.endif
|
2017-05-30 16:51:48 +01:00
|
|
|
#
|
|
|
|
# If installing over the running system (DESTDIR is / or unset) and the install
|
|
|
|
# includes rescue, try running rescue from the objdir as a sanity check. If
|
|
|
|
# rescue is not functional (e.g., because it depends on a system call not
|
|
|
|
# supported by the currently running kernel), abort the installation.
|
|
|
|
#
|
|
|
|
.if !make(distributeworld) && ${MK_RESCUE} != "no" && \
|
|
|
|
(empty(DESTDIR) || ${DESTDIR} == "/") && empty(BYPASS_INSTALLCHECK_SH)
|
|
|
|
_installcheck_world: __installcheck_sh_check
|
|
|
|
__installcheck_sh_check: .PHONY
|
|
|
|
@if [ "`${OBJTREE}${.CURDIR}/rescue/rescue/rescue sh -c 'echo OK'`" != \
|
|
|
|
OK ]; then \
|
|
|
|
echo "rescue/sh check failed, installation aborted" >&2; \
|
|
|
|
false; \
|
|
|
|
fi
|
|
|
|
.endif
|
2013-01-11 23:44:35 +00:00
|
|
|
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
#
|
|
|
|
# Required install tools to be saved in a scratch dir for safety.
|
|
|
|
#
|
2009-10-28 07:05:32 +00:00
|
|
|
.if ${MK_ZONEINFO} != "no"
|
2013-01-11 18:37:51 +00:00
|
|
|
_zoneinfo= zic tzsetup
|
2009-10-28 07:05:32 +00:00
|
|
|
.endif
|
2009-03-13 10:09:08 +00:00
|
|
|
|
2015-08-09 19:15:33 +01: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 23:41:31 +01: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 23:23:36 +01: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 19:05:25 +01:00
|
|
|
.if ${MK_MAN_UTILS} != "no"
|
2014-12-08 18:29:20 +00:00
|
|
|
ITOOLS+=makewhatis
|
|
|
|
.endif
|
|
|
|
|
2002-05-14 09:30:40 +01:00
|
|
|
#
|
|
|
|
# distributeworld
|
|
|
|
#
|
|
|
|
# Distributes everything compiled by a `buildworld'.
|
1998-08-31 02:08:08 +01: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 19:17:21 +01: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 18:04:30 +01: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 20:04:04 +01: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 20:04:04 +01:00
|
|
|
.endif
|
|
|
|
|
2013-01-22 21:10:03 +00:00
|
|
|
MTREE_MAGIC?= mtree 2.0
|
|
|
|
|
2016-04-21 17:43:36 +01:00
|
|
|
distributeworld installworld stageworld: _installcheck_world .PHONY
|
2000-07-19 05:41:59 +01:00
|
|
|
mkdir -p ${INSTALLTMP}
|
2007-12-04 12:55:27 +00:00
|
|
|
progs=$$(for prog in ${ITOOLS}; do \
|
2007-10-15 14:50:46 +01:00
|
|
|
if progpath=`which $$prog`; then \
|
2007-12-04 12:55:27 +00:00
|
|
|
echo $$progpath; \
|
2007-10-15 14:50:46 +01: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 14:50:46 +01: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 22:40:02 +01: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 21:35:34 +01: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 21:35:34 +01:00
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/usr >/dev/null
|
|
|
|
.endif
|
|
|
|
.endif
|
2014-06-10 18:04:30 +01:00
|
|
|
.if ${MK_TESTS} != "no" && ${dist} == "tests"
|
2014-12-18 18:16:00 +00:00
|
|
|
-mkdir -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE}
|
2014-06-10 18:04:30 +01: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 02:46:55 +01: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 18:04:30 +01: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 21:35:34 +01: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 06:33:48 +01: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 02:32:47 +01: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 19:22:42 +01: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 23:01:48 +01: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 20:04:04 +01:00
|
|
|
.for dist in ${DEBUG_DISTRIBUTIONS}
|
2013-07-23 20:34:09 +01: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 23:01:48 +01:00
|
|
|
@# a line containing only the filename will sort immediately before
|
2013-07-23 20:34:09 +01: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 20:04:04 +01:00
|
|
|
.endfor
|
2013-01-22 21:10:03 +00:00
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
.endif
|
|
|
|
|
2016-04-21 17:30:16 +01: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 02:08:08 +01: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 20:04:04 +01:00
|
|
|
.for dist in ${DEBUG_DISTRIBUTIONS}
|
|
|
|
. if defined(NO_ROOT)
|
2013-07-23 20:34:09 +01: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 20:04:04 +01:00
|
|
|
. else
|
2013-07-23 20:34:09 +01: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 20:04:04 +01:00
|
|
|
. endif
|
|
|
|
.endfor
|
2013-07-23 20:34:09 +01:00
|
|
|
|
1998-08-31 02:08:08 +01: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 18:08:29 +01:00
|
|
|
restage reinstall: .MAKE .PHONY
|
1998-08-31 02:08:08 +01:00
|
|
|
@echo "--------------------------------------------------------------"
|
1998-09-17 17:32:00 +01:00
|
|
|
@echo ">>> Making hierarchy"
|
1998-08-31 02:08:08 +01:00
|
|
|
@echo "--------------------------------------------------------------"
|
2012-10-18 13:32:51 +01:00
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \
|
2016-05-10 06:47:25 +01:00
|
|
|
LOCAL_MTREE=${LOCAL_MTREE:Q} hierarchy
|
2016-05-18 18:08:29 +01:00
|
|
|
.if make(restage)
|
1998-08-31 02:08:08 +01:00
|
|
|
@echo "--------------------------------------------------------------"
|
2016-05-18 18:08:29 +01:00
|
|
|
@echo ">>> Making distribution"
|
2016-05-10 06:47:25 +01:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \
|
2016-05-18 18:08:29 +01:00
|
|
|
LOCAL_MTREE=${LOCAL_MTREE:Q} distribution
|
|
|
|
.endif
|
2016-05-10 06:47:25 +01:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> Installing everything"
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
|
2016-05-13 18:44:20 +01: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 06:33:48 +01:00
|
|
|
redistribute: .MAKE .PHONY
|
2002-04-30 12:50:01 +01:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-03-19 17:57:07 +00:00
|
|
|
@echo ">>> Distributing everything"
|
2002-04-30 12:50:01 +01:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 12:38:41 +01: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 19:16:14 +01: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 15:43:46 +01: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 23:05:31 +01: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 08:28:55 +01: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 08:28:55 +01: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 14:17:54 +01:00
|
|
|
# we're in kernel-land. Since only TARGET_ARCH is (expected) to
|
2001-10-25 08:28:55 +01: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 22:19:59 +01: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 03:58:39 +01:00
|
|
|
INSTKERNNAME?= kernel
|
2000-01-09 17:56:40 +00:00
|
|
|
|
2003-04-16 22:05:06 +01:00
|
|
|
KERNSRCDIR?= ${.CURDIR}/sys
|
|
|
|
KRNLCONFDIR= ${KERNSRCDIR}/${TARGET}/conf
|
|
|
|
KRNLOBJDIR= ${OBJTREE}${KERNSRCDIR}
|
2001-08-27 13:01:46 +01: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 13:01:46 +01: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 23:25:01 +01:00
|
|
|
|
2000-01-09 17:56:40 +00:00
|
|
|
#
|
|
|
|
# buildkernel
|
|
|
|
#
|
|
|
|
# Builds all kernels defined by BUILDKERNELS.
|
|
|
|
#
|
2015-10-21 06:33:48 +01: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 05:31:32 +01: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 10:20:18 +01:00
|
|
|
mkdir -p ${KRNLOBJDIR}
|
2000-06-15 11:00:20 +01: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 13:01:46 +01:00
|
|
|
config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
|
2014-05-03 10:24:20 +01: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 06:33:48 +01:00
|
|
|
${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR}
|
2000-06-15 11:00:20 +01: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 06:33:48 +01: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-31 00:50:23 +01:00
|
|
|
@echo ">>> stage 3.1: building everything"
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2015-10-21 06:33:48 +01: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 22:15:28 +01:00
|
|
|
NO_INSTALLEXTRAKERNELS?= yes
|
2016-05-04 22:00:41 +01: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 17:30:16 +01: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 01:43:55 +01:00
|
|
|
@echo ">>> Installing kernel ${INSTALLKERNEL}"
|
2004-03-13 15:46:34 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2000-09-17 22:02:58 +01: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 18:21:34 +01:00
|
|
|
.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
|
2015-09-01 12:59:12 +01: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 16:42:14 +01:00
|
|
|
.endif
|
2000-09-03 03:58:39 +01:00
|
|
|
|
2016-04-21 17:30:16 +01: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 19:37:14 +01: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 19:37:14 +01:00
|
|
|
${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.premeta/} \
|
|
|
|
${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \
|
2013-05-30 15:09:58 +01:00
|
|
|
DESTDIR=${INSTALL_DDIR}/kernel \
|
2011-03-02 14:39:26 +00:00
|
|
|
${.TARGET:S/distributekernel/install/}
|
2013-05-20 22:16:38 +01:00
|
|
|
.if defined(NO_ROOT)
|
2016-02-05 00:43:42 +00:00
|
|
|
@sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \
|
2013-05-16 19:37:14 +01:00
|
|
|
${DESTDIR}/${DISTDIR}/kernel.meta
|
2013-05-20 22:16:38 +01:00
|
|
|
.endif
|
2015-12-01 20:24:58 +00:00
|
|
|
.endif
|
2016-05-04 18:21:34 +01:00
|
|
|
.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
|
2015-09-01 12:46:13 +01:00
|
|
|
.for _kernel in ${BUILDKERNELS:[2..-1]}
|
2013-05-16 19:37:14 +01:00
|
|
|
.if defined(NO_ROOT)
|
2016-02-05 00:43:42 +00:00
|
|
|
@echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta
|
2013-05-16 19:37:14 +01:00
|
|
|
.endif
|
2012-01-15 08:36:25 +00:00
|
|
|
cd ${KRNLOBJDIR}/${_kernel}; \
|
2013-05-16 19:37:14 +01: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 15:09:58 +01:00
|
|
|
DESTDIR=${INSTALL_DDIR}/kernel.${_kernel} \
|
2012-01-15 08:36:25 +00:00
|
|
|
${.TARGET:S/distributekernel/install/}
|
2013-09-24 20:09:21 +01:00
|
|
|
.if defined(NO_ROOT)
|
2016-02-05 00:43:42 +00:00
|
|
|
@sed -e "s|^./kernel.${_kernel}|.|" \
|
2013-05-16 19:37:14 +01:00
|
|
|
${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta > \
|
|
|
|
${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta
|
2013-09-24 20:09:21 +01:00
|
|
|
.endif
|
2012-01-15 08:36:25 +00:00
|
|
|
.endfor
|
2015-09-02 16:42:14 +01:00
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
|
2016-04-21 17:30:16 +01:00
|
|
|
packagekernel: .PHONY
|
2013-05-16 19:37:14 +01:00
|
|
|
.if defined(NO_ROOT)
|
2015-12-01 20:24:58 +00:00
|
|
|
.if !defined(NO_INSTALLKERNEL)
|
2013-05-16 19:37:14 +01: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 18:21:34 +01:00
|
|
|
.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
|
2015-09-01 12:46:13 +01:00
|
|
|
.for _kernel in ${BUILDKERNELS:[2..-1]}
|
2013-05-16 19:37:14 +01: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 19:37:14 +01:00
|
|
|
.endfor
|
2015-09-02 16:42:14 +01:00
|
|
|
.endif
|
2013-05-16 19:37:14 +01: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 18:21:34 +01:00
|
|
|
.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
|
2015-09-01 12:46:13 +01: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 19:37:14 +01:00
|
|
|
.endif
|
2015-09-02 16:42:14 +01:00
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
|
2016-04-21 17:30:16 +01:00
|
|
|
stagekernel: .PHONY
|
2016-04-21 17:30:25 +01: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 19:10:20 +01: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 17:30:16 +01: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 17:30:16 +01:00
|
|
|
packages: .PHONY
|
2016-04-21 17:30:25 +01:00
|
|
|
${_+_}${MAKE} -C ${.CURDIR} PKG_VERSION=${PKG_VERSION} real-packages
|
2016-02-09 19:27:38 +00:00
|
|
|
|
2016-04-21 17:30:16 +01:00
|
|
|
package-pkg: .PHONY
|
2016-02-24 03:05:05 +00:00
|
|
|
rm -rf /tmp/ports.${TARGET} || :
|
2016-04-21 17:50:45 +01:00
|
|
|
env ${WMAKEENV:Q} SRCDIR=${.CURDIR} PORTSDIR=${PORTSDIR} REVISION=${_REVISION} \
|
2016-12-16 23:05:47 +00:00
|
|
|
PKG_CMD=${PKG_CMD} PKG_VERSION=${PKG_VERSION} REPODIR=${REPODIR} \
|
|
|
|
WSTAGEDIR=${WSTAGEDIR} \
|
2016-02-24 03:05:05 +00:00
|
|
|
sh ${.CURDIR}/release/scripts/make-pkg-package.sh
|
|
|
|
|
2016-04-21 17:30:16 +01:00
|
|
|
real-packages: stage-packages create-packages sign-packages .PHONY
|
2016-02-08 16:08:13 +00:00
|
|
|
|
2016-04-21 17:30:16 +01:00
|
|
|
stage-packages: .PHONY
|
2016-04-08 02:57:40 +01:00
|
|
|
@mkdir -p ${REPODIR} ${WSTAGEDIR} ${KSTAGEDIR}
|
2016-01-22 18:06:09 +00:00
|
|
|
${_+_}@cd ${.CURDIR}; \
|
2016-04-06 00:24:17 +01: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 17:30:16 +01:00
|
|
|
create-packages: _pkgbootstrap .PHONY
|
2016-02-08 16:08:13 +00:00
|
|
|
@mkdir -p ${REPODIR}
|
|
|
|
${_+_}@cd ${.CURDIR}; \
|
2016-04-06 00:24:17 +01:00
|
|
|
${MAKE} DESTDIR=${WSTAGEDIR} \
|
2016-01-29 21:42:27 +00:00
|
|
|
PKG_VERSION=${PKG_VERSION} create-world-packages ; \
|
2016-04-06 00:24:17 +01: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 17:30:16 +01:00
|
|
|
create-world-packages: _pkgbootstrap .PHONY
|
2016-04-08 02:57:40 +01: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 02:57:40 +01: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 02:57:40 +01:00
|
|
|
-s ${SRCDIR} -u ${WSTAGEDIR}/$${pkgname}.ucl ; \
|
2015-03-05 00:13:42 +00:00
|
|
|
done
|
2016-04-08 02:57:40 +01: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 02:57:40 +01:00
|
|
|
' ${WSTAGEDIR}/$${pkgname}.ucl ; \
|
2016-12-16 23:05:47 +00:00
|
|
|
${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
|
2016-04-08 02:57:40 +01:00
|
|
|
create -M ${WSTAGEDIR}/$${pkgname}.ucl \
|
|
|
|
-p ${WSTAGEDIR}/$${pkgname}.plist \
|
|
|
|
-r ${WSTAGEDIR} \
|
2016-12-16 23:05:47 +00:00
|
|
|
-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} ; \
|
2015-03-05 00:13:42 +00:00
|
|
|
done
|
|
|
|
|
2016-04-21 17:30:16 +01:00
|
|
|
create-kernel-packages: _pkgbootstrap .PHONY
|
2016-04-08 02:57:40 +01:00
|
|
|
.if exists(${KSTAGEDIR}/kernel.meta)
|
2016-03-08 19:35:30 +00:00
|
|
|
.for flavor in "" -debug
|
2016-04-08 02:57:40 +01: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 02:57:40 +01: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 02:57:40 +01: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 02:57:40 +01:00
|
|
|
${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl ; \
|
2016-12-16 23:05:47 +00:00
|
|
|
${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
|
2016-04-08 02:57:40 +01:00
|
|
|
create -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \
|
|
|
|
-p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \
|
|
|
|
-r ${KSTAGEDIR}/${DISTDIR} \
|
2016-12-16 23:05:47 +00:00
|
|
|
-o ${REPODIR}/$$(${PKG_CMD} -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 18:21:34 +01:00
|
|
|
.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
|
2016-01-27 21:10:03 +00:00
|
|
|
.for _kernel in ${BUILDKERNELS:[2..-1]}
|
2016-04-08 02:57:40 +01:00
|
|
|
.if exists(${KSTAGEDIR}/kernel.${_kernel}.meta)
|
2016-03-08 19:35:30 +00:00
|
|
|
.for flavor in "" -debug
|
2016-04-08 02:57:40 +01: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 02:57:40 +01: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 02:57:40 +01: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 02:57:40 +01:00
|
|
|
${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \
|
2016-12-16 23:05:47 +00:00
|
|
|
${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
|
2016-04-08 02:57:40 +01:00
|
|
|
create -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \
|
|
|
|
-p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \
|
|
|
|
-r ${KSTAGEDIR}/kernel.${_kernel} \
|
2016-12-16 23:05:47 +00:00
|
|
|
-o ${REPODIR}/$$(${PKG_CMD} -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 17:30:16 +01:00
|
|
|
sign-packages: _pkgbootstrap .PHONY
|
2016-12-16 23:05:47 +00:00
|
|
|
@[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest" ] && \
|
|
|
|
unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest ; \
|
|
|
|
${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh repo \
|
|
|
|
-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \
|
|
|
|
${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \
|
2016-02-09 19:27:38 +00:00
|
|
|
${PKGSIGNKEY} ; \
|
2017-04-18 20:44:34 +01:00
|
|
|
cd ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI); \
|
|
|
|
ln -s ${PKG_VERSION} 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
|
2017-02-18 21:41:50 +00:00
|
|
|
@if [ ! -x "${LOCALBASE}/bin/kyua" ]; then \
|
2016-02-07 18:40:04 +00:00
|
|
|
echo "You need kyua (devel/kyua) to run the test suite." | /usr/bin/fmt; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2017-02-18 21:47:32 +00:00
|
|
|
${_+_}PATH="$$PATH:${LOCALBASE}/bin" kyua test -k ${TESTSBASE}/Kyuafile
|
2016-02-07 18:40:04 +00:00
|
|
|
|
|
|
|
#
|
2006-05-26 19:10:06 +01:00
|
|
|
#
|
|
|
|
# doxygen
|
|
|
|
#
|
|
|
|
# Build the API documentation with doxygen
|
|
|
|
#
|
2015-10-21 06:33:48 +01:00
|
|
|
doxygen: .PHONY
|
2017-02-18 21:41:50 +00:00
|
|
|
@if [ ! -x "${LOCALBASE}/bin/doxygen" ]; then \
|
2006-05-26 19:10:06 +01: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 19:10:06 +01:00
|
|
|
|
1998-08-31 02:08:08 +01:00
|
|
|
#
|
|
|
|
# update
|
|
|
|
#
|
2013-05-28 22:57:55 +01:00
|
|
|
# Update the source tree(s), by running svn/svnup to update to the
|
1998-08-31 02:08:08 +01:00
|
|
|
# latest copy.
|
|
|
|
#
|
2016-04-21 17:30:16 +01:00
|
|
|
update: .PHONY
|
2009-06-14 16:16:24 +01:00
|
|
|
.if defined(SVN_UPDATE)
|
2013-05-29 00:43:47 +01:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> Updating ${.CURDIR} using Subversion"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2015-12-01 19:00:43 +00:00
|
|
|
@(cd ${.CURDIR}; ${SVN} update ${SVNFLAGS})
|
1998-08-31 02:08:08 +01: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 18:48:58 +01: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 02:08:08 +01:00
|
|
|
#
|
2015-08-11 16:43:09 +01: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 01:30:53 +01:00
|
|
|
_elftoolchain_libs= lib/libelf lib/libdwarf
|
2015-08-11 16:43:09 +01:00
|
|
|
.endif
|
|
|
|
|
2016-04-21 17:30:16 +01:00
|
|
|
legacy: .PHONY
|
2016-10-23 19:00:08 +01:00
|
|
|
# Temporary special case for automatically detecting the clang compiler issue
|
|
|
|
# Note: 9.x didn't have FreeBSD_version bumps often enough, so you may need to
|
|
|
|
# set BOOTSTRAPPING to 0 if you're stable/9 tree post-dates r286035 but is before
|
|
|
|
# the version bump in r296219 (from July 29, 2015 -> Feb 29, 2016).
|
|
|
|
.if ${BOOTSTRAPPING} != 0 && \
|
|
|
|
${WANT_COMPILER_TYPE} == "clang" && ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 30601
|
|
|
|
.if ${BOOTSTRAPPING} > 10000000 && ${BOOTSTRAPPING} < 1002501
|
|
|
|
@echo "ERROR: Source upgrades from stable/10 prior to r286033 are not supported."; false
|
|
|
|
.elif ${BOOTSTRAPPING} > 9000000 && ${BOOTSTRAPPING} < 903509
|
|
|
|
@echo "ERROR: Source upgrades from stable/9 prior to r286035 are not supported."; false
|
|
|
|
.endif
|
|
|
|
.endif
|
2016-06-06 00:05:10 +01:00
|
|
|
.if ${BOOTSTRAPPING} < ${MINIMUM_SUPPORTED_OSREL} && ${BOOTSTRAPPING} != 0
|
|
|
|
@echo "ERROR: Source upgrades from versions prior to ${MINIMUM_SUPPORTED_REL} are not supported."; \
|
2008-01-23 22:21:36 +00:00
|
|
|
false
|
|
|
|
.endif
|
2016-10-23 19:00:08 +01:00
|
|
|
|
2015-08-11 16:43:09 +01:00
|
|
|
.for _tool in tools/build ${_elftoolchain_libs}
|
2016-03-31 00:50:23 +01:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
2017-05-09 21:21:38 +01:00
|
|
|
if [ -z "${NO_OBJ}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
|
2015-12-01 19:00:43 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \
|
2016-06-06 00:56:28 +01:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ MK_INCLUDES=no all; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ MK_INCLUDES=no \
|
|
|
|
DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
|
2003-04-06 04:50:28 +01:00
|
|
|
.endfor
|
|
|
|
|
2003-04-06 22:33:49 +01: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 22:33:49 +01:00
|
|
|
#
|
2015-09-25 01:30:53 +01: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 11:08:11 +01:00
|
|
|
_strfile= usr.bin/fortune/strfile
|
2003-04-06 22:33:49 +01:00
|
|
|
.endif
|
|
|
|
|
2015-06-21 23:45:53 +01:00
|
|
|
.if ${MK_GCC} != "no" && ${MK_CXX} != "no"
|
2005-02-27 11:22:58 +00:00
|
|
|
_gperf= gnu/usr.bin/gperf
|
2003-04-30 11:58:52 +01:00
|
|
|
.endif
|
2011-02-22 08:13:49 +00:00
|
|
|
|
2014-06-30 01:20:12 +01:00
|
|
|
.if ${MK_VT} != "no"
|
2014-06-12 19:31:32 +01: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 20:29:19 +01:00
|
|
|
_m4= usr.bin/m4
|
2016-01-08 21:07:34 +00:00
|
|
|
_lex= usr.bin/lex
|
2013-05-21 20:32:35 +01: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
|
|
|
|
|
2017-03-06 20:32:17 +00:00
|
|
|
# r245440 mtree -N support added
|
|
|
|
# r313404 requires sha384.h for libnetbsd, added to libmd in r292782
|
2017-03-05 21:16:50 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1100093
|
|
|
|
_nmtree= lib/libmd \
|
|
|
|
lib/libnetbsd \
|
2013-01-15 00:12:34 +00:00
|
|
|
usr.sbin/nmtree
|
2015-02-23 05:28:17 +00:00
|
|
|
|
2017-03-05 21:16:50 +00:00
|
|
|
${_bt}-lib/libnetbsd: ${_bt}-lib/libmd
|
2015-02-23 05:28:17 +00:00
|
|
|
${_bt}-usr.sbin/nmtree: ${_bt}-lib/libnetbsd
|
2013-01-15 00:12:34 +00:00
|
|
|
.endif
|
|
|
|
|
2017-02-21 18:49:30 +00:00
|
|
|
# r246097: log addition login.conf.db, passwd, pwd.db, and spwd.db with cat -l
|
2013-01-29 22:17:58 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1000027
|
|
|
|
_cat= bin/cat
|
|
|
|
.endif
|
|
|
|
|
2015-05-19 15:05:15 +01:00
|
|
|
# r277259 crunchide: Correct 64-bit section header offset
|
|
|
|
# r281674 crunchide: always include both 32- and 64-bit ELF support
|
2015-08-12 17:43:15 +01:00
|
|
|
.if ${BOOTSTRAPPING} < 1100078
|
2016-05-27 00:20:36 +01:00
|
|
|
_crunchide= usr.sbin/crunch/crunchide
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# r285986 crunchen: use STRIPBIN rather than STRIP
|
|
|
|
# 1100113: Support MK_AUTO_OBJ
|
2016-09-02 00:22:31 +01:00
|
|
|
# 1200006: META_MODE fixes
|
2016-05-27 00:20:36 +01:00
|
|
|
.if ${BOOTSTRAPPING} < 1100078 || \
|
2016-09-02 00:22:31 +01:00
|
|
|
(${MK_AUTO_OBJ} == "yes" && ${BOOTSTRAPPING} < 1100114) || \
|
|
|
|
(${MK_META_MODE} == "yes" && ${BOOTSTRAPPING} < 1200006)
|
2016-05-27 00:20:36 +01:00
|
|
|
_crunchgen= usr.sbin/crunch/crunchgen
|
2015-04-17 17:02:49 +01:00
|
|
|
.endif
|
|
|
|
|
2016-04-21 14:14:55 +01:00
|
|
|
# r296926 -P keymap search path, MFC to stable/10 in r298297
|
|
|
|
.if ${BOOTSTRAPPING} < 1003501 || \
|
|
|
|
(${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103)
|
2016-03-28 20:51:45 +01: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 22:22:49 +01:00
|
|
|
.if ${MK_BSNMP} != "no"
|
2006-03-31 15:10:35 +01:00
|
|
|
_gensnmptree= usr.sbin/bsnmpd/gensnmptree
|
|
|
|
.endif
|
|
|
|
|
2017-04-09 02:35:19 +01:00
|
|
|
# We need to build tblgen when we're building clang or lld, either as
|
|
|
|
# bootstrap tools, or as the part of the normal build.
|
|
|
|
.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" || \
|
|
|
|
${MK_LLD_BOOTSTRAP} != "no" || ${MK_LLD} != "no"
|
2011-11-10 20:15:35 +00:00
|
|
|
_clang_tblgen= \
|
Completely revamp the way llvm, clang and lldb are built.
* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.
N.B.: This is work in progress, some details may still be missing.
It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.
The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.
Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.
2016-08-26 23:44:22 +01:00
|
|
|
lib/clang/libllvmminimal \
|
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
|
|
|
|
Completely revamp the way llvm, clang and lldb are built.
* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.
N.B.: This is work in progress, some details may still be missing.
It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.
The main idea behind this restructuring is maintainability and build
peformance. The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.
Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
one target will be fine. This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
libraries.
* Adding other components from the LLVM project, such as lld.
2016-08-26 23:44:22 +01:00
|
|
|
${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/libllvmminimal
|
|
|
|
${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-lib/clang/libllvmminimal
|
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 14:02:43 +01: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 14:44:11 +01:00
|
|
|
kerberos5/tools/slc \
|
|
|
|
usr.bin/compile_et
|
2015-02-23 05:28:17 +00:00
|
|
|
|
2015-04-21 11:17:25 +01: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.
|
2015-11-04 07:20:55 +00:00
|
|
|
_libopenbsd?= lib/libopenbsd
|
2017-01-21 13:17:25 +00:00
|
|
|
_makewhatis= usr.bin/mandoc
|
|
|
|
${_bt}-usr.bin/mandoc: ${_bt}-lib/libopenbsd
|
2015-05-30 18:41:37 +01:00
|
|
|
|
2015-02-23 05:28:17 +00:00
|
|
|
bootstrap-tools: .PHONY
|
|
|
|
|
2011-05-11 18:50:19 +01: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 13:57:53 +01: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 13:57:53 +01:00
|
|
|
${_strfile} \
|
|
|
|
${_gperf} \
|
2010-06-13 14:02:43 +01:00
|
|
|
${_dtc} \
|
2013-01-29 22:17:58 +00:00
|
|
|
${_cat} \
|
2016-03-28 20:51:45 +01: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 18:41:37 +01:00
|
|
|
${_makewhatis} \
|
2003-07-01 13:57:53 +01:00
|
|
|
usr.bin/rpcgen \
|
2009-12-31 00:07:26 +00:00
|
|
|
${_yacc} \
|
2013-05-21 20:32:35 +01:00
|
|
|
${_m4} \
|
2012-05-22 16:59:07 +01:00
|
|
|
${_lex} \
|
2003-07-01 13:57:53 +01: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-27 00:20:36 +01:00
|
|
|
${_crunchide} \
|
|
|
|
${_crunchgen} \
|
2014-06-12 19:31:32 +01:00
|
|
|
${_nmtree} \
|
2015-08-08 01:18:32 +01:00
|
|
|
${_vtfontcvt} \
|
|
|
|
usr.bin/localedef
|
2015-02-23 05:28:17 +00:00
|
|
|
${_bt}-${_tool}: .PHONY .MAKE
|
2016-03-31 00:50:23 +01:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
2017-05-09 21:21:38 +01:00
|
|
|
if [ -z "${NO_OBJ}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
|
2015-12-01 19:00:43 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ all; \
|
2003-04-13 12:42:55 +01: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 20:00:47 +01:00
|
|
|
# rescue includes programs that have build-tools targets
|
2015-08-12 20:39:11 +01:00
|
|
|
_rescue=rescue/rescue
|
2003-07-11 18:01:58 +01:00
|
|
|
.endif
|
|
|
|
|
2003-07-01 13:57:53 +01: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 20:21:58 +01:00
|
|
|
${_rescue} \
|
2003-07-01 13:57:53 +01:00
|
|
|
${_share} \
|
|
|
|
usr.bin/awk \
|
2004-08-09 11:51:01 +01: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 21:03:12 +01:00
|
|
|
usr.bin/mkcsmapper_static \
|
|
|
|
usr.bin/vi/catalog
|
2015-10-22 06:01:14 +01:00
|
|
|
build-tools_${_tool}: .PHONY
|
2004-09-07 16:19:40 +01:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
2017-05-09 21:21:38 +01:00
|
|
|
if [ -z "${NO_OBJ}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
|
2003-02-24 20:09:16 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ build-tools
|
2015-10-22 06:01:14 +01: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 06:01:14 +01:00
|
|
|
build-tools_${_tool}: .PHONY
|
2016-03-31 00:50:23 +01:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,all)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
2017-05-09 21:21:38 +01:00
|
|
|
if [ -z "${NO_OBJ}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
|
2004-01-31 08:15:57 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ all
|
2015-10-22 06:01:14 +01: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 17:30:16 +01: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 06:21:30 +01:00
|
|
|
.if ${TARGET_ARCH} != ${MACHINE_ARCH}
|
2005-12-07 20:01:12 +00:00
|
|
|
.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
|
2003-07-01 13:57:53 +01:00
|
|
|
_btxld= usr.sbin/btxld
|
|
|
|
.endif
|
2008-04-15 06:14:42 +01:00
|
|
|
.endif
|
2002-03-20 18:25:50 +00:00
|
|
|
|
2015-09-21 17:07:22 +01: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 13:38:57 +01:00
|
|
|
_dtrace_tools= cddl/lib/libctf cddl/usr.bin/ctfconvert \
|
2015-09-21 17:07:22 +01:00
|
|
|
cddl/usr.bin/ctfmerge
|
|
|
|
.endif
|
|
|
|
|
2014-04-18 18:03:58 +01: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 06:13:25 +01:00
|
|
|
_binutils= gnu/usr.bin/binutils
|
2014-12-30 18:42:53 +00:00
|
|
|
.endif
|
2015-08-17 11:48:55 +01: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 11:48:55 +01: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 06:13:25 +01:00
|
|
|
.endif
|
|
|
|
|
2014-04-18 18:03:58 +01:00
|
|
|
.if ${MK_CLANG_BOOTSTRAP} != "no"
|
2011-11-09 19:00:27 +00:00
|
|
|
_clang= usr.bin/clang
|
2017-04-09 02:35:19 +01:00
|
|
|
.endif
|
|
|
|
.if ${MK_LLD_BOOTSTRAP} != "no"
|
|
|
|
_lld= usr.bin/clang/lld
|
|
|
|
.endif
|
|
|
|
.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_LLD_BOOTSTRAP} != "no"
|
2011-11-10 20:15:35 +00:00
|
|
|
_clang_libs= lib/clang
|
2011-05-19 06:13:25 +01:00
|
|
|
.endif
|
2014-04-18 18:03:58 +01:00
|
|
|
.if ${MK_GCC_BOOTSTRAP} != "no"
|
2017-03-21 22:09:00 +00:00
|
|
|
_gcc= gnu/usr.bin/cc
|
2013-10-29 12:34:11 +00:00
|
|
|
.endif
|
2015-05-20 10:36:25 +01:00
|
|
|
.if ${MK_USB} != "no"
|
|
|
|
_usb_tools= sys/boot/usb/tools
|
|
|
|
.endif
|
2011-05-19 06:13:25 +01:00
|
|
|
|
2015-10-21 06:33:48 +01:00
|
|
|
cross-tools: .MAKE .PHONY
|
2003-07-01 13:57:53 +01:00
|
|
|
.for _tool in \
|
2016-07-21 07:06:11 +01:00
|
|
|
${LOCAL_XTOOL_DIRS} \
|
2010-08-21 16:39:06 +01:00
|
|
|
${_clang_libs} \
|
|
|
|
${_clang} \
|
2017-01-25 21:05:48 +00:00
|
|
|
${_lld} \
|
2011-05-19 06:13:25 +01:00
|
|
|
${_binutils} \
|
2014-12-01 17:49:42 +00:00
|
|
|
${_elftctools} \
|
2015-09-21 17:07:22 +01:00
|
|
|
${_dtrace_tools} \
|
2017-03-21 22:09:00 +00:00
|
|
|
${_gcc} \
|
2003-07-01 13:57:53 +01:00
|
|
|
${_btxld} \
|
2015-05-20 10:36:25 +01:00
|
|
|
${_usb_tools}
|
2016-03-31 00:50:23 +01:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
2017-05-09 21:21:38 +01:00
|
|
|
if [ -z "${NO_OBJ}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
|
2015-12-01 19:00:43 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ all; \
|
2002-05-12 17:01:00 +01:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
|
1999-12-20 10:32:11 +00:00
|
|
|
.endfor
|
|
|
|
|
2015-10-24 02:39:31 +01:00
|
|
|
NXBDESTDIR= ${OBJTREE}/nxb-bin
|
2014-08-18 22:04:44 +01:00
|
|
|
NXBENV= MAKEOBJDIRPREFIX=${OBJTREE}/nxb \
|
2017-01-02 19:33:22 +00:00
|
|
|
TOOLS_PREFIX= \
|
2014-08-18 22:04:44 +01:00
|
|
|
INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
2015-04-30 03:08:36 +01:00
|
|
|
PATH=${PATH}:${OBJTREE}/gperf_for_gcc/usr/bin
|
2014-08-18 22:04:44 +01:00
|
|
|
NXBMAKE= ${NXBENV} ${MAKE} \
|
2015-12-31 14:39:45 +00:00
|
|
|
LLVM_TBLGEN=${NXBDESTDIR}/usr/bin/llvm-tblgen \
|
2015-10-24 02:39:31 +01:00
|
|
|
CLANG_TBLGEN=${NXBDESTDIR}/usr/bin/clang-tblgen \
|
2014-08-18 22:04:44 +01:00
|
|
|
MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH} \
|
|
|
|
MK_GDB=no MK_TESTS=no \
|
2014-08-19 16:04:32 +01:00
|
|
|
SSP_CFLAGS= \
|
2017-06-04 00:13:46 +01:00
|
|
|
MK_HTML=no NO_LINT=yes MK_MAN=no MK_MAN_UTILS=yes \
|
2014-08-18 22:04:44 +01: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 22:04:44 +01:00
|
|
|
|
2015-04-30 01:17:32 +01: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 06:33:48 +01:00
|
|
|
native-xtools: .PHONY
|
2015-04-30 01:17:32 +01:00
|
|
|
.if ${MK_GCC_BOOTSTRAP} != "no"
|
|
|
|
mkdir -p ${OBJTREE}/gperf_for_gcc/usr/bin
|
2016-03-31 00:50:23 +01:00
|
|
|
${_+_}@${ECHODIR} "===> ${_gperf} (obj,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_gperf}; \
|
2017-05-09 21:21:38 +01:00
|
|
|
if [ -z "${NO_OBJ}" ]; then ${NXBMAKE} DIRPRFX=${_gperf}/ obj; fi; \
|
2015-12-01 19:00:43 +00:00
|
|
|
${NXBMAKE} DIRPRFX=${_gperf}/ all; \
|
2015-04-30 01:17:32 +01:00
|
|
|
${NXBMAKE} DIRPRFX=${_gperf}/ DESTDIR=${OBJTREE}/gperf_for_gcc install
|
|
|
|
.endif
|
2015-10-24 02:39:31 +01:00
|
|
|
mkdir -p ${NXBDESTDIR}/bin ${NXBDESTDIR}/sbin ${NXBDESTDIR}/usr
|
2014-08-18 22:04:44 +01:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
2015-10-24 02:39:31 +01:00
|
|
|
-p ${NXBDESTDIR}/usr >/dev/null
|
2014-08-18 22:04:44 +01:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
2015-10-24 02:39:31 +01:00
|
|
|
-p ${NXBDESTDIR}/usr/include >/dev/null
|
2015-10-24 00:07:45 +01:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
|
2015-10-24 02:39:31 +01:00
|
|
|
-p ${NXBDESTDIR}/usr/lib >/dev/null
|
2015-10-24 00:07:45 +01:00
|
|
|
.endif
|
2014-08-18 22:04:44 +01: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 22:04:44 +01:00
|
|
|
${_clang_tblgen} \
|
|
|
|
usr.bin/ar \
|
|
|
|
${_binutils} \
|
2014-12-01 17:49:42 +00:00
|
|
|
${_elftctools} \
|
2017-03-21 22:09:00 +00:00
|
|
|
${_gcc} \
|
2014-08-18 22:04:44 +01:00
|
|
|
${_gcc_tools} \
|
|
|
|
${_clang_libs} \
|
|
|
|
${_clang} \
|
2017-06-02 01:57:59 +01:00
|
|
|
${_lld} \
|
2014-11-13 22:25:22 +00:00
|
|
|
sbin/md5 \
|
2014-11-16 20:10:37 +00:00
|
|
|
sbin/sysctl \
|
2017-04-20 20:24:51 +01:00
|
|
|
usr.bin/diff \
|
2014-08-18 22:04:44 +01:00
|
|
|
usr.bin/awk \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/basename \
|
2014-08-18 22:04:44 +01: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 22:04:44 +01:00
|
|
|
usr.bin/lex \
|
2016-11-10 16:27:34 +00:00
|
|
|
usr.bin/limits \
|
2014-08-18 22:04:44 +01:00
|
|
|
usr.bin/lorder \
|
2017-06-04 00:13:46 +01:00
|
|
|
${_libopenbsd} \
|
|
|
|
${_makewhatis} \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/mktemp \
|
|
|
|
usr.bin/mt \
|
|
|
|
usr.bin/patch \
|
2017-02-03 16:27:23 +00:00
|
|
|
usr.bin/readelf \
|
2014-08-18 22:04:44 +01: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-31 00:50:23 +01:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
2017-05-09 21:21:38 +01:00
|
|
|
if [ -z "${NO_OBJ}" ]; then ${NXBMAKE} DIRPRFX=${_tool}/ obj; fi; \
|
2015-12-01 19:00:43 +00:00
|
|
|
${NXBMAKE} DIRPRFX=${_tool}/ all; \
|
2015-10-24 02:39:31 +01:00
|
|
|
${NXBMAKE} DIRPRFX=${_tool}/ DESTDIR=${NXBDESTDIR} install
|
2014-08-18 22:04:44 +01: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 06:33:48 +01:00
|
|
|
hierarchy hier: .MAKE .PHONY
|
2015-12-01 19:00:43 +00:00
|
|
|
${_+_}cd ${.CURDIR}/etc; ${HMAKE} distrib-dirs
|
1998-08-31 02:08:08 +01: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 20:46:25 +01: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 02:08:08 +01:00
|
|
|
#
|
2015-10-21 06:33:48 +01: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 01:13:08 +01:00
|
|
|
${MAKE} -f Makefile.inc1 _generic_libs
|
2002-04-12 20:46:25 +01:00
|
|
|
|
2007-05-19 04:34:59 +01:00
|
|
|
#
|
|
|
|
# static libgcc.a prerequisite for shared libc
|
|
|
|
#
|
2016-11-04 19:35:49 +00:00
|
|
|
_prereq_libs= lib/libcompiler_rt
|
2016-10-20 22:29:59 +01:00
|
|
|
.if ${MK_SSP} != "no"
|
|
|
|
_prereq_libs+= gnu/lib/libssp/libssp_nonshared
|
|
|
|
.endif
|
2007-05-19 04:34:59 +01:00
|
|
|
|
2002-04-16 15:38:15 +01:00
|
|
|
# These dependencies are not automatically generated:
|
|
|
|
#
|
2007-05-19 04:34:59 +01:00
|
|
|
# gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before
|
|
|
|
# all shared libraries for ELF.
|
2002-04-16 15:38:15 +01:00
|
|
|
#
|
2007-05-19 04:34:59 +01:00
|
|
|
_startup_libs= gnu/lib/csu
|
2015-05-12 18:53:22 +01:00
|
|
|
_startup_libs+= lib/csu
|
2010-11-11 15:48:27 +00:00
|
|
|
_startup_libs+= lib/libcompiler_rt
|
2007-05-19 04:34:59 +01: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 04:34:59 +01:00
|
|
|
|
2016-11-04 19:35:49 +00:00
|
|
|
.if ${MK_LLVM_LIBUNWIND} != "no"
|
|
|
|
_prereq_libs+= lib/libgcc_eh lib/libgcc_s
|
|
|
|
_startup_libs+= lib/libgcc_eh lib/libgcc_s
|
|
|
|
|
|
|
|
lib/libgcc_s__L: lib/libc__L
|
|
|
|
lib/libgcc_s__L: lib/libc_nonshared__L
|
|
|
|
.if ${MK_LIBCPLUSPLUS} != "no"
|
|
|
|
lib/libcxxrt__L: lib/libgcc_s__L
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.else # MK_LLVM_LIBUNWIND == no
|
|
|
|
|
|
|
|
_prereq_libs+= gnu/lib/libgcc
|
|
|
|
_startup_libs+= gnu/lib/libgcc
|
|
|
|
|
2007-05-19 04:34:59 +01: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
|
2016-11-04 19:35:49 +00:00
|
|
|
.endif
|
1998-08-31 02:08:08 +01:00
|
|
|
|
2012-03-22 08:48:42 +00:00
|
|
|
_prebuild_libs= ${_kerberos5_lib_libasn1} \
|
|
|
|
${_kerberos5_lib_libhdb} \
|
|
|
|
${_kerberos5_lib_libheimbase} \
|
2011-09-27 08:14:12 +01:00
|
|
|
${_kerberos5_lib_libheimntlm} \
|
2015-05-20 19:56:29 +01: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 09:13:35 +01: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 02:17:03 +01: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 21:36:09 +01:00
|
|
|
lib/libgeom \
|
2012-07-31 00:14:24 +01:00
|
|
|
${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \
|
2014-10-03 21:36:09 +01:00
|
|
|
${_cddl_lib_libuutil} \
|
2014-05-22 06:33:50 +01:00
|
|
|
${_cddl_lib_libavl} \
|
2013-03-05 08:09:53 +00:00
|
|
|
${_cddl_lib_libzfs_core} \
|
2014-10-05 23:13:13 +01: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 23:26:11 +01:00
|
|
|
${_secure_lib_libcrypto} ${_lib_libldns} \
|
2016-09-27 19:08:38 +01:00
|
|
|
${_secure_lib_libssh} ${_secure_lib_libssl}
|
2016-04-14 02:17:03 +01:00
|
|
|
|
2014-07-10 22:11:48 +01:00
|
|
|
.if ${MK_GNUCXX} != "no"
|
2014-03-30 23:24:37 +01:00
|
|
|
_prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++
|
2014-04-29 00:16:46 +01:00
|
|
|
gnu/lib/libstdc++__L: lib/msun__L
|
2014-07-23 23:18:43 +01:00
|
|
|
gnu/lib/libsupc++__L: gnu/lib/libstdc++__L
|
2014-03-30 23:24:37 +01:00
|
|
|
.endif
|
2002-07-01 18:51:43 +01:00
|
|
|
|
2016-09-27 19:08:38 +01:00
|
|
|
.if ${MK_DIALOG} != "no"
|
|
|
|
_prebuild_libs+= gnu/lib/libdialog
|
|
|
|
gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L
|
|
|
|
.endif
|
|
|
|
|
2015-03-17 15:16:36 +00:00
|
|
|
.if ${MK_LIBCPLUSPLUS} != "no"
|
|
|
|
_prebuild_libs+= lib/libc++
|
|
|
|
.endif
|
|
|
|
|
2014-10-03 21:36:09 +01:00
|
|
|
lib/libgeom__L: lib/libexpat__L
|
2015-11-27 18:58:26 +00:00
|
|
|
lib/libkvm__L: lib/libelf__L
|
2014-10-03 21:36:09 +01:00
|
|
|
|
2008-03-29 17:44:40 +00:00
|
|
|
.if ${MK_LIBTHR} != "no"
|
|
|
|
_lib_libthr= lib/libthr
|
2007-10-01 19:22:32 +01: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 20:40:59 +01: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 20:40:59 +01:00
|
|
|
_generic_libs+= ${_DIR}
|
|
|
|
.endif
|
|
|
|
.endfor
|
2002-04-16 15:38:15 +01:00
|
|
|
|
2006-10-07 20:26:46 +01:00
|
|
|
lib/libopie__L lib/libtacplus__L: lib/libmd__L
|
2002-04-16 15:38:15 +01:00
|
|
|
|
2007-04-06 03:13:30 +01:00
|
|
|
.if ${MK_CDDL} != "no"
|
2011-02-27 19:44:10 +00:00
|
|
|
_cddl_lib_libumem= cddl/lib/libumem
|
2012-07-31 00:14:24 +01:00
|
|
|
_cddl_lib_libnvpair= cddl/lib/libnvpair
|
2014-05-22 06:33:50 +01:00
|
|
|
_cddl_lib_libavl= cddl/lib/libavl
|
2014-10-03 21:36:09 +01: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 23:13:13 +01:00
|
|
|
_cddl_lib_libctf= cddl/lib/libctf
|
2007-04-06 03:13:30 +01: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 21:36:09 +01:00
|
|
|
cddl/lib/libzfs__L: lib/libgeom__L
|
2014-10-05 23:13:13 +01:00
|
|
|
cddl/lib/libctf__L: lib/libz__L
|
2007-04-06 03:13:30 +01:00
|
|
|
.endif
|
2015-05-20 14:05:33 +01: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-24 00:12:30 +01:00
|
|
|
.if ${MACHINE_CPUARCH} != "sparc64"
|
2016-07-30 04:05:23 +01:00
|
|
|
_prebuild_libs+= lib/libprocstat lib/libproc lib/librtld_db
|
2016-07-30 04:43:55 +01:00
|
|
|
lib/libprocstat__L: lib/libelf__L lib/libkvm__L lib/libutil__L
|
2016-07-30 04:05:23 +01:00
|
|
|
lib/libproc__L: lib/libprocstat__L
|
|
|
|
lib/librtld_db__L: lib/libprocstat__L
|
2015-05-20 14:05:33 +01:00
|
|
|
.endif
|
2007-04-06 03:13:30 +01:00
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_CRYPT} != "no"
|
|
|
|
.if ${MK_OPENSSL} != "no"
|
2006-10-07 20:26:46 +01: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 23:26:11 +01: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 23:26:11 +01:00
|
|
|
.if ${MK_LDNS} != "no"
|
|
|
|
secure/lib/libssh__L: lib/libldns__L
|
|
|
|
.endif
|
2017-01-02 20:29:50 +00:00
|
|
|
.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no"
|
2010-01-26 10:00:26 +00:00
|
|
|
secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \
|
|
|
|
kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \
|
|
|
|
lib/libmd__L kerberos5/lib/libroken__L
|
2004-05-12 08:02:17 +01:00
|
|
|
.endif
|
1999-12-17 11:23:56 +00:00
|
|
|
.endif
|
2002-06-21 09:54:03 +01:00
|
|
|
.endif
|
2006-10-07 20:26:46 +01:00
|
|
|
_secure_lib= secure/lib
|
2002-04-16 15:38:15 +01:00
|
|
|
.endif
|
1999-12-17 11:23:56 +00:00
|
|
|
|
2011-09-27 08:14:12 +01: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 19:56:29 +01: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 08:14:12 +01: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 08:14:12 +01: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 08:14:12 +01: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 08:14:12 +01:00
|
|
|
.endif
|
|
|
|
|
2015-05-30 17:00:33 +01: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 20:26:46 +01:00
|
|
|
.if ${MK_KERBEROS} != "no"
|
|
|
|
_kerberos5_lib= kerberos5/lib
|
|
|
|
_kerberos5_lib_libasn1= kerberos5/lib/libasn1
|
2011-09-27 08:14:12 +01:00
|
|
|
_kerberos5_lib_libhdb= kerberos5/lib/libhdb
|
2012-03-22 08:48:42 +00:00
|
|
|
_kerberos5_lib_libheimbase= kerberos5/lib/libheimbase
|
2006-10-07 20:26:46 +01:00
|
|
|
_kerberos5_lib_libkrb5= kerberos5/lib/libkrb5
|
2008-05-07 14:53:12 +01:00
|
|
|
_kerberos5_lib_libhx509= kerberos5/lib/libhx509
|
2006-10-07 20:26:46 +01:00
|
|
|
_kerberos5_lib_libroken= kerberos5/lib/libroken
|
2008-05-07 14:53:12 +01:00
|
|
|
_kerberos5_lib_libheimntlm= kerberos5/lib/libheimntlm
|
2015-05-20 19:56:29 +01: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 16:00:29 +01:00
|
|
|
.endif
|
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_NIS} != "no"
|
2006-10-07 20:26:46 +01:00
|
|
|
_lib_libypclnt= lib/libypclnt
|
2004-11-13 20:40:32 +00:00
|
|
|
.endif
|
|
|
|
|
2006-10-07 20:26:46 +01:00
|
|
|
.if ${MK_OPENSSL} == "no"
|
2011-05-17 20:11:47 +01:00
|
|
|
lib/libradius__L: lib/libmd__L
|
2006-10-07 20:26:46 +01:00
|
|
|
.endif
|
2002-04-16 15:38:15 +01: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 06:02:08 +01: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
|
|
|
|
|
2007-05-19 04:34:59 +01:00
|
|
|
.for _lib in ${_prereq_libs}
|
2013-07-06 01:13:08 +01:00
|
|
|
${_lib}__PL: .PHONY .MAKE
|
2007-05-19 04:34:59 +01:00
|
|
|
.if exists(${.CURDIR}/${_lib})
|
2016-03-31 00:50:23 +01:00
|
|
|
${_+_}@${ECHODIR} "===> ${_lib} (obj,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_lib}; \
|
2017-05-09 21:21:38 +01:00
|
|
|
if [ -z "${NO_OBJ}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; fi; \
|
2014-04-25 20:25:26 +01:00
|
|
|
${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \
|
2015-12-01 19:00:43 +00:00
|
|
|
DIRPRFX=${_lib}/ all; \
|
2014-04-25 20:25:26 +01:00
|
|
|
${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \
|
2013-11-08 14:20:22 +00:00
|
|
|
DIRPRFX=${_lib}/ install
|
2007-05-19 04:34:59 +01:00
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
2016-04-14 02:17:03 +01:00
|
|
|
.for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
|
2013-07-06 01:13:08 +01:00
|
|
|
${_lib}__L: .PHONY .MAKE
|
1999-11-24 06:04:11 +00:00
|
|
|
.if exists(${.CURDIR}/${_lib})
|
2016-03-31 00:50:23 +01:00
|
|
|
${_+_}@${ECHODIR} "===> ${_lib} (obj,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_lib}; \
|
2017-05-09 21:21:38 +01:00
|
|
|
if [ -z "${NO_OBJ}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; fi; \
|
2015-12-01 19:00:43 +00:00
|
|
|
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ all; \
|
2014-03-30 23:24:53 +01:00
|
|
|
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ install
|
1999-01-07 06:26:33 +00:00
|
|
|
.endif
|
1999-07-07 05:46:46 +01:00
|
|
|
.endfor
|
1998-09-01 01:39:02 +01:00
|
|
|
|
2007-05-26 21:17:19 +01:00
|
|
|
_prereq_libs: ${_prereq_libs:S/$/__PL/}
|
2002-04-12 20:46:25 +01: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 04:51:50 +01:00
|
|
|
SUBDIR_PARALLEL=
|
|
|
|
.endif
|
1998-08-31 02:08:08 +01:00
|
|
|
|
|
|
|
.include <bsd.subdir.mk>
|
2005-07-23 15:23:30 +01:00
|
|
|
|
2007-05-16 09:46:35 +01: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 19:02:20 +01:00
|
|
|
|
2005-07-23 15:23:30 +01: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 19:02:20 +01:00
|
|
|
.else
|
|
|
|
RM_I=-v
|
2005-07-23 15:23:30 +01:00
|
|
|
.endif
|
|
|
|
|
2016-04-21 17:30:16 +01:00
|
|
|
delete-old-files: .PHONY
|
2005-07-23 15:23:30 +01: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 08:58:55 +01:00
|
|
|
# It's annoying, but better safe than sorry.
|
2011-04-01 21:59:23 +01: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 21:59:23 +01:00
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
2013-10-01 23:53:27 +01:00
|
|
|
-V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \
|
2011-04-01 21:59:23 +01:00
|
|
|
while read file; do \
|
2007-05-16 09:37:40 +01:00
|
|
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
2007-05-19 21:34:29 +01:00
|
|
|
chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
|
2011-04-01 21:59:23 +01:00
|
|
|
rm ${RM_I} "${DESTDIR}/$${file}" <&3; \
|
2006-02-18 16:58:21 +00:00
|
|
|
fi; \
|
2015-10-16 05:07:27 +01: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 21:16:06 +01:00
|
|
|
done
|
2005-08-07 14:47:25 +01: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 21:59:23 +01:00
|
|
|
rm ${RM_I} $${catpage} <&3; \
|
2005-11-12 19:31:30 +00:00
|
|
|
fi; \
|
2005-08-07 14:47:25 +01:00
|
|
|
done
|
2005-07-23 15:23:30 +01:00
|
|
|
@echo ">>> Old files removed"
|
|
|
|
|
2016-04-21 17:30:16 +01:00
|
|
|
check-old-files: .PHONY
|
2005-07-23 15:23:30 +01: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 21:59:23 +01:00
|
|
|
-V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \
|
|
|
|
while read file; do \
|
2007-05-16 09:37:40 +01:00
|
|
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
2007-05-13 19:15:50 +01:00
|
|
|
echo "${DESTDIR}/$${file}"; \
|
|
|
|
fi; \
|
2015-10-16 05:07:27 +01:00
|
|
|
for ext in debug symbols; do \
|
|
|
|
if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
|
|
|
|
echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
2007-05-16 21:16:06 +01:00
|
|
|
done
|
2005-08-07 14:47:25 +01: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 21:59:23 +01:00
|
|
|
echo $${catpage}; \
|
2005-11-12 19:31:30 +00:00
|
|
|
fi; \
|
2005-08-07 14:47:25 +01:00
|
|
|
done
|
2005-07-23 15:23:30 +01:00
|
|
|
|
2016-04-21 17:30:16 +01:00
|
|
|
delete-old-libs: .PHONY
|
2005-07-23 15:23:30 +01:00
|
|
|
@echo ">>> Removing old libraries"
|
|
|
|
@echo "${OLD_LIBS_MESSAGE}" | fmt
|
2011-04-01 21:59:23 +01:00
|
|
|
@exec 3<&0; \
|
2013-10-29 17:46:26 +00:00
|
|
|
cd ${.CURDIR}; \
|
2011-04-01 21:59:23 +01:00
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
|
|
|
-V OLD_LIBS | xargs -n1 | \
|
|
|
|
while read file; do \
|
2007-05-16 09:37:40 +01:00
|
|
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
2007-05-19 21:34:29 +01:00
|
|
|
chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
|
2011-04-01 21:59:23 +01:00
|
|
|
rm ${RM_I} "${DESTDIR}/$${file}" <&3; \
|
2006-02-18 16:58:21 +00:00
|
|
|
fi; \
|
2013-10-21 11:09:48 +01: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 21:16:06 +01:00
|
|
|
done
|
2005-07-23 15:23:30 +01:00
|
|
|
@echo ">>> Old libraries removed"
|
|
|
|
|
2016-04-21 17:30:16 +01:00
|
|
|
check-old-libs: .PHONY
|
2005-07-23 15:23:30 +01: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 21:59:23 +01:00
|
|
|
-V OLD_LIBS | xargs -n1 | \
|
|
|
|
while read file; do \
|
2007-05-16 09:37:40 +01:00
|
|
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
2007-05-13 19:15:50 +01:00
|
|
|
echo "${DESTDIR}/$${file}"; \
|
|
|
|
fi; \
|
2013-10-21 11:09:48 +01:00
|
|
|
for ext in debug symbols; do \
|
|
|
|
if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
|
|
|
|
echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
2007-05-16 21:16:06 +01:00
|
|
|
done
|
2005-07-23 15:23:30 +01:00
|
|
|
|
2016-04-21 17:30:16 +01:00
|
|
|
delete-old-dirs: .PHONY
|
2005-07-23 15:23:30 +01: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 23:53:27 +01:00
|
|
|
-V OLD_DIRS | xargs -n1 | sort -r | \
|
2011-04-01 21:59:23 +01:00
|
|
|
while read dir; do \
|
2007-05-16 09:37:40 +01:00
|
|
|
if [ -d "${DESTDIR}/$${dir}" ]; then \
|
|
|
|
rmdir -v "${DESTDIR}/$${dir}" || true; \
|
|
|
|
elif [ -L "${DESTDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
|
2006-02-18 16:58:21 +00:00
|
|
|
fi; \
|
2016-11-30 19:06:47 +00:00
|
|
|
if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
|
|
|
|
rmdir -v "${DESTDIR}${DEBUGDIR}/$${dir}" || true; \
|
|
|
|
elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please remove everything manually."; \
|
|
|
|
fi; \
|
2007-05-16 21:16:06 +01:00
|
|
|
done
|
2005-07-23 15:23:30 +01:00
|
|
|
@echo ">>> Old directories removed"
|
|
|
|
|
2016-04-21 17:30:16 +01:00
|
|
|
check-old-dirs: .PHONY
|
2005-07-23 15:23:30 +01: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 21:59:23 +01:00
|
|
|
-V OLD_DIRS | xargs -n1 | \
|
|
|
|
while read dir; do \
|
2007-05-16 09:37:40 +01:00
|
|
|
if [ -d "${DESTDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}/$${dir}"; \
|
|
|
|
elif [ -L "${DESTDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
|
2006-02-18 16:58:21 +00:00
|
|
|
fi; \
|
2016-11-30 19:06:47 +00:00
|
|
|
if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}${DEBUGDIR}/$${dir}"; \
|
|
|
|
elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please remove everything manually."; \
|
|
|
|
fi; \
|
2007-05-16 21:16:06 +01:00
|
|
|
done
|
2005-07-23 15:23:30 +01:00
|
|
|
|
2016-04-21 17:30:16 +01:00
|
|
|
delete-old: delete-old-files delete-old-dirs .PHONY
|
2016-08-12 14:52:51 +01:00
|
|
|
@echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'."
|
2005-07-23 15:23:30 +01:00
|
|
|
|
2016-04-21 17:30:16 +01:00
|
|
|
check-old: check-old-files check-old-libs check-old-dirs .PHONY
|
2016-08-12 14:52:51 +01: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 15:23:30 +01:00
|
|
|
|
2005-07-30 19:02:20 +01:00
|
|
|
.endif
|
|
|
|
|
2006-03-18 14:30:23 +00:00
|
|
|
#
|
|
|
|
# showconfig - show build configuration.
|
|
|
|
#
|
2016-04-21 17:30:16 +01:00
|
|
|
showconfig: .PHONY
|
2014-10-21 21:29:51 +01: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 10:24:20 +01: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 17:30:16 +01:00
|
|
|
builddtb: .PHONY
|
2014-04-30 19:02:04 +01: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 19:02:04 +01: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 23:18:43 +01:00
|
|
|
.if defined(TARGET) && defined(TARGET_ARCH)
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2014-07-23 23:18:43 +01: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 20:25:26 +01:00
|
|
|
MK_MAN=no MK_NLS=no MK_PROFILE=no \
|
2014-05-10 17:37:53 +01:00
|
|
|
MK_KERBEROS=no MK_RESCUE=no MK_TESTS=no MK_WARNS=no \
|
2014-07-23 23:18:43 +01: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 23:18:43 +01:00
|
|
|
XDDIR=${TARGET_ARCH}-freebsd
|
2014-04-04 18:58:33 +01: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 08:28:36 +01:00
|
|
|
TOOLS_PREFIX=${XDTP}
|
2017-02-18 00:08:13 +00:00
|
|
|
|
|
|
|
.if ${WANT_COMPILER_TYPE} == gcc || \
|
|
|
|
(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc)
|
|
|
|
# GCC requires -isystem and -L when using a cross-compiler. --sysroot
|
|
|
|
# won't set header path and -L is used to ensure the base library path
|
|
|
|
# is added before the port PREFIX library path.
|
|
|
|
CD2CFLAGS+= -isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib
|
|
|
|
# GCC requires -B to find /usr/lib/crti.o when using a cross-compiler
|
|
|
|
# combined with --sysroot.
|
|
|
|
CD2CFLAGS+= -B${XDDESTDIR}/usr/lib
|
|
|
|
# Force using libc++ for external GCC.
|
|
|
|
# XXX: This should be checking MK_GNUCXX == no
|
|
|
|
.if ${X_COMPILER_VERSION} >= 40800
|
|
|
|
CD2CXXFLAGS+= -isystem ${XDDESTDIR}/usr/include/c++/v1 -std=c++11 \
|
|
|
|
-nostdinc++
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
CD2CFLAGS+= --sysroot=${XDDESTDIR}/
|
|
|
|
CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CXXFLAGS} ${CD2CFLAGS}" \
|
2014-04-03 08:28:36 +01:00
|
|
|
CPP="${CPP} ${CD2CFLAGS}" \
|
2014-07-23 23:18:43 +01:00
|
|
|
MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH}
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2013-03-31 09:31:06 +01:00
|
|
|
CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp
|
|
|
|
CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN}
|
2013-10-16 17:46:25 +01:00
|
|
|
CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} ${NOFUN}
|
2017-02-17 22:51:21 +00:00
|
|
|
.if ${MK_META_MODE} != "no"
|
|
|
|
# Don't rebuild build-tools targets during normal build.
|
2017-04-06 19:21:59 +01:00
|
|
|
CD2MAKE+= BUILD_TOOLS_META=.NOMETA
|
2017-02-17 22:51:21 +00:00
|
|
|
.endif
|
2014-04-03 23:22:10 +01: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 19:28:12 +01:00
|
|
|
.ORDER: xdev-build xdev-install xdev-links
|
2016-04-21 17:30:16 +01:00
|
|
|
xdev: xdev-build xdev-install .PHONY
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2013-03-31 09:31:06 +01:00
|
|
|
.ORDER: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools
|
2016-04-21 17:30:16 +01:00
|
|
|
xdev-build: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools .PHONY
|
2013-03-31 09:31:06 +01:00
|
|
|
|
2015-10-21 06:33:48 +01:00
|
|
|
_xb-worldtmp: .PHONY
|
2013-03-31 09:31:06 +01:00
|
|
|
mkdir -p ${CDTMP}/usr
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${CDTMP}/usr >/dev/null
|
|
|
|
|
2015-10-21 06:33:48 +01:00
|
|
|
_xb-bootstrap-tools: .PHONY
|
2013-03-31 09:31:06 +01:00
|
|
|
.for _tool in \
|
2014-12-08 07:33:11 +00:00
|
|
|
${_clang_tblgen} \
|
2017-02-17 22:51:34 +00:00
|
|
|
${_gperf} \
|
|
|
|
${_yacc}
|
2016-03-31 00:50:23 +01:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
2017-05-09 21:21:38 +01:00
|
|
|
if [ -z "${NO_OBJ}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ obj; fi; \
|
2015-12-01 19:00:43 +00:00
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ all; \
|
2013-03-31 09:31:06 +01:00
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install
|
|
|
|
.endfor
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2015-10-21 06:33:48 +01: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 06:33:48 +01:00
|
|
|
_xb-cross-tools: .PHONY
|
2009-03-13 07:23:58 +00:00
|
|
|
.for _tool in \
|
2014-04-01 07:46:59 +01:00
|
|
|
${_binutils} \
|
2014-12-01 17:49:42 +00:00
|
|
|
${_elftctools} \
|
2013-03-31 09:31:06 +01:00
|
|
|
usr.bin/ar \
|
|
|
|
${_clang_libs} \
|
2014-04-01 07:46:59 +01:00
|
|
|
${_clang} \
|
2017-03-21 22:09:00 +00:00
|
|
|
${_gcc}
|
2016-03-31 00:50:23 +01:00
|
|
|
${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,all)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
2017-05-09 21:21:38 +01:00
|
|
|
if [ -z "${NO_OBJ}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ obj; fi; \
|
2009-03-13 07:23:58 +00:00
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ all
|
|
|
|
.endfor
|
|
|
|
|
2015-10-21 06:33:48 +01: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 21:35:34 +01:00
|
|
|
-p ${XDDESTDIR}/usr >/dev/null
|
|
|
|
.endif
|
2014-07-21 22:26:10 +01:00
|
|
|
.if ${MK_TESTS} != "no"
|
2014-12-18 18:16:00 +00:00
|
|
|
mkdir -p ${XDDESTDIR}${TESTSBASE}
|
2014-07-21 22:26:10 +01: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 22:26:10 +01:00
|
|
|
.endif
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2014-07-10 19:28:12 +01:00
|
|
|
.ORDER: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries
|
2016-04-21 17:30:16 +01: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 06:33:48 +01:00
|
|
|
_xi-cross-tools: .PHONY
|
2009-03-13 07:23:58 +00:00
|
|
|
@echo "_xi-cross-tools"
|
|
|
|
.for _tool in \
|
2014-04-01 07:46:59 +01:00
|
|
|
${_binutils} \
|
2014-12-01 17:49:42 +00:00
|
|
|
${_elftctools} \
|
2013-03-31 09:31:06 +01:00
|
|
|
usr.bin/ar \
|
2014-04-01 07:46:59 +01:00
|
|
|
${_clang_libs} \
|
|
|
|
${_clang} \
|
2017-03-21 22:09:00 +00:00
|
|
|
${_gcc}
|
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 06:33:48 +01: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 06:33:48 +01:00
|
|
|
_xi-libraries: .PHONY
|
2009-03-13 07:23:58 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 libraries \
|
|
|
|
DESTDIR=${XDDESTDIR}
|
|
|
|
|
2015-10-21 06:33:48 +01:00
|
|
|
xdev-links: .PHONY
|
2009-03-13 07:23:58 +00:00
|
|
|
${_+_}cd ${XDDESTDIR}/usr/bin; \
|
2014-07-10 19:28:12 +01: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 17:30:16 +01:00
|
|
|
xdev xdev-build xdev-install xdev-links: .PHONY
|
2014-07-23 23:18:43 +01:00
|
|
|
@echo "*** Error: Both TARGET and TARGET_ARCH must be defined for \"${.TARGET}\" target"
|
2009-03-13 07:23:58 +00:00
|
|
|
.endif
|