1998-08-31 01:08:08 +00:00
|
|
|
#
|
1999-08-28 01:35:59 +00:00
|
|
|
# $FreeBSD$
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# Make command line options:
|
2004-12-21 12:21:26 +00:00
|
|
|
# -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
|
|
|
|
# -DNO_CLEAN do not clean at all
|
2013-01-22 21:10:03 +00:00
|
|
|
# -DDB_FROM_SRC use the user/group databases in src/etc instead of
|
|
|
|
# the system database when installing.
|
2004-12-21 12:13:23 +00:00
|
|
|
# -DNO_SHARE do not go into share subdir
|
2009-12-16 02:54:34 +00:00
|
|
|
# -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,DEPEND,OBJ}
|
2000-06-15 10:00:20 +00:00
|
|
|
# -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
|
2001-01-22 23:29:13 +00:00
|
|
|
# -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
|
2000-06-15 10:00:20 +00:00
|
|
|
# -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
|
2009-12-16 02:54:34 +00:00
|
|
|
# -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel
|
2000-08-07 14:35:49 +00:00
|
|
|
# -DNO_PORTSUPDATE do not update ports in ${MAKE} update
|
2013-01-22 21:10:03 +00:00
|
|
|
# -DNO_ROOT install without using root privilege
|
2000-08-07 14:35:49 +00:00
|
|
|
# -DNO_DOCUPDATE do not update doc in ${MAKE} update
|
2014-04-25 19:25:00 +00:00
|
|
|
# -DWITHOUT_CTF do not run the DTrace CTF conversion tools on built objects
|
1998-08-31 01:08:08 +00:00
|
|
|
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
|
2014-06-17 22:23:36 +00:00
|
|
|
# LOCAL_ITOOLS="list of tools" to add additional tools to the ITOOLS list
|
2012-06-15 19:42:49 +00:00
|
|
|
# LOCAL_LIB_DIRS="list of dirs" to add additional dirs to libraries target
|
2012-10-18 12:32:51 +00:00
|
|
|
# LOCAL_MTREE="list of mtree files" to process to allow local directories
|
|
|
|
# to be created before files are installed
|
2012-01-05 21:50:50 +00:00
|
|
|
# LOCAL_TOOL_DIRS="list of dirs" to add additional dirs to the build-tools
|
|
|
|
# list
|
2013-01-22 21:10:03 +00:00
|
|
|
# METALOG="path to metadata log" to write permission and ownership
|
|
|
|
# when NO_ROOT is set. (default: ${DESTDIR}/METALOG)
|
2006-09-07 16:41:30 +00:00
|
|
|
# TARGET="machine" to crossbuild world for a different machine type
|
2010-04-14 18:56:07 +00:00
|
|
|
# TARGET_ARCH= may be required when a TARGET supports multiple endians
|
2015-11-05 22:09:00 +00:00
|
|
|
# BUILDENV_SHELL= shell to launch for the buildenv target (def:${SHELL})
|
2013-02-03 10:26:24 +00:00
|
|
|
# WORLD_FLAGS= additional flags to pass to make(1) during buildworld
|
|
|
|
# KERNEL_FLAGS= additional flags to pass to make(1) during buildkernel
|
Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)
Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.
SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.
With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.
- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.
- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.
- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.
- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.
The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.
This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.
- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.
- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.
- Document these changes in build.7
Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks
2015-10-22 00:07:48 +00:00
|
|
|
# SUBDIR_OVERRIDE="list of dirs" to build rather than everything.
|
|
|
|
# All libraries and includes, and some build tools will still build.
|
1998-08-31 01:08:08 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# The intended user-driven targets are:
|
|
|
|
# buildworld - rebuild *everything*, including glue to help do upgrades
|
|
|
|
# installworld- install everything built by "buildworld"
|
2016-02-07 18:40:04 +00:00
|
|
|
# checkworld - run test suite on installed world
|
2006-05-26 18:10:06 +00:00
|
|
|
# doxygen - build API documentation of the kernel
|
2013-05-28 21:57:55 +00:00
|
|
|
# update - convenient way to update your source tree (eg: svn/svnup)
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# Standard targets (not defined here) are documented in the makefiles in
|
|
|
|
# /usr/share/mk. These include:
|
|
|
|
# obj depend all install clean cleandepend cleanobj
|
|
|
|
|
2011-02-10 19:58:21 +00:00
|
|
|
.if !defined(TARGET) || !defined(TARGET_ARCH)
|
|
|
|
.error "Both TARGET and TARGET_ARCH must be defined."
|
|
|
|
.endif
|
|
|
|
|
2015-12-20 05:52:03 +00:00
|
|
|
LOCALBASE?= /usr/local
|
|
|
|
|
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
|
|
|
|
.include <bsd.compiler.mk> # don't depend on src.opts.mk doing it
|
|
|
|
.include "share/mk/src.opts.mk"
|
2008-09-19 16:14:42 +00:00
|
|
|
|
2015-10-16 21:09:15 +00:00
|
|
|
# We must do lib/ and libexec/ before bin/ in case of a mid-install error to
|
|
|
|
# keep the users system reasonably usable. For static->dynamic root upgrades,
|
|
|
|
# we don't want to install a dynamic binary without rtld and the needed
|
|
|
|
# libraries. More commonly, for dynamic root, we don't want to install a
|
|
|
|
# binary that requires a newer library version that hasn't been installed yet.
|
|
|
|
# This ordering is not a guarantee though. The only guarantee of a working
|
|
|
|
# system here would require fine-grained ordering of all components based
|
|
|
|
# on their dependencies.
|
2013-10-24 22:55:15 +00:00
|
|
|
SRCDIR?= ${.CURDIR}
|
Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)
Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.
SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.
With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.
- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.
- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.
- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.
- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.
The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.
This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.
- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.
- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.
- Document these changes in build.7
Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks
2015-10-22 00:07:48 +00:00
|
|
|
.if !empty(SUBDIR_OVERRIDE)
|
2013-05-01 09:56:09 +00:00
|
|
|
SUBDIR= ${SUBDIR_OVERRIDE}
|
|
|
|
.else
|
2015-02-11 08:26:36 +00:00
|
|
|
SUBDIR= lib libexec
|
2016-02-02 20:50:09 +00:00
|
|
|
.if !defined(NO_ROOT) && (make(installworld) || make(install))
|
2015-10-17 03:51:50 +00:00
|
|
|
# Ensure libraries are installed before progressing.
|
|
|
|
SUBDIR+=.WAIT
|
|
|
|
.endif
|
2006-11-13 05:52:11 +00:00
|
|
|
SUBDIR+=bin
|
2007-04-06 02:13:30 +00:00
|
|
|
.if ${MK_CDDL} != "no"
|
|
|
|
SUBDIR+=cddl
|
|
|
|
.endif
|
2006-11-13 05:52:11 +00:00
|
|
|
SUBDIR+=gnu include
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_KERBEROS} != "no"
|
2004-02-13 21:52:08 +00:00
|
|
|
SUBDIR+=kerberos5
|
1998-08-31 01:08:08 +00:00
|
|
|
.endif
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_RESCUE} != "no"
|
2004-02-13 21:52:08 +00:00
|
|
|
SUBDIR+=rescue
|
1998-08-31 01:08:08 +00:00
|
|
|
.endif
|
2004-02-13 21:52:08 +00:00
|
|
|
SUBDIR+=sbin
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_CRYPT} != "no"
|
2004-02-13 21:52:08 +00:00
|
|
|
SUBDIR+=secure
|
1998-08-31 01:08:08 +00:00
|
|
|
.endif
|
2004-12-21 12:13:23 +00:00
|
|
|
.if !defined(NO_SHARE)
|
2004-02-13 21:52:08 +00:00
|
|
|
SUBDIR+=share
|
2002-04-30 11:46:49 +00:00
|
|
|
.endif
|
2006-11-13 05:52:11 +00:00
|
|
|
SUBDIR+=sys usr.bin usr.sbin
|
2013-10-25 05:25:19 +00:00
|
|
|
.if ${MK_TESTS} != "no"
|
|
|
|
SUBDIR+= tests
|
|
|
|
.endif
|
2011-03-21 09:58:24 +00:00
|
|
|
.if ${MK_OFED} != "no"
|
|
|
|
SUBDIR+=contrib/ofed
|
|
|
|
.endif
|
2002-04-30 11:46:49 +00:00
|
|
|
|
2014-11-21 18:35:48 +00:00
|
|
|
# Local directories are last, since it is nice to at least get the base
|
|
|
|
# system rebuilt before you do them.
|
|
|
|
.for _DIR in ${LOCAL_DIRS}
|
2004-02-13 21:52:08 +00:00
|
|
|
.if exists(${.CURDIR}/${_DIR}/Makefile)
|
2014-11-21 18:35:48 +00:00
|
|
|
SUBDIR+= ${_DIR}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
# Add LOCAL_LIB_DIRS, but only if they will not be picked up as a SUBDIR
|
|
|
|
# of a LOCAL_DIRS directory. This allows LOCAL_DIRS=foo and
|
|
|
|
# LOCAL_LIB_DIRS=foo/lib to behave as expected.
|
|
|
|
.for _DIR in ${LOCAL_DIRS:M*/} ${LOCAL_DIRS:N*/:S|$|/|}
|
|
|
|
_REDUNDENT_LIB_DIRS+= ${LOCAL_LIB_DIRS:M${_DIR}*}
|
|
|
|
.endfor
|
|
|
|
.for _DIR in ${LOCAL_LIB_DIRS}
|
|
|
|
.if empty(_REDUNDENT_LIB_DIRS:M${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile)
|
|
|
|
SUBDIR+= ${_DIR}
|
2014-12-16 20:45:17 +00:00
|
|
|
.else
|
|
|
|
.warning ${_DIR} not added to SUBDIR list. See UPDATING 20141121.
|
1998-08-31 01:08:08 +00:00
|
|
|
.endif
|
|
|
|
.endfor
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
|
2015-10-16 23:53:37 +00:00
|
|
|
# We must do etc/ last as it hooks into building the man whatis file
|
|
|
|
# by calling 'makedb' in share/man. This is only relevant for
|
|
|
|
# install/distribute so they build the whatis file after every manpage is
|
|
|
|
# installed.
|
2016-02-02 20:50:09 +00:00
|
|
|
.if make(installworld) || make(install)
|
2015-10-17 03:51:50 +00:00
|
|
|
SUBDIR+=.WAIT
|
|
|
|
.endif
|
2015-10-16 23:53:37 +00:00
|
|
|
SUBDIR+=etc
|
|
|
|
|
Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)
Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.
SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.
With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.
- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.
- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.
- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.
- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.
The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.
This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.
- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.
- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.
- Document these changes in build.7
Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks
2015-10-22 00:07:48 +00:00
|
|
|
.endif # !empty(SUBDIR_OVERRIDE)
|
2015-10-21 18:58:46 +00:00
|
|
|
|
2005-02-28 09:23:38 +00:00
|
|
|
.if defined(NOCLEAN)
|
2015-10-22 01:32:11 +00:00
|
|
|
.warning NOCLEAN option is deprecated. Use NO_CLEAN instead.
|
2005-02-28 09:23:38 +00:00
|
|
|
NO_CLEAN= ${NOCLEAN}
|
|
|
|
.endif
|
2004-12-21 12:21:26 +00:00
|
|
|
.if defined(NO_CLEANDIR)
|
1998-08-31 01:08:08 +00:00
|
|
|
CLEANDIR= clean cleandepend
|
|
|
|
.else
|
|
|
|
CLEANDIR= cleandir
|
|
|
|
.endif
|
|
|
|
|
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
|
|
|
|
BUILDENV_SHELL?=/bin/sh
|
|
|
|
.endif
|
2012-01-30 20:19:28 +00:00
|
|
|
|
2013-05-28 23:43:47 +00:00
|
|
|
SVN?= /usr/local/bin/svn
|
2009-06-14 15:16:24 +00:00
|
|
|
SVNFLAGS?= -r HEAD
|
1998-08-31 01:08:08 +00:00
|
|
|
|
1999-12-10 10:48:20 +00:00
|
|
|
MAKEOBJDIRPREFIX?= /usr/obj
|
2003-05-04 04:14:10 +00:00
|
|
|
.if !defined(OSRELDATE)
|
2003-08-25 17:48:25 +00:00
|
|
|
.if exists(/usr/include/osreldate.h)
|
2003-05-15 17:59:32 +00:00
|
|
|
OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
|
|
|
|
/usr/include/osreldate.h
|
2003-08-25 17:48:25 +00:00
|
|
|
.else
|
2003-08-27 04:49:43 +00:00
|
|
|
OSRELDATE= 0
|
2003-08-25 17:48:25 +00:00
|
|
|
.endif
|
2015-10-17 04:03:53 +00:00
|
|
|
.export OSRELDATE
|
2003-05-04 04:14:10 +00:00
|
|
|
.endif
|
2006-09-07 16:41:30 +00:00
|
|
|
|
2015-10-17 05:55:45 +00:00
|
|
|
# Set VERSION for CTFMERGE to use via the default CTFFLAGS=-L VERSION.
|
2015-12-08 17:09:17 +00:00
|
|
|
.if !defined(VERSION) && !make(showconfig)
|
2014-03-02 00:14:57 +00:00
|
|
|
REVISION!= ${MAKE} -C ${SRCDIR}/release -V REVISION
|
|
|
|
BRANCH!= ${MAKE} -C ${SRCDIR}/release -V BRANCH
|
2013-10-24 22:55:15 +00:00
|
|
|
SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
|
|
|
|
${SRCDIR}/sys/sys/param.h
|
2013-11-13 08:08:56 +00:00
|
|
|
VERSION= FreeBSD ${REVISION}-${BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE}
|
2015-10-17 05:55:45 +00:00
|
|
|
.export VERSION
|
2008-05-23 04:22:14 +00:00
|
|
|
.endif
|
|
|
|
|
2015-12-14 09:52:09 +00:00
|
|
|
KNOWN_ARCHES?= aarch64/arm64 \
|
|
|
|
amd64 \
|
|
|
|
arm \
|
|
|
|
armeb/arm \
|
|
|
|
armv6/arm \
|
|
|
|
armv6hf/arm \
|
|
|
|
i386 \
|
|
|
|
i386/pc98 \
|
|
|
|
mips \
|
|
|
|
mipsel/mips \
|
|
|
|
mips64el/mips \
|
|
|
|
mips64/mips \
|
|
|
|
mipsn32el/mips \
|
|
|
|
mipsn32/mips \
|
|
|
|
powerpc \
|
|
|
|
powerpc64/powerpc \
|
|
|
|
riscv64/riscv \
|
|
|
|
sparc64
|
2015-12-11 22:55:23 +00:00
|
|
|
|
2006-09-07 16:41:30 +00:00
|
|
|
.if ${TARGET} == ${TARGET_ARCH}
|
|
|
|
_t= ${TARGET}
|
|
|
|
.else
|
|
|
|
_t= ${TARGET_ARCH}/${TARGET}
|
|
|
|
.endif
|
|
|
|
.for _t in ${_t}
|
|
|
|
.if empty(KNOWN_ARCHES:M${_t})
|
|
|
|
.error Unknown target ${TARGET_ARCH}:${TARGET}.
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.if ${TARGET} == ${MACHINE}
|
2002-08-02 18:04:22 +00:00
|
|
|
TARGET_CPUTYPE?=${CPUTYPE}
|
2002-04-11 13:43:50 +00:00
|
|
|
.else
|
2002-07-31 03:56:03 +00:00
|
|
|
TARGET_CPUTYPE?=
|
2002-04-11 13:43:50 +00:00
|
|
|
.endif
|
2006-09-07 16:41:30 +00:00
|
|
|
|
2002-08-08 15:43:23 +00:00
|
|
|
.if !empty(TARGET_CPUTYPE)
|
|
|
|
_TARGET_CPUTYPE=${TARGET_CPUTYPE}
|
|
|
|
.else
|
|
|
|
_TARGET_CPUTYPE=dummy
|
|
|
|
.endif
|
2015-12-08 17:09:17 +00:00
|
|
|
# Skip for showconfig as it is just wasted time and may invoke auto.obj.mk.
|
|
|
|
.if !make(showconfig)
|
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
|
|
|
_CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} \
|
|
|
|
-f /dev/null -m ${.CURDIR}/share/mk -V CPUTYPE
|
2002-08-08 15:43:23 +00:00
|
|
|
.if ${_CPUTYPE} != ${_TARGET_CPUTYPE}
|
2002-08-02 18:04:22 +00:00
|
|
|
.error CPUTYPE global should be set with ?=.
|
|
|
|
.endif
|
2015-12-08 17:09:17 +00:00
|
|
|
.endif
|
Fix cross-building, etc:
1. To cross-build, one now needs to set TARGET_ARCH, and not the
MACHINE_ARCH. MACHINE_ARCH should never be changed manually!
2. Initialize DESTDIR= explicitly for bootstrap-tools, build-tools,
and cross-tools stages. This fixes broken header and library
dependencies problem. We build them in the host environment,
and obviously want them to depend on host headers and libraries.
The problem with broken header dependencies for bootstrap-tools
and cross-tools was already partially solved (see BOOTSTRAPPING
tests in bsd.prog.mk and bsd.lib.mk), but it was still there for
build-tools if the user ran "make world DESTDIR=/foo". Also,
for all of these stages, the library dependencies were broken
because of how bsd.libnames.mk define DPADD members.
We still provide a glue to install bootstrap- and cross-tools
under the ${WORLDTMP}.
Removed PATH overrides for bootstrap-, build-, and cross-tools
stages. There is just no reason why we would need to override
it, and the hacks to clean up the ${WORLDTMP} in the -DNOCLEAN
case are no longer needed with fixes from this step.
That is, we now never use ${WORLDTMP} headers and libraries,
and we don't use any ${WORLDTMP} installed binaries during
these stages. Again, these stages depend solely on the host
environment, including compiler, headers, and libraries.
3. Moved "miniperl" back from cross-tools (it has nothing to do
with a cross-compiler) to build-tools where it belongs. The
change from step 1 let to do this. Also, to make this work,
build-tools targets of "cc_tools" and "miniperl" were modified
to call "depend". Here follow the detailed explanations.
There are two categories of build tools, for now. In the first
category there are "cc_tools" and "miniperl". They occupy the
whole (sub)directory, and nothing needs to be done in this
subdirectory later during the "all" stage. They are also
constructed using system makefiles. We must build the .depend
early in the build-tools stage because:
1) They use (and depend on) the host environment.
2) If we don't do this in build-tools, the "depend" stage of
buildworld will do this for us; wrong library and header
dependencies will be recorded (DESTDIR=${WORLDTMP}) and,
what's worse, the "all" stage may then clobber the
build-architecture format tools (that we built in the
build-tools stage) with the target-architecture format
ones, breaking cross build.
In the second category there are all other build-tools. They
share their directory with the "main" module that needs them
in the "all" stage, and they don't show up themselves in the
.depend file. The portion of this fix was already committed
in gnu/usr.bin/cc/cc_tools/Makefile,v 1.52.
4. "libperl" is no longer a build tool, and "miniperl" is the
stand-alone application. I had to make this change because
build-tools and "all" stages share the same object directory.
Without this change, if we cross compile, libperl.a is first
built for the build architecture during the build-tools stage
(for the purposes of immediate linkage with "miniperl").
Later on, the "all" stage sees this library as up-to-date,
and doesn't rebuild it. The effect is that the wrong format
static libperl library is installed with installworld.
5. Fixed "includes" to install secure/lib/libtelnet headers if
required.
Reviewed by: bde
2001-09-29 13:17:54 +00:00
|
|
|
.if make(buildworld)
|
2005-12-03 05:11:07 +00:00
|
|
|
BUILD_ARCH!= uname -p
|
Fix cross-building, etc:
1. To cross-build, one now needs to set TARGET_ARCH, and not the
MACHINE_ARCH. MACHINE_ARCH should never be changed manually!
2. Initialize DESTDIR= explicitly for bootstrap-tools, build-tools,
and cross-tools stages. This fixes broken header and library
dependencies problem. We build them in the host environment,
and obviously want them to depend on host headers and libraries.
The problem with broken header dependencies for bootstrap-tools
and cross-tools was already partially solved (see BOOTSTRAPPING
tests in bsd.prog.mk and bsd.lib.mk), but it was still there for
build-tools if the user ran "make world DESTDIR=/foo". Also,
for all of these stages, the library dependencies were broken
because of how bsd.libnames.mk define DPADD members.
We still provide a glue to install bootstrap- and cross-tools
under the ${WORLDTMP}.
Removed PATH overrides for bootstrap-, build-, and cross-tools
stages. There is just no reason why we would need to override
it, and the hacks to clean up the ${WORLDTMP} in the -DNOCLEAN
case are no longer needed with fixes from this step.
That is, we now never use ${WORLDTMP} headers and libraries,
and we don't use any ${WORLDTMP} installed binaries during
these stages. Again, these stages depend solely on the host
environment, including compiler, headers, and libraries.
3. Moved "miniperl" back from cross-tools (it has nothing to do
with a cross-compiler) to build-tools where it belongs. The
change from step 1 let to do this. Also, to make this work,
build-tools targets of "cc_tools" and "miniperl" were modified
to call "depend". Here follow the detailed explanations.
There are two categories of build tools, for now. In the first
category there are "cc_tools" and "miniperl". They occupy the
whole (sub)directory, and nothing needs to be done in this
subdirectory later during the "all" stage. They are also
constructed using system makefiles. We must build the .depend
early in the build-tools stage because:
1) They use (and depend on) the host environment.
2) If we don't do this in build-tools, the "depend" stage of
buildworld will do this for us; wrong library and header
dependencies will be recorded (DESTDIR=${WORLDTMP}) and,
what's worse, the "all" stage may then clobber the
build-architecture format tools (that we built in the
build-tools stage) with the target-architecture format
ones, breaking cross build.
In the second category there are all other build-tools. They
share their directory with the "main" module that needs them
in the "all" stage, and they don't show up themselves in the
.depend file. The portion of this fix was already committed
in gnu/usr.bin/cc/cc_tools/Makefile,v 1.52.
4. "libperl" is no longer a build tool, and "miniperl" is the
stand-alone application. I had to make this change because
build-tools and "all" stages share the same object directory.
Without this change, if we cross compile, libperl.a is first
built for the build architecture during the build-tools stage
(for the purposes of immediate linkage with "miniperl").
Later on, the "all" stage sees this library as up-to-date,
and doesn't rebuild it. The effect is that the wrong format
static libperl library is installed with installworld.
5. Fixed "includes" to install secure/lib/libtelnet headers if
required.
Reviewed by: bde
2001-09-29 13:17:54 +00:00
|
|
|
.if ${MACHINE_ARCH} != ${BUILD_ARCH}
|
|
|
|
.error To cross-build, set TARGET_ARCH.
|
|
|
|
.endif
|
|
|
|
.endif
|
2010-09-08 19:53:16 +00:00
|
|
|
.if ${MACHINE} == ${TARGET} && ${MACHINE_ARCH} == ${TARGET_ARCH} && !defined(CROSS_BUILD_TESTING)
|
1999-12-11 17:05:36 +00:00
|
|
|
OBJTREE= ${MAKEOBJDIRPREFIX}
|
|
|
|
.else
|
2010-06-24 16:32:20 +00:00
|
|
|
OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}
|
1999-12-11 17:05:36 +00:00
|
|
|
.endif
|
2005-03-02 16:40:51 +00:00
|
|
|
WORLDTMP= ${OBJTREE}${.CURDIR}/tmp
|
Step 1 of eliminating the "games" distribution: Move binaries to /usr/bin;
update paths; and include everything in the "base" distribution.
The "games" distribution being optional made sense when there were more
games and we had small disks; but the "games-like" games were moved into
the ports tree a dozen years ago and the remaining "utility-like" games
occupy less than 0.001% of my laptop's small hard drive. Meanwhile every
new user is confronted by the question "do you want games installed" when
they they try to install FreeBSD.
The next steps will be:
2. Removing punch card (bcd, ppt), phase-of-moon (pom), clock (grdc), and
caesar cipher (caesar, rot13) utilities. I intend to keep fortune, factor,
morse, number, primes, and random, since there is evidence that those are
still being used.
3. Merging src/games into src/usr.bin.
This change will not be MFCed.
Reviewed by: jmg
Discussed at: EuroBSDCon
Approved by: gjb (release-affecting changes)
2015-02-12 05:35:00 +00:00
|
|
|
BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin
|
|
|
|
XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin
|
2003-04-13 11:42:55 +00:00
|
|
|
STRICTTMPPATH= ${BPATH}:${XPATH}
|
1998-10-17 11:56:20 +00:00
|
|
|
TMPPATH= ${STRICTTMPPATH}:${PATH}
|
1998-08-31 01:08:08 +00:00
|
|
|
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
#
|
|
|
|
# Avoid running mktemp(1) unless actually needed.
|
|
|
|
# It may not be functional, e.g., due to new ABI
|
|
|
|
# when in the middle of installing over this system.
|
|
|
|
#
|
|
|
|
.if make(distributeworld) || make(installworld)
|
2001-12-23 22:49:06 +00:00
|
|
|
INSTALLTMP!= /usr/bin/mktemp -d -u -t install
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
.endif
|
2000-07-19 04:41:59 +00:00
|
|
|
|
1999-12-20 10:32:11 +00:00
|
|
|
#
|
|
|
|
# Building a world goes through the following stages
|
|
|
|
#
|
2003-04-06 21:46:44 +00:00
|
|
|
# 1. legacy stage [BMAKE]
|
2003-04-06 21:23:02 +00:00
|
|
|
# This stage is responsible for creating compatibility
|
|
|
|
# shims that are needed by the bootstrap-tools,
|
2015-03-25 21:59:36 +00:00
|
|
|
# build-tools and cross-tools stages. These are generally
|
|
|
|
# APIs that tools from one of those three stages need to
|
|
|
|
# build that aren't present on the host.
|
2003-04-06 21:23:02 +00:00
|
|
|
# 1. bootstrap-tools stage [BMAKE]
|
1999-12-20 10:32:11 +00:00
|
|
|
# This stage is responsible for creating programs that
|
|
|
|
# are needed for backward compatibility reasons. They
|
|
|
|
# are not built as cross-tools.
|
2003-04-06 21:23:02 +00:00
|
|
|
# 2. build-tools stage [TMAKE]
|
1999-12-20 10:32:11 +00:00
|
|
|
# This stage is responsible for creating the object
|
|
|
|
# tree and building any tools that are needed during
|
2015-08-12 19:00:47 +00:00
|
|
|
# the build process. Some programs are listed during
|
2015-08-13 22:32:42 +00:00
|
|
|
# this phase because they build binaries to generate
|
2015-08-12 19:00:47 +00:00
|
|
|
# files needed to build these programs. This stage also
|
|
|
|
# builds the 'build-tools' target rather than 'all'.
|
2003-04-06 21:23:02 +00:00
|
|
|
# 3. cross-tools stage [XMAKE]
|
1999-12-20 10:32:11 +00:00
|
|
|
# This stage is responsible for creating any tools that
|
2015-03-25 21:59:36 +00:00
|
|
|
# are needed for building the system. A cross-compiler is one
|
2015-08-12 19:00:47 +00:00
|
|
|
# of them. This differs from build tools in two ways:
|
|
|
|
# 1. the 'all' target is built rather than 'build-tools'
|
|
|
|
# 2. these tools are installed into TMPPATH for stage 4.
|
2000-10-13 01:19:36 +00:00
|
|
|
# 4. world stage [WMAKE]
|
1999-12-20 10:32:11 +00:00
|
|
|
# This stage actually builds the world.
|
2000-10-13 01:19:36 +00:00
|
|
|
# 5. install stage (optional) [IMAKE]
|
1999-12-20 10:32:11 +00:00
|
|
|
# This stage installs a previously built world.
|
|
|
|
#
|
|
|
|
|
2003-04-13 15:43:29 +00:00
|
|
|
BOOTSTRAPPING?= 0
|
|
|
|
|
1999-12-20 10:32:11 +00:00
|
|
|
# Common environment for world related stages
|
2015-11-05 21:48:12 +00:00
|
|
|
CROSSENV+= MAKEOBJDIRPREFIX=${OBJTREE} \
|
Fix cross-building, etc:
1. To cross-build, one now needs to set TARGET_ARCH, and not the
MACHINE_ARCH. MACHINE_ARCH should never be changed manually!
2. Initialize DESTDIR= explicitly for bootstrap-tools, build-tools,
and cross-tools stages. This fixes broken header and library
dependencies problem. We build them in the host environment,
and obviously want them to depend on host headers and libraries.
The problem with broken header dependencies for bootstrap-tools
and cross-tools was already partially solved (see BOOTSTRAPPING
tests in bsd.prog.mk and bsd.lib.mk), but it was still there for
build-tools if the user ran "make world DESTDIR=/foo". Also,
for all of these stages, the library dependencies were broken
because of how bsd.libnames.mk define DPADD members.
We still provide a glue to install bootstrap- and cross-tools
under the ${WORLDTMP}.
Removed PATH overrides for bootstrap-, build-, and cross-tools
stages. There is just no reason why we would need to override
it, and the hacks to clean up the ${WORLDTMP} in the -DNOCLEAN
case are no longer needed with fixes from this step.
That is, we now never use ${WORLDTMP} headers and libraries,
and we don't use any ${WORLDTMP} installed binaries during
these stages. Again, these stages depend solely on the host
environment, including compiler, headers, and libraries.
3. Moved "miniperl" back from cross-tools (it has nothing to do
with a cross-compiler) to build-tools where it belongs. The
change from step 1 let to do this. Also, to make this work,
build-tools targets of "cc_tools" and "miniperl" were modified
to call "depend". Here follow the detailed explanations.
There are two categories of build tools, for now. In the first
category there are "cc_tools" and "miniperl". They occupy the
whole (sub)directory, and nothing needs to be done in this
subdirectory later during the "all" stage. They are also
constructed using system makefiles. We must build the .depend
early in the build-tools stage because:
1) They use (and depend on) the host environment.
2) If we don't do this in build-tools, the "depend" stage of
buildworld will do this for us; wrong library and header
dependencies will be recorded (DESTDIR=${WORLDTMP}) and,
what's worse, the "all" stage may then clobber the
build-architecture format tools (that we built in the
build-tools stage) with the target-architecture format
ones, breaking cross build.
In the second category there are all other build-tools. They
share their directory with the "main" module that needs them
in the "all" stage, and they don't show up themselves in the
.depend file. The portion of this fix was already committed
in gnu/usr.bin/cc/cc_tools/Makefile,v 1.52.
4. "libperl" is no longer a build tool, and "miniperl" is the
stand-alone application. I had to make this change because
build-tools and "all" stages share the same object directory.
Without this change, if we cross compile, libperl.a is first
built for the build architecture during the build-tools stage
(for the purposes of immediate linkage with "miniperl").
Later on, the "all" stage sees this library as up-to-date,
and doesn't rebuild it. The effect is that the wrong format
static libperl library is installed with installworld.
5. Fixed "includes" to install secure/lib/libtelnet headers if
required.
Reviewed by: bde
2001-09-29 13:17:54 +00:00
|
|
|
MACHINE_ARCH=${TARGET_ARCH} \
|
2001-10-25 07:28:55 +00:00
|
|
|
MACHINE=${TARGET} \
|
2011-02-22 08:13:49 +00:00
|
|
|
CPUTYPE=${TARGET_CPUTYPE}
|
|
|
|
.if ${MK_GROFF} != "no"
|
|
|
|
CROSSENV+= GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \
|
|
|
|
GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \
|
|
|
|
GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac
|
|
|
|
.endif
|
2014-03-14 19:45:40 +00:00
|
|
|
.if defined(TARGET_CFLAGS)
|
|
|
|
CROSSENV+= ${TARGET_CFLAGS}
|
|
|
|
.endif
|
1999-12-09 16:40:27 +00:00
|
|
|
|
2003-04-06 21:23:02 +00:00
|
|
|
# bootstrap-tools stage
|
2004-08-25 22:06:29 +00:00
|
|
|
BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
2003-04-13 11:42:55 +00:00
|
|
|
PATH=${BPATH}:${PATH} \
|
2003-04-12 15:07:46 +00:00
|
|
|
WORLDTMP=${WORLDTMP} \
|
2014-03-30 23:43:30 +00:00
|
|
|
MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
|
2015-09-26 04:22:18 +00:00
|
|
|
# need to keep this in sync with targets/pseudo/bootstrap-tools/Makefile
|
|
|
|
BSARGS= DESTDIR= \
|
2002-11-13 13:49:29 +00:00
|
|
|
BOOTSTRAPPING=${OSRELDATE} \
|
2014-08-19 15:04:32 +00:00
|
|
|
SSP_CFLAGS= \
|
2015-01-02 18:45:03 +00:00
|
|
|
MK_HTML=no NO_LINT=yes MK_MAN=no \
|
2014-04-25 19:25:26 +00:00
|
|
|
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
|
2014-05-10 16:38:03 +00:00
|
|
|
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
|
2014-12-18 18:26:10 +00:00
|
|
|
MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
|
2015-03-25 20:57:08 +00:00
|
|
|
MK_LLDB=no MK_TESTS=no \
|
2015-09-25 00:30:53 +00:00
|
|
|
MK_INCLUDES=yes
|
1999-12-20 10:32:11 +00:00
|
|
|
|
2015-09-26 04:22:18 +00:00
|
|
|
BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \
|
|
|
|
${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
|
|
|
|
${BSARGS}
|
1999-12-20 10:32:11 +00:00
|
|
|
|
2003-04-06 21:23:02 +00:00
|
|
|
# build-tools stage
|
2003-04-05 20:30:30 +00:00
|
|
|
TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
|
2013-02-03 10:26:24 +00:00
|
|
|
${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
|
2006-09-08 10:09:02 +00:00
|
|
|
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
|
2004-08-25 22:06:29 +00:00
|
|
|
DESTDIR= \
|
2011-05-11 17:50:19 +00:00
|
|
|
BOOTSTRAPPING=${OSRELDATE} \
|
2014-08-19 15:04:32 +00:00
|
|
|
SSP_CFLAGS= \
|
2011-05-11 17:50:19 +00:00
|
|
|
-DNO_LINT \
|
2014-12-18 18:26:10 +00:00
|
|
|
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
|
|
|
|
MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
|
|
|
|
MK_LLDB=no MK_TESTS=no
|
1999-12-20 10:32:11 +00:00
|
|
|
|
2003-04-06 21:23:02 +00:00
|
|
|
# cross-tools stage
|
2006-03-17 18:54:44 +00:00
|
|
|
XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
|
2006-09-07 20:27:56 +00:00
|
|
|
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
|
2014-03-30 22:24:53 +00:00
|
|
|
MK_GDB=no MK_TESTS=no
|
1999-12-20 10:32:11 +00:00
|
|
|
|
2013-11-09 00:15:36 +00:00
|
|
|
# kernel-tools stage
|
|
|
|
KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
|
|
|
PATH=${BPATH}:${PATH} \
|
2015-10-17 05:55:45 +00:00
|
|
|
WORLDTMP=${WORLDTMP}
|
2013-11-09 00:15:36 +00:00
|
|
|
KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOBJDIRPREFIX=${WORLDTMP} \
|
|
|
|
${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
|
|
|
|
DESTDIR= \
|
|
|
|
BOOTSTRAPPING=${OSRELDATE} \
|
2014-08-19 15:04:32 +00:00
|
|
|
SSP_CFLAGS= \
|
2015-01-02 18:45:03 +00:00
|
|
|
MK_HTML=no -DNO_LINT MK_MAN=no \
|
2014-04-25 19:25:26 +00:00
|
|
|
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
|
2014-05-10 16:38:03 +00:00
|
|
|
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no
|
2013-11-09 00:15:36 +00:00
|
|
|
|
1999-12-20 10:32:11 +00:00
|
|
|
# world stage
|
|
|
|
WMAKEENV= ${CROSSENV} \
|
2012-05-07 09:00:30 +00:00
|
|
|
_LDSCRIPTROOT= \
|
2000-01-11 16:23:51 +00:00
|
|
|
INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
1999-12-10 10:48:20 +00:00
|
|
|
PATH=${TMPPATH}
|
2013-06-14 22:32:47 +00:00
|
|
|
|
|
|
|
# make hierarchy
|
2013-08-30 01:32:47 +00:00
|
|
|
HMAKE= PATH=${TMPPATH} ${MAKE} LOCAL_MTREE=${LOCAL_MTREE:Q}
|
2013-06-14 22:32:47 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
HMAKE+= PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT
|
|
|
|
.endif
|
|
|
|
|
2013-05-15 14:30:03 +00:00
|
|
|
.if defined(CROSS_TOOLCHAIN_PREFIX)
|
|
|
|
CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
|
|
|
|
CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
|
|
|
|
.endif
|
2015-03-12 08:40:32 +00:00
|
|
|
|
|
|
|
# If we do not have a bootstrap binutils (because the in-tree one does not
|
|
|
|
# support the target architecture), provide a default cross-binutils prefix.
|
|
|
|
# This allows aarch64 builds, for example, to automatically use the
|
|
|
|
# aarch64-binutils port or package.
|
2015-09-17 04:48:15 +00:00
|
|
|
.if !make(showconfig)
|
2015-03-12 08:40:32 +00:00
|
|
|
.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \
|
|
|
|
!defined(CROSS_BINUTILS_PREFIX)
|
|
|
|
CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/
|
|
|
|
.if !exists(${CROSS_BINUTILS_PREFIX})
|
|
|
|
.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX.
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2013-05-15 14:30:03 +00:00
|
|
|
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
|
2014-10-09 15:52:01 +00:00
|
|
|
XBINUTILS= AS AR LD NM OBJCOPY OBJDUMP RANLIB SIZE STRINGS
|
2013-05-15 14:30:03 +00:00
|
|
|
.for BINUTIL in ${XBINUTILS}
|
2015-04-02 17:03:02 +00:00
|
|
|
.if defined(CROSS_BINUTILS_PREFIX) && \
|
|
|
|
exists(${CROSS_BINUTILS_PREFIX}${${BINUTIL}})
|
2013-05-15 14:30:03 +00:00
|
|
|
X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${${BINUTIL}}
|
|
|
|
.else
|
|
|
|
X${BINUTIL}?= ${${BINUTIL}}
|
|
|
|
.endif
|
|
|
|
.endfor
|
2015-11-05 21:48:12 +00:00
|
|
|
CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCFLAGS} ${XCXXFLAGS}" \
|
2014-10-21 20:07:15 +00:00
|
|
|
DEPFLAGS="${DEPFLAGS}" \
|
2014-10-27 23:31:07 +00:00
|
|
|
CPP="${XCPP} ${XCFLAGS}" \
|
2013-05-15 14:30:03 +00:00
|
|
|
AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \
|
2014-10-09 12:20:00 +00:00
|
|
|
OBJDUMP=${XOBJDUMP} OBJCOPY="${XOBJCOPY}" \
|
2014-10-09 15:52:01 +00:00
|
|
|
RANLIB=${XRANLIB} STRINGS=${XSTRINGS} \
|
|
|
|
SIZE="${XSIZE}"
|
2013-05-15 14:30:03 +00:00
|
|
|
|
Add built-in ccache build support via WITH_CCACHE_BUILD option.
ccache is mostly beneficial for frequent builds where -DNO_CLEAN is not
used to achieve a safe pseudo-incremental build. This is explained in
more detail upstream [1] [2]. It incurs about a 20%-28% hit to populate the
cache, but with a full cache saves 30-50% in build times. When combined with
the WITH_FAST_DEPEND feature it saves up to 65% since ccache does cache the
resulting dependency file, which it does not do when using mkdep(1)/'CC
-E'. Stats are provided at the end of this message.
This removes the need to modify /etc/make.conf with the CC:= and CXX:=
lines which conflicted with external compiler support [3] (causing the
bootstrap compiler to not be built which lead to obscure failures [4]),
incorrectly invoked ccache in various stages, required CCACHE_CPP2 to avoid
Clang errors with parenthesis, and did not work with META_MODE.
The option name was picked to match the existing option in ports. This
feature is available for both in-src and out-of-src builds that use
/usr/share/mk.
Linking, assembly compiles, and pre-processing avoid using ccache since it is
only overhead. ccache does nothing special in these modes, although there is
no harm in calling it for them.
CCACHE_COMPILERCHECK is set to 'content' when using the in-tree bootstrap
compiler to hash the content of the compiler binary to determine if it
should be a cache miss. For external compilers the 'mtime' option is used
as it is more efficient and likely to be correct. Future work may optimize the
'content' check using the same checks as whether a bootstrap compiler is needed
to be built.
The CCACHE_CPP2 pessimization is currently default in our devel/ccache
port due to Clang requiring it. Clang's -Wparentheses-equality,
-Wtautological-compare, and -Wself-assign warnings do not mix well with
compiling already-pre-processed code that may have expanded macros that
trigger the warnings. GCC has so far not had this issue so it is allowed to
disable the CCACHE_CPP2 default in our port.
Sharing a cache between multiple checkouts, or systems, is explained in
the ccache manual. Sharing a cache over NFS would likely not be worth
it, but syncing cache directories between systems may be useful for an
organization. There is also a memcached backend available [5]. Due to using
an object directory outside of the source directory though you will need to
ensure that both are in the same prefix and all users use the same layout. A
possible working layout is as follows:
Source: /some/prefix/src1
Source: /some/prefix/src2
Source: /some/prefix/src3
Objdir: /some/prefix/obj
Environment: CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj'
This will use src*/../obj as the MAKEOBJDIRPREFIX and tells ccache to replace
all absolute paths to be relative. Using something like this is required due
to -I and -o flags containing both SRC and OBJDIR absolute paths that ccache
adds into its hash for the object without CCACHE_BASEDIR.
distcc can be hooked into by setting CCACHE_PREFIX=/usr/local/bin/distcc.
I have not personally tested this and assume it will not mix well with
using the bootstrap compiler.
The cache from buildworld can be reused in a subdir by first running
'make buildenv' (from r290424).
Note that the cache is currently different depending on whether -j is
used or not due to ccache enabling -fdiagnostics-color automatically if
stderr is a TTY, which bmake only does if not using -j.
The system I used for testing was:
WITNESS
Build options: -j20 WITH_LLDB=yes WITH_DEBUG_FILES=yes WITH_CCACHE_BUILD=yes
DISK: ZFS 3-way mirror with very slow disks using SSD l2arc/log.
The arc was fully populated with src tree files and ccache objects.
RAM: 76GiB
CPU: Intel(R) Xeon(R) CPU L5520 @2.27GHz
2 package(s) x 4 core(s) x 2 SMT threads = hw.ncpu=16
The WITH_FAST_DEPEND feature was used for comparison here as well to show
the dramatic time savings with a full cache.
buildworld:
x buildworld-before
+ buildworld-ccache-empty
* buildworld-ccache-full
% buildworld-ccache-full-fastdep
# buildworld-fastdep
+-------------------------------------------------------------------------------+
|% * # +|
|% * # +|
|% * # xxx +|
| |A |
| A|
| A |
|A |
| A |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 3744.13 3794.31 3752.25 3763.5633 26.935139
+ 3 4519 4525.04 4520.73 4521.59 3.1104823
Difference at 95.0% confidence
758.027 +/- 43.4565
20.1412% +/- 1.15466%
(Student's t, pooled s = 19.1726)
* 3 1823.08 1827.2 1825.62 1825.3 2.0785572
Difference at 95.0% confidence
-1938.26 +/- 43.298
-51.5007% +/- 1.15045%
(Student's t, pooled s = 19.1026)
% 3 1266.96 1279.37 1270.47 1272.2667 6.3971113
Difference at 95.0% confidence
-2491.3 +/- 44.3704
-66.1952% +/- 1.17895%
(Student's t, pooled s = 19.5758)
# 3 3153.34 3155.16 3154.2 3154.2333 0.91045776
Difference at 95.0% confidence
-609.33 +/- 43.1943
-16.1902% +/- 1.1477%
(Student's t, pooled s = 19.0569)
buildkernel:
x buildkernel-before
+ buildkernel-ccache-empty
* buildkernel-ccache-empty-fastdep
% buildkernel-ccache-full
# buildkernel-ccache-full-fastdep
@ buildkernel-fastdep
+-------------------------------------------------------------------------------+
|# @ % * |
|# @ % * x + |
|# @ % * xx ++|
| MA |
| MA|
| A |
| A |
|A |
| A |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 571.57 573.94 571.79 572.43333 1.3094401
+ 3 727.97 731.91 728.06 729.31333 2.2492295
Difference at 95.0% confidence
156.88 +/- 4.17129
27.4058% +/- 0.728695%
(Student's t, pooled s = 1.84034)
* 3 527.1 528.29 528.08 527.82333 0.63516402
Difference at 95.0% confidence
-44.61 +/- 2.33254
-7.79305% +/- 0.407478%
(Student's t, pooled s = 1.02909)
% 3 400.4 401.05 400.62 400.69 0.3306055
Difference at 95.0% confidence
-171.743 +/- 2.16453
-30.0023% +/- 0.378128%
(Student's t, pooled s = 0.954969)
# 3 201.94 203.34 202.28 202.52 0.73020545
Difference at 95.0% confidence
-369.913 +/- 2.40293
-64.6212% +/- 0.419774%
(Student's t, pooled s = 1.06015)
@ 3 369.12 370.57 369.3 369.66333 0.79033748
Difference at 95.0% confidence
-202.77 +/- 2.45131
-35.4225% +/- 0.428227%
(Student's t, pooled s = 1.0815)
[1] https://ccache.samba.org/performance.html
[2] http://www.mail-archive.com/ccache@lists.samba.org/msg00576.html
[3] https://reviews.freebsd.org/D3484
[5] https://github.com/jrosdahl/ccache/pull/30
PR: 182944 [4]
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
Relnotes: yes
2015-11-08 00:50:18 +00:00
|
|
|
.if ${XCC:N${CCACHE_BIN}:M/*}
|
2013-05-15 14:30:03 +00:00
|
|
|
.if defined(CROSS_BINUTILS_PREFIX)
|
|
|
|
# In the case of xdev-build tools, CROSS_BINUTILS_PREFIX won't be a
|
|
|
|
# directory, but the compiler will look in the right place for it's
|
|
|
|
# tools so we don't need to tell it where to look.
|
|
|
|
.if exists(${CROSS_BINUTILS_PREFIX})
|
2015-02-18 19:27:51 +00:00
|
|
|
BFLAGS+= -B${CROSS_BINUTILS_PREFIX}
|
2013-05-15 14:30:03 +00:00
|
|
|
.endif
|
|
|
|
.else
|
2015-02-18 19:27:51 +00:00
|
|
|
BFLAGS+= -B${WORLDTMP}/usr/bin
|
2013-05-15 14:30:03 +00:00
|
|
|
.endif
|
2014-10-01 08:26:51 +00:00
|
|
|
.if ${TARGET} == "arm"
|
2014-10-01 12:47:25 +00:00
|
|
|
.if ${TARGET_ARCH:M*hf*} != ""
|
2014-03-23 12:49:25 +00:00
|
|
|
TARGET_ABI= gnueabihf
|
2014-10-01 12:47:25 +00:00
|
|
|
.else
|
|
|
|
TARGET_ABI= gnueabi
|
2013-05-15 14:30:03 +00:00
|
|
|
.endif
|
2014-03-30 23:43:30 +00:00
|
|
|
.endif
|
2014-10-09 09:46:44 +00:00
|
|
|
.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc
|
2014-10-27 23:31:07 +00:00
|
|
|
XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib
|
|
|
|
XCXXFLAGS+= -I${WORLDTMP}/usr/include/c++/v1 -std=gnu++11 -L${WORLDTMP}/../lib/libc++
|
2015-10-26 19:28:20 +00:00
|
|
|
# XXX: DEPFLAGS is a workaround for not properly passing CXXFLAGS to sub-makes
|
|
|
|
# due to CXX="${XCXX} ${XCXXFLAGS}". bsd.dep.mk does use CXXFLAGS when
|
|
|
|
# building C++ files so this can come out if passing CXXFLAGS down is fixed.
|
2014-10-21 20:07:15 +00:00
|
|
|
DEPFLAGS+= -I${WORLDTMP}/usr/include/c++/v1
|
2014-10-09 09:04:01 +00:00
|
|
|
.else
|
2014-03-30 23:43:30 +00:00
|
|
|
TARGET_ABI?= unknown
|
2013-10-10 20:47:11 +00:00
|
|
|
TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0
|
2014-10-27 23:31:07 +00:00
|
|
|
XCFLAGS+= -target ${TARGET_TRIPLE}
|
2015-03-26 23:37:03 +00:00
|
|
|
.endif
|
2015-02-18 19:27:51 +00:00
|
|
|
XCFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS}
|
|
|
|
XCXXFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS}
|
2015-02-26 20:02:29 +00:00
|
|
|
.else
|
|
|
|
.if defined(CROSS_BINUTILS_PREFIX) && exists(${CROSS_BINUTILS_PREFIX})
|
|
|
|
BFLAGS+= -B${CROSS_BINUTILS_PREFIX}
|
|
|
|
XCFLAGS+= ${BFLAGS}
|
|
|
|
XCXXFLAGS+= ${BFLAGS}
|
2014-10-09 09:04:01 +00:00
|
|
|
.endif
|
2015-02-26 20:02:29 +00:00
|
|
|
.endif # ${XCC:M/*}
|
2013-05-15 14:30:03 +00:00
|
|
|
|
2013-02-03 10:26:24 +00:00
|
|
|
WMAKE= ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 DESTDIR=${WORLDTMP}
|
1999-12-08 13:45:11 +00:00
|
|
|
|
2010-07-13 21:19:59 +00:00
|
|
|
.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64"
|
2004-11-06 03:14:26 +00:00
|
|
|
# 32 bit world
|
2014-09-18 01:57:36 +00:00
|
|
|
LIB32_OBJTREE= ${OBJTREE}${.CURDIR}/world32
|
2004-11-06 03:14:26 +00:00
|
|
|
LIB32TMP= ${OBJTREE}${.CURDIR}/lib32
|
|
|
|
|
2010-07-13 21:19:59 +00:00
|
|
|
.if ${TARGET_ARCH} == "amd64"
|
2005-12-07 22:55:29 +00:00
|
|
|
.if empty(TARGET_CPUTYPE)
|
2008-08-19 14:23:26 +00:00
|
|
|
LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2
|
2005-12-07 17:41:10 +00:00
|
|
|
.else
|
2008-08-19 14:23:26 +00:00
|
|
|
LIB32CPUFLAGS= -march=${TARGET_CPUTYPE}
|
2005-12-07 17:41:10 +00:00
|
|
|
.endif
|
2010-07-13 21:19:59 +00:00
|
|
|
LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \
|
2012-10-07 16:45:38 +00:00
|
|
|
MACHINE_CPU="i686 mmx sse sse2"
|
|
|
|
LIB32WMAKEFLAGS= \
|
2015-04-02 06:58:17 +00:00
|
|
|
AS="${XAS} --32" \
|
|
|
|
LD="${XLD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \
|
|
|
|
OBJCOPY="${XOBJCOPY}"
|
2010-07-13 21:19:59 +00:00
|
|
|
|
|
|
|
.elif ${TARGET_ARCH} == "powerpc64"
|
|
|
|
.if empty(TARGET_CPUTYPE)
|
|
|
|
LIB32CPUFLAGS= -mcpu=powerpc
|
|
|
|
.else
|
|
|
|
LIB32CPUFLAGS= -mcpu=${TARGET_CPUTYPE}
|
|
|
|
.endif
|
2012-10-07 16:45:38 +00:00
|
|
|
LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc
|
|
|
|
LIB32WMAKEFLAGS= \
|
2015-04-02 06:58:17 +00:00
|
|
|
LD="${XLD} -m elf32ppc_fbsd" \
|
|
|
|
OBJCOPY="${XOBJCOPY}"
|
2010-07-13 21:19:59 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
|
|
LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -DCOMPAT_32BIT \
|
2009-11-01 08:20:30 +00:00
|
|
|
-isystem ${LIB32TMP}/usr/include/ \
|
2004-11-06 03:14:26 +00:00
|
|
|
-L${LIB32TMP}/usr/lib32 \
|
|
|
|
-B${LIB32TMP}/usr/lib32
|
Add built-in ccache build support via WITH_CCACHE_BUILD option.
ccache is mostly beneficial for frequent builds where -DNO_CLEAN is not
used to achieve a safe pseudo-incremental build. This is explained in
more detail upstream [1] [2]. It incurs about a 20%-28% hit to populate the
cache, but with a full cache saves 30-50% in build times. When combined with
the WITH_FAST_DEPEND feature it saves up to 65% since ccache does cache the
resulting dependency file, which it does not do when using mkdep(1)/'CC
-E'. Stats are provided at the end of this message.
This removes the need to modify /etc/make.conf with the CC:= and CXX:=
lines which conflicted with external compiler support [3] (causing the
bootstrap compiler to not be built which lead to obscure failures [4]),
incorrectly invoked ccache in various stages, required CCACHE_CPP2 to avoid
Clang errors with parenthesis, and did not work with META_MODE.
The option name was picked to match the existing option in ports. This
feature is available for both in-src and out-of-src builds that use
/usr/share/mk.
Linking, assembly compiles, and pre-processing avoid using ccache since it is
only overhead. ccache does nothing special in these modes, although there is
no harm in calling it for them.
CCACHE_COMPILERCHECK is set to 'content' when using the in-tree bootstrap
compiler to hash the content of the compiler binary to determine if it
should be a cache miss. For external compilers the 'mtime' option is used
as it is more efficient and likely to be correct. Future work may optimize the
'content' check using the same checks as whether a bootstrap compiler is needed
to be built.
The CCACHE_CPP2 pessimization is currently default in our devel/ccache
port due to Clang requiring it. Clang's -Wparentheses-equality,
-Wtautological-compare, and -Wself-assign warnings do not mix well with
compiling already-pre-processed code that may have expanded macros that
trigger the warnings. GCC has so far not had this issue so it is allowed to
disable the CCACHE_CPP2 default in our port.
Sharing a cache between multiple checkouts, or systems, is explained in
the ccache manual. Sharing a cache over NFS would likely not be worth
it, but syncing cache directories between systems may be useful for an
organization. There is also a memcached backend available [5]. Due to using
an object directory outside of the source directory though you will need to
ensure that both are in the same prefix and all users use the same layout. A
possible working layout is as follows:
Source: /some/prefix/src1
Source: /some/prefix/src2
Source: /some/prefix/src3
Objdir: /some/prefix/obj
Environment: CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj'
This will use src*/../obj as the MAKEOBJDIRPREFIX and tells ccache to replace
all absolute paths to be relative. Using something like this is required due
to -I and -o flags containing both SRC and OBJDIR absolute paths that ccache
adds into its hash for the object without CCACHE_BASEDIR.
distcc can be hooked into by setting CCACHE_PREFIX=/usr/local/bin/distcc.
I have not personally tested this and assume it will not mix well with
using the bootstrap compiler.
The cache from buildworld can be reused in a subdir by first running
'make buildenv' (from r290424).
Note that the cache is currently different depending on whether -j is
used or not due to ccache enabling -fdiagnostics-color automatically if
stderr is a TTY, which bmake only does if not using -j.
The system I used for testing was:
WITNESS
Build options: -j20 WITH_LLDB=yes WITH_DEBUG_FILES=yes WITH_CCACHE_BUILD=yes
DISK: ZFS 3-way mirror with very slow disks using SSD l2arc/log.
The arc was fully populated with src tree files and ccache objects.
RAM: 76GiB
CPU: Intel(R) Xeon(R) CPU L5520 @2.27GHz
2 package(s) x 4 core(s) x 2 SMT threads = hw.ncpu=16
The WITH_FAST_DEPEND feature was used for comparison here as well to show
the dramatic time savings with a full cache.
buildworld:
x buildworld-before
+ buildworld-ccache-empty
* buildworld-ccache-full
% buildworld-ccache-full-fastdep
# buildworld-fastdep
+-------------------------------------------------------------------------------+
|% * # +|
|% * # +|
|% * # xxx +|
| |A |
| A|
| A |
|A |
| A |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 3744.13 3794.31 3752.25 3763.5633 26.935139
+ 3 4519 4525.04 4520.73 4521.59 3.1104823
Difference at 95.0% confidence
758.027 +/- 43.4565
20.1412% +/- 1.15466%
(Student's t, pooled s = 19.1726)
* 3 1823.08 1827.2 1825.62 1825.3 2.0785572
Difference at 95.0% confidence
-1938.26 +/- 43.298
-51.5007% +/- 1.15045%
(Student's t, pooled s = 19.1026)
% 3 1266.96 1279.37 1270.47 1272.2667 6.3971113
Difference at 95.0% confidence
-2491.3 +/- 44.3704
-66.1952% +/- 1.17895%
(Student's t, pooled s = 19.5758)
# 3 3153.34 3155.16 3154.2 3154.2333 0.91045776
Difference at 95.0% confidence
-609.33 +/- 43.1943
-16.1902% +/- 1.1477%
(Student's t, pooled s = 19.0569)
buildkernel:
x buildkernel-before
+ buildkernel-ccache-empty
* buildkernel-ccache-empty-fastdep
% buildkernel-ccache-full
# buildkernel-ccache-full-fastdep
@ buildkernel-fastdep
+-------------------------------------------------------------------------------+
|# @ % * |
|# @ % * x + |
|# @ % * xx ++|
| MA |
| MA|
| A |
| A |
|A |
| A |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 571.57 573.94 571.79 572.43333 1.3094401
+ 3 727.97 731.91 728.06 729.31333 2.2492295
Difference at 95.0% confidence
156.88 +/- 4.17129
27.4058% +/- 0.728695%
(Student's t, pooled s = 1.84034)
* 3 527.1 528.29 528.08 527.82333 0.63516402
Difference at 95.0% confidence
-44.61 +/- 2.33254
-7.79305% +/- 0.407478%
(Student's t, pooled s = 1.02909)
% 3 400.4 401.05 400.62 400.69 0.3306055
Difference at 95.0% confidence
-171.743 +/- 2.16453
-30.0023% +/- 0.378128%
(Student's t, pooled s = 0.954969)
# 3 201.94 203.34 202.28 202.52 0.73020545
Difference at 95.0% confidence
-369.913 +/- 2.40293
-64.6212% +/- 0.419774%
(Student's t, pooled s = 1.06015)
@ 3 369.12 370.57 369.3 369.66333 0.79033748
Difference at 95.0% confidence
-202.77 +/- 2.45131
-35.4225% +/- 0.428227%
(Student's t, pooled s = 1.0815)
[1] https://ccache.samba.org/performance.html
[2] http://www.mail-archive.com/ccache@lists.samba.org/msg00576.html
[3] https://reviews.freebsd.org/D3484
[5] https://github.com/jrosdahl/ccache/pull/30
PR: 182944 [4]
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
Relnotes: yes
2015-11-08 00:50:18 +00:00
|
|
|
.if ${XCC:N${CCACHE_BIN}:M/*}
|
2013-05-21 16:58:23 +00:00
|
|
|
LIB32FLAGS+= --sysroot=${WORLDTMP}
|
|
|
|
.endif
|
2004-11-06 03:14:26 +00:00
|
|
|
|
|
|
|
# Yes, the flags are redundant.
|
2014-09-18 01:57:36 +00:00
|
|
|
LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${LIB32_OBJTREE} \
|
2012-05-07 09:00:30 +00:00
|
|
|
_LDSCRIPTROOT=${LIB32TMP} \
|
2004-11-06 03:14:26 +00:00
|
|
|
INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
|
|
|
PATH=${TMPPATH} \
|
|
|
|
LIBDIR=/usr/lib32 \
|
2012-09-13 16:00:46 +00:00
|
|
|
SHLIBDIR=/usr/lib32 \
|
2014-08-08 23:55:22 +00:00
|
|
|
DTRACE="${DTRACE} -32"
|
2014-03-30 23:43:30 +00:00
|
|
|
LIB32WMAKEFLAGS+= CC="${XCC} ${LIB32FLAGS}" \
|
2013-05-15 14:30:03 +00:00
|
|
|
CXX="${XCXX} ${LIB32FLAGS}" \
|
2012-10-07 16:45:38 +00:00
|
|
|
DESTDIR=${LIB32TMP} \
|
|
|
|
-DCOMPAT_32BIT \
|
2013-01-17 17:27:10 +00:00
|
|
|
-DLIBRARIES_ONLY \
|
2012-10-07 16:45:38 +00:00
|
|
|
-DNO_CPU_CFLAGS \
|
2014-04-25 19:25:00 +00:00
|
|
|
MK_CTF=no \
|
2014-01-24 18:01:46 +00:00
|
|
|
-DNO_LINT \
|
2014-03-30 22:24:53 +00:00
|
|
|
MK_TESTS=no
|
2004-11-06 03:14:26 +00:00
|
|
|
|
2012-10-07 16:45:38 +00:00
|
|
|
LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \
|
2015-01-02 18:45:03 +00:00
|
|
|
MK_MAN=no MK_HTML=no
|
2014-04-25 19:25:45 +00:00
|
|
|
LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} \
|
|
|
|
MK_TOOLCHAIN=no ${IMAKE_INSTALL}
|
2004-11-06 03:14:26 +00:00
|
|
|
.endif
|
|
|
|
|
2012-05-07 09:00:30 +00:00
|
|
|
IMAKEENV= ${CROSSENV:N_LDSCRIPTROOT=*}
|
2013-01-15 00:12:34 +00:00
|
|
|
IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \
|
2014-03-30 23:43:30 +00:00
|
|
|
${IMAKE_INSTALL} ${IMAKE_MTREE}
|
2004-08-09 11:38:41 +00:00
|
|
|
.if empty(.MAKEFLAGS:M-n)
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \
|
|
|
|
LD_LIBRARY_PATH=${INSTALLTMP} \
|
|
|
|
PATH_LOCALE=${INSTALLTMP}/locale
|
|
|
|
IMAKE+= __MAKE_SHELL=${INSTALLTMP}/sh
|
2004-08-09 11:38:41 +00:00
|
|
|
.else
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP}
|
2004-08-09 11:38:41 +00:00
|
|
|
.endif
|
2013-01-15 00:12:34 +00:00
|
|
|
.if defined(DB_FROM_SRC)
|
2013-01-22 21:10:03 +00:00
|
|
|
INSTALLFLAGS+= -N ${.CURDIR}/etc
|
|
|
|
MTREEFLAGS+= -N ${.CURDIR}/etc
|
|
|
|
.endif
|
2013-05-30 14:09:58 +00:00
|
|
|
_INSTALL_DDIR= ${DESTDIR}/${DISTDIR}
|
|
|
|
INSTALL_DDIR= ${_INSTALL_DDIR:S://:/:g:C:/$::}
|
2013-01-22 21:10:03 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
METALOG?= ${DESTDIR}/${DISTDIR}/METALOG
|
|
|
|
IMAKE+= -DNO_ROOT METALOG=${METALOG}
|
2013-05-30 14:09:58 +00:00
|
|
|
INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR}
|
2013-01-22 21:10:03 +00:00
|
|
|
MTREEFLAGS+= -W
|
|
|
|
.endif
|
|
|
|
.if defined(DB_FROM_SRC) || defined(NO_ROOT)
|
|
|
|
IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}"
|
2014-01-30 22:26:51 +00:00
|
|
|
IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}"
|
2013-01-15 00:12:34 +00:00
|
|
|
.endif
|
1999-12-10 10:48:20 +00:00
|
|
|
|
2001-01-22 08:07:58 +00:00
|
|
|
# kernel stage
|
2002-09-17 01:49:00 +00:00
|
|
|
KMAKEENV= ${WMAKEENV}
|
2013-04-12 17:57:40 +00:00
|
|
|
KMAKE= ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME}
|
2001-01-22 08:07:58 +00:00
|
|
|
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# buildworld
|
|
|
|
#
|
|
|
|
# Attempt to rebuild the entire system, with reasonable chance of
|
|
|
|
# success, regardless of how old your existing system is.
|
|
|
|
#
|
2015-10-21 05:33:48 +00:00
|
|
|
_worldtmp: .PHONY
|
2003-02-04 08:15:30 +00:00
|
|
|
.if ${.CURDIR:C/[^,]//g} != ""
|
|
|
|
# The m4 build of sendmail files doesn't like it if ',' is used
|
|
|
|
# anywhere in the path of it's files.
|
|
|
|
@echo
|
|
|
|
@echo "*** Error: path to source tree contains a comma ','"
|
|
|
|
@echo
|
2004-03-04 09:14:30 +00:00
|
|
|
false
|
2003-02-04 08:15:30 +00:00
|
|
|
.endif
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
1999-12-10 10:48:20 +00:00
|
|
|
@echo ">>> Rebuilding the temporary build tree"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-12-21 12:21:26 +00:00
|
|
|
.if !defined(NO_CLEAN)
|
1998-08-31 01:08:08 +00:00
|
|
|
rm -rf ${WORLDTMP}
|
2010-07-13 21:19:59 +00:00
|
|
|
.if defined(LIB32TMP)
|
2005-08-05 23:48:58 +00:00
|
|
|
rm -rf ${LIB32TMP}
|
|
|
|
.endif
|
2002-04-11 14:49:32 +00:00
|
|
|
.else
|
2003-04-06 23:46:02 +00:00
|
|
|
rm -rf ${WORLDTMP}/legacy/usr/include
|
2016-01-11 20:27:05 +00:00
|
|
|
# XXX - These can depend on any header file.
|
2016-01-08 22:59:49 +00:00
|
|
|
rm -f ${OBJTREE}${.CURDIR}/lib/libsysdecode/ioctl.c
|
2008-02-05 08:56:18 +00:00
|
|
|
rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c
|
1999-12-10 10:48:20 +00:00
|
|
|
.endif
|
2003-04-13 14:34:17 +00:00
|
|
|
.for _dir in \
|
2013-01-29 22:17:58 +00:00
|
|
|
lib usr legacy/bin legacy/usr
|
2003-04-13 14:34:17 +00:00
|
|
|
mkdir -p ${WORLDTMP}/${_dir}
|
1999-12-08 13:45:11 +00:00
|
|
|
.endfor
|
2009-03-15 13:14:06 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${WORLDTMP}/legacy/usr >/dev/null
|
2011-02-22 08:13:49 +00:00
|
|
|
.if ${MK_GROFF} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.groff.dist \
|
|
|
|
-p ${WORLDTMP}/legacy/usr >/dev/null
|
|
|
|
.endif
|
2009-03-15 13:14:06 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${WORLDTMP}/usr >/dev/null
|
2003-05-18 20:22:26 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
2004-03-14 16:44:27 +00:00
|
|
|
-p ${WORLDTMP}/usr/include >/dev/null
|
2001-03-22 09:54:25 +00:00
|
|
|
ln -sf ${.CURDIR}/sys ${WORLDTMP}
|
2013-06-07 21:40:02 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
|
|
|
# We could instead disable debug files for these build stages
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
|
|
|
|
-p ${WORLDTMP}/legacy/usr/lib >/dev/null
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
|
|
|
|
-p ${WORLDTMP}/usr/lib >/dev/null
|
|
|
|
.endif
|
2015-10-20 20:35:34 +00:00
|
|
|
.if ${MK_LIB32} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
|
|
|
|
-p ${WORLDTMP}/usr >/dev/null
|
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
|
|
|
|
-p ${WORLDTMP}/legacy/usr/lib/debug/usr >/dev/null
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
|
|
|
|
-p ${WORLDTMP}/usr/lib/debug/usr >/dev/null
|
|
|
|
.endif
|
|
|
|
.endif
|
2013-10-25 05:25:19 +00:00
|
|
|
.if ${MK_TESTS} != "no"
|
2014-12-18 18:16:00 +00:00
|
|
|
mkdir -p ${WORLDTMP}${TESTSBASE}
|
2013-10-25 05:25:19 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
|
2014-12-18 18:16:00 +00:00
|
|
|
-p ${WORLDTMP}${TESTSBASE} >/dev/null
|
2015-10-15 01:46:55 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
2015-10-15 21:21:41 +00:00
|
|
|
mkdir -p ${WORLDTMP}/usr/lib/debug/${TESTSBASE}
|
2015-10-15 01:46:55 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
|
|
|
|
-p ${WORLDTMP}/usr/lib/debug/${TESTSBASE} >/dev/null
|
|
|
|
.endif
|
2013-10-25 05:25:19 +00:00
|
|
|
.endif
|
2012-10-18 12:32:51 +00:00
|
|
|
.for _mtree in ${LOCAL_MTREE}
|
|
|
|
mtree -deU -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null
|
|
|
|
.endfor
|
2003-04-06 21:46:44 +00:00
|
|
|
_legacy:
|
2003-04-06 03:50:28 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 1.1: legacy release compatibility shims"
|
2003-04-06 03:50:28 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${BMAKE} legacy
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_bootstrap-tools:
|
1999-12-10 10:48:20 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 1.2: bootstrap tools"
|
1999-12-10 10:48:20 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_cleanobj:
|
2004-12-21 12:21:26 +00:00
|
|
|
.if !defined(NO_CLEAN)
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 2.1: cleaning up the object tree"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2015-10-17 03:51:50 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR}
|
2010-07-13 21:19:59 +00:00
|
|
|
.if defined(LIB32TMP)
|
2015-10-17 03:51:50 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${LIB32WMAKE} -f Makefile.inc1 ${CLEANDIR}
|
2005-08-05 23:48:58 +00:00
|
|
|
.endif
|
1999-01-04 12:05:59 +00:00
|
|
|
.endif
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_obj:
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 2.2: rebuilding the object tree"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2015-10-17 03:51:50 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} obj
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_build-tools:
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 2.3: build tools"
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${TMAKE} build-tools
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_cross-tools:
|
1999-11-24 06:04:11 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
1999-12-20 10:32:11 +00:00
|
|
|
@echo ">>> stage 3: cross tools"
|
1999-11-24 06:04:11 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools
|
2013-11-08 05:11:32 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_includes:
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-11-03 21:09:47 +00:00
|
|
|
@echo ">>> stage 4.1: building includes"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)
Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.
SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.
With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.
- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.
- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.
- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.
- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.
The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.
This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.
- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.
- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.
- Document these changes in build.7
Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks
2015-10-22 00:07:48 +00:00
|
|
|
# Special handling for SUBDIR_OVERRIDE in buildworld as they most likely need
|
|
|
|
# headers from default SUBDIR. Do SUBDIR_OVERRIDE includes last.
|
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} SUBDIR_OVERRIDE= SHARED=symlinks \
|
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
|
|
|
includes
|
Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)
Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.
SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.
With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.
- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.
- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.
- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.
- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.
The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.
This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.
- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.
- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.
- Document these changes in build.7
Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks
2015-10-22 00:07:48 +00:00
|
|
|
.if !empty(SUBDIR_OVERRIDE) && make(buildworld)
|
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}; ${WMAKE} SHARED=symlinks includes
|
Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)
Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.
SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.
With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.
- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.
- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.
- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.
- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.
The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.
This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.
- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.
- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.
- Document these changes in build.7
Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks
2015-10-22 00:07:48 +00:00
|
|
|
.endif
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_libraries:
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 4.2: building libraries"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; \
|
2015-01-02 18:45:03 +00:00
|
|
|
${WMAKE} -DNO_FSCHG MK_HTML=no -DNO_LINT MK_MAN=no \
|
2014-10-22 03:39:11 +00:00
|
|
|
MK_PROFILE=no MK_TESTS=no MK_TESTS_SUPPORT=${MK_TESTS} libraries
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_depend:
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 4.3: make dependencies"
|
1999-12-20 10:32:11 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2015-10-17 03:51:50 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} depend
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
everything:
|
1999-12-20 10:32:11 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2004-03-19 17:57:07 +00:00
|
|
|
@echo ">>> stage 4.4: building everything"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2015-12-07 18:45:55 +00:00
|
|
|
${_+_}cd ${.CURDIR}; _PARALLEL_SUBDIR_OK=1 ${WMAKE} all
|
2010-07-13 21:19:59 +00:00
|
|
|
.if defined(LIB32TMP)
|
2015-10-21 05:33:48 +00:00
|
|
|
build32: .PHONY
|
2004-11-06 03:14:26 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> stage 5.1: building 32 bit shim libraries"
|
|
|
|
@echo "--------------------------------------------------------------"
|
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
|
|
|
mkdir -p ${LIB32TMP}/usr/include
|
2009-03-15 13:14:06 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${LIB32TMP}/usr >/dev/null
|
2004-11-06 03:14:26 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
|
|
|
-p ${LIB32TMP}/usr/include >/dev/null
|
2015-10-20 20:35:34 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
|
|
|
|
-p ${LIB32TMP}/usr >/dev/null
|
2013-06-07 21:40:02 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
|
|
|
|
-p ${LIB32TMP}/usr/lib >/dev/null
|
2015-10-20 20:35:34 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
|
|
|
|
-p ${LIB32TMP}/usr/lib/debug/usr >/dev/null
|
2013-06-07 21:40:02 +00:00
|
|
|
.endif
|
2005-08-05 23:48:58 +00:00
|
|
|
mkdir -p ${WORLDTMP}
|
2004-11-06 03:14:26 +00:00
|
|
|
ln -sf ${.CURDIR}/sys ${WORLDTMP}
|
|
|
|
.for _t in obj includes
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}/include; ${LIB32WMAKE} DIRPRFX=include/ ${_t}
|
|
|
|
${_+_}cd ${.CURDIR}/lib; ${LIB32WMAKE} DIRPRFX=lib/ ${_t}
|
2007-04-06 02:13:30 +00:00
|
|
|
.if ${MK_CDDL} != "no"
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} DIRPRFX=cddl/lib/ ${_t}
|
2007-04-06 02:13:30 +00:00
|
|
|
.endif
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} DIRPRFX=gnu/lib/ ${_t}
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_CRYPT} != "no"
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} DIRPRFX=secure/lib/ ${_t}
|
2004-11-06 03:14:26 +00:00
|
|
|
.endif
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_KERBEROS} != "no"
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} DIRPRFX=kerberos5/lib ${_t}
|
2004-11-15 05:59:10 +00:00
|
|
|
.endif
|
2004-11-06 03:14:26 +00:00
|
|
|
.endfor
|
2006-05-17 09:33:15 +00:00
|
|
|
.for _dir in usr.bin/lex/lib
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} DIRPRFX=${_dir}/ obj
|
2004-12-01 23:23:14 +00:00
|
|
|
.endfor
|
2007-03-09 12:11:58 +00:00
|
|
|
.for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}/${_dir}; \
|
2012-11-30 20:50:34 +00:00
|
|
|
WORLDTMP=${WORLDTMP} \
|
|
|
|
MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \
|
2014-09-18 01:57:36 +00:00
|
|
|
MAKEOBJDIRPREFIX=${LIB32_OBJTREE} ${MAKE} SSP_CFLAGS= DESTDIR= \
|
2014-05-10 16:37:53 +00:00
|
|
|
DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
|
2014-05-10 16:38:03 +00:00
|
|
|
build-tools
|
2004-11-06 03:14:26 +00:00
|
|
|
.endfor
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}; \
|
2015-11-14 01:45:37 +00:00
|
|
|
${LIB32WMAKE} -f Makefile.inc1 -DNO_FSCHG libraries
|
2004-11-06 03:14:26 +00:00
|
|
|
.for _t in obj depend all
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \
|
2015-11-14 01:45:37 +00:00
|
|
|
-DNO_FSCHG DIRPRFX=libexec/rtld-elf/ ${_t}
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \
|
2011-03-01 14:53:36 +00:00
|
|
|
DIRPRFX=usr.bin/ldd ${_t}
|
2004-11-06 03:14:26 +00:00
|
|
|
.endfor
|
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
distribute32 install32: .MAKE .PHONY
|
|
|
|
${_+_}cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
|
2008-05-23 04:22:14 +00:00
|
|
|
.if ${MK_CDDL} != "no"
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}/cddl/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
|
2008-05-23 04:22:14 +00:00
|
|
|
.endif
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_CRYPT} != "no"
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
|
2008-11-12 04:43:55 +00:00
|
|
|
.endif
|
|
|
|
.if ${MK_KERBEROS} != "no"
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
|
2004-11-06 03:14:26 +00:00
|
|
|
.endif
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}/libexec/rtld-elf; \
|
2008-08-02 12:14:22 +00:00
|
|
|
PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//}
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} \
|
|
|
|
${.TARGET:S/32$//}
|
2004-11-06 03:14:26 +00:00
|
|
|
.endif
|
1998-08-31 01:08:08 +00:00
|
|
|
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
WMAKE_TGTS=
|
Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)
Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.
SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.
With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.
- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.
- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.
- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.
- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.
The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.
This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.
- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.
- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.
- Document these changes in build.7
Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks
2015-10-22 00:07:48 +00:00
|
|
|
WMAKE_TGTS+= _worldtmp _legacy
|
|
|
|
.if empty(SUBDIR_OVERRIDE)
|
|
|
|
WMAKE_TGTS+= _bootstrap-tools
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
.endif
|
Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)
Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.
SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.
With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.
- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.
- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.
- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.
- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.
The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.
This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.
- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.
- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.
- Document these changes in build.7
Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks
2015-10-22 00:07:48 +00:00
|
|
|
WMAKE_TGTS+= _cleanobj _obj _build-tools _cross-tools
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
WMAKE_TGTS+= _includes _libraries _depend everything
|
Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir". It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use. Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories. It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)
Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.
SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.
With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories. This is still much better than building unneeded things via
'everything' when testing small subset changes. A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.
- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
such as '_libraries' and '_includes' use it. This probably was avoiding
calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
-DNO_CLEAN can be used for that.
- '_legacy' must be included since '_build-tools' uses -legacy.
The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
of build-tools came in r113136.
- 'bootstrap-tools' is still skipped as this feature is not for
upgrades.
- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.
The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
could need anything from them. However in r96462 the real 'includes'
target was changed from manual sub-makes to just recursing 'includes'
on SUBDIR, thus not all includes have been installed into WORLDTMP since then
when combined with 'buildworld'.
This is not done unless calling 'make buildworld' as it would be
unexpected to have it go into all directories when doing 'make
SUBDIR_OVERRIDE=mydir includes'.
- Also need to build the cross-compiler so it is used with --sysroot.
If this is burdensome then telling the build to use the local compiler
as an external compiler (thus using a proper --sysroot to WORLDTMP) is
possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.
- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
since it won't contain anything related to SUBDIR_OVERRIDE. Testing
of the lib32 build can be done with 'make build32'.
- Document these changes in build.7
Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks
2015-10-22 00:07:48 +00:00
|
|
|
.if defined(LIB32TMP) && ${MK_LIB32} != "no" && empty(SUBDIR_OVERRIDE)
|
2004-11-06 03:14:26 +00:00
|
|
|
WMAKE_TGTS+= build32
|
|
|
|
.endif
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
|
2006-09-07 19:36:16 +00:00
|
|
|
buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
|
|
|
|
.ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
|
1998-08-31 01:08:08 +00:00
|
|
|
|
2006-09-07 19:36:16 +00:00
|
|
|
buildworld_prologue:
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> World build started on `LC_ALL=C date`"
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
|
|
|
|
buildworld_epilogue:
|
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> World build completed on `LC_ALL=C date`"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2006-06-06 16:24:54 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# We need to have this as a target because the indirection between Makefile
|
|
|
|
# and Makefile.inc1 causes the correct PATH to be used, rather than a
|
2006-06-06 18:07:58 +00:00
|
|
|
# modification of the current environment's PATH. In addition, we need
|
|
|
|
# to quote multiword values.
|
2007-05-26 20:17:19 +00:00
|
|
|
#
|
2015-11-05 22:28:31 +00:00
|
|
|
buildenvvars: .PHONY
|
2015-10-17 05:57:29 +00:00
|
|
|
@echo ${WMAKEENV:Q} ${.MAKE.EXPORTED:@v@$v=\"${$v}\"@}
|
2006-06-06 16:24:54 +00:00
|
|
|
|
2014-11-21 18:18:37 +00:00
|
|
|
.if ${.TARGETS:Mbuildenv}
|
|
|
|
.if ${.MAKEFLAGS:M-j}
|
|
|
|
.error The buildenv target is incompatible with -j
|
|
|
|
.endif
|
|
|
|
.endif
|
2015-11-05 22:28:31 +00:00
|
|
|
BUILDENV_DIR?= ${.CURDIR}
|
|
|
|
buildenv: .PHONY
|
2005-02-26 22:02:18 +00:00
|
|
|
@echo Entering world for ${TARGET_ARCH}:${TARGET}
|
2015-11-08 00:50:06 +00:00
|
|
|
.if ${BUILDENV_SHELL:M*zsh*}
|
|
|
|
@echo For ZSH you must run: export CPUTYPE=${TARGET_CPUTYPE}
|
|
|
|
.endif
|
2015-11-05 22:28:31 +00:00
|
|
|
@cd ${BUILDENV_DIR} && env ${WMAKEENV} BUILDENV=1 ${BUILDENV_SHELL} \
|
|
|
|
|| true
|
2005-02-26 22:02:18 +00:00
|
|
|
|
2005-07-07 00:58:41 +00:00
|
|
|
TOOLCHAIN_TGTS= ${WMAKE_TGTS:N_depend:Neverything:Nbuild32}
|
2004-04-13 13:42:01 +00:00
|
|
|
toolchain: ${TOOLCHAIN_TGTS}
|
|
|
|
kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries}
|
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
|
|
|
#
|
2013-09-18 00:33:24 +00:00
|
|
|
installcheck: _installcheck_world _installcheck_kernel
|
|
|
|
_installcheck_world:
|
|
|
|
_installcheck_kernel:
|
2004-03-03 19:36:20 +00:00
|
|
|
|
2005-11-07 15:03:04 +00:00
|
|
|
#
|
2013-01-15 00:12:34 +00:00
|
|
|
# Require DESTDIR to be set if installing for a different architecture or
|
|
|
|
# using the user/group database in the source tree.
|
2005-11-07 15:03:04 +00:00
|
|
|
#
|
2013-01-15 00:12:34 +00:00
|
|
|
.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE} || \
|
|
|
|
defined(DB_FROM_SRC)
|
2005-11-12 19:28:46 +00:00
|
|
|
.if !make(distributeworld)
|
2013-09-18 00:33:24 +00:00
|
|
|
_installcheck_world: __installcheck_DESTDIR
|
|
|
|
_installcheck_kernel: __installcheck_DESTDIR
|
|
|
|
__installcheck_DESTDIR:
|
2005-11-07 15:03:04 +00:00
|
|
|
.if !defined(DESTDIR) || empty(DESTDIR)
|
|
|
|
@echo "ERROR: Please set DESTDIR!"; \
|
|
|
|
false
|
|
|
|
.endif
|
|
|
|
.endif
|
2005-11-12 19:28:46 +00:00
|
|
|
.endif
|
2005-11-07 15:03:04 +00:00
|
|
|
|
2013-01-15 00:12:34 +00:00
|
|
|
.if !defined(DB_FROM_SRC)
|
2013-01-11 23:44:35 +00:00
|
|
|
#
|
|
|
|
# Check for missing UIDs/GIDs.
|
|
|
|
#
|
|
|
|
CHECK_UIDS= auditdistd
|
|
|
|
CHECK_GIDS= audit
|
|
|
|
.if ${MK_SENDMAIL} != "no"
|
|
|
|
CHECK_UIDS+= smmsp
|
|
|
|
CHECK_GIDS+= smmsp
|
|
|
|
.endif
|
|
|
|
.if ${MK_PF} != "no"
|
|
|
|
CHECK_UIDS+= proxy
|
|
|
|
CHECK_GIDS+= proxy authpf
|
|
|
|
.endif
|
2013-09-17 12:59:37 +00:00
|
|
|
.if ${MK_UNBOUND} != "no"
|
|
|
|
CHECK_UIDS+= unbound
|
|
|
|
CHECK_GIDS+= unbound
|
|
|
|
.endif
|
2013-09-18 00:33:24 +00:00
|
|
|
_installcheck_world: __installcheck_UGID
|
|
|
|
__installcheck_UGID:
|
2013-01-11 23:44:35 +00:00
|
|
|
.for uid in ${CHECK_UIDS}
|
|
|
|
@if ! `id -u ${uid} >/dev/null 2>&1`; then \
|
|
|
|
echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \
|
|
|
|
false; \
|
|
|
|
fi
|
|
|
|
.endfor
|
|
|
|
.for gid in ${CHECK_GIDS}
|
|
|
|
@if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \
|
|
|
|
echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \
|
|
|
|
false; \
|
|
|
|
fi
|
|
|
|
.endfor
|
2013-01-15 00:12:34 +00:00
|
|
|
.endif
|
2013-01-11 23:44:35 +00:00
|
|
|
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
#
|
|
|
|
# Required install tools to be saved in a scratch dir for safety.
|
|
|
|
#
|
2009-10-28 07:05:32 +00:00
|
|
|
.if ${MK_ZONEINFO} != "no"
|
2013-01-11 18:37:51 +00:00
|
|
|
_zoneinfo= zic tzsetup
|
2009-10-28 07:05:32 +00:00
|
|
|
.endif
|
2009-03-13 10:09:08 +00:00
|
|
|
|
2015-08-09 18:15:33 +00:00
|
|
|
ITOOLS= [ awk cap_mkdb cat chflags chmod chown cmp cp \
|
2013-01-22 21:10:03 +00:00
|
|
|
date echo egrep find grep id install ${_install-info} \
|
2015-10-16 22:41:31 +00:00
|
|
|
ln make mkdir mtree mv pwd_mkdb \
|
2014-12-17 20:02:07 +00:00
|
|
|
rm sed services_mkdb sh strip sysctl test true uname wc ${_zoneinfo} \
|
2014-06-17 22:23:36 +00:00
|
|
|
${LOCAL_ITOOLS}
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
|
2014-12-08 18:29:20 +00:00
|
|
|
# Needed for share/man
|
|
|
|
.if ${MK_MAN} != "no"
|
|
|
|
ITOOLS+=makewhatis
|
|
|
|
.endif
|
|
|
|
|
2002-05-14 08:30:40 +00:00
|
|
|
#
|
|
|
|
# distributeworld
|
|
|
|
#
|
|
|
|
# Distributes everything compiled by a `buildworld'.
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# installworld
|
|
|
|
#
|
|
|
|
# Installs everything compiled by a 'buildworld'.
|
|
|
|
#
|
2011-03-02 14:39:26 +00:00
|
|
|
|
|
|
|
# Non-base distributions produced by the base system
|
2012-09-03 18:17:21 +00:00
|
|
|
EXTRA_DISTRIBUTIONS= doc
|
2011-03-02 14:39:26 +00:00
|
|
|
.if defined(LIB32TMP) && ${MK_LIB32} != "no"
|
|
|
|
EXTRA_DISTRIBUTIONS+= lib32
|
|
|
|
.endif
|
2014-06-10 17:04:30 +00:00
|
|
|
.if ${MK_TESTS} != "no"
|
|
|
|
EXTRA_DISTRIBUTIONS+= tests
|
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
|
Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:
r262491:
Add DEBUG_DISTRIBUTIONS, and set it to include base and
EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
distribution does not have corresponding debug information.
Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
and 'packageworld' targets, to reduce the number of occurances
of excluding distributions that do not have .debug files.
r262493:
In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
for dvdrom and cdrom targets. (Later reverted.)
Exclude the *.debug.txz distributions from dvdrom and
cdrom images, but include them for ftp distribution.
r262516:
Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
following output:
eval: ${base....}: Bad substitution
eval: ${doc....}: Bad substitution
eval: ${games....}: Bad substitution
eval: ${lib32....}: Bad substitution
This also follows other naming conventions seen in the
wild.
r267345:
Explicitly set MK_DEBUG_FILES=no, which overrides the
WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
previously experienced.
This change allows us to create the {base,kernel}_debug.txz
distributions without accidentally installing the *.debug
files on the medium itself.
r267397:
Remove evaluations of MK_DEBUG_FILES where not needed.
If DEBUG_DISTRIBUTIONS is empty, which is true if
MK_DEBUG_FILES evaluates to 'no' above, the loop does
nothing.
MFC after: 1 month
Tested on: head@r267801
Reviewed by: brooks [1], emaste, imp [1]
[1] earlier version
Sponsored by: The FreeBSD Foundation
2014-07-01 19:04:04 +00:00
|
|
|
DEBUG_DISTRIBUTIONS=
|
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
2015-02-10 01:35:26 +00:00
|
|
|
DEBUG_DISTRIBUTIONS+= base ${EXTRA_DISTRIBUTIONS:S,doc,,:S,tests,,}
|
Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:
r262491:
Add DEBUG_DISTRIBUTIONS, and set it to include base and
EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
distribution does not have corresponding debug information.
Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
and 'packageworld' targets, to reduce the number of occurances
of excluding distributions that do not have .debug files.
r262493:
In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
for dvdrom and cdrom targets. (Later reverted.)
Exclude the *.debug.txz distributions from dvdrom and
cdrom images, but include them for ftp distribution.
r262516:
Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
following output:
eval: ${base....}: Bad substitution
eval: ${doc....}: Bad substitution
eval: ${games....}: Bad substitution
eval: ${lib32....}: Bad substitution
This also follows other naming conventions seen in the
wild.
r267345:
Explicitly set MK_DEBUG_FILES=no, which overrides the
WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
previously experienced.
This change allows us to create the {base,kernel}_debug.txz
distributions without accidentally installing the *.debug
files on the medium itself.
r267397:
Remove evaluations of MK_DEBUG_FILES where not needed.
If DEBUG_DISTRIBUTIONS is empty, which is true if
MK_DEBUG_FILES evaluates to 'no' above, the loop does
nothing.
MFC after: 1 month
Tested on: head@r267801
Reviewed by: brooks [1], emaste, imp [1]
[1] earlier version
Sponsored by: The FreeBSD Foundation
2014-07-01 19:04:04 +00:00
|
|
|
.endif
|
|
|
|
|
2013-01-22 21:10:03 +00:00
|
|
|
MTREE_MAGIC?= mtree 2.0
|
|
|
|
|
2013-09-18 00:33:24 +00:00
|
|
|
distributeworld installworld: _installcheck_world
|
2000-07-19 04:41:59 +00:00
|
|
|
mkdir -p ${INSTALLTMP}
|
2007-12-04 12:55:27 +00:00
|
|
|
progs=$$(for prog in ${ITOOLS}; do \
|
2007-10-15 13:50:46 +00:00
|
|
|
if progpath=`which $$prog`; then \
|
2007-12-04 12:55:27 +00:00
|
|
|
echo $$progpath; \
|
2007-10-15 13:50:46 +00:00
|
|
|
else \
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
echo "Required tool $$prog not found in PATH." >&2; \
|
2007-10-15 13:50:46 +00:00
|
|
|
exit 1; \
|
|
|
|
fi; \
|
2007-12-04 12:55:27 +00:00
|
|
|
done); \
|
|
|
|
libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | \
|
|
|
|
while read line; do \
|
|
|
|
set -- $$line; \
|
|
|
|
if [ "$$2 $$3" != "not found" ]; then \
|
|
|
|
echo $$2; \
|
|
|
|
else \
|
|
|
|
echo "Required library $$1 not found." >&2; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
done); \
|
|
|
|
cp $$libs $$progs ${INSTALLTMP}
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale
|
2013-01-22 21:10:03 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
echo "#${MTREE_MAGIC}" > ${METALOG}
|
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
.if make(distributeworld)
|
|
|
|
.for dist in ${EXTRA_DISTRIBUTIONS}
|
|
|
|
-mkdir ${DESTDIR}/${DISTDIR}/${dist}
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \
|
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist} >/dev/null
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null
|
2013-06-07 21:40:02 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
|
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null
|
|
|
|
.endif
|
2015-10-20 20:35:34 +00:00
|
|
|
.if ${MK_LIB32} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
|
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
|
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
|
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/usr >/dev/null
|
|
|
|
.endif
|
|
|
|
.endif
|
2014-06-10 17:04:30 +00:00
|
|
|
.if ${MK_TESTS} != "no" && ${dist} == "tests"
|
2014-12-18 18:16:00 +00:00
|
|
|
-mkdir -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE}
|
2014-06-10 17:04:30 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
|
2014-12-18 18:16:00 +00:00
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null
|
2015-10-15 01:46:55 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
|
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/${TESTSBASE} >/dev/null
|
|
|
|
.endif
|
2014-06-10 17:04:30 +00:00
|
|
|
.endif
|
2013-01-22 21:10:03 +00:00
|
|
|
.if defined(NO_ROOT)
|
2014-01-30 22:26:51 +00:00
|
|
|
${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \
|
2013-01-22 21:10:03 +00:00
|
|
|
sed -e 's#^\./#./${dist}/#' >> ${METALOG}
|
2014-01-30 22:26:51 +00:00
|
|
|
${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \
|
2013-01-22 21:10:03 +00:00
|
|
|
sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
|
2014-01-30 22:26:51 +00:00
|
|
|
${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \
|
2013-01-22 21:10:03 +00:00
|
|
|
sed -e 's#^\./#./${dist}/usr/include/#' >> ${METALOG}
|
2015-10-20 20:35:34 +00:00
|
|
|
.if ${MK_LIB32} != "no"
|
|
|
|
${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.lib32.dist | \
|
|
|
|
sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
|
|
|
|
.endif
|
2013-01-22 21:10:03 +00:00
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
.endfor
|
|
|
|
-mkdir ${DESTDIR}/${DISTDIR}/base
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \
|
2013-01-22 21:10:03 +00:00
|
|
|
METALOG=${METALOG} ${IMAKE_INSTALL} ${IMAKE_MTREE} \
|
|
|
|
DISTBASE=/base DESTDIR=${DESTDIR}/${DISTDIR}/base \
|
2013-08-30 01:32:47 +00:00
|
|
|
LOCAL_MTREE=${LOCAL_MTREE:Q} distrib-dirs
|
2011-03-02 14:39:26 +00:00
|
|
|
.endif
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \
|
|
|
|
${IMAKEENV} rm -rf ${INSTALLTMP}
|
2011-03-02 14:39:26 +00:00
|
|
|
.if make(distributeworld)
|
|
|
|
.for dist in ${EXTRA_DISTRIBUTIONS}
|
2013-06-05 22:27:49 +00:00
|
|
|
find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -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
|
|
|
|
@# a line containing only the filename will sort immediatly before
|
|
|
|
@# the relevant mtree line.
|
|
|
|
cd ${DESTDIR}/${DISTDIR}; \
|
|
|
|
find ./${dist} | sort -u ${METALOG} - | \
|
|
|
|
awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \
|
|
|
|
${DESTDIR}/${DISTDIR}/${dist}.meta
|
|
|
|
.endfor
|
Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:
r262491:
Add DEBUG_DISTRIBUTIONS, and set it to include base and
EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
distribution does not have corresponding debug information.
Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
and 'packageworld' targets, to reduce the number of occurances
of excluding distributions that do not have .debug files.
r262493:
In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
for dvdrom and cdrom targets. (Later reverted.)
Exclude the *.debug.txz distributions from dvdrom and
cdrom images, but include them for ftp distribution.
r262516:
Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
following output:
eval: ${base....}: Bad substitution
eval: ${doc....}: Bad substitution
eval: ${games....}: Bad substitution
eval: ${lib32....}: Bad substitution
This also follows other naming conventions seen in the
wild.
r267345:
Explicitly set MK_DEBUG_FILES=no, which overrides the
WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
previously experienced.
This change allows us to create the {base,kernel}_debug.txz
distributions without accidentally installing the *.debug
files on the medium itself.
r267397:
Remove evaluations of MK_DEBUG_FILES where not needed.
If DEBUG_DISTRIBUTIONS is empty, which is true if
MK_DEBUG_FILES evaluates to 'no' above, the loop does
nothing.
MFC after: 1 month
Tested on: head@r267801
Reviewed by: brooks [1], emaste, imp [1]
[1] earlier version
Sponsored by: The FreeBSD Foundation
2014-07-01 19:04:04 +00:00
|
|
|
.for dist in ${DEBUG_DISTRIBUTIONS}
|
2013-07-23 19:34:09 +00:00
|
|
|
@# For each file that exists in this dist, print the corresponding
|
|
|
|
@# line from the METALOG. This relies on the fact that
|
|
|
|
@# a line containing only the filename will sort immediatly before
|
|
|
|
@# the relevant mtree line.
|
|
|
|
cd ${DESTDIR}/${DISTDIR}; \
|
|
|
|
find ./${dist}/usr/lib/debug | sort -u ${METALOG} - | \
|
|
|
|
awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \
|
|
|
|
${DESTDIR}/${DISTDIR}/${dist}.debug.meta
|
Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:
r262491:
Add DEBUG_DISTRIBUTIONS, and set it to include base and
EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
distribution does not have corresponding debug information.
Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
and 'packageworld' targets, to reduce the number of occurances
of excluding distributions that do not have .debug files.
r262493:
In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
for dvdrom and cdrom targets. (Later reverted.)
Exclude the *.debug.txz distributions from dvdrom and
cdrom images, but include them for ftp distribution.
r262516:
Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
following output:
eval: ${base....}: Bad substitution
eval: ${doc....}: Bad substitution
eval: ${games....}: Bad substitution
eval: ${lib32....}: Bad substitution
This also follows other naming conventions seen in the
wild.
r267345:
Explicitly set MK_DEBUG_FILES=no, which overrides the
WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
previously experienced.
This change allows us to create the {base,kernel}_debug.txz
distributions without accidentally installing the *.debug
files on the medium itself.
r267397:
Remove evaluations of MK_DEBUG_FILES where not needed.
If DEBUG_DISTRIBUTIONS is empty, which is true if
MK_DEBUG_FILES evaluates to 'no' above, the loop does
nothing.
MFC after: 1 month
Tested on: head@r267801
Reviewed by: brooks [1], emaste, imp [1]
[1] earlier version
Sponsored by: The FreeBSD Foundation
2014-07-01 19:04:04 +00:00
|
|
|
.endfor
|
2013-01-22 21:10:03 +00:00
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
packageworld:
|
|
|
|
.for dist in base ${EXTRA_DISTRIBUTIONS}
|
2013-01-22 21:10:03 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
2015-02-17 23:13:45 +00:00
|
|
|
tar cvf - --exclude usr/lib/debug \
|
|
|
|
@${DESTDIR}/${DISTDIR}/${dist}.meta | \
|
2015-12-01 19:58:08 +00:00
|
|
|
${XZ_CMD} > ${PACKAGEDIR}/${dist}.txz
|
2013-01-22 21:10:03 +00:00
|
|
|
.else
|
2011-03-02 14:39:26 +00:00
|
|
|
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
2015-02-17 23:13:45 +00:00
|
|
|
tar cvf - --exclude usr/lib/debug . | \
|
2015-12-01 19:58:08 +00:00
|
|
|
${XZ_CMD} > ${PACKAGEDIR}/${dist}.txz
|
2013-01-22 21:10:03 +00:00
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
.endfor
|
1998-08-31 01:08:08 +00:00
|
|
|
|
Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:
r262491:
Add DEBUG_DISTRIBUTIONS, and set it to include base and
EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
distribution does not have corresponding debug information.
Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
and 'packageworld' targets, to reduce the number of occurances
of excluding distributions that do not have .debug files.
r262493:
In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
for dvdrom and cdrom targets. (Later reverted.)
Exclude the *.debug.txz distributions from dvdrom and
cdrom images, but include them for ftp distribution.
r262516:
Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
following output:
eval: ${base....}: Bad substitution
eval: ${doc....}: Bad substitution
eval: ${games....}: Bad substitution
eval: ${lib32....}: Bad substitution
This also follows other naming conventions seen in the
wild.
r267345:
Explicitly set MK_DEBUG_FILES=no, which overrides the
WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
previously experienced.
This change allows us to create the {base,kernel}_debug.txz
distributions without accidentally installing the *.debug
files on the medium itself.
r267397:
Remove evaluations of MK_DEBUG_FILES where not needed.
If DEBUG_DISTRIBUTIONS is empty, which is true if
MK_DEBUG_FILES evaluates to 'no' above, the loop does
nothing.
MFC after: 1 month
Tested on: head@r267801
Reviewed by: brooks [1], emaste, imp [1]
[1] earlier version
Sponsored by: The FreeBSD Foundation
2014-07-01 19:04:04 +00:00
|
|
|
.for dist in ${DEBUG_DISTRIBUTIONS}
|
|
|
|
. if defined(NO_ROOT)
|
2013-07-23 19:34:09 +00:00
|
|
|
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
2015-02-17 23:13:45 +00:00
|
|
|
tar cvf - @${DESTDIR}/${DISTDIR}/${dist}.debug.meta | \
|
2015-12-01 19:58:08 +00:00
|
|
|
${XZ_CMD} > ${PACKAGEDIR}/${dist}-dbg.txz
|
Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:
r262491:
Add DEBUG_DISTRIBUTIONS, and set it to include base and
EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
distribution does not have corresponding debug information.
Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
and 'packageworld' targets, to reduce the number of occurances
of excluding distributions that do not have .debug files.
r262493:
In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
for dvdrom and cdrom targets. (Later reverted.)
Exclude the *.debug.txz distributions from dvdrom and
cdrom images, but include them for ftp distribution.
r262516:
Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
following output:
eval: ${base....}: Bad substitution
eval: ${doc....}: Bad substitution
eval: ${games....}: Bad substitution
eval: ${lib32....}: Bad substitution
This also follows other naming conventions seen in the
wild.
r267345:
Explicitly set MK_DEBUG_FILES=no, which overrides the
WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
previously experienced.
This change allows us to create the {base,kernel}_debug.txz
distributions without accidentally installing the *.debug
files on the medium itself.
r267397:
Remove evaluations of MK_DEBUG_FILES where not needed.
If DEBUG_DISTRIBUTIONS is empty, which is true if
MK_DEBUG_FILES evaluates to 'no' above, the loop does
nothing.
MFC after: 1 month
Tested on: head@r267801
Reviewed by: brooks [1], emaste, imp [1]
[1] earlier version
Sponsored by: The FreeBSD Foundation
2014-07-01 19:04:04 +00:00
|
|
|
. else
|
2013-07-23 19:34:09 +00:00
|
|
|
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
2015-02-17 23:13:45 +00:00
|
|
|
tar cvLf - usr/lib/debug | \
|
2015-12-01 19:58:08 +00:00
|
|
|
${XZ_CMD} > ${PACKAGEDIR}/${dist}-dbg.txz
|
Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:
r262491:
Add DEBUG_DISTRIBUTIONS, and set it to include base and
EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
distribution does not have corresponding debug information.
Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
and 'packageworld' targets, to reduce the number of occurances
of excluding distributions that do not have .debug files.
r262493:
In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
for dvdrom and cdrom targets. (Later reverted.)
Exclude the *.debug.txz distributions from dvdrom and
cdrom images, but include them for ftp distribution.
r262516:
Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
following output:
eval: ${base....}: Bad substitution
eval: ${doc....}: Bad substitution
eval: ${games....}: Bad substitution
eval: ${lib32....}: Bad substitution
This also follows other naming conventions seen in the
wild.
r267345:
Explicitly set MK_DEBUG_FILES=no, which overrides the
WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
previously experienced.
This change allows us to create the {base,kernel}_debug.txz
distributions without accidentally installing the *.debug
files on the medium itself.
r267397:
Remove evaluations of MK_DEBUG_FILES where not needed.
If DEBUG_DISTRIBUTIONS is empty, which is true if
MK_DEBUG_FILES evaluates to 'no' above, the loop does
nothing.
MFC after: 1 month
Tested on: head@r267801
Reviewed by: brooks [1], emaste, imp [1]
[1] earlier version
Sponsored by: The FreeBSD Foundation
2014-07-01 19:04:04 +00:00
|
|
|
. endif
|
|
|
|
.endfor
|
2013-07-23 19:34:09 +00:00
|
|
|
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# reinstall
|
|
|
|
#
|
|
|
|
# If you have a build server, you can NFS mount the source and obj directories
|
|
|
|
# and do a 'make reinstall' on the *client* to install new binaries from the
|
|
|
|
# most recent server build.
|
|
|
|
#
|
2015-10-21 05:33:48 +00:00
|
|
|
reinstall: .MAKE .PHONY
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
1998-09-17 16:32:00 +00:00
|
|
|
@echo ">>> Making hierarchy"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2012-10-18 12:32:51 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \
|
2013-08-30 01:32:47 +00:00
|
|
|
LOCAL_MTREE=${LOCAL_MTREE:Q} hierarchy
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2004-03-19 17:57:07 +00:00
|
|
|
@echo ">>> Installing everything"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
|
2010-07-13 21:19:59 +00:00
|
|
|
.if defined(LIB32TMP) && ${MK_LIB32} != "no"
|
2004-11-06 03:14:26 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32
|
|
|
|
.endif
|
1998-08-31 01:08:08 +00:00
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
redistribute: .MAKE .PHONY
|
2002-04-30 11:50:01 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-03-19 17:57:07 +00:00
|
|
|
@echo ">>> Distributing everything"
|
2002-04-30 11:50:01 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
|
2010-07-13 21:19:59 +00:00
|
|
|
.if defined(LIB32TMP) && ${MK_LIB32} != "no"
|
2008-08-02 12:14:22 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 \
|
|
|
|
DISTRIBUTION=lib32
|
2005-06-16 18:16:14 +00:00
|
|
|
.endif
|
2000-11-21 04:37:30 +00:00
|
|
|
|
2016-02-03 20:24:21 +00:00
|
|
|
distrib-dirs distribution: .MAKE .PHONY
|
2016-02-03 01:40:07 +00:00
|
|
|
${_+_}cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \
|
|
|
|
${IMAKE_INSTALL} ${IMAKE_MTREE} METALOG=${METALOG} ${.TARGET}
|
2016-02-03 20:24:21 +00:00
|
|
|
.if make(distribution)
|
2015-10-10 14:43:46 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${CROSSENV} PATH=${TMPPATH} \
|
|
|
|
${MAKE} -f Makefile.inc1 ${IMAKE_INSTALL} \
|
2016-02-16 02:14:09 +00:00
|
|
|
METALOG=${METALOG} MK_TESTS=no installconfig
|
2016-02-03 20:24:21 +00:00
|
|
|
.endif
|
2015-10-09 22:05:31 +00:00
|
|
|
|
2000-01-09 17:56:40 +00:00
|
|
|
#
|
|
|
|
# buildkernel and installkernel
|
|
|
|
#
|
|
|
|
# Which kernels to build and/or install is specified by setting
|
2001-01-22 07:29:48 +00:00
|
|
|
# KERNCONF. If not defined a GENERIC kernel is built/installed.
|
2001-10-25 07:28:55 +00:00
|
|
|
# Only the existing (depending TARGET) config files are used
|
2000-01-09 17:56:40 +00:00
|
|
|
# for building kernels and only the first of these is designated
|
|
|
|
# as the one being installed.
|
|
|
|
#
|
2001-10-25 07:28:55 +00:00
|
|
|
# Note that we have to use TARGET instead of TARGET_ARCH when
|
Fix cross-building, etc:
1. To cross-build, one now needs to set TARGET_ARCH, and not the
MACHINE_ARCH. MACHINE_ARCH should never be changed manually!
2. Initialize DESTDIR= explicitly for bootstrap-tools, build-tools,
and cross-tools stages. This fixes broken header and library
dependencies problem. We build them in the host environment,
and obviously want them to depend on host headers and libraries.
The problem with broken header dependencies for bootstrap-tools
and cross-tools was already partially solved (see BOOTSTRAPPING
tests in bsd.prog.mk and bsd.lib.mk), but it was still there for
build-tools if the user ran "make world DESTDIR=/foo". Also,
for all of these stages, the library dependencies were broken
because of how bsd.libnames.mk define DPADD members.
We still provide a glue to install bootstrap- and cross-tools
under the ${WORLDTMP}.
Removed PATH overrides for bootstrap-, build-, and cross-tools
stages. There is just no reason why we would need to override
it, and the hacks to clean up the ${WORLDTMP} in the -DNOCLEAN
case are no longer needed with fixes from this step.
That is, we now never use ${WORLDTMP} headers and libraries,
and we don't use any ${WORLDTMP} installed binaries during
these stages. Again, these stages depend solely on the host
environment, including compiler, headers, and libraries.
3. Moved "miniperl" back from cross-tools (it has nothing to do
with a cross-compiler) to build-tools where it belongs. The
change from step 1 let to do this. Also, to make this work,
build-tools targets of "cc_tools" and "miniperl" were modified
to call "depend". Here follow the detailed explanations.
There are two categories of build tools, for now. In the first
category there are "cc_tools" and "miniperl". They occupy the
whole (sub)directory, and nothing needs to be done in this
subdirectory later during the "all" stage. They are also
constructed using system makefiles. We must build the .depend
early in the build-tools stage because:
1) They use (and depend on) the host environment.
2) If we don't do this in build-tools, the "depend" stage of
buildworld will do this for us; wrong library and header
dependencies will be recorded (DESTDIR=${WORLDTMP}) and,
what's worse, the "all" stage may then clobber the
build-architecture format tools (that we built in the
build-tools stage) with the target-architecture format
ones, breaking cross build.
In the second category there are all other build-tools. They
share their directory with the "main" module that needs them
in the "all" stage, and they don't show up themselves in the
.depend file. The portion of this fix was already committed
in gnu/usr.bin/cc/cc_tools/Makefile,v 1.52.
4. "libperl" is no longer a build tool, and "miniperl" is the
stand-alone application. I had to make this change because
build-tools and "all" stages share the same object directory.
Without this change, if we cross compile, libperl.a is first
built for the build architecture during the build-tools stage
(for the purposes of immediate linkage with "miniperl").
Later on, the "all" stage sees this library as up-to-date,
and doesn't rebuild it. The effect is that the wrong format
static libperl library is installed with installworld.
5. Fixed "includes" to install secure/lib/libtelnet headers if
required.
Reviewed by: bde
2001-09-29 13:17:54 +00:00
|
|
|
# we're in kernel-land. Since only TARGET_ARCH is (expected) to
|
2001-10-25 07:28:55 +00:00
|
|
|
# be set to cross-build, we have to make sure TARGET is set
|
2000-01-09 17:56:40 +00:00
|
|
|
# properly.
|
|
|
|
|
2009-01-15 04:19:03 +00:00
|
|
|
.if defined(KERNFAST)
|
|
|
|
NO_KERNELCLEAN= t
|
|
|
|
NO_KERNELCONFIG= t
|
|
|
|
NO_KERNELDEPEND= t
|
2009-12-16 02:54:34 +00:00
|
|
|
NO_KERNELOBJ= t
|
2009-01-23 18:23:16 +00:00
|
|
|
# Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah
|
|
|
|
.if !defined(KERNCONF) && ${KERNFAST} != "1"
|
|
|
|
KERNCONF=${KERNFAST}
|
|
|
|
.endif
|
2009-01-15 04:19:03 +00:00
|
|
|
.endif
|
2010-07-13 21:19:59 +00:00
|
|
|
.if ${TARGET_ARCH} == "powerpc64"
|
|
|
|
KERNCONF?= GENERIC64
|
|
|
|
.else
|
2001-01-22 07:29:48 +00:00
|
|
|
KERNCONF?= GENERIC
|
2001-01-23 09:52:50 +00:00
|
|
|
.endif
|
2000-09-03 02:58:39 +00:00
|
|
|
INSTKERNNAME?= kernel
|
2000-01-09 17:56:40 +00:00
|
|
|
|
2003-04-16 21:05:06 +00:00
|
|
|
KERNSRCDIR?= ${.CURDIR}/sys
|
|
|
|
KRNLCONFDIR= ${KERNSRCDIR}/${TARGET}/conf
|
|
|
|
KRNLOBJDIR= ${OBJTREE}${KERNSRCDIR}
|
2001-08-27 12:01:46 +00:00
|
|
|
KERNCONFDIR?= ${KRNLCONFDIR}
|
2000-01-09 17:56:40 +00:00
|
|
|
|
|
|
|
BUILDKERNELS=
|
|
|
|
INSTALLKERNEL=
|
2015-12-01 20:24:58 +00:00
|
|
|
.if defined(NO_INSTALLKERNEL)
|
|
|
|
# All of the BUILDKERNELS loops start at index 1.
|
|
|
|
BUILDKERNELS+= dummy
|
|
|
|
.endif
|
2001-01-22 07:29:48 +00:00
|
|
|
.for _kernel in ${KERNCONF}
|
2001-08-27 12:01:46 +00:00
|
|
|
.if exists(${KERNCONFDIR}/${_kernel})
|
2000-01-09 17:56:40 +00:00
|
|
|
BUILDKERNELS+= ${_kernel}
|
2015-12-01 20:24:58 +00:00
|
|
|
.if empty(INSTALLKERNEL) && !defined(NO_INSTALLKERNEL)
|
2000-01-09 17:56:40 +00:00
|
|
|
INSTALLKERNEL= ${_kernel}
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
${WMAKE_TGTS:N_worldtmp:Nbuild32} ${.ALLTARGETS:M_*:N_worldtmp}: .MAKE .PHONY
|
2014-03-30 22:25:01 +00:00
|
|
|
|
2000-01-09 17:56:40 +00:00
|
|
|
#
|
|
|
|
# buildkernel
|
|
|
|
#
|
|
|
|
# Builds all kernels defined by BUILDKERNELS.
|
|
|
|
#
|
2015-10-21 05:33:48 +00:00
|
|
|
buildkernel: .MAKE .PHONY
|
2015-12-01 20:24:58 +00:00
|
|
|
.if empty(BUILDKERNELS:Ndummy)
|
2005-02-27 11:48:45 +00:00
|
|
|
@echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \
|
2004-03-04 09:14:30 +00:00
|
|
|
false
|
2000-10-25 04:31:32 +00:00
|
|
|
.endif
|
2000-01-09 17:56:40 +00:00
|
|
|
@echo
|
2015-12-01 20:24:58 +00:00
|
|
|
.for _kernel in ${BUILDKERNELS:Ndummy}
|
2000-01-09 17:56:40 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2001-03-02 16:52:14 +00:00
|
|
|
@echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
|
2000-01-09 17:56:40 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo "===> ${_kernel}"
|
2000-04-27 09:20:18 +00:00
|
|
|
mkdir -p ${KRNLOBJDIR}
|
2000-06-15 10:00:20 +00:00
|
|
|
.if !defined(NO_KERNELCONFIG)
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> stage 1: configuring the kernel"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2000-01-09 17:56:40 +00:00
|
|
|
cd ${KRNLCONFDIR}; \
|
|
|
|
PATH=${TMPPATH} \
|
2001-08-27 12:01:46 +00:00
|
|
|
config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
|
2014-05-03 09:24:20 +00:00
|
|
|
-I '${KERNCONFDIR}' '${KERNCONFDIR}/${_kernel}'
|
2001-01-22 23:10:01 +00:00
|
|
|
.endif
|
2004-12-21 12:21:26 +00:00
|
|
|
.if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN)
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> stage 2.1: cleaning up the object tree"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR}
|
2000-06-15 10:00:20 +00:00
|
|
|
.endif
|
2009-12-16 02:54:34 +00:00
|
|
|
.if !defined(NO_KERNELOBJ)
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> stage 2.2: rebuilding the object tree"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj
|
2009-12-16 02:54:34 +00:00
|
|
|
.endif
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> stage 2.3: build tools"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2013-11-09 00:15:36 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${KTMAKE} kernel-tools
|
2000-06-15 10:00:20 +00:00
|
|
|
.if !defined(NO_KERNELDEPEND)
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> stage 3.1: making dependencies"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} depend -DNO_MODULES_OBJ
|
2000-06-15 10:00:20 +00:00
|
|
|
.endif
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2013-05-28 21:29:05 +00:00
|
|
|
@echo ">>> stage 3.2: building everything"
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2015-10-21 05:33:48 +00:00
|
|
|
${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ
|
2001-01-21 23:44:41 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2001-03-02 16:52:14 +00:00
|
|
|
@echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
|
2001-01-21 23:44:41 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2000-01-09 17:56:40 +00:00
|
|
|
.endfor
|
|
|
|
|
|
|
|
#
|
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 \
|
2013-09-18 00:33:24 +00:00
|
|
|
reinstallkernel reinstallkernel.debug: _installcheck_kernel
|
2015-12-01 20:24:58 +00:00
|
|
|
.if !defined(NO_INSTALLKERNEL)
|
2003-02-07 07:29:57 +00:00
|
|
|
.if empty(INSTALLKERNEL)
|
2005-02-27 11:48:45 +00:00
|
|
|
@echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
|
2004-03-04 09:14:30 +00:00
|
|
|
false
|
2003-02-07 07:29:57 +00:00
|
|
|
.endif
|
2004-03-13 15:46:34 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2011-05-05 00:43:55 +00:00
|
|
|
@echo ">>> Installing kernel ${INSTALLKERNEL}"
|
2004-03-13 15:46:34 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2000-09-17 21:02:58 +00:00
|
|
|
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
|
2002-12-02 14:03:40 +00:00
|
|
|
${CROSSENV} PATH=${TMPPATH} \
|
2013-01-29 21:48:10 +00:00
|
|
|
${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
|
2015-12-01 20:24:58 +00:00
|
|
|
.endif
|
2016-01-06 21:58:45 +00:00
|
|
|
.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS)
|
2015-09-01 11:59:12 +00:00
|
|
|
.for _kernel in ${BUILDKERNELS:[2..-1]}
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> Installing kernel ${_kernel}"
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
cd ${KRNLOBJDIR}/${_kernel}; \
|
|
|
|
${CROSSENV} PATH=${TMPPATH} \
|
|
|
|
${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//}
|
|
|
|
.endfor
|
2015-09-02 15:42:14 +00:00
|
|
|
.endif
|
2000-09-03 02:58:39 +00:00
|
|
|
|
2011-03-02 14:39:26 +00:00
|
|
|
distributekernel distributekernel.debug:
|
2015-12-01 20:24:58 +00:00
|
|
|
.if !defined(NO_INSTALLKERNEL)
|
2011-03-02 14:39:26 +00:00
|
|
|
.if empty(INSTALLKERNEL)
|
|
|
|
@echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
|
|
|
|
false
|
2013-05-16 18:37:14 +00:00
|
|
|
.endif
|
|
|
|
mkdir -p ${DESTDIR}/${DISTDIR}
|
|
|
|
.if defined(NO_ROOT)
|
|
|
|
echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.premeta
|
2011-03-02 14:39:26 +00:00
|
|
|
.endif
|
|
|
|
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
|
2013-05-16 18:37:14 +00:00
|
|
|
${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.premeta/} \
|
|
|
|
${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \
|
2013-05-30 14:09:58 +00:00
|
|
|
DESTDIR=${INSTALL_DDIR}/kernel \
|
2011-03-02 14:39:26 +00:00
|
|
|
${.TARGET:S/distributekernel/install/}
|
2013-05-20 21:16:38 +00:00
|
|
|
.if defined(NO_ROOT)
|
2013-05-16 18:37:14 +00:00
|
|
|
sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \
|
|
|
|
${DESTDIR}/${DISTDIR}/kernel.meta
|
2013-05-20 21:16:38 +00:00
|
|
|
.endif
|
2015-12-01 20:24:58 +00:00
|
|
|
.endif
|
2016-01-06 21:58:45 +00:00
|
|
|
.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS)
|
2015-09-01 11:46:13 +00:00
|
|
|
.for _kernel in ${BUILDKERNELS:[2..-1]}
|
2013-05-16 18:37:14 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta
|
|
|
|
.endif
|
2012-01-15 08:36:25 +00:00
|
|
|
cd ${KRNLOBJDIR}/${_kernel}; \
|
2013-05-16 18:37:14 +00:00
|
|
|
${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.${_kernel}.premeta/} \
|
|
|
|
${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} \
|
2012-01-15 08:36:25 +00:00
|
|
|
KERNEL=${INSTKERNNAME}.${_kernel} \
|
2013-05-30 14:09:58 +00:00
|
|
|
DESTDIR=${INSTALL_DDIR}/kernel.${_kernel} \
|
2012-01-15 08:36:25 +00:00
|
|
|
${.TARGET:S/distributekernel/install/}
|
2013-09-24 19:09:21 +00:00
|
|
|
.if defined(NO_ROOT)
|
2013-05-16 18:37:14 +00:00
|
|
|
sed -e 's|^./kernel|.|' \
|
|
|
|
${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta > \
|
|
|
|
${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta
|
2013-09-24 19:09:21 +00:00
|
|
|
.endif
|
2012-01-15 08:36:25 +00:00
|
|
|
.endfor
|
2015-09-02 15:42:14 +00:00
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
|
|
|
|
packagekernel:
|
2013-05-16 18:37:14 +00:00
|
|
|
.if defined(NO_ROOT)
|
2015-12-01 20:24:58 +00:00
|
|
|
.if !defined(NO_INSTALLKERNEL)
|
2013-05-16 18:37:14 +00:00
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel; \
|
2016-01-05 21:05:17 +00:00
|
|
|
tar cvf - --exclude '*.debug' \
|
|
|
|
@${DESTDIR}/${DISTDIR}/kernel.meta | \
|
2015-12-01 19:58:08 +00:00
|
|
|
${XZ_CMD} > ${PACKAGEDIR}/kernel.txz
|
2015-12-01 20:24:58 +00:00
|
|
|
.endif
|
2016-01-05 21:05:17 +00:00
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel; \
|
|
|
|
tar cvf - --include '*/*/*.debug' \
|
|
|
|
@${DESTDIR}/${DISTDIR}/kernel.meta | \
|
|
|
|
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz
|
2016-01-06 21:58:45 +00:00
|
|
|
.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS)
|
2015-09-01 11:46:13 +00:00
|
|
|
.for _kernel in ${BUILDKERNELS:[2..-1]}
|
2013-05-16 18:37:14 +00:00
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
|
2016-01-05 21:05:17 +00:00
|
|
|
tar cvf - --exclude '*.debug' \
|
|
|
|
@${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \
|
2015-12-01 19:58:08 +00:00
|
|
|
${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz
|
2016-01-05 21:05:17 +00:00
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
|
|
|
|
tar cvf - --include '*/*/*.debug' \
|
|
|
|
@${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \
|
|
|
|
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz
|
2013-05-16 18:37:14 +00:00
|
|
|
.endfor
|
2015-09-02 15:42:14 +00:00
|
|
|
.endif
|
2013-05-16 18:37:14 +00:00
|
|
|
.else
|
2015-12-01 20:24:58 +00:00
|
|
|
.if !defined(NO_INSTALLKERNEL)
|
2012-01-15 08:36:25 +00:00
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel; \
|
2016-01-05 21:05:17 +00:00
|
|
|
tar cvf - --exclude '*.debug' . | \
|
2015-12-01 19:58:08 +00:00
|
|
|
${XZ_CMD} > ${PACKAGEDIR}/kernel.txz
|
2015-12-01 20:24:58 +00:00
|
|
|
.endif
|
2016-01-05 21:05:17 +00:00
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel; \
|
|
|
|
tar cvf - --include '*/*/*.debug' $$(eval find .) | \
|
|
|
|
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz
|
2016-01-06 21:58:45 +00:00
|
|
|
.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS)
|
2015-09-01 11:46:13 +00:00
|
|
|
.for _kernel in ${BUILDKERNELS:[2..-1]}
|
2012-01-15 08:36:25 +00:00
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
|
2016-01-05 21:05:17 +00:00
|
|
|
tar cvf - --exclude '*.debug' . | \
|
2015-12-01 19:58:08 +00:00
|
|
|
${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz
|
2016-01-05 21:05:17 +00:00
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
|
|
|
|
tar cvf - --include '*/*/*.debug' $$(eval find .) | \
|
|
|
|
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz
|
2012-01-15 08:36:25 +00:00
|
|
|
.endfor
|
2013-05-16 18:37:14 +00:00
|
|
|
.endif
|
2015-09-02 15:42:14 +00:00
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
|
2016-02-07 18:40:04 +00:00
|
|
|
#
|
|
|
|
#
|
|
|
|
# checkworld
|
|
|
|
#
|
|
|
|
# Run test suite on installed world.
|
|
|
|
#
|
|
|
|
checkworld: .PHONY
|
|
|
|
@if [ ! -x ${LOCALBASE}/bin/kyua ]; then \
|
|
|
|
echo "You need kyua (devel/kyua) to run the test suite." | /usr/bin/fmt; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
${_+_}${LOCALBASE}/bin/kyua test -k ${TESTSBASE}/Kyuafile
|
|
|
|
|
|
|
|
#
|
2006-05-26 18:10:06 +00:00
|
|
|
#
|
|
|
|
# doxygen
|
|
|
|
#
|
|
|
|
# Build the API documentation with doxygen
|
|
|
|
#
|
2015-10-21 05:33:48 +00:00
|
|
|
doxygen: .PHONY
|
2015-12-20 05:52:03 +00:00
|
|
|
@if [ ! -x ${LOCALBASE}/bin/doxygen ]; then \
|
2006-05-26 18:10:06 +00:00
|
|
|
echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2015-12-01 19:00:43 +00:00
|
|
|
${_+_}cd ${.CURDIR}/tools/kerneldoc/subsys; ${MAKE} obj all
|
2006-05-26 18:10:06 +00:00
|
|
|
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# update
|
|
|
|
#
|
2013-05-28 21:57:55 +00:00
|
|
|
# Update the source tree(s), by running svn/svnup to update to the
|
1998-08-31 01:08:08 +00:00
|
|
|
# latest copy.
|
|
|
|
#
|
|
|
|
update:
|
2013-05-28 23:43:47 +00:00
|
|
|
.if (defined(CVS_UPDATE) || defined(SUP_UPDATE)) && !defined(SVN_UPDATE)
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2013-05-28 23:43:47 +00:00
|
|
|
@echo "CVS_UPDATE and SUP_UPDATE are no longer supported."
|
|
|
|
@echo "Please see: https://wiki.freebsd.org/CvsIsDeprecated"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2013-05-28 23:43:47 +00:00
|
|
|
@exit 1
|
2009-06-14 15:16:24 +00:00
|
|
|
.endif
|
|
|
|
.if defined(SVN_UPDATE)
|
2013-05-28 23:43:47 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> Updating ${.CURDIR} using Subversion"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2015-12-01 19:00:43 +00:00
|
|
|
@(cd ${.CURDIR}; ${SVN} update ${SVNFLAGS})
|
1998-08-31 01:08:08 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# From here onwards are utility targets used by the 'make world' and
|
|
|
|
# related targets. If your 'world' breaks, you may like to try to fix
|
|
|
|
# the problem and manually run the following targets to attempt to
|
|
|
|
# complete the build. Beware, this is *not* guaranteed to work, you
|
|
|
|
# need to have a pretty good grip on the current state of the system
|
|
|
|
# to attempt to manually finish it. If in doubt, 'make world' again.
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
2015-08-11 17:48:58 +00:00
|
|
|
# legacy: Build compatibility shims for the next three targets. This is a
|
|
|
|
# minimal set of tools and shims necessary to compensate for older systems
|
|
|
|
# which don't have the APIs required by the targets built in bootstrap-tools,
|
|
|
|
# build-tools or cross-tools.
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
2015-08-11 15:43:09 +00:00
|
|
|
|
|
|
|
# ELF Tool Chain libraries are needed for ELF tools and dtrace tools.
|
|
|
|
.if ${BOOTSTRAPPING} < 1100006
|
2015-09-25 00:30:53 +00:00
|
|
|
_elftoolchain_libs= lib/libelf lib/libdwarf
|
2015-08-11 15:43:09 +00:00
|
|
|
.endif
|
|
|
|
|
2003-04-06 21:46:44 +00:00
|
|
|
legacy:
|
2014-04-13 05:21:30 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 800107 && ${BOOTSTRAPPING} != 0
|
2015-09-15 14:24:19 +00:00
|
|
|
@echo "ERROR: Source upgrades from versions prior to 8.0 are not supported."; \
|
2008-01-23 22:21:36 +00:00
|
|
|
false
|
|
|
|
.endif
|
2015-08-11 15:43:09 +00:00
|
|
|
.for _tool in tools/build ${_elftoolchain_libs}
|
2004-09-07 15:19:40 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ obj; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ depend; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ all; \
|
2003-04-06 21:46:44 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
|
2003-04-06 03:50:28 +00:00
|
|
|
.endfor
|
|
|
|
|
2003-04-06 21:33:49 +00:00
|
|
|
#
|
2015-03-25 21:59:36 +00:00
|
|
|
# bootstrap-tools: Build tools needed for compatibility. These are binaries that
|
|
|
|
# are built to build other binaries in the system. However, the focus of these
|
|
|
|
# binaries is usually quite narrow. Bootstrap tools use the host's compiler and
|
|
|
|
# libraries, augmented by -legacy.
|
2003-04-06 21:33:49 +00:00
|
|
|
#
|
2015-09-25 00:30:53 +00:00
|
|
|
_bt= _bootstrap-tools
|
2015-02-23 05:28:17 +00:00
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_GAMES} != "no"
|
2015-10-02 10:08:11 +00:00
|
|
|
_strfile= usr.bin/fortune/strfile
|
2003-04-06 21:33:49 +00:00
|
|
|
.endif
|
|
|
|
|
2015-06-21 22:45:53 +00:00
|
|
|
.if ${MK_GCC} != "no" && ${MK_CXX} != "no"
|
2005-02-27 11:22:58 +00:00
|
|
|
_gperf= gnu/usr.bin/gperf
|
2003-04-30 10:58:52 +00:00
|
|
|
.endif
|
2011-02-22 08:13:49 +00:00
|
|
|
|
|
|
|
.if ${MK_GROFF} != "no"
|
2015-05-01 20:08:25 +00:00
|
|
|
_groff= gnu/usr.bin/groff \
|
|
|
|
usr.bin/soelim
|
2003-05-31 21:29:38 +00:00
|
|
|
.endif
|
2003-04-30 10:58:52 +00:00
|
|
|
|
2014-06-30 00:20:12 +00:00
|
|
|
.if ${MK_VT} != "no"
|
2014-06-12 18:31:32 +00:00
|
|
|
_vtfontcvt= usr.bin/vtfontcvt
|
|
|
|
.endif
|
|
|
|
|
2009-10-21 19:39:34 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 900002
|
|
|
|
_sed= usr.bin/sed
|
|
|
|
.endif
|
|
|
|
|
2016-01-08 21:07:34 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1000033
|
2015-11-04 07:20:55 +00:00
|
|
|
_libopenbsd= lib/libopenbsd
|
2015-05-30 19:29:19 +00:00
|
|
|
_m4= usr.bin/m4
|
2016-01-08 21:07:34 +00:00
|
|
|
_lex= usr.bin/lex
|
2015-02-23 05:28:17 +00:00
|
|
|
|
2015-11-04 07:20:55 +00:00
|
|
|
${_bt}-usr.bin/m4: ${_bt}-lib/libopenbsd
|
2016-01-08 21:07:34 +00:00
|
|
|
${_bt}-usr.bin/lex: ${_bt}-usr.bin/m4
|
2013-05-21 19:32:35 +00:00
|
|
|
.endif
|
|
|
|
|
2013-01-21 23:12:50 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1000026
|
2013-01-15 00:12:34 +00:00
|
|
|
_nmtree= lib/libnetbsd \
|
|
|
|
usr.sbin/nmtree
|
2015-02-23 05:28:17 +00:00
|
|
|
|
|
|
|
${_bt}-usr.sbin/nmtree: ${_bt}-lib/libnetbsd
|
2013-01-15 00:12:34 +00:00
|
|
|
.endif
|
|
|
|
|
2013-01-29 22:17:58 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1000027
|
|
|
|
_cat= bin/cat
|
|
|
|
.endif
|
|
|
|
|
2015-05-19 14:05:15 +00:00
|
|
|
# r277259 crunchide: Correct 64-bit section header offset
|
|
|
|
# r281674 crunchide: always include both 32- and 64-bit ELF support
|
2015-08-12 16:43:15 +00:00
|
|
|
# r285986 crunchen: use STRIPBIN rather than STRIP
|
|
|
|
.if ${BOOTSTRAPPING} < 1100078
|
2015-04-17 16:02:49 +00:00
|
|
|
_crunch= usr.sbin/crunch
|
|
|
|
.endif
|
|
|
|
|
2011-08-11 10:29:10 +00:00
|
|
|
.if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041
|
|
|
|
_awk= usr.bin/awk
|
|
|
|
.endif
|
|
|
|
|
2015-02-18 23:10:15 +00:00
|
|
|
_yacc= lib/liby \
|
|
|
|
usr.bin/yacc
|
2015-02-23 05:28:17 +00:00
|
|
|
|
|
|
|
${_bt}-usr.bin/yacc: ${_bt}-lib/liby
|
2015-02-18 23:10:15 +00:00
|
|
|
|
2014-08-15 21:22:49 +00:00
|
|
|
.if ${MK_BSNMP} != "no"
|
2006-03-31 14:10:35 +00:00
|
|
|
_gensnmptree= usr.sbin/bsnmpd/gensnmptree
|
|
|
|
.endif
|
|
|
|
|
2014-08-18 21:04:44 +00:00
|
|
|
# We need to build tblgen when we're building clang either as
|
2014-04-18 17:03:58 +00:00
|
|
|
# the bootstrap compiler, or as the part of the normal build.
|
|
|
|
.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no"
|
2011-11-10 20:15:35 +00:00
|
|
|
_clang_tblgen= \
|
|
|
|
lib/clang/libllvmsupport \
|
|
|
|
lib/clang/libllvmtablegen \
|
|
|
|
usr.bin/clang/tblgen \
|
|
|
|
usr.bin/clang/clang-tblgen
|
2015-02-23 05:28:17 +00:00
|
|
|
|
|
|
|
${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/libllvmtablegen ${_bt}-lib/clang/libllvmsupport
|
|
|
|
${_bt}-usr.bin/clang/tblgen: ${_bt}-lib/clang/libllvmtablegen ${_bt}-lib/clang/libllvmsupport
|
2011-11-10 20:15:35 +00:00
|
|
|
.endif
|
|
|
|
|
2014-02-28 18:29:09 +00:00
|
|
|
# Default to building the GPL DTC, but build the BSDL one if users explicitly
|
2013-01-22 17:49:51 +00:00
|
|
|
# request it.
|
2013-01-22 19:40:26 +00:00
|
|
|
_dtc= usr.bin/dtc
|
2013-01-22 17:49:51 +00:00
|
|
|
.if ${MK_GPL_DTC} != "no"
|
2010-06-13 13:02:43 +00:00
|
|
|
_dtc= gnu/usr.bin/dtc
|
|
|
|
.endif
|
|
|
|
|
2012-03-22 08:48:42 +00:00
|
|
|
.if ${MK_KERBEROS} != "no"
|
|
|
|
_kerberos5_bootstrap_tools= \
|
|
|
|
kerberos5/tools/make-roken \
|
|
|
|
kerberos5/lib/libroken \
|
|
|
|
kerberos5/lib/libvers \
|
|
|
|
kerberos5/tools/asn1_compile \
|
2013-05-11 13:44:11 +00:00
|
|
|
kerberos5/tools/slc \
|
|
|
|
usr.bin/compile_et
|
2015-02-23 05:28:17 +00:00
|
|
|
|
2015-04-21 10:17:25 +00:00
|
|
|
.ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g}
|
2012-03-22 08:48:42 +00:00
|
|
|
.endif
|
|
|
|
|
2015-05-30 17:41:37 +00:00
|
|
|
.if ${MK_MANDOCDB} != "no"
|
2015-11-04 07:20:55 +00:00
|
|
|
_libopenbsd?= lib/libopenbsd
|
2015-05-30 19:29:19 +00:00
|
|
|
_makewhatis= lib/libsqlite3 \
|
2015-06-03 13:43:04 +00:00
|
|
|
usr.bin/mandoc
|
2015-11-04 07:20:55 +00:00
|
|
|
${_bt}-usr.bin/mandoc: ${_bt}-lib/libopenbsd ${_bt}-lib/libsqlite3
|
2015-05-30 17:41:37 +00:00
|
|
|
.else
|
|
|
|
_makewhatis=usr.bin/makewhatis
|
|
|
|
.endif
|
|
|
|
|
2015-02-23 05:28:17 +00:00
|
|
|
bootstrap-tools: .PHONY
|
|
|
|
|
2011-05-11 17:50:19 +00:00
|
|
|
# Please document (add comment) why something is in 'bootstrap-tools'.
|
|
|
|
# Try to bound the building of the bootstrap-tool to just the
|
|
|
|
# FreeBSD versions that need the tool built at this stage of the build.
|
2003-07-01 12:57:53 +00:00
|
|
|
.for _tool in \
|
2011-11-10 20:15:35 +00:00
|
|
|
${_clang_tblgen} \
|
2012-03-22 08:48:42 +00:00
|
|
|
${_kerberos5_bootstrap_tools} \
|
2003-07-01 12:57:53 +00:00
|
|
|
${_strfile} \
|
|
|
|
${_gperf} \
|
|
|
|
${_groff} \
|
2010-06-13 13:02:43 +00:00
|
|
|
${_dtc} \
|
2011-08-11 10:29:10 +00:00
|
|
|
${_awk} \
|
2013-01-29 22:17:58 +00:00
|
|
|
${_cat} \
|
2005-02-19 10:25:42 +00:00
|
|
|
usr.bin/lorder \
|
2015-11-04 07:20:55 +00:00
|
|
|
${_libopenbsd} \
|
2015-05-30 17:41:37 +00:00
|
|
|
${_makewhatis} \
|
2003-07-01 12:57:53 +00:00
|
|
|
usr.bin/rpcgen \
|
2009-10-21 19:39:34 +00:00
|
|
|
${_sed} \
|
2009-12-31 00:07:26 +00:00
|
|
|
${_yacc} \
|
2013-05-21 19:32:35 +00:00
|
|
|
${_m4} \
|
2012-05-22 15:59:07 +00:00
|
|
|
${_lex} \
|
2003-07-01 12:57:53 +00:00
|
|
|
usr.bin/xinstall \
|
2006-03-09 12:55:02 +00:00
|
|
|
${_gensnmptree} \
|
2013-01-15 00:12:34 +00:00
|
|
|
usr.sbin/config \
|
2013-05-24 15:53:13 +00:00
|
|
|
${_crunch} \
|
2014-06-12 18:31:32 +00:00
|
|
|
${_nmtree} \
|
2015-08-08 00:18:32 +00:00
|
|
|
${_vtfontcvt} \
|
|
|
|
usr.bin/localedef
|
2015-02-23 05:28:17 +00:00
|
|
|
${_bt}-${_tool}: .PHONY .MAKE
|
2004-09-07 15:19:40 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ obj; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ depend; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ all; \
|
2003-04-13 11:42:55 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
|
2015-02-23 05:28:17 +00:00
|
|
|
|
|
|
|
bootstrap-tools: ${_bt}-${_tool}
|
1999-12-08 13:45:11 +00:00
|
|
|
.endfor
|
1999-11-24 06:04:11 +00:00
|
|
|
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
#
|
1999-12-20 10:32:11 +00:00
|
|
|
# build-tools: Build special purpose build tools
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
#
|
2004-12-21 12:13:23 +00:00
|
|
|
.if !defined(NO_SHARE)
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
_share= share/syscons/scrnmaps
|
|
|
|
.endif
|
|
|
|
|
2012-11-20 03:21:26 +00:00
|
|
|
.if ${MK_GCC} != "no"
|
2012-02-29 22:58:51 +00:00
|
|
|
_gcc_tools= gnu/usr.bin/cc/cc_tools
|
|
|
|
.endif
|
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_RESCUE} != "no"
|
2015-08-12 19:00:47 +00:00
|
|
|
# rescue includes programs that have build-tools targets
|
2015-08-12 19:39:11 +00:00
|
|
|
_rescue=rescue/rescue
|
2003-07-11 17:01:58 +00:00
|
|
|
.endif
|
|
|
|
|
2003-07-01 12:57:53 +00:00
|
|
|
.for _tool in \
|
|
|
|
bin/csh \
|
|
|
|
bin/sh \
|
2012-01-05 21:50:50 +00:00
|
|
|
${LOCAL_TOOL_DIRS} \
|
2007-01-20 07:48:10 +00:00
|
|
|
lib/ncurses/ncurses \
|
2007-03-09 12:11:58 +00:00
|
|
|
lib/ncurses/ncursesw \
|
2015-08-12 19:21:58 +00:00
|
|
|
${_rescue} \
|
2003-07-01 12:57:53 +00:00
|
|
|
${_share} \
|
|
|
|
usr.bin/awk \
|
2004-08-09 10:51:01 +00:00
|
|
|
lib/libmagic \
|
Add the BSD-licensed Citrus iconv to the base system with default off
setting. It can be built by setting the WITH_ICONV knob. While this
knob is unset, the library part, the binaries, the header file and
the metadata files will not be built or installed so it makes no impact
on the system if left turned off.
This work is based on the iconv implementation in NetBSD but a great
number of improvements and feature additions have been included:
- Some utilities have been added. There is a conversion table generator,
which can compare conversion tables to reference data generated by
GNU libiconv. This helps ensuring conversion compatibility.
- UTF-16 surrogate support and some endianness issues have been fixed.
- The rather chaotic Makefiles to build metadata have been refactored
and cleaned up, now it is easy to read and it is also easier to add
support for new encodings.
- A bunch of new encodings and encoding aliases have been added.
- Support for 1->2, 1->3 and 1->4 mappings, which is needed for
transliterating with flying accents as GNU does, like "u.
- Lots of warnings have been fixed, the major part of the code is
now WARNS=6 clean.
- New section 1 and section 5 manual pages have been added.
- Some GNU-specific calls have been implemented:
iconvlist(), iconvctl(), iconv_canonicalize(), iconv_open_into()
- Support for GNU's //IGNORE suffix has been added.
- The "-" argument for stdin is now recognized in iconv(1) as per POSIX.
- The Big5 conversion module has been fixed.
- The iconv.h header files is supposed to be compatible with the
GNU version, i.e. sources should build with base iconv.h and
GNU libiconv. It also includes a macro magic to deal with the
char ** and const char ** incompatibility.
- GNU compatibility: "" or "char" means the current local
encoding in use
- Various cleanups and style(9) fixes.
Approved by: delphij (mentor)
Obtained from: The NetBSD Project
Sponsored by: Google Summer of Code 2009
2011-02-25 00:04:39 +00:00
|
|
|
usr.bin/mkesdb_static \
|
2013-08-11 20:03:12 +00:00
|
|
|
usr.bin/mkcsmapper_static \
|
|
|
|
usr.bin/vi/catalog
|
2015-10-22 05:01:14 +00:00
|
|
|
build-tools_${_tool}: .PHONY
|
2004-09-07 15:19:40 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ obj; \
|
2003-02-24 20:09:16 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ build-tools
|
2015-10-22 05:01:14 +00:00
|
|
|
build-tools: build-tools_${_tool}
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
.endfor
|
2004-01-31 08:15:57 +00:00
|
|
|
.for _tool in \
|
2012-03-22 08:48:42 +00:00
|
|
|
${_gcc_tools}
|
2015-10-22 05:01:14 +00:00
|
|
|
build-tools_${_tool}: .PHONY
|
2004-09-07 15:19:40 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ obj; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ depend; \
|
2004-01-31 08:15:57 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ all
|
2015-10-22 05:01:14 +00:00
|
|
|
build-tools: build-tools_${_tool}
|
2004-01-31 08:15:57 +00:00
|
|
|
.endfor
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
|
2013-11-07 04:31:21 +00:00
|
|
|
#
|
|
|
|
# kernel-tools: Build kernel-building tools
|
|
|
|
#
|
2015-10-16 20:23:04 +00:00
|
|
|
kernel-tools:
|
2013-11-07 22:50:42 +00:00
|
|
|
mkdir -p ${MAKEOBJDIRPREFIX}/usr
|
2013-11-07 04:31:21 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
2013-11-07 22:50:42 +00:00
|
|
|
-p ${MAKEOBJDIRPREFIX}/usr >/dev/null
|
2013-11-07 04:31:21 +00:00
|
|
|
|
1999-12-20 10:32:11 +00:00
|
|
|
#
|
2015-03-25 21:59:36 +00:00
|
|
|
# cross-tools: All the tools needed to build the rest of the system after
|
|
|
|
# we get done with the earlier stages. It is the last set of tools needed
|
|
|
|
# to begin building the target binaries.
|
1999-12-20 10:32:11 +00:00
|
|
|
#
|
2014-04-13 05:21:30 +00:00
|
|
|
.if ${TARGET_ARCH} != ${MACHINE_ARCH}
|
2005-12-07 20:01:12 +00:00
|
|
|
.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
|
2003-07-01 12:57:53 +00:00
|
|
|
_btxld= usr.sbin/btxld
|
|
|
|
.endif
|
2008-04-15 05:14:42 +00:00
|
|
|
.endif
|
2002-03-20 18:25:50 +00:00
|
|
|
|
2015-09-21 16:07:22 +00:00
|
|
|
# Rebuild ctfconvert and ctfmerge to avoid difficult-to-diagnose failures
|
|
|
|
# resulting from missing bug fixes or ELF Toolchain updates.
|
|
|
|
.if ${MK_CDDL} != "no"
|
2015-09-28 12:38:57 +00:00
|
|
|
_dtrace_tools= cddl/lib/libctf cddl/usr.bin/ctfconvert \
|
2015-09-21 16:07:22 +00:00
|
|
|
cddl/usr.bin/ctfmerge
|
|
|
|
.endif
|
|
|
|
|
2014-04-18 17:03:58 +00:00
|
|
|
# If we're given an XAS, don't build binutils.
|
2014-12-30 18:42:53 +00:00
|
|
|
.if ${XAS:M/*} == ""
|
|
|
|
.if ${MK_BINUTILS_BOOTSTRAP} != "no"
|
2011-05-19 05:13:25 +00:00
|
|
|
_binutils= gnu/usr.bin/binutils
|
2014-12-30 18:42:53 +00:00
|
|
|
.endif
|
2015-08-17 10:48:55 +00:00
|
|
|
.if ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no"
|
2014-12-01 17:49:42 +00:00
|
|
|
_elftctools= lib/libelftc \
|
2016-02-12 21:12:47 +00:00
|
|
|
lib/libpe \
|
2014-12-01 17:49:42 +00:00
|
|
|
usr.bin/elfcopy \
|
|
|
|
usr.bin/nm \
|
|
|
|
usr.bin/size \
|
|
|
|
usr.bin/strings
|
2015-01-23 21:34:08 +00:00
|
|
|
# These are not required by the build, but can be useful for developers who
|
|
|
|
# cross-build on a FreeBSD 10 host:
|
|
|
|
_elftctools+= usr.bin/addr2line
|
2014-12-01 17:49:42 +00:00
|
|
|
.endif
|
2015-08-17 10:48:55 +00:00
|
|
|
.elif ${TARGET_ARCH} != ${MACHINE_ARCH} && ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no"
|
2015-03-17 19:35:50 +00:00
|
|
|
# If cross-building with an external binutils we still need to build strip for
|
|
|
|
# the target (for at least crunchide).
|
|
|
|
_elftctools= lib/libelftc \
|
2016-02-12 21:12:47 +00:00
|
|
|
lib/libpe \
|
2015-03-17 19:35:50 +00:00
|
|
|
usr.bin/elfcopy
|
2011-05-19 05:13:25 +00:00
|
|
|
.endif
|
|
|
|
|
2013-05-15 14:30:03 +00:00
|
|
|
# If an full path to an external cross compiler is given, don't build
|
|
|
|
# a cross compiler.
|
Add built-in ccache build support via WITH_CCACHE_BUILD option.
ccache is mostly beneficial for frequent builds where -DNO_CLEAN is not
used to achieve a safe pseudo-incremental build. This is explained in
more detail upstream [1] [2]. It incurs about a 20%-28% hit to populate the
cache, but with a full cache saves 30-50% in build times. When combined with
the WITH_FAST_DEPEND feature it saves up to 65% since ccache does cache the
resulting dependency file, which it does not do when using mkdep(1)/'CC
-E'. Stats are provided at the end of this message.
This removes the need to modify /etc/make.conf with the CC:= and CXX:=
lines which conflicted with external compiler support [3] (causing the
bootstrap compiler to not be built which lead to obscure failures [4]),
incorrectly invoked ccache in various stages, required CCACHE_CPP2 to avoid
Clang errors with parenthesis, and did not work with META_MODE.
The option name was picked to match the existing option in ports. This
feature is available for both in-src and out-of-src builds that use
/usr/share/mk.
Linking, assembly compiles, and pre-processing avoid using ccache since it is
only overhead. ccache does nothing special in these modes, although there is
no harm in calling it for them.
CCACHE_COMPILERCHECK is set to 'content' when using the in-tree bootstrap
compiler to hash the content of the compiler binary to determine if it
should be a cache miss. For external compilers the 'mtime' option is used
as it is more efficient and likely to be correct. Future work may optimize the
'content' check using the same checks as whether a bootstrap compiler is needed
to be built.
The CCACHE_CPP2 pessimization is currently default in our devel/ccache
port due to Clang requiring it. Clang's -Wparentheses-equality,
-Wtautological-compare, and -Wself-assign warnings do not mix well with
compiling already-pre-processed code that may have expanded macros that
trigger the warnings. GCC has so far not had this issue so it is allowed to
disable the CCACHE_CPP2 default in our port.
Sharing a cache between multiple checkouts, or systems, is explained in
the ccache manual. Sharing a cache over NFS would likely not be worth
it, but syncing cache directories between systems may be useful for an
organization. There is also a memcached backend available [5]. Due to using
an object directory outside of the source directory though you will need to
ensure that both are in the same prefix and all users use the same layout. A
possible working layout is as follows:
Source: /some/prefix/src1
Source: /some/prefix/src2
Source: /some/prefix/src3
Objdir: /some/prefix/obj
Environment: CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj'
This will use src*/../obj as the MAKEOBJDIRPREFIX and tells ccache to replace
all absolute paths to be relative. Using something like this is required due
to -I and -o flags containing both SRC and OBJDIR absolute paths that ccache
adds into its hash for the object without CCACHE_BASEDIR.
distcc can be hooked into by setting CCACHE_PREFIX=/usr/local/bin/distcc.
I have not personally tested this and assume it will not mix well with
using the bootstrap compiler.
The cache from buildworld can be reused in a subdir by first running
'make buildenv' (from r290424).
Note that the cache is currently different depending on whether -j is
used or not due to ccache enabling -fdiagnostics-color automatically if
stderr is a TTY, which bmake only does if not using -j.
The system I used for testing was:
WITNESS
Build options: -j20 WITH_LLDB=yes WITH_DEBUG_FILES=yes WITH_CCACHE_BUILD=yes
DISK: ZFS 3-way mirror with very slow disks using SSD l2arc/log.
The arc was fully populated with src tree files and ccache objects.
RAM: 76GiB
CPU: Intel(R) Xeon(R) CPU L5520 @2.27GHz
2 package(s) x 4 core(s) x 2 SMT threads = hw.ncpu=16
The WITH_FAST_DEPEND feature was used for comparison here as well to show
the dramatic time savings with a full cache.
buildworld:
x buildworld-before
+ buildworld-ccache-empty
* buildworld-ccache-full
% buildworld-ccache-full-fastdep
# buildworld-fastdep
+-------------------------------------------------------------------------------+
|% * # +|
|% * # +|
|% * # xxx +|
| |A |
| A|
| A |
|A |
| A |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 3744.13 3794.31 3752.25 3763.5633 26.935139
+ 3 4519 4525.04 4520.73 4521.59 3.1104823
Difference at 95.0% confidence
758.027 +/- 43.4565
20.1412% +/- 1.15466%
(Student's t, pooled s = 19.1726)
* 3 1823.08 1827.2 1825.62 1825.3 2.0785572
Difference at 95.0% confidence
-1938.26 +/- 43.298
-51.5007% +/- 1.15045%
(Student's t, pooled s = 19.1026)
% 3 1266.96 1279.37 1270.47 1272.2667 6.3971113
Difference at 95.0% confidence
-2491.3 +/- 44.3704
-66.1952% +/- 1.17895%
(Student's t, pooled s = 19.5758)
# 3 3153.34 3155.16 3154.2 3154.2333 0.91045776
Difference at 95.0% confidence
-609.33 +/- 43.1943
-16.1902% +/- 1.1477%
(Student's t, pooled s = 19.0569)
buildkernel:
x buildkernel-before
+ buildkernel-ccache-empty
* buildkernel-ccache-empty-fastdep
% buildkernel-ccache-full
# buildkernel-ccache-full-fastdep
@ buildkernel-fastdep
+-------------------------------------------------------------------------------+
|# @ % * |
|# @ % * x + |
|# @ % * xx ++|
| MA |
| MA|
| A |
| A |
|A |
| A |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 571.57 573.94 571.79 572.43333 1.3094401
+ 3 727.97 731.91 728.06 729.31333 2.2492295
Difference at 95.0% confidence
156.88 +/- 4.17129
27.4058% +/- 0.728695%
(Student's t, pooled s = 1.84034)
* 3 527.1 528.29 528.08 527.82333 0.63516402
Difference at 95.0% confidence
-44.61 +/- 2.33254
-7.79305% +/- 0.407478%
(Student's t, pooled s = 1.02909)
% 3 400.4 401.05 400.62 400.69 0.3306055
Difference at 95.0% confidence
-171.743 +/- 2.16453
-30.0023% +/- 0.378128%
(Student's t, pooled s = 0.954969)
# 3 201.94 203.34 202.28 202.52 0.73020545
Difference at 95.0% confidence
-369.913 +/- 2.40293
-64.6212% +/- 0.419774%
(Student's t, pooled s = 1.06015)
@ 3 369.12 370.57 369.3 369.66333 0.79033748
Difference at 95.0% confidence
-202.77 +/- 2.45131
-35.4225% +/- 0.428227%
(Student's t, pooled s = 1.0815)
[1] https://ccache.samba.org/performance.html
[2] http://www.mail-archive.com/ccache@lists.samba.org/msg00576.html
[3] https://reviews.freebsd.org/D3484
[5] https://github.com/jrosdahl/ccache/pull/30
PR: 182944 [4]
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
Relnotes: yes
2015-11-08 00:50:18 +00:00
|
|
|
.if ${XCC:N${CCACHE_BIN}:M/*} == "" && ${MK_CROSS_COMPILER} != "no"
|
2014-04-18 17:03:58 +00:00
|
|
|
.if ${MK_CLANG_BOOTSTRAP} != "no"
|
2011-11-09 19:00:27 +00:00
|
|
|
_clang= usr.bin/clang
|
2011-11-10 20:15:35 +00:00
|
|
|
_clang_libs= lib/clang
|
2011-05-19 05:13:25 +00:00
|
|
|
.endif
|
2014-04-18 17:03:58 +00:00
|
|
|
.if ${MK_GCC_BOOTSTRAP} != "no"
|
2013-10-29 12:34:11 +00:00
|
|
|
_cc= gnu/usr.bin/cc
|
|
|
|
.endif
|
2013-05-15 14:30:03 +00:00
|
|
|
.endif
|
2015-05-20 09:36:25 +00:00
|
|
|
.if ${MK_USB} != "no"
|
|
|
|
_usb_tools= sys/boot/usb/tools
|
|
|
|
.endif
|
2011-05-19 05:13:25 +00:00
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
cross-tools: .MAKE .PHONY
|
2003-07-01 12:57:53 +00:00
|
|
|
.for _tool in \
|
2010-08-21 15:39:06 +00:00
|
|
|
${_clang_libs} \
|
|
|
|
${_clang} \
|
2011-05-19 05:13:25 +00:00
|
|
|
${_binutils} \
|
2014-12-01 17:49:42 +00:00
|
|
|
${_elftctools} \
|
2015-09-21 16:07:22 +00:00
|
|
|
${_dtrace_tools} \
|
2011-05-19 05:13:25 +00:00
|
|
|
${_cc} \
|
2003-07-01 12:57:53 +00:00
|
|
|
${_btxld} \
|
|
|
|
${_crunchide} \
|
2015-05-20 09:36:25 +00:00
|
|
|
${_usb_tools}
|
2004-09-07 15:19:40 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ obj; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ depend; \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ all; \
|
2002-05-12 16:01:00 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
|
1999-12-20 10:32:11 +00:00
|
|
|
.endfor
|
|
|
|
|
2015-10-24 01:39:31 +00:00
|
|
|
NXBDESTDIR= ${OBJTREE}/nxb-bin
|
2014-08-18 21:04:44 +00:00
|
|
|
NXBENV= MAKEOBJDIRPREFIX=${OBJTREE}/nxb \
|
|
|
|
INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
2015-04-30 02:08:36 +00:00
|
|
|
PATH=${PATH}:${OBJTREE}/gperf_for_gcc/usr/bin
|
2014-08-18 21:04:44 +00:00
|
|
|
NXBMAKE= ${NXBENV} ${MAKE} \
|
2015-10-24 01:39:31 +00:00
|
|
|
TBLGEN=${NXBDESTDIR}/usr/bin/tblgen \
|
|
|
|
CLANG_TBLGEN=${NXBDESTDIR}/usr/bin/clang-tblgen \
|
2014-08-18 21:04:44 +00:00
|
|
|
MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH} \
|
|
|
|
MK_GDB=no MK_TESTS=no \
|
2014-08-19 15:04:32 +00:00
|
|
|
SSP_CFLAGS= \
|
2015-01-02 18:45:03 +00:00
|
|
|
MK_HTML=no NO_LINT=yes MK_MAN=no \
|
2014-08-18 21:04:44 +00:00
|
|
|
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
|
|
|
|
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
|
2014-12-18 18:26:10 +00:00
|
|
|
MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
|
2015-12-23 21:55:54 +00:00
|
|
|
MK_LLDB=no MK_DEBUG_FILES=no
|
2014-08-18 21:04:44 +00:00
|
|
|
|
2015-04-30 00:17:32 +00:00
|
|
|
# native-xtools is the current target for qemu-user cross builds of ports
|
|
|
|
# via poudriere and the imgact_binmisc kernel module.
|
|
|
|
# For non-clang enabled targets that are still using the in tree gcc
|
|
|
|
# we must build a gperf binary for one instance of its Makefiles. On
|
|
|
|
# clang-enabled systems, the gperf binary is obsolete.
|
2015-10-21 05:33:48 +00:00
|
|
|
native-xtools: .PHONY
|
2015-04-30 00:17:32 +00:00
|
|
|
.if ${MK_GCC_BOOTSTRAP} != "no"
|
|
|
|
mkdir -p ${OBJTREE}/gperf_for_gcc/usr/bin
|
|
|
|
${_+_}@${ECHODIR} "===> ${_gperf} (obj,depend,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_gperf}; \
|
|
|
|
${NXBMAKE} DIRPRFX=${_gperf}/ obj; \
|
|
|
|
${NXBMAKE} DIRPRFX=${_gperf}/ depend; \
|
|
|
|
${NXBMAKE} DIRPRFX=${_gperf}/ all; \
|
2015-04-30 00:17:32 +00:00
|
|
|
${NXBMAKE} DIRPRFX=${_gperf}/ DESTDIR=${OBJTREE}/gperf_for_gcc install
|
|
|
|
.endif
|
2015-10-24 01:39:31 +00:00
|
|
|
mkdir -p ${NXBDESTDIR}/bin ${NXBDESTDIR}/sbin ${NXBDESTDIR}/usr
|
2014-08-18 21:04:44 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
2015-10-24 01:39:31 +00:00
|
|
|
-p ${NXBDESTDIR}/usr >/dev/null
|
2014-08-18 21:04:44 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
2015-10-24 01:39:31 +00:00
|
|
|
-p ${NXBDESTDIR}/usr/include >/dev/null
|
2015-10-23 23:07:45 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
|
2015-10-24 01:39:31 +00:00
|
|
|
-p ${NXBDESTDIR}/usr/lib >/dev/null
|
2015-10-23 23:07:45 +00:00
|
|
|
.endif
|
2014-08-18 21:04:44 +00:00
|
|
|
.for _tool in \
|
2014-11-16 20:10:37 +00:00
|
|
|
bin/cat \
|
|
|
|
bin/chmod \
|
|
|
|
bin/cp \
|
2014-11-13 22:25:22 +00:00
|
|
|
bin/csh \
|
2014-11-16 23:31:23 +00:00
|
|
|
bin/echo \
|
2014-11-16 20:10:37 +00:00
|
|
|
bin/expr \
|
2014-11-16 23:31:23 +00:00
|
|
|
bin/hostname \
|
2014-11-16 20:10:37 +00:00
|
|
|
bin/ln \
|
|
|
|
bin/ls \
|
|
|
|
bin/mkdir \
|
2014-11-16 23:31:23 +00:00
|
|
|
bin/mv \
|
2014-11-16 20:10:37 +00:00
|
|
|
bin/ps \
|
|
|
|
bin/realpath \
|
|
|
|
bin/rm \
|
|
|
|
bin/rmdir \
|
2014-11-13 22:25:22 +00:00
|
|
|
bin/sh \
|
2014-11-16 20:10:37 +00:00
|
|
|
bin/sleep \
|
2014-08-18 21:04:44 +00:00
|
|
|
${_clang_tblgen} \
|
|
|
|
usr.bin/ar \
|
|
|
|
${_binutils} \
|
2014-12-01 17:49:42 +00:00
|
|
|
${_elftctools} \
|
2014-08-18 21:04:44 +00:00
|
|
|
${_cc} \
|
|
|
|
${_gcc_tools} \
|
|
|
|
${_clang_libs} \
|
|
|
|
${_clang} \
|
2014-11-13 22:25:22 +00:00
|
|
|
sbin/md5 \
|
2014-11-16 20:10:37 +00:00
|
|
|
sbin/sysctl \
|
|
|
|
gnu/usr.bin/diff \
|
2014-08-18 21:04:44 +00:00
|
|
|
usr.bin/awk \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/basename \
|
2014-08-18 21:04:44 +00:00
|
|
|
usr.bin/bmake \
|
2014-11-13 22:25:22 +00:00
|
|
|
usr.bin/bzip2 \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/cmp \
|
|
|
|
usr.bin/dirname \
|
|
|
|
usr.bin/env \
|
2014-11-13 22:25:22 +00:00
|
|
|
usr.bin/fetch \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/find \
|
|
|
|
usr.bin/grep \
|
2014-11-13 22:25:22 +00:00
|
|
|
usr.bin/gzip \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/id \
|
2014-08-18 21:04:44 +00:00
|
|
|
usr.bin/lex \
|
|
|
|
usr.bin/lorder \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/mktemp \
|
|
|
|
usr.bin/mt \
|
|
|
|
usr.bin/patch \
|
2014-08-18 21:04:44 +00:00
|
|
|
usr.bin/sed \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/sort \
|
2014-11-13 22:25:22 +00:00
|
|
|
usr.bin/tar \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/touch \
|
|
|
|
usr.bin/tr \
|
|
|
|
usr.bin/true \
|
|
|
|
usr.bin/uniq \
|
2014-11-13 22:25:22 +00:00
|
|
|
usr.bin/unzip \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/xargs \
|
|
|
|
usr.bin/xinstall \
|
2014-11-13 22:25:22 +00:00
|
|
|
usr.bin/xz \
|
2014-11-16 20:10:37 +00:00
|
|
|
usr.bin/yacc \
|
|
|
|
usr.sbin/chown
|
2014-08-18 21:04:44 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
|
|
|
${NXBMAKE} DIRPRFX=${_tool}/ obj; \
|
|
|
|
${NXBMAKE} DIRPRFX=${_tool}/ depend; \
|
|
|
|
${NXBMAKE} DIRPRFX=${_tool}/ all; \
|
2015-10-24 01:39:31 +00:00
|
|
|
${NXBMAKE} DIRPRFX=${_tool}/ DESTDIR=${NXBDESTDIR} install
|
2014-08-18 21:04:44 +00:00
|
|
|
.endfor
|
|
|
|
|
1999-11-24 06:04:11 +00:00
|
|
|
#
|
1999-12-08 13:45:11 +00:00
|
|
|
# hierarchy - ensure that all the needed directories are present
|
1999-11-24 06:04:11 +00:00
|
|
|
#
|
2015-10-21 05:33:48 +00:00
|
|
|
hierarchy hier: .MAKE .PHONY
|
2015-12-01 19:00:43 +00:00
|
|
|
${_+_}cd ${.CURDIR}/etc; ${HMAKE} distrib-dirs
|
1998-08-31 01:08:08 +00:00
|
|
|
|
|
|
|
#
|
1999-12-08 13:45:11 +00:00
|
|
|
# libraries - build all libraries, and install them under ${DESTDIR}.
|
1999-11-24 06:04:11 +00:00
|
|
|
#
|
2002-04-12 19:46:25 +00:00
|
|
|
# The list of libraries with dependents (${_prebuild_libs}) and their
|
|
|
|
# interdependencies (__L) are built automatically by the
|
|
|
|
# ${.CURDIR}/tools/make_libdeps.sh script.
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
2015-10-21 05:33:48 +00:00
|
|
|
libraries: .MAKE .PHONY
|
2015-12-01 19:00:43 +00:00
|
|
|
${_+_}cd ${.CURDIR}; \
|
|
|
|
${MAKE} -f Makefile.inc1 _prereq_libs; \
|
|
|
|
${MAKE} -f Makefile.inc1 _startup_libs; \
|
|
|
|
${MAKE} -f Makefile.inc1 _prebuild_libs; \
|
2013-07-06 00:13:08 +00:00
|
|
|
${MAKE} -f Makefile.inc1 _generic_libs
|
2002-04-12 19:46:25 +00:00
|
|
|
|
2007-05-19 03:34:59 +00:00
|
|
|
#
|
|
|
|
# static libgcc.a prerequisite for shared libc
|
|
|
|
#
|
2010-11-11 15:48:27 +00:00
|
|
|
_prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc lib/libcompiler_rt
|
2007-05-19 03:34:59 +00:00
|
|
|
|
2002-04-16 14:38:15 +00:00
|
|
|
# These dependencies are not automatically generated:
|
|
|
|
#
|
2007-05-19 03:34:59 +00:00
|
|
|
# gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before
|
|
|
|
# all shared libraries for ELF.
|
2002-04-16 14:38:15 +00:00
|
|
|
#
|
2007-05-19 03:34:59 +00:00
|
|
|
_startup_libs= gnu/lib/csu
|
2015-05-12 17:53:22 +00:00
|
|
|
_startup_libs+= lib/csu
|
2007-05-19 03:34:59 +00:00
|
|
|
_startup_libs+= gnu/lib/libgcc
|
2010-11-11 15:48:27 +00:00
|
|
|
_startup_libs+= lib/libcompiler_rt
|
2007-05-19 03:34:59 +00:00
|
|
|
_startup_libs+= lib/libc
|
2013-11-17 22:52:17 +00:00
|
|
|
_startup_libs+= lib/libc_nonshared
|
2011-11-26 03:26:06 +00:00
|
|
|
.if ${MK_LIBCPLUSPLUS} != "no"
|
2011-11-25 20:59:04 +00:00
|
|
|
_startup_libs+= lib/libcxxrt
|
|
|
|
.endif
|
2007-05-19 03:34:59 +00:00
|
|
|
|
|
|
|
gnu/lib/libgcc__L: lib/libc__L
|
2013-11-17 22:52:17 +00:00
|
|
|
gnu/lib/libgcc__L: lib/libc_nonshared__L
|
2012-03-17 22:12:09 +00:00
|
|
|
.if ${MK_LIBCPLUSPLUS} != "no"
|
|
|
|
lib/libcxxrt__L: gnu/lib/libgcc__L
|
|
|
|
.endif
|
1998-08-31 01:08:08 +00:00
|
|
|
|
2012-03-22 08:48:42 +00:00
|
|
|
_prebuild_libs= ${_kerberos5_lib_libasn1} \
|
|
|
|
${_kerberos5_lib_libhdb} \
|
|
|
|
${_kerberos5_lib_libheimbase} \
|
2011-09-27 07:14:12 +00:00
|
|
|
${_kerberos5_lib_libheimntlm} \
|
2015-05-20 18:56:29 +00:00
|
|
|
${_libsqlite3} \
|
2012-03-22 08:48:42 +00:00
|
|
|
${_kerberos5_lib_libheimipcc} \
|
2010-01-26 10:00:26 +00:00
|
|
|
${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \
|
|
|
|
${_kerberos5_lib_libroken} \
|
2012-03-22 08:48:42 +00:00
|
|
|
${_kerberos5_lib_libwind} \
|
2012-03-23 03:16:35 +00:00
|
|
|
lib/libbz2 ${_libcom_err} lib/libcrypt \
|
2013-04-20 08:13:35 +00:00
|
|
|
lib/libelf lib/libexpat \
|
2014-11-06 22:53:50 +00:00
|
|
|
lib/libfigpar \
|
2014-03-14 02:58:48 +00:00
|
|
|
${_lib_libgssapi} \
|
2013-12-02 08:21:28 +00:00
|
|
|
lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \
|
|
|
|
${_lib_libcapsicum} \
|
2007-03-09 12:11:58 +00:00
|
|
|
lib/ncurses/ncurses lib/ncurses/ncursesw \
|
2011-11-24 13:18:58 +00:00
|
|
|
lib/libopie lib/libpam ${_lib_libthr} \
|
2015-02-04 06:53:45 +00:00
|
|
|
${_lib_libradius} lib/libsbuf lib/libtacplus \
|
2014-10-03 20:36:09 +00:00
|
|
|
lib/libgeom \
|
2012-07-30 23:14:24 +00:00
|
|
|
${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \
|
2014-10-03 20:36:09 +00:00
|
|
|
${_cddl_lib_libuutil} \
|
2014-05-22 05:33:50 +00:00
|
|
|
${_cddl_lib_libavl} \
|
2013-03-05 08:09:53 +00:00
|
|
|
${_cddl_lib_libzfs_core} \
|
2014-10-05 22:13:13 +00:00
|
|
|
${_cddl_lib_libctf} \
|
2013-12-01 09:41:06 +00:00
|
|
|
lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \
|
2013-09-10 22:26:11 +00:00
|
|
|
${_secure_lib_libcrypto} ${_lib_libldns} \
|
2014-11-07 00:59:40 +00:00
|
|
|
${_secure_lib_libssh} ${_secure_lib_libssl} \
|
|
|
|
gnu/lib/libdialog
|
2014-07-10 21:11:48 +00:00
|
|
|
.if ${MK_GNUCXX} != "no"
|
2014-03-30 22:24:37 +00:00
|
|
|
_prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++
|
2014-04-28 23:16:46 +00:00
|
|
|
gnu/lib/libstdc++__L: lib/msun__L
|
2014-07-23 22:18:43 +00:00
|
|
|
gnu/lib/libsupc++__L: gnu/lib/libstdc++__L
|
2014-03-30 22:24:37 +00:00
|
|
|
.endif
|
2002-07-01 17:51:43 +00:00
|
|
|
|
2015-03-17 15:16:36 +00:00
|
|
|
.if ${MK_LIBCPLUSPLUS} != "no"
|
|
|
|
_prebuild_libs+= lib/libc++
|
|
|
|
.endif
|
|
|
|
|
2014-10-03 20:36:09 +00:00
|
|
|
lib/libgeom__L: lib/libexpat__L
|
2015-11-27 18:58:26 +00:00
|
|
|
lib/libkvm__L: lib/libelf__L
|
2014-10-03 20:36:09 +00:00
|
|
|
|
2008-03-29 17:44:40 +00:00
|
|
|
.if ${MK_LIBTHR} != "no"
|
|
|
|
_lib_libthr= lib/libthr
|
2007-10-01 18:22:32 +00:00
|
|
|
.endif
|
|
|
|
|
2015-02-04 06:53:45 +00:00
|
|
|
.if ${MK_RADIUS_SUPPORT} != "no"
|
|
|
|
_lib_libradius= lib/libradius
|
|
|
|
.endif
|
|
|
|
|
2011-03-21 09:58:24 +00:00
|
|
|
.if ${MK_OFED} != "no"
|
|
|
|
_ofed_lib= contrib/ofed/usr.lib/
|
|
|
|
.endif
|
|
|
|
|
2013-12-02 08:21:28 +00:00
|
|
|
.if ${MK_CASPER} != "no"
|
|
|
|
_lib_libcapsicum=lib/libcapsicum
|
|
|
|
.endif
|
|
|
|
|
|
|
|
lib/libcapsicum__L: lib/libnv__L
|
2013-12-01 09:41:06 +00:00
|
|
|
lib/libpjdlog__L: lib/libutil__L
|
2015-02-09 06:20:34 +00:00
|
|
|
lib/liblzma__L: lib/libthr__L
|
2013-12-01 09:41:06 +00:00
|
|
|
|
2011-03-21 09:58:24 +00:00
|
|
|
_generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib}
|
2012-06-15 19:40:59 +00:00
|
|
|
.for _DIR in ${LOCAL_LIB_DIRS}
|
|
|
|
.if exists(${.CURDIR}/${_DIR}/Makefile)
|
|
|
|
_generic_libs+= ${_DIR}
|
|
|
|
.endif
|
|
|
|
.endfor
|
2002-04-16 14:38:15 +00:00
|
|
|
|
2006-10-07 19:26:46 +00:00
|
|
|
lib/libopie__L lib/libtacplus__L: lib/libmd__L
|
2002-04-16 14:38:15 +00:00
|
|
|
|
2007-04-06 02:13:30 +00:00
|
|
|
.if ${MK_CDDL} != "no"
|
2011-02-27 19:44:10 +00:00
|
|
|
_cddl_lib_libumem= cddl/lib/libumem
|
2012-07-30 23:14:24 +00:00
|
|
|
_cddl_lib_libnvpair= cddl/lib/libnvpair
|
2014-05-22 05:33:50 +00:00
|
|
|
_cddl_lib_libavl= cddl/lib/libavl
|
2014-10-03 20:36:09 +00:00
|
|
|
_cddl_lib_libuutil= cddl/lib/libuutil
|
2013-03-05 08:09:53 +00:00
|
|
|
_cddl_lib_libzfs_core= cddl/lib/libzfs_core
|
2014-10-05 22:13:13 +00:00
|
|
|
_cddl_lib_libctf= cddl/lib/libctf
|
2007-04-06 02:13:30 +00:00
|
|
|
_cddl_lib= cddl/lib
|
2013-03-05 22:51:11 +00:00
|
|
|
cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L
|
2014-10-03 20:36:09 +00:00
|
|
|
cddl/lib/libzfs__L: lib/libgeom__L
|
2014-10-05 22:13:13 +00:00
|
|
|
cddl/lib/libctf__L: lib/libz__L
|
2015-05-26 16:25:28 +00:00
|
|
|
.endif
|
2015-05-20 13:05:33 +00:00
|
|
|
# cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built
|
|
|
|
# on select architectures though (see cddl/lib/Makefile)
|
2015-08-23 23:12:30 +00:00
|
|
|
.if ${MACHINE_CPUARCH} != "sparc64"
|
2015-05-20 13:05:33 +00:00
|
|
|
_prebuild_libs+= lib/libproc lib/librtld_db
|
|
|
|
.endif
|
2007-04-06 02:13:30 +00:00
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_CRYPT} != "no"
|
|
|
|
.if ${MK_OPENSSL} != "no"
|
2006-10-07 19:26:46 +00:00
|
|
|
_secure_lib_libcrypto= secure/lib/libcrypto
|
|
|
|
_secure_lib_libssl= secure/lib/libssl
|
2005-11-10 18:07:07 +00:00
|
|
|
lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L
|
2013-09-10 22:26:11 +00:00
|
|
|
.if ${MK_LDNS} != "no"
|
|
|
|
_lib_libldns= lib/libldns
|
|
|
|
lib/libldns__L: secure/lib/libcrypto__L
|
|
|
|
.endif
|
2010-01-23 19:29:42 +00:00
|
|
|
.if ${MK_OPENSSH} != "no"
|
|
|
|
_secure_lib_libssh= secure/lib/libssh
|
|
|
|
secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L
|
2013-09-10 22:26:11 +00:00
|
|
|
.if ${MK_LDNS} != "no"
|
|
|
|
secure/lib/libssh__L: lib/libldns__L
|
|
|
|
.endif
|
2010-01-23 19:29:42 +00:00
|
|
|
.if ${MK_KERBEROS_SUPPORT} != "no"
|
2010-01-26 10:00:26 +00:00
|
|
|
secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \
|
|
|
|
kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \
|
|
|
|
lib/libmd__L kerberos5/lib/libroken__L
|
2004-05-12 07:02:17 +00:00
|
|
|
.endif
|
1999-12-17 11:23:56 +00:00
|
|
|
.endif
|
2002-06-21 08:54:03 +00:00
|
|
|
.endif
|
2006-10-07 19:26:46 +00:00
|
|
|
_secure_lib= secure/lib
|
2002-04-16 14:38:15 +00:00
|
|
|
.endif
|
1999-12-17 11:23:56 +00:00
|
|
|
|
2011-09-27 07:14:12 +00:00
|
|
|
.if ${MK_KERBEROS} != "no"
|
|
|
|
kerberos5/lib/libasn1__L: lib/libcom_err__L kerberos5/lib/libroken__L
|
|
|
|
kerberos5/lib/libhdb__L: kerberos5/lib/libasn1__L lib/libcom_err__L \
|
2012-03-22 08:48:42 +00:00
|
|
|
kerberos5/lib/libkrb5__L kerberos5/lib/libroken__L \
|
2015-05-20 18:56:29 +00:00
|
|
|
kerberos5/lib/libwind__L lib/libsqlite3__L
|
2012-03-22 08:48:42 +00:00
|
|
|
kerberos5/lib/libheimntlm__L: secure/lib/libcrypto__L kerberos5/lib/libkrb5__L \
|
|
|
|
kerberos5/lib/libroken__L lib/libcom_err__L
|
2011-09-27 07:14:12 +00:00
|
|
|
kerberos5/lib/libhx509__L: kerberos5/lib/libasn1__L lib/libcom_err__L \
|
2012-03-22 08:48:42 +00:00
|
|
|
secure/lib/libcrypto__L kerberos5/lib/libroken__L kerberos5/lib/libwind__L
|
2011-09-27 07:14:12 +00:00
|
|
|
kerberos5/lib/libkrb5__L: kerberos5/lib/libasn1__L lib/libcom_err__L \
|
|
|
|
lib/libcrypt__L secure/lib/libcrypto__L kerberos5/lib/libhx509__L \
|
2012-03-22 08:48:42 +00:00
|
|
|
kerberos5/lib/libroken__L kerberos5/lib/libwind__L \
|
|
|
|
kerberos5/lib/libheimbase__L kerberos5/lib/libheimipcc__L
|
2011-09-27 07:14:12 +00:00
|
|
|
kerberos5/lib/libroken__L: lib/libcrypt__L
|
2012-03-22 08:48:42 +00:00
|
|
|
kerberos5/lib/libwind__L: kerberos5/lib/libroken__L lib/libcom_err__L
|
|
|
|
kerberos5/lib/libheimbase__L: lib/libthr__L
|
|
|
|
kerberos5/lib/libheimipcc__L: kerberos5/lib/libroken__L kerberos5/lib/libheimbase__L lib/libthr__L
|
2011-09-27 07:14:12 +00:00
|
|
|
.endif
|
|
|
|
|
2015-05-30 16:00:33 +00:00
|
|
|
lib/libsqlite3__L: lib/libthr__L
|
|
|
|
|
2010-01-23 19:29:42 +00:00
|
|
|
.if ${MK_GSSAPI} != "no"
|
|
|
|
_lib_libgssapi= lib/libgssapi
|
|
|
|
.endif
|
|
|
|
|
2006-10-07 19:26:46 +00:00
|
|
|
.if ${MK_KERBEROS} != "no"
|
|
|
|
_kerberos5_lib= kerberos5/lib
|
|
|
|
_kerberos5_lib_libasn1= kerberos5/lib/libasn1
|
2011-09-27 07:14:12 +00:00
|
|
|
_kerberos5_lib_libhdb= kerberos5/lib/libhdb
|
2012-03-22 08:48:42 +00:00
|
|
|
_kerberos5_lib_libheimbase= kerberos5/lib/libheimbase
|
2006-10-07 19:26:46 +00:00
|
|
|
_kerberos5_lib_libkrb5= kerberos5/lib/libkrb5
|
2008-05-07 13:53:12 +00:00
|
|
|
_kerberos5_lib_libhx509= kerberos5/lib/libhx509
|
2006-10-07 19:26:46 +00:00
|
|
|
_kerberos5_lib_libroken= kerberos5/lib/libroken
|
2008-05-07 13:53:12 +00:00
|
|
|
_kerberos5_lib_libheimntlm= kerberos5/lib/libheimntlm
|
2015-05-20 18:56:29 +00:00
|
|
|
_libsqlite3= lib/libsqlite3
|
2012-03-22 08:48:42 +00:00
|
|
|
_kerberos5_lib_libheimipcc= kerberos5/lib/libheimipcc
|
|
|
|
_kerberos5_lib_libwind= kerberos5/lib/libwind
|
2012-03-23 03:16:35 +00:00
|
|
|
_libcom_err= lib/libcom_err
|
2004-04-27 15:00:29 +00:00
|
|
|
.endif
|
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_NIS} != "no"
|
2006-10-07 19:26:46 +00:00
|
|
|
_lib_libypclnt= lib/libypclnt
|
2004-11-13 20:40:32 +00:00
|
|
|
.endif
|
|
|
|
|
2006-10-07 19:26:46 +00:00
|
|
|
.if ${MK_OPENSSL} == "no"
|
2011-05-17 19:11:47 +00:00
|
|
|
lib/libradius__L: lib/libmd__L
|
2006-10-07 19:26:46 +00:00
|
|
|
.endif
|
2002-04-16 14:38:15 +00:00
|
|
|
|
_Really_, _Really_ fix buildworld by moving the conditionals down, fixing some
typos, and fixing the dependency when MK_LIBCPLUSPLUS != no
- `:D` operator evaluation is immediate, i.e. like .if defined(..). So r283159
was in effect a no-op commit.
- Fix dependency in MK_LIBCPLUSPLUS case in two ways:
-- lib/libc++ was the wrong dependency. It should have been libcxxrt.
-- lib/libc++ was missing __L, so again it was depending on the directory, not
the relevant .PHONY target.
Tested with: make tinderbox (amd64, arm, sparc64) and JFLAG=-j16
In collaboration with: bdrewery, imp, peter
BIG pointyhat to: ngie (for trying to commit things at 6am while staying up all
night working on other tasks)
2015-05-21 05:02:08 +00:00
|
|
|
lib/libproc__L: \
|
|
|
|
${_cddl_lib_libctf:D${_cddl_lib_libctf}__L} lib/libelf__L lib/librtld_db__L lib/libutil__L
|
|
|
|
.if ${MK_CXX} != "no"
|
|
|
|
.if ${MK_LIBCPLUSPLUS} != "no"
|
|
|
|
lib/libproc__L: lib/libcxxrt__L
|
|
|
|
.else # This implies MK_GNUCXX != "no"; see lib/libproc
|
|
|
|
lib/libproc__L: gnu/lib/libsupc++__L
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2014-11-08 04:24:54 +00:00
|
|
|
gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L
|
2014-11-07 00:59:40 +00:00
|
|
|
|
2007-05-19 03:34:59 +00:00
|
|
|
.for _lib in ${_prereq_libs}
|
2013-07-06 00:13:08 +00:00
|
|
|
${_lib}__PL: .PHONY .MAKE
|
2007-05-19 03:34:59 +00:00
|
|
|
.if exists(${.CURDIR}/${_lib})
|
|
|
|
${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_lib}; \
|
|
|
|
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \
|
|
|
|
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend; \
|
2014-04-25 19:25:26 +00:00
|
|
|
${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \
|
2015-12-01 19:00:43 +00:00
|
|
|
DIRPRFX=${_lib}/ all; \
|
2014-04-25 19:25:26 +00:00
|
|
|
${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \
|
2013-11-08 14:20:22 +00:00
|
|
|
DIRPRFX=${_lib}/ install
|
2007-05-19 03:34:59 +00:00
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
2011-11-24 13:18:58 +00:00
|
|
|
.for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
|
2013-07-06 00:13:08 +00:00
|
|
|
${_lib}__L: .PHONY .MAKE
|
1999-11-24 06:04:11 +00:00
|
|
|
.if exists(${.CURDIR}/${_lib})
|
2006-08-24 17:02:26 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_lib}; \
|
|
|
|
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \
|
|
|
|
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend; \
|
|
|
|
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ all; \
|
2014-03-30 22:24:53 +00:00
|
|
|
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ install
|
1999-01-07 06:26:33 +00:00
|
|
|
.endif
|
1999-07-07 04:46:46 +00:00
|
|
|
.endfor
|
1998-09-01 00:39:02 +00:00
|
|
|
|
2011-11-24 13:18:58 +00:00
|
|
|
# libpam is special: we need to build static PAM modules before
|
|
|
|
# static PAM library, and dynamic PAM library before dynamic PAM
|
|
|
|
# modules.
|
2013-07-06 00:13:08 +00:00
|
|
|
lib/libpam__L: .PHONY .MAKE
|
2011-11-24 13:18:58 +00:00
|
|
|
${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/lib/libpam; \
|
|
|
|
${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ obj; \
|
|
|
|
${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ depend; \
|
2014-03-30 22:24:53 +00:00
|
|
|
${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \
|
2015-12-01 19:00:43 +00:00
|
|
|
-D_NO_LIBPAM_SO_YET all; \
|
2014-03-30 22:24:53 +00:00
|
|
|
${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \
|
2013-11-08 14:20:22 +00:00
|
|
|
-D_NO_LIBPAM_SO_YET install
|
2011-11-24 13:18:58 +00:00
|
|
|
|
2007-05-26 20:17:19 +00:00
|
|
|
_prereq_libs: ${_prereq_libs:S/$/__PL/}
|
2002-04-12 19:46:25 +00:00
|
|
|
_startup_libs: ${_startup_libs:S/$/__L/}
|
|
|
|
_prebuild_libs: ${_prebuild_libs:S/$/__L/}
|
|
|
|
_generic_libs: ${_generic_libs:S/$/__L/}
|
|
|
|
|
bsd.subdir.mk: Only recurse on called targets, rather than dependencies.
This is to fix 'make all' causing it to recurse on both 'all' and 'buildconfig'
due to 'buildconfig' being in ALL_SUBDIR_TARGETS and being a dependency of
'all'.
This now adds all of the '*includes', '*files' targets as subdir targets,
allowing them to recurse.
This also removes the need for some 'realinstall' hacks in bsd.subdir.mk since
it no longer recurses; only 'install' will recurse and call the proper
'beforeinstall', 'realinstall', and 'afterinstall' in each sub-directory.
This fixes 'make includes' and 'make files' to not be a rerolled ${MAKE}
sub-shell but to rather just recurse on 'inclues' and 'files'. This avoids
various issues such as the one fixed in r289462. As such revert Makefile.inc1
back to using 'includes' which avoids an extra tree walk and parallelizes
the includes phases better.
Makefile.inc1 includes a guard so that 'make all' will not use SUBDIR_PARALLEL,
added in r289438. This is so users do not get a probably broken build if they
run 'make all' from the top-level. Before the change in this commit, the
workaround for 'make everything' was 'par-all' which would depend on 'all' and
cause a proper parallel recursion. Now that will not work so a new
_PARALLEL_SUBUDIR_OK is used to allow it.
This is still part of an effort to combine bsd.(files|incs|confs).mk and move
some of its logic out of bsd.subdir.mk, as attempted in r289282 and reverted in
r289331. This commit fixes the problems found there which was mostly double
recursing during 'includes' which would recurse on itself and 'buildincludes'
and 'installincludes', all in parallel. The logic is still in bsd.subdir.mk
for now.
I've been cautious about this commit but have experienced no breakage on the
tree except for the 'par-all' case which was already a hack. If something foo
is depending on something bar that should recurse, it is very likely that the
foo target is being recursed on already meaning that bar will still effectively
recurse once sub-directories call foo.
Discussed on: arch@
MFC after: never
Sponsored by: EMC / Isilon Storage Division
2015-12-02 01:50:22 +00:00
|
|
|
# Enable SUBDIR_PARALLEL when not calling 'make all', unless called from
|
2015-12-07 18:45:55 +00:00
|
|
|
# 'everything' with _PARALLEL_SUBDIR_OK set. This is because it is unlikely
|
bsd.subdir.mk: Only recurse on called targets, rather than dependencies.
This is to fix 'make all' causing it to recurse on both 'all' and 'buildconfig'
due to 'buildconfig' being in ALL_SUBDIR_TARGETS and being a dependency of
'all'.
This now adds all of the '*includes', '*files' targets as subdir targets,
allowing them to recurse.
This also removes the need for some 'realinstall' hacks in bsd.subdir.mk since
it no longer recurses; only 'install' will recurse and call the proper
'beforeinstall', 'realinstall', and 'afterinstall' in each sub-directory.
This fixes 'make includes' and 'make files' to not be a rerolled ${MAKE}
sub-shell but to rather just recurse on 'inclues' and 'files'. This avoids
various issues such as the one fixed in r289462. As such revert Makefile.inc1
back to using 'includes' which avoids an extra tree walk and parallelizes
the includes phases better.
Makefile.inc1 includes a guard so that 'make all' will not use SUBDIR_PARALLEL,
added in r289438. This is so users do not get a probably broken build if they
run 'make all' from the top-level. Before the change in this commit, the
workaround for 'make everything' was 'par-all' which would depend on 'all' and
cause a proper parallel recursion. Now that will not work so a new
_PARALLEL_SUBUDIR_OK is used to allow it.
This is still part of an effort to combine bsd.(files|incs|confs).mk and move
some of its logic out of bsd.subdir.mk, as attempted in r289282 and reverted in
r289331. This commit fixes the problems found there which was mostly double
recursing during 'includes' which would recurse on itself and 'buildincludes'
and 'installincludes', all in parallel. The logic is still in bsd.subdir.mk
for now.
I've been cautious about this commit but have experienced no breakage on the
tree except for the 'par-all' case which was already a hack. If something foo
is depending on something bar that should recurse, it is very likely that the
foo target is being recursed on already meaning that bar will still effectively
recurse once sub-directories call foo.
Discussed on: arch@
MFC after: never
Sponsored by: EMC / Isilon Storage Division
2015-12-02 01:50:22 +00:00
|
|
|
# that running 'make all' from the top-level, especially with a SUBDIR_OVERRIDE
|
|
|
|
# or LOCAL_DIRS set, will have a reliable build if SUBDIRs are built in
|
|
|
|
# parallel. This is safe for the world stage of buildworld though since it has
|
|
|
|
# already built libraries in a proper order and installed includes into
|
|
|
|
# WORLDTMP. Special handling is done for SUBDIR ordering for 'install*' to
|
|
|
|
# avoid trashing a system if it crashes mid-install.
|
2015-12-07 18:45:55 +00:00
|
|
|
.if !make(all) || defined(_PARALLEL_SUBDIR_OK)
|
2015-10-17 03:51:50 +00:00
|
|
|
SUBDIR_PARALLEL=
|
|
|
|
.endif
|
1998-08-31 01:08:08 +00:00
|
|
|
|
|
|
|
.include <bsd.subdir.mk>
|
2005-07-23 14:23:30 +00:00
|
|
|
|
2007-05-16 08:46:35 +00:00
|
|
|
.if make(check-old) || make(check-old-dirs) || \
|
|
|
|
make(check-old-files) || make(check-old-libs) || \
|
|
|
|
make(delete-old) || make(delete-old-dirs) || \
|
|
|
|
make(delete-old-files) || make(delete-old-libs)
|
2005-07-30 18:02:20 +00:00
|
|
|
|
2005-07-23 14:23:30 +00:00
|
|
|
#
|
|
|
|
# check for / delete old files section
|
|
|
|
#
|
|
|
|
|
|
|
|
.include "ObsoleteFiles.inc"
|
|
|
|
|
|
|
|
OLD_LIBS_MESSAGE="Please be sure no application still uses those libraries, \
|
|
|
|
else you can not start such an application. Consult UPDATING for more \
|
|
|
|
information regarding how to cope with the removal/revision bump of a \
|
|
|
|
specific library."
|
|
|
|
|
|
|
|
.if !defined(BATCH_DELETE_OLD_FILES)
|
|
|
|
RM_I=-i
|
2005-07-30 18:02:20 +00:00
|
|
|
.else
|
|
|
|
RM_I=-v
|
2005-07-23 14:23:30 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
delete-old-files:
|
|
|
|
@echo ">>> Removing old files (only deletes safe to delete libs)"
|
|
|
|
# Ask for every old file if the user really wants to remove it.
|
2005-08-23 07:58:55 +00:00
|
|
|
# It's annoying, but better safe than sorry.
|
2011-04-01 20:59:23 +00:00
|
|
|
# NB: We cannot pass the list of OLD_FILES as a parameter because the
|
|
|
|
# argument list will get too long. Using .for/.endfor make "loops" will make
|
|
|
|
# the Makefile parser segfault.
|
|
|
|
@exec 3<&0; \
|
2013-10-29 17:46:26 +00:00
|
|
|
cd ${.CURDIR}; \
|
2011-04-01 20:59:23 +00:00
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
2013-10-01 22:53:27 +00:00
|
|
|
-V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \
|
2011-04-01 20:59:23 +00:00
|
|
|
while read file; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
2007-05-19 20:34:29 +00:00
|
|
|
chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
|
2011-04-01 20:59:23 +00:00
|
|
|
rm ${RM_I} "${DESTDIR}/$${file}" <&3; \
|
2006-02-18 16:58:21 +00:00
|
|
|
fi; \
|
2015-10-16 04:07:27 +00:00
|
|
|
for ext in debug symbols; do \
|
|
|
|
if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \
|
|
|
|
"${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
|
|
|
|
rm ${RM_I} "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" \
|
|
|
|
<&3; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
2007-05-16 20:16:06 +00:00
|
|
|
done
|
2005-08-07 13:47:25 +00:00
|
|
|
# Remove catpages without corresponding manpages.
|
2010-01-14 23:27:23 +00:00
|
|
|
@exec 3<&0; \
|
2005-11-12 19:31:30 +00:00
|
|
|
find ${DESTDIR}/usr/share/man/cat* ! -type d | \
|
|
|
|
sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
|
|
|
|
while read catpage; do \
|
|
|
|
read manpage; \
|
|
|
|
if [ ! -e "$${manpage}" ]; then \
|
2011-04-01 20:59:23 +00:00
|
|
|
rm ${RM_I} $${catpage} <&3; \
|
2005-11-12 19:31:30 +00:00
|
|
|
fi; \
|
2005-08-07 13:47:25 +00:00
|
|
|
done
|
2005-07-23 14:23:30 +00:00
|
|
|
@echo ">>> Old files removed"
|
|
|
|
|
|
|
|
check-old-files:
|
|
|
|
@echo ">>> Checking for old files"
|
2013-10-29 17:46:26 +00:00
|
|
|
@cd ${.CURDIR}; \
|
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
2011-04-01 20:59:23 +00:00
|
|
|
-V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \
|
|
|
|
while read file; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
2007-05-13 18:15:50 +00:00
|
|
|
echo "${DESTDIR}/$${file}"; \
|
|
|
|
fi; \
|
2015-10-16 04:07:27 +00:00
|
|
|
for ext in debug symbols; do \
|
|
|
|
if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
|
|
|
|
echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
2007-05-16 20:16:06 +00:00
|
|
|
done
|
2005-08-07 13:47:25 +00:00
|
|
|
# Check for catpages without corresponding manpages.
|
2005-11-12 19:31:30 +00:00
|
|
|
@find ${DESTDIR}/usr/share/man/cat* ! -type d | \
|
|
|
|
sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
|
|
|
|
while read catpage; do \
|
|
|
|
read manpage; \
|
|
|
|
if [ ! -e "$${manpage}" ]; then \
|
2011-04-01 20:59:23 +00:00
|
|
|
echo $${catpage}; \
|
2005-11-12 19:31:30 +00:00
|
|
|
fi; \
|
2005-08-07 13:47:25 +00:00
|
|
|
done
|
2005-07-23 14:23:30 +00:00
|
|
|
|
|
|
|
delete-old-libs:
|
|
|
|
@echo ">>> Removing old libraries"
|
|
|
|
@echo "${OLD_LIBS_MESSAGE}" | fmt
|
2011-04-01 20:59:23 +00:00
|
|
|
@exec 3<&0; \
|
2013-10-29 17:46:26 +00:00
|
|
|
cd ${.CURDIR}; \
|
2011-04-01 20:59:23 +00:00
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
|
|
|
-V OLD_LIBS | xargs -n1 | \
|
|
|
|
while read file; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
2007-05-19 20:34:29 +00:00
|
|
|
chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
|
2011-04-01 20:59:23 +00:00
|
|
|
rm ${RM_I} "${DESTDIR}/$${file}" <&3; \
|
2006-02-18 16:58:21 +00:00
|
|
|
fi; \
|
2013-10-21 10:09:48 +00:00
|
|
|
for ext in debug symbols; do \
|
|
|
|
if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \
|
|
|
|
"${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
|
|
|
|
rm ${RM_I} "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" \
|
|
|
|
<&3; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
2007-05-16 20:16:06 +00:00
|
|
|
done
|
2005-07-23 14:23:30 +00:00
|
|
|
@echo ">>> Old libraries removed"
|
|
|
|
|
|
|
|
check-old-libs:
|
|
|
|
@echo ">>> Checking for old libraries"
|
2013-10-29 17:46:26 +00:00
|
|
|
@cd ${.CURDIR}; \
|
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
2011-04-01 20:59:23 +00:00
|
|
|
-V OLD_LIBS | xargs -n1 | \
|
|
|
|
while read file; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
2007-05-13 18:15:50 +00:00
|
|
|
echo "${DESTDIR}/$${file}"; \
|
|
|
|
fi; \
|
2013-10-21 10:09:48 +00:00
|
|
|
for ext in debug symbols; do \
|
|
|
|
if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
|
|
|
|
echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
2007-05-16 20:16:06 +00:00
|
|
|
done
|
2005-07-23 14:23:30 +00:00
|
|
|
|
|
|
|
delete-old-dirs:
|
|
|
|
@echo ">>> Removing old directories"
|
2013-10-29 17:46:26 +00:00
|
|
|
@cd ${.CURDIR}; \
|
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
2013-10-01 22:53:27 +00:00
|
|
|
-V OLD_DIRS | xargs -n1 | sort -r | \
|
2011-04-01 20:59:23 +00:00
|
|
|
while read dir; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -d "${DESTDIR}/$${dir}" ]; then \
|
|
|
|
rmdir -v "${DESTDIR}/$${dir}" || true; \
|
|
|
|
elif [ -L "${DESTDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
|
2006-02-18 16:58:21 +00:00
|
|
|
fi; \
|
2007-05-16 20:16:06 +00:00
|
|
|
done
|
2005-07-23 14:23:30 +00:00
|
|
|
@echo ">>> Old directories removed"
|
|
|
|
|
|
|
|
check-old-dirs:
|
|
|
|
@echo ">>> Checking for old directories"
|
2013-10-29 17:46:26 +00:00
|
|
|
@cd ${.CURDIR}; \
|
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
2011-04-01 20:59:23 +00:00
|
|
|
-V OLD_DIRS | xargs -n1 | \
|
|
|
|
while read dir; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -d "${DESTDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}/$${dir}"; \
|
|
|
|
elif [ -L "${DESTDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
|
2006-02-18 16:58:21 +00:00
|
|
|
fi; \
|
2007-05-16 20:16:06 +00:00
|
|
|
done
|
2005-07-23 14:23:30 +00:00
|
|
|
|
|
|
|
delete-old: delete-old-files delete-old-dirs
|
|
|
|
@echo "To remove old libraries run '${MAKE} delete-old-libs'."
|
|
|
|
|
|
|
|
check-old: check-old-files check-old-libs check-old-dirs
|
|
|
|
@echo "To remove old files and directories run '${MAKE} delete-old'."
|
|
|
|
@echo "To remove old libraries run '${MAKE} delete-old-libs'."
|
|
|
|
|
2005-07-30 18:02:20 +00:00
|
|
|
.endif
|
|
|
|
|
2006-03-18 14:30:23 +00:00
|
|
|
#
|
|
|
|
# showconfig - show build configuration.
|
|
|
|
#
|
|
|
|
showconfig:
|
2014-10-21 20:29:51 +00:00
|
|
|
@(${MAKE} -n -f ${.CURDIR}/sys/conf/kern.opts.mk -V dummy -dg1; \
|
|
|
|
${MAKE} -n -f ${.CURDIR}/share/mk/src.opts.mk -V dummy -dg1) 2>&1 | grep ^MK_ | sort -u
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2011-02-11 02:37:47 +00:00
|
|
|
.if !empty(KRNLOBJDIR) && !empty(KERNCONF)
|
|
|
|
DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/
|
|
|
|
|
|
|
|
.if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE)
|
|
|
|
.if exists(${KERNCONFDIR}/${KERNCONF})
|
|
|
|
FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ {print $$2}' \
|
2014-05-03 09:24:20 +00:00
|
|
|
'${KERNCONFDIR}/${KERNCONF}' ; echo
|
2011-02-11 02:37:47 +00:00
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !defined(DTBOUTPUTPATH) || !exists(${DTBOUTPUTPATH})
|
|
|
|
DTBOUTPUTPATH= ${.CURDIR}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build 'standalone' Device Tree Blob
|
|
|
|
#
|
|
|
|
builddtb:
|
2014-04-30 18:02:04 +00:00
|
|
|
@PATH=${TMPPATH} MACHINE=${TARGET} \
|
2014-02-28 18:29:09 +00:00
|
|
|
${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \
|
2014-04-30 18:02:04 +00:00
|
|
|
"${FDT_DTS_FILE}" ${DTBOUTPUTPATH}
|
2009-03-13 07:23:58 +00:00
|
|
|
|
|
|
|
###############
|
|
|
|
|
2015-11-09 23:36:46 +00:00
|
|
|
# cleanworld
|
|
|
|
# In the following, the first 'rm' in a series will usually remove all
|
|
|
|
# files and directories. If it does not, then there are probably some
|
|
|
|
# files with file flags set, so this unsets them and tries the 'rm' a
|
|
|
|
# second time. There are situations where this target will be cleaning
|
|
|
|
# some directories via more than one method, but that duplication is
|
|
|
|
# needed to correctly handle all the possible situations. Removing all
|
|
|
|
# files without file flags set in the first 'rm' instance saves time,
|
|
|
|
# because 'chflags' will need to operate on fewer files afterwards.
|
|
|
|
#
|
|
|
|
# It is expected that BW_CANONICALOBJDIR == the CANONICALOBJDIR as would be
|
|
|
|
# created by bsd.obj.mk, except that we don't want to .include that file
|
|
|
|
# in this makefile.
|
|
|
|
#
|
2015-11-09 23:36:57 +00:00
|
|
|
BW_CANONICALOBJDIR:=${OBJTREE}${.CURDIR}
|
2015-11-09 23:36:46 +00:00
|
|
|
cleanworld: .PHONY
|
|
|
|
.if exists(${BW_CANONICALOBJDIR}/)
|
|
|
|
-rm -rf ${BW_CANONICALOBJDIR}/*
|
|
|
|
-chflags -R 0 ${BW_CANONICALOBJDIR}
|
|
|
|
rm -rf ${BW_CANONICALOBJDIR}/*
|
|
|
|
.endif
|
2015-11-09 23:36:57 +00:00
|
|
|
.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR}
|
2015-11-09 23:36:46 +00:00
|
|
|
# To be safe in this case, fall back to a 'make cleandir'
|
|
|
|
${_+_}@cd ${.CURDIR}; ${MAKE} cleandir
|
|
|
|
.endif
|
|
|
|
|
2014-07-23 22:18:43 +00:00
|
|
|
.if defined(TARGET) && defined(TARGET_ARCH)
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2014-07-23 22:18:43 +00:00
|
|
|
.if ${TARGET} == ${MACHINE} && ${TARGET_ARCH} == ${MACHINE_ARCH}
|
2011-02-11 02:37:47 +00:00
|
|
|
XDEV_CPUTYPE?=${CPUTYPE}
|
|
|
|
.else
|
|
|
|
XDEV_CPUTYPE?=${TARGET_CPUTYPE}
|
|
|
|
.endif
|
|
|
|
|
2015-01-02 18:45:03 +00:00
|
|
|
NOFUN=-DNO_FSCHG MK_HTML=no -DNO_LINT \
|
2014-04-25 19:25:26 +00:00
|
|
|
MK_MAN=no MK_NLS=no MK_PROFILE=no \
|
2014-05-10 16:37:53 +00:00
|
|
|
MK_KERBEROS=no MK_RESCUE=no MK_TESTS=no MK_WARNS=no \
|
2014-07-23 22:18:43 +00:00
|
|
|
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
|
2011-02-11 02:37:47 +00:00
|
|
|
CPUTYPE=${XDEV_CPUTYPE}
|
2011-02-11 04:03:39 +00:00
|
|
|
|
2014-07-23 22:18:43 +00:00
|
|
|
XDDIR=${TARGET_ARCH}-freebsd
|
2014-04-04 17:58:33 +00:00
|
|
|
XDTP?=/usr/${XDDIR}
|
|
|
|
.if ${XDTP:N/*}
|
|
|
|
.error XDTP variable should be an absolute path
|
|
|
|
.endif
|
|
|
|
|
2013-02-04 09:34:25 +00:00
|
|
|
CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \
|
|
|
|
INSTALL="sh ${.CURDIR}/tools/install.sh"
|
2009-03-13 07:23:58 +00:00
|
|
|
CDENV= ${CDBENV} \
|
2014-04-03 07:28:36 +00:00
|
|
|
TOOLS_PREFIX=${XDTP}
|
2013-03-31 08:54:04 +00:00
|
|
|
CD2CFLAGS=-isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib \
|
2014-04-03 07:28:36 +00:00
|
|
|
--sysroot=${XDDESTDIR}/ -B${XDDESTDIR}/usr/libexec \
|
|
|
|
-B${XDDESTDIR}/usr/bin -B${XDDESTDIR}/usr/lib
|
|
|
|
CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CFLAGS}" \
|
|
|
|
CPP="${CPP} ${CD2CFLAGS}" \
|
2014-07-23 22:18:43 +00:00
|
|
|
MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH}
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2013-03-31 08:31:06 +00:00
|
|
|
CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp
|
|
|
|
CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN}
|
2013-10-16 16:46:25 +00:00
|
|
|
CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} ${NOFUN}
|
2014-04-03 22:22:10 +00:00
|
|
|
XDDESTDIR=${DESTDIR}/${XDTP}
|
2009-03-15 23:52:13 +00:00
|
|
|
.if !defined(OSREL)
|
|
|
|
OSREL!= uname -r | sed -e 's/[-(].*//'
|
|
|
|
.endif
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2014-07-10 18:28:12 +00:00
|
|
|
.ORDER: xdev-build xdev-install xdev-links
|
2009-03-13 07:23:58 +00:00
|
|
|
xdev: xdev-build xdev-install
|
|
|
|
|
2013-03-31 08:31:06 +00:00
|
|
|
.ORDER: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools
|
|
|
|
xdev-build: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools
|
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
_xb-worldtmp: .PHONY
|
2013-03-31 08:31:06 +00:00
|
|
|
mkdir -p ${CDTMP}/usr
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${CDTMP}/usr >/dev/null
|
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
_xb-bootstrap-tools: .PHONY
|
2013-03-31 08:31:06 +00:00
|
|
|
.for _tool in \
|
2014-12-08 09:09:50 +00:00
|
|
|
${_clang_tblgen} \
|
|
|
|
${_gperf}
|
2013-03-31 08:31:06 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ obj; \
|
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ depend; \
|
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ all; \
|
2013-03-31 08:31:06 +00:00
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install
|
|
|
|
.endfor
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
_xb-build-tools: .PHONY
|
2011-02-11 04:03:39 +00:00
|
|
|
${_+_}@cd ${.CURDIR}; \
|
2009-03-13 07:23:58 +00:00
|
|
|
${CDBENV} ${MAKE} -f Makefile.inc1 ${NOFUN} build-tools
|
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
_xb-cross-tools: .PHONY
|
2009-03-13 07:23:58 +00:00
|
|
|
.for _tool in \
|
2014-04-01 06:46:59 +00:00
|
|
|
${_binutils} \
|
2014-12-01 17:49:42 +00:00
|
|
|
${_elftctools} \
|
2013-03-31 08:31:06 +00:00
|
|
|
usr.bin/ar \
|
|
|
|
${_clang_libs} \
|
2014-04-01 06:46:59 +00:00
|
|
|
${_clang} \
|
|
|
|
${_cc}
|
2009-03-13 07:23:58 +00:00
|
|
|
${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \
|
2015-12-01 19:00:43 +00:00
|
|
|
cd ${.CURDIR}/${_tool}; \
|
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ obj; \
|
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ depend; \
|
2009-03-13 07:23:58 +00:00
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ all
|
|
|
|
.endfor
|
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
_xi-mtree: .PHONY
|
2009-03-13 07:23:58 +00:00
|
|
|
${_+_}@${ECHODIR} "mtree populating ${XDDESTDIR}"
|
|
|
|
mkdir -p ${XDDESTDIR}
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \
|
|
|
|
-p ${XDDESTDIR} >/dev/null
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${XDDESTDIR}/usr >/dev/null
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
|
|
|
-p ${XDDESTDIR}/usr/include >/dev/null
|
2015-10-20 20:35:34 +00:00
|
|
|
.if ${MK_LIB32} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
|
|
|
|
-p ${XDDESTDIR}/usr >/dev/null
|
|
|
|
.endif
|
2014-07-21 21:26:10 +00:00
|
|
|
.if ${MK_TESTS} != "no"
|
2014-12-18 18:16:00 +00:00
|
|
|
mkdir -p ${XDDESTDIR}${TESTSBASE}
|
2014-07-21 21:26:10 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
|
2014-12-18 18:16:00 +00:00
|
|
|
-p ${XDDESTDIR}${TESTSBASE} >/dev/null
|
2014-07-21 21:26:10 +00:00
|
|
|
.endif
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2014-07-10 18:28:12 +00:00
|
|
|
.ORDER: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries
|
|
|
|
xdev-install: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
_xi-cross-tools: .PHONY
|
2009-03-13 07:23:58 +00:00
|
|
|
@echo "_xi-cross-tools"
|
|
|
|
.for _tool in \
|
2014-04-01 06:46:59 +00:00
|
|
|
${_binutils} \
|
2014-12-01 17:49:42 +00:00
|
|
|
${_elftctools} \
|
2013-03-31 08:31:06 +00:00
|
|
|
usr.bin/ar \
|
2014-04-01 06:46:59 +00:00
|
|
|
${_clang_libs} \
|
|
|
|
${_clang} \
|
|
|
|
${_cc}
|
2009-03-13 07:23:58 +00:00
|
|
|
${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \
|
|
|
|
cd ${.CURDIR}/${_tool}; \
|
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR}
|
|
|
|
.endfor
|
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
_xi-includes: .PHONY
|
bsd.subdir.mk: Only recurse on called targets, rather than dependencies.
This is to fix 'make all' causing it to recurse on both 'all' and 'buildconfig'
due to 'buildconfig' being in ALL_SUBDIR_TARGETS and being a dependency of
'all'.
This now adds all of the '*includes', '*files' targets as subdir targets,
allowing them to recurse.
This also removes the need for some 'realinstall' hacks in bsd.subdir.mk since
it no longer recurses; only 'install' will recurse and call the proper
'beforeinstall', 'realinstall', and 'afterinstall' in each sub-directory.
This fixes 'make includes' and 'make files' to not be a rerolled ${MAKE}
sub-shell but to rather just recurse on 'inclues' and 'files'. This avoids
various issues such as the one fixed in r289462. As such revert Makefile.inc1
back to using 'includes' which avoids an extra tree walk and parallelizes
the includes phases better.
Makefile.inc1 includes a guard so that 'make all' will not use SUBDIR_PARALLEL,
added in r289438. This is so users do not get a probably broken build if they
run 'make all' from the top-level. Before the change in this commit, the
workaround for 'make everything' was 'par-all' which would depend on 'all' and
cause a proper parallel recursion. Now that will not work so a new
_PARALLEL_SUBUDIR_OK is used to allow it.
This is still part of an effort to combine bsd.(files|incs|confs).mk and move
some of its logic out of bsd.subdir.mk, as attempted in r289282 and reverted in
r289331. This commit fixes the problems found there which was mostly double
recursing during 'includes' which would recurse on itself and 'buildincludes'
and 'installincludes', all in parallel. The logic is still in bsd.subdir.mk
for now.
I've been cautious about this commit but have experienced no breakage on the
tree except for the 'par-all' case which was already a hack. If something foo
is depending on something bar that should recurse, it is very likely that the
foo target is being recursed on already meaning that bar will still effectively
recurse once sub-directories call foo.
Discussed on: arch@
MFC after: never
Sponsored by: EMC / Isilon Storage Division
2015-12-02 01:50:22 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 includes \
|
2009-03-13 07:23:58 +00:00
|
|
|
DESTDIR=${XDDESTDIR}
|
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
_xi-libraries: .PHONY
|
2009-03-13 07:23:58 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 libraries \
|
|
|
|
DESTDIR=${XDDESTDIR}
|
|
|
|
|
2015-10-21 05:33:48 +00:00
|
|
|
xdev-links: .PHONY
|
2009-03-13 07:23:58 +00:00
|
|
|
${_+_}cd ${XDDESTDIR}/usr/bin; \
|
2014-07-10 18:28:12 +00:00
|
|
|
mkdir -p ../../../../usr/bin; \
|
2009-03-13 07:23:58 +00:00
|
|
|
for i in *; do \
|
|
|
|
ln -sf ../../${XDTP}/usr/bin/$$i \
|
|
|
|
../../../../usr/bin/${XDDIR}-$$i; \
|
|
|
|
ln -sf ../../${XDTP}/usr/bin/$$i \
|
|
|
|
../../../../usr/bin/${XDDIR}${OSREL}-$$i; \
|
|
|
|
done
|
2011-11-26 00:30:39 +00:00
|
|
|
.else
|
2014-07-10 18:28:12 +00:00
|
|
|
xdev xdev-build xdev-install xdev-links:
|
2014-07-23 22:18:43 +00:00
|
|
|
@echo "*** Error: Both TARGET and TARGET_ARCH must be defined for \"${.TARGET}\" target"
|
2009-03-13 07:23:58 +00:00
|
|
|
.endif
|