2015-07-23 11:03:24 +03:00
|
|
|
# $NetBSD: Makefile,v 1.316 2015/07/23 08:03:25 mrg Exp $
|
1999-04-01 06:49:12 +04:00
|
|
|
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
1999-04-01 06:49:12 +04:00
|
|
|
# This is the top-level makefile for building NetBSD. For an outline of
|
|
|
|
# how to build a snapshot or release, as well as other release engineering
|
2003-07-26 21:06:22 +04:00
|
|
|
# information, see http://www.NetBSD.org/developers/releng/index.html
|
1999-04-01 06:49:12 +04:00
|
|
|
#
|
|
|
|
# Not everything you can set or do is documented in this makefile. In
|
|
|
|
# particular, you should review the files in /usr/share/mk (especially
|
|
|
|
# bsd.README) for general information on building programs and writing
|
|
|
|
# Makefiles within this structure, and see the comments in src/etc/Makefile
|
|
|
|
# for further information on installation and release set options.
|
|
|
|
#
|
|
|
|
# Variables listed below can be set on the make command line (highest
|
|
|
|
# priority), in /etc/mk.conf (middle priority), or in the environment
|
|
|
|
# (lowest priority).
|
|
|
|
#
|
|
|
|
# Variables:
|
1999-11-30 20:48:11 +03:00
|
|
|
# DESTDIR is the target directory for installation of the compiled
|
|
|
|
# software. It defaults to /. Note that programs are built against
|
|
|
|
# libraries installed in DESTDIR.
|
2003-07-18 12:26:01 +04:00
|
|
|
# MKMAN, if `no', will prevent building of manual pages.
|
|
|
|
# MKOBJDIRS, if not `no', will build object directories at
|
1999-11-30 20:48:11 +03:00
|
|
|
# an appropriate point in a build.
|
2003-07-18 12:26:01 +04:00
|
|
|
# MKSHARE, if `no', will prevent building and installing
|
1999-04-01 06:49:12 +04:00
|
|
|
# anything in /usr/share.
|
2003-07-18 12:26:01 +04:00
|
|
|
# MKUPDATE, if not `no', will avoid a `make cleandir' at the start of
|
2002-06-20 12:21:59 +04:00
|
|
|
# `make build', as well as having the effects listed in
|
|
|
|
# /usr/share/mk/bsd.README.
|
2001-06-10 17:15:29 +04:00
|
|
|
# NOCLEANDIR, if defined, will avoid a `make cleandir' at the start
|
2002-06-20 12:21:59 +04:00
|
|
|
# of the `make build'.
|
2000-08-05 14:17:35 +04:00
|
|
|
# NOINCLUDES will avoid the `make includes' usually done by `make build'.
|
1999-04-01 06:49:12 +04:00
|
|
|
#
|
2003-07-18 12:26:01 +04:00
|
|
|
# See mk.conf(5) for more details.
|
|
|
|
#
|
|
|
|
#
|
1999-04-01 06:49:12 +04:00
|
|
|
# Targets:
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
# build:
|
2003-01-03 18:34:30 +03:00
|
|
|
# Builds a full release of NetBSD in DESTDIR, except for the
|
|
|
|
# /etc configuration files.
|
|
|
|
# If BUILD_DONE is set, this is an empty target.
|
|
|
|
# distribution:
|
|
|
|
# Builds a full release of NetBSD in DESTDIR, including the /etc
|
|
|
|
# configuration files.
|
|
|
|
# buildworld:
|
|
|
|
# As per `make distribution', except that it ensures that DESTDIR
|
|
|
|
# is not the root directory.
|
|
|
|
# installworld:
|
|
|
|
# Install the distribution from DESTDIR to INSTALLWORLDDIR (which
|
|
|
|
# defaults to the root directory). Ensures that INSTALLWORLDDIR
|
2012-01-24 21:37:34 +04:00
|
|
|
# is not the root directory if cross compiling.
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
# release:
|
2005-08-25 06:04:39 +04:00
|
|
|
# Does a `make distribution', and then tars up the DESTDIR files
|
2008-03-18 07:24:38 +03:00
|
|
|
# into ${RELEASEDIR}/${RELEASEMACHINEDIR}, in release(7) format.
|
2003-01-03 18:34:30 +03:00
|
|
|
# (See etc/Makefile for more information on this.)
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
# regression-tests:
|
|
|
|
# Runs the regression tests in "regress" on this host.
|
2003-05-10 11:12:37 +04:00
|
|
|
# sets:
|
2008-03-18 07:24:38 +03:00
|
|
|
# Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets
|
|
|
|
# from ${DESTDIR}
|
2003-05-10 11:12:37 +04:00
|
|
|
# sourcesets:
|
|
|
|
# Populate ${RELEASEDIR}/source/sets from ${NETBSDSRCDIR}
|
2006-01-04 18:30:02 +03:00
|
|
|
# syspkgs:
|
2008-03-18 07:24:38 +03:00
|
|
|
# Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/syspkgs
|
|
|
|
# from ${DESTDIR}
|
2006-01-29 00:34:07 +03:00
|
|
|
# iso-image:
|
2014-11-05 11:19:17 +03:00
|
|
|
# Create CD-ROM image in RELEASEDIR/images.
|
2006-01-29 00:34:07 +03:00
|
|
|
# RELEASEDIR must already have been populated by `make release'
|
|
|
|
# or equivalent.
|
2007-08-30 09:30:02 +04:00
|
|
|
# iso-image-source:
|
2014-11-05 11:19:17 +03:00
|
|
|
# Create CD-ROM image with source in RELEASEDIR/images.
|
2007-08-30 09:30:02 +04:00
|
|
|
# RELEASEDIR must already have been populated by
|
|
|
|
# `make release sourcesets' or equivalent.
|
2012-01-22 07:53:29 +04:00
|
|
|
# live-image:
|
|
|
|
# Create bootable live image for emulators or USB stick etc.
|
|
|
|
# in RELEASEDIR/liveimage.
|
|
|
|
# RELEASEDIR must already have been populated by `make release'
|
|
|
|
# or equivalent.
|
|
|
|
# install-image:
|
|
|
|
# Create bootable installation image for USB stick etc.
|
|
|
|
# in RELEASEDIR/installimage.
|
|
|
|
# RELEASEDIR must already have been populated by `make release'
|
|
|
|
# or equivalent.
|
2001-06-10 17:02:54 +04:00
|
|
|
#
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
# Targets invoked by `make build,' in order:
|
|
|
|
# cleandir: cleans the tree.
|
2008-10-25 19:03:44 +04:00
|
|
|
# do-top-obj: creates the top level object directory.
|
2008-10-22 21:37:16 +04:00
|
|
|
# do-tools-obj: creates object directories for the host toolchain.
|
2001-11-13 02:16:17 +03:00
|
|
|
# do-tools: builds host toolchain.
|
2012-11-04 15:02:11 +04:00
|
|
|
# params: record the values of variables that might affect the
|
|
|
|
# build.
|
2008-10-22 21:37:16 +04:00
|
|
|
# obj: creates object directories.
|
2001-09-22 16:30:13 +04:00
|
|
|
# do-distrib-dirs: creates the distribution directories.
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
# includes: installs include files.
|
2012-08-17 20:22:27 +04:00
|
|
|
# do-lib: builds and installs prerequisites from lib
|
2008-10-28 01:32:51 +03:00
|
|
|
# if ${MKCOMPAT} != "no".
|
2012-08-17 20:22:27 +04:00
|
|
|
# do-compat-lib: builds and installs prerequisites from compat/lib
|
2008-10-28 01:32:51 +03:00
|
|
|
# if ${MKCOMPAT} != "no".
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
# do-build: builds and installs the entire system.
|
2008-11-10 02:02:28 +03:00
|
|
|
# do-x11: builds and installs X11 if ${MKX11} != "no"; either
|
2015-07-23 11:03:24 +03:00
|
|
|
# X11R7 from src/external/mit/xorg
|
2009-11-30 19:13:22 +03:00
|
|
|
# do-extsrc: builds and installs extsrc if ${MKEXTSRC} != "no".
|
2003-12-06 01:33:01 +03:00
|
|
|
# do-obsolete: installs the obsolete sets (for the postinstall-* targets).
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
1996-04-13 10:36:15 +04:00
|
|
|
|
2001-10-31 04:20:09 +03:00
|
|
|
.if ${.MAKEFLAGS:M${.CURDIR}/share/mk} == ""
|
|
|
|
.MAKEFLAGS: -m ${.CURDIR}/share/mk
|
|
|
|
.endif
|
|
|
|
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
2002-02-28 05:22:59 +03:00
|
|
|
# If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may
|
|
|
|
# not be the top level objdir, because "make obj" can happen in the *middle*
|
|
|
|
# of "make build" (long after <bsd.own.mk> is calculated it). So, pre-set
|
|
|
|
# _SRC_TOP_OBJ_ here so it will not be added to ${.MAKEOVERRIDES}.
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
2002-02-28 05:22:59 +03:00
|
|
|
_SRC_TOP_OBJ_=
|
|
|
|
|
2001-10-31 04:20:09 +03:00
|
|
|
.include <bsd.own.mk>
|
1993-03-22 11:43:59 +03:00
|
|
|
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
# Sanity check: make sure that "make build" is not invoked simultaneously
|
|
|
|
# with a standard recursive target.
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
1998-07-24 20:48:47 +04:00
|
|
|
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
.if make(build) || make(release) || make(snapshot)
|
|
|
|
.for targ in ${TARGETS:Nobj:Ncleandir}
|
|
|
|
.if make(${targ}) && !target(.BEGIN)
|
|
|
|
.BEGIN:
|
|
|
|
@echo 'BUILD ABORTED: "make build" and "make ${targ}" are mutually exclusive.'
|
|
|
|
@false
|
|
|
|
.endif
|
|
|
|
.endfor
|
1998-12-22 14:21:09 +03:00
|
|
|
.endif
|
|
|
|
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
2008-10-25 19:03:44 +04:00
|
|
|
# _SUBDIR is used to set SUBDIR, after removing directories that have
|
|
|
|
# BUILD_${dir}=no, or that have no ${dir}/Makefile.
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
2009-06-08 02:46:12 +04:00
|
|
|
_SUBDIR= tools lib include gnu external crypto/external bin games
|
|
|
|
_SUBDIR+= libexec sbin usr.bin
|
2013-07-16 13:52:21 +04:00
|
|
|
_SUBDIR+= usr.sbin share sys etc tests compat
|
|
|
|
_SUBDIR+= .WAIT rescue .WAIT distrib regress
|
2000-02-01 04:22:05 +03:00
|
|
|
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
.for dir in ${_SUBDIR}
|
2008-10-25 19:03:44 +04:00
|
|
|
.if "${dir}" == ".WAIT" \
|
|
|
|
|| (${BUILD_${dir}:Uyes} != "no" && exists(${dir}/Makefile))
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
SUBDIR+= ${dir}
|
1996-08-11 03:29:00 +04:00
|
|
|
.endif
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
.endfor
|
1993-07-04 18:02:11 +04:00
|
|
|
|
1993-07-07 16:55:48 +04:00
|
|
|
.if exists(regress)
|
2006-01-21 22:01:15 +03:00
|
|
|
regression-tests: .PHONY .MAKE
|
1993-05-22 11:15:13 +04:00
|
|
|
@echo Running regression tests...
|
2004-04-13 16:43:12 +04:00
|
|
|
${MAKEDIRTARGET} regress regress
|
1994-06-14 08:40:29 +04:00
|
|
|
.endif
|
1994-02-07 08:08:57 +03:00
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
.if ${MKUNPRIVED} != "no"
|
2002-06-26 04:10:16 +04:00
|
|
|
NOPOSTINSTALL= # defined
|
|
|
|
.endif
|
|
|
|
|
2006-01-21 22:01:15 +03:00
|
|
|
afterinstall: .PHONY .MAKE
|
2001-11-25 00:53:16 +03:00
|
|
|
.if ${MKMAN} != "no"
|
2004-04-13 16:43:12 +04:00
|
|
|
${MAKEDIRTARGET} share/man makedb
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
.endif
|
2003-07-18 12:26:01 +04:00
|
|
|
.if (${MKUNPRIVED} != "no" && ${MKINFO} != "no")
|
2004-04-13 16:43:12 +04:00
|
|
|
${MAKEDIRTARGET} gnu/usr.bin/texinfo/install-info infodir-meta
|
2001-11-25 00:53:16 +03:00
|
|
|
.endif
|
2002-06-26 04:10:16 +04:00
|
|
|
.if !defined(NOPOSTINSTALL)
|
2004-04-13 16:43:12 +04:00
|
|
|
${MAKEDIRTARGET} . postinstall-check
|
2002-06-19 04:17:11 +04:00
|
|
|
.endif
|
2002-04-29 16:09:13 +04:00
|
|
|
|
2014-06-16 13:04:43 +04:00
|
|
|
_POSTINSTALL= ${.CURDIR}/usr.sbin/postinstall/postinstall \
|
|
|
|
-m ${MACHINE} -a ${MACHINE_ARCH}
|
2012-08-14 16:37:41 +04:00
|
|
|
_POSTINSTALL_ENV= \
|
|
|
|
AWK=${TOOL_AWK:Q} \
|
|
|
|
DB=${TOOL_DB:Q} \
|
2012-08-15 16:50:12 +04:00
|
|
|
HOST_SH=${HOST_SH:Q} \
|
2012-08-14 16:37:41 +04:00
|
|
|
MAKE=${MAKE:Q} \
|
2012-08-14 17:12:15 +04:00
|
|
|
PWD_MKDB=${TOOL_PWD_MKDB:Q} \
|
2014-06-16 11:11:52 +04:00
|
|
|
SED=${TOOL_SED:Q} \
|
2012-08-14 17:12:15 +04:00
|
|
|
STAT=${TOOL_STAT:Q}
|
2005-04-17 19:18:34 +04:00
|
|
|
|
2015-05-03 18:13:13 +03:00
|
|
|
.if ${MKX11} != "no"
|
|
|
|
_POSTINSTALL_X11=-x ${X11SRCDIR:Q}
|
|
|
|
.endif
|
|
|
|
|
2004-01-27 04:45:07 +03:00
|
|
|
postinstall-check: .PHONY
|
2002-04-27 12:11:53 +04:00
|
|
|
@echo " === Post installation checks ==="
|
2015-05-03 18:13:13 +03:00
|
|
|
${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ check; if [ $$? -gt 1 ]; then exit 1; fi
|
2002-04-27 12:11:53 +04:00
|
|
|
@echo " ================================"
|
|
|
|
|
2004-01-27 04:45:07 +03:00
|
|
|
postinstall-fix: .NOTMAIN .PHONY
|
2002-04-29 16:14:36 +04:00
|
|
|
@echo " === Post installation fixes ==="
|
2015-05-03 18:13:13 +03:00
|
|
|
${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix
|
2003-07-17 11:46:11 +04:00
|
|
|
@echo " ==============================="
|
|
|
|
|
2004-01-27 04:45:07 +03:00
|
|
|
postinstall-fix-obsolete: .NOTMAIN .PHONY
|
2003-07-17 11:46:11 +04:00
|
|
|
@echo " === Removing obsolete files ==="
|
2015-05-03 18:13:13 +03:00
|
|
|
${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix obsolete
|
2003-07-17 11:46:11 +04:00
|
|
|
@echo " ==============================="
|
2002-04-29 16:14:36 +04:00
|
|
|
|
2014-06-16 13:06:26 +04:00
|
|
|
postinstall-fix-obsolete_stand: .NOTMAIN .PHONY
|
|
|
|
@echo " === Removing obsolete files ==="
|
2015-05-03 18:13:13 +03:00
|
|
|
${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix obsolete_stand
|
2014-06-16 13:06:26 +04:00
|
|
|
@echo " ==============================="
|
|
|
|
|
2001-11-25 00:53:16 +03:00
|
|
|
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
# Targets (in order!) called by "make build".
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
2001-11-15 22:32:19 +03:00
|
|
|
BUILDTARGETS+= check-tools
|
2003-07-18 12:26:01 +04:00
|
|
|
.if ${MKUPDATE} == "no" && !defined(NOCLEANDIR)
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
BUILDTARGETS+= cleandir
|
2001-09-22 16:30:13 +04:00
|
|
|
.endif
|
2008-10-25 19:03:44 +04:00
|
|
|
.if ${MKOBJDIRS} != "no"
|
|
|
|
BUILDTARGETS+= do-top-obj
|
|
|
|
.endif
|
|
|
|
.if ${USETOOLS} == "yes" # {
|
2001-11-13 20:47:16 +03:00
|
|
|
.if ${MKOBJDIRS} != "no"
|
2008-10-22 21:37:16 +04:00
|
|
|
BUILDTARGETS+= do-tools-obj
|
2001-11-13 20:47:16 +03:00
|
|
|
.endif
|
2001-11-13 02:16:17 +03:00
|
|
|
BUILDTARGETS+= do-tools
|
2008-10-25 19:03:44 +04:00
|
|
|
.endif # USETOOLS # }
|
2012-11-04 15:02:11 +04:00
|
|
|
BUILDTARGETS+= params
|
2008-10-22 21:37:16 +04:00
|
|
|
.if ${MKOBJDIRS} != "no"
|
|
|
|
BUILDTARGETS+= obj
|
|
|
|
.endif
|
2009-04-23 13:43:49 +04:00
|
|
|
BUILDTARGETS+= clean_METALOG
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
.if !defined(NODISTRIBDIRS)
|
|
|
|
BUILDTARGETS+= do-distrib-dirs
|
2001-09-22 16:30:13 +04:00
|
|
|
.endif
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
.if !defined(NOINCLUDES)
|
|
|
|
BUILDTARGETS+= includes
|
2001-09-22 16:30:13 +04:00
|
|
|
.endif
|
2010-12-04 00:38:46 +03:00
|
|
|
BUILDTARGETS+= do-lib
|
2012-08-17 20:22:27 +04:00
|
|
|
BUILDTARGETS+= do-compat-lib
|
2008-11-10 02:02:28 +03:00
|
|
|
.if ${MKX11} != "no"
|
2004-01-08 10:01:06 +03:00
|
|
|
BUILDTARGETS+= do-x11
|
|
|
|
.endif
|
2015-01-07 23:42:01 +03:00
|
|
|
BUILDTARGETS+= do-build
|
2009-11-30 19:13:22 +03:00
|
|
|
.if ${MKEXTSRC} != "no"
|
|
|
|
BUILDTARGETS+= do-extsrc
|
|
|
|
.endif
|
2003-02-22 06:20:45 +03:00
|
|
|
BUILDTARGETS+= do-obsolete
|
2001-09-22 16:30:13 +04:00
|
|
|
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
# Enforce proper ordering of some rules.
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
2001-06-10 17:02:54 +04:00
|
|
|
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
.ORDER: ${BUILDTARGETS}
|
2004-01-27 04:45:07 +03:00
|
|
|
includes-lib: .PHONY includes-include includes-sys
|
|
|
|
includes-gnu: .PHONY includes-lib
|
2001-06-10 17:02:54 +04:00
|
|
|
|
2012-11-04 15:02:11 +04:00
|
|
|
#
|
|
|
|
# Record the values of variables that might affect the build.
|
|
|
|
# If no values have changed, avoid updating the timestamp
|
|
|
|
# of the params file.
|
|
|
|
#
|
|
|
|
# This is referenced by _NETBSD_VERSION_DEPENDS in <bsd.own.mk>.
|
|
|
|
#
|
2012-12-03 17:53:28 +04:00
|
|
|
.include "${NETBSDSRCDIR}/etc/Makefile.params"
|
2012-11-04 15:02:11 +04:00
|
|
|
CLEANDIRFILES+= params
|
|
|
|
params: .EXEC
|
|
|
|
${_MKMSG_CREATE} params
|
2012-12-03 17:53:28 +04:00
|
|
|
@${PRINT_PARAMS} >${.TARGET}.new
|
2012-11-04 15:02:11 +04:00
|
|
|
@if cmp -s ${.TARGET}.new ${.TARGET} > /dev/null 2>&1; then \
|
|
|
|
: "params is unchanged" ; \
|
|
|
|
rm ${.TARGET}.new ; \
|
|
|
|
else \
|
|
|
|
: "params has changed or is new" ; \
|
|
|
|
mv ${.TARGET}.new ${.TARGET} ; \
|
|
|
|
fi
|
|
|
|
|
2012-12-03 17:53:28 +04:00
|
|
|
#
|
|
|
|
# Display current make(1) parameters
|
|
|
|
#
|
|
|
|
show-params: .PHONY .MAKE
|
|
|
|
@${PRINT_PARAMS}
|
|
|
|
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
# Build the system and install into DESTDIR.
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
2001-08-14 18:04:35 +04:00
|
|
|
|
2002-12-02 11:23:41 +03:00
|
|
|
START_TIME!= date
|
|
|
|
|
2006-01-21 22:01:15 +03:00
|
|
|
build: .PHONY .MAKE
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
.if defined(BUILD_DONE)
|
|
|
|
@echo "Build already installed into ${DESTDIR}"
|
|
|
|
.else
|
2002-12-02 11:23:41 +03:00
|
|
|
@echo "Build started at: ${START_TIME}"
|
2001-10-30 20:59:10 +03:00
|
|
|
.for tgt in ${BUILDTARGETS}
|
2004-04-13 16:43:12 +04:00
|
|
|
${MAKEDIRTARGET} . ${tgt}
|
2001-10-30 20:59:10 +03:00
|
|
|
.endfor
|
2004-04-13 16:43:12 +04:00
|
|
|
${MAKEDIRTARGET} etc install-etc-release
|
2002-12-02 11:23:41 +03:00
|
|
|
@echo "Build started at: ${START_TIME}"
|
2002-05-02 20:36:21 +04:00
|
|
|
@printf "Build finished at: " && date
|
1997-03-25 01:22:15 +03:00
|
|
|
.endif
|
2001-06-10 17:02:54 +04:00
|
|
|
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
2001-11-25 21:31:12 +03:00
|
|
|
# Build a full distribution, but not a release (i.e. no sets into
|
2002-12-21 19:43:33 +03:00
|
|
|
# ${RELEASEDIR}). "buildworld" enforces a build to ${DESTDIR} != /
|
|
|
|
#
|
2001-11-25 21:31:12 +03:00
|
|
|
|
2006-01-21 22:01:15 +03:00
|
|
|
distribution buildworld: .PHONY .MAKE
|
2002-12-26 15:01:48 +03:00
|
|
|
.if make(buildworld) && \
|
|
|
|
(!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
|
2002-12-21 19:43:33 +03:00
|
|
|
@echo "Won't make ${.TARGET} with DESTDIR=/"
|
|
|
|
@false
|
|
|
|
.endif
|
2004-04-13 16:43:12 +04:00
|
|
|
${MAKEDIRTARGET} . build NOPOSTINSTALL=1
|
|
|
|
${MAKEDIRTARGET} etc distribution INSTALL_DONE=1
|
2002-07-10 22:55:20 +04:00
|
|
|
.if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/"
|
2004-04-13 16:43:12 +04:00
|
|
|
${MAKEDIRTARGET} . postinstall-fix-obsolete
|
2014-06-16 13:06:26 +04:00
|
|
|
${MAKEDIRTARGET} . postinstall-fix-obsolete_stand
|
2004-04-13 16:43:12 +04:00
|
|
|
${MAKEDIRTARGET} distrib/sets checkflist
|
2002-07-10 22:55:20 +04:00
|
|
|
.endif
|
2002-12-02 11:27:03 +03:00
|
|
|
@echo "make ${.TARGET} started at: ${START_TIME}"
|
2002-08-30 10:30:33 +04:00
|
|
|
@printf "make ${.TARGET} finished at: " && date
|
2001-11-25 21:31:12 +03:00
|
|
|
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
|
|
|
# Install the distribution from $DESTDIR to $INSTALLWORLDDIR (defaults to `/')
|
|
|
|
# If installing to /, ensures that the host's operating system is NetBSD and
|
|
|
|
# the host's `uname -m` == ${MACHINE}.
|
|
|
|
#
|
|
|
|
|
|
|
|
HOST_UNAME_S!= uname -s
|
|
|
|
HOST_UNAME_M!= uname -m
|
|
|
|
|
2006-01-21 22:01:15 +03:00
|
|
|
installworld: .PHONY .MAKE
|
2002-12-26 15:01:48 +03:00
|
|
|
.if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
|
2002-12-21 19:43:33 +03:00
|
|
|
@echo "Can't make ${.TARGET} to DESTDIR=/"
|
|
|
|
@false
|
|
|
|
.endif
|
|
|
|
.if !defined(INSTALLWORLDDIR) || \
|
|
|
|
${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/"
|
|
|
|
.if (${HOST_UNAME_S} != "NetBSD")
|
|
|
|
@echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLWORLDDIR=/"
|
|
|
|
@false
|
|
|
|
.endif
|
|
|
|
.if (${HOST_UNAME_M} != ${MACHINE})
|
|
|
|
@echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLWORLDDIR=/"
|
|
|
|
@false
|
|
|
|
.endif
|
|
|
|
.endif
|
2004-04-13 16:43:12 +04:00
|
|
|
${MAKEDIRTARGET} distrib/sets installsets \
|
2011-01-29 19:56:26 +03:00
|
|
|
INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=${INSTALLSETS:Q}
|
2004-04-13 16:43:12 +04:00
|
|
|
${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR}
|
2002-12-21 19:43:33 +03:00
|
|
|
@echo "make ${.TARGET} started at: ${START_TIME}"
|
|
|
|
@printf "make ${.TARGET} finished at: " && date
|
2011-08-09 02:15:42 +04:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install modules from $DESTDIR to $INSTALLMODULESDIR
|
|
|
|
#
|
|
|
|
installmodules: .PHONY .MAKE
|
|
|
|
.if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
|
|
|
|
@echo "Can't make ${.TARGET} to DESTDIR=/"
|
|
|
|
@false
|
|
|
|
.endif
|
|
|
|
.if !defined(INSTALLMODULESDIR) || \
|
|
|
|
${INSTALLMODULESDIR} == "" || ${INSTALLMODULESDIR} == "/"
|
|
|
|
.if (${HOST_UNAME_S} != "NetBSD")
|
|
|
|
@echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLMODULESDIR=/"
|
|
|
|
@false
|
|
|
|
.endif
|
|
|
|
.if (${HOST_UNAME_M} != ${MACHINE})
|
|
|
|
@echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLMODULESDIR=/"
|
|
|
|
@false
|
|
|
|
.endif
|
|
|
|
.endif
|
2011-08-09 03:18:36 +04:00
|
|
|
${MAKEDIRTARGET} sys/modules install DESTDIR=${INSTALLMODULESDIR:U/}
|
2011-08-09 02:15:42 +04:00
|
|
|
@echo "make ${.TARGET} started at: ${START_TIME}"
|
|
|
|
@printf "make ${.TARGET} finished at: " && date
|
2002-12-21 19:43:33 +03:00
|
|
|
|
2003-01-26 09:19:12 +03:00
|
|
|
#
|
2003-05-10 11:12:37 +04:00
|
|
|
# Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR
|
2003-01-26 09:19:12 +03:00
|
|
|
#
|
|
|
|
|
2006-01-04 18:30:02 +03:00
|
|
|
.for tgt in sets sourcesets syspkgs
|
2006-01-21 22:01:15 +03:00
|
|
|
${tgt}: .PHONY .MAKE
|
2004-04-13 16:43:12 +04:00
|
|
|
${MAKEDIRTARGET} distrib/sets ${tgt}
|
2003-05-10 11:12:37 +04:00
|
|
|
.endfor
|
2003-01-26 09:19:12 +03:00
|
|
|
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
2005-08-25 06:04:39 +04:00
|
|
|
# Build a release or snapshot (implies "make distribution"). Note that
|
2002-07-10 22:55:20 +04:00
|
|
|
# in this case, the set lists will be checked before the tar files
|
|
|
|
# are made.
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
2001-06-10 17:02:54 +04:00
|
|
|
|
2006-01-21 22:01:15 +03:00
|
|
|
release snapshot: .PHONY .MAKE
|
2005-08-25 06:04:39 +04:00
|
|
|
${MAKEDIRTARGET} . distribution
|
|
|
|
${MAKEDIRTARGET} etc release DISTRIBUTION_DONE=1
|
2002-12-02 11:27:03 +03:00
|
|
|
@echo "make ${.TARGET} started at: ${START_TIME}"
|
2002-08-30 10:30:33 +04:00
|
|
|
@printf "make ${.TARGET} finished at: " && date
|
2001-06-10 17:02:54 +04:00
|
|
|
|
2006-01-29 00:34:07 +03:00
|
|
|
#
|
|
|
|
# Create a CD-ROM image.
|
|
|
|
#
|
|
|
|
|
|
|
|
iso-image: .PHONY
|
Add an iso_image target (iso-image as a target name doesn't play well with
bsd.subdirs.mk) in distrib/makefile, which builds an iso image for $MACHINE
with binary sets, stored in ${RELEASEDIR}/iso. The image is bootable for:
alpha, amd64, cats, i386, pmax, sgimips, sparc, sparc64, sun3, vax.
mac68k/macppc no there yet because of missing feature in makefs.
call iso_image in distrib/ for iso-image in the top Makefile.
2007-03-07 00:56:47 +03:00
|
|
|
${MAKEDIRTARGET} distrib iso_image
|
2006-01-29 00:34:07 +03:00
|
|
|
${MAKEDIRTARGET} etc iso-image
|
|
|
|
@echo "make ${.TARGET} started at: ${START_TIME}"
|
|
|
|
@printf "make ${.TARGET} finished at: " && date
|
|
|
|
|
2007-08-30 09:30:02 +04:00
|
|
|
iso-image-source: .PHONY
|
|
|
|
${MAKEDIRTARGET} distrib iso_image CDSOURCE=true
|
|
|
|
${MAKEDIRTARGET} etc iso-image
|
|
|
|
@echo "make ${.TARGET} started at: ${START_TIME}"
|
|
|
|
@printf "make ${.TARGET} finished at: " && date
|
|
|
|
|
2012-01-22 07:53:29 +04:00
|
|
|
#
|
|
|
|
# Create bootable live images.
|
|
|
|
#
|
|
|
|
|
|
|
|
live-image: .PHONY
|
|
|
|
${MAKEDIRTARGET} etc live-image
|
|
|
|
@echo "make ${.TARGET} started at: ${START_TIME}"
|
|
|
|
@printf "make ${.TARGET} finished at: " && date
|
|
|
|
|
|
|
|
#
|
|
|
|
# Create bootable installation images.
|
|
|
|
#
|
|
|
|
|
|
|
|
install-image: .PHONY
|
|
|
|
${MAKEDIRTARGET} etc install-image
|
|
|
|
@echo "make ${.TARGET} started at: ${START_TIME}"
|
|
|
|
@printf "make ${.TARGET} finished at: " && date
|
|
|
|
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
# Special components of the "make build" process.
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
2001-06-10 17:02:54 +04:00
|
|
|
|
2004-01-27 04:45:07 +03:00
|
|
|
check-tools: .PHONY
|
2004-01-03 17:04:27 +03:00
|
|
|
.if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN)
|
* Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
two variables:
TOOLCHAIN_MISSING -- set to "yes" on platforms for which there is
no working in-tree toolchain (hppa, ns32k, sh5, x86_64).
EXTERNAL_TOOLCHAIN -- if defined by the user, points to the root of
an external toolchain (e.g. /usr/local/gnu). This enables the cross-build
framework even for TOOLCHAIN_MISSING platforms.
If TOOLCHAIN_MISSING is set to "yes", MKGDB, MKBFD, and MKGCC are all
unconditionally set to "no", since the bits are not there to build.
If EXTERNAL_TOOLCHAIN is set, MKGCC is unconditionally set to "no",
since the external toolchain's compiler is not in-sync with the
in-tree compiler support components (e.g. libgcc).
* Set MACHINE_CPU much earlier in bsd.own.mk, so that more tests in
that file can use it.
2002-09-18 03:18:25 +04:00
|
|
|
@echo '*** WARNING: Building on MACHINE=${MACHINE} with missing toolchain.'
|
|
|
|
@echo '*** May result in a failed build or corrupt binaries!'
|
|
|
|
.elif defined(EXTERNAL_TOOLCHAIN)
|
|
|
|
@echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.'
|
2001-11-15 22:32:19 +03:00
|
|
|
.endif
|
2002-05-03 02:13:30 +04:00
|
|
|
.if defined(NBUILDJOBS)
|
|
|
|
@echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!'
|
|
|
|
.endif
|
2001-11-15 22:32:19 +03:00
|
|
|
|
2009-04-23 13:43:49 +04:00
|
|
|
# Delete or sanitise a leftover METALOG from a previous build.
|
|
|
|
clean_METALOG: .PHONY .MAKE
|
|
|
|
.if ${MKUPDATE} != "no"
|
|
|
|
${MAKEDIRTARGET} distrib/sets clean_METALOG
|
|
|
|
.endif
|
|
|
|
|
2006-01-21 22:01:15 +03:00
|
|
|
do-distrib-dirs: .PHONY .MAKE
|
2001-10-31 22:41:54 +03:00
|
|
|
.if !defined(DESTDIR) || ${DESTDIR} == ""
|
2004-04-13 16:43:12 +04:00
|
|
|
${MAKEDIRTARGET} etc distrib-dirs DESTDIR=/
|
2001-10-31 22:41:54 +03:00
|
|
|
.else
|
2004-04-13 16:43:12 +04:00
|
|
|
${MAKEDIRTARGET} etc distrib-dirs DESTDIR=${DESTDIR}
|
2001-10-31 22:41:54 +03:00
|
|
|
.endif
|
2001-06-10 17:02:54 +04:00
|
|
|
|
2002-11-30 02:48:37 +03:00
|
|
|
.for targ in cleandir obj includes
|
2004-01-27 04:45:07 +03:00
|
|
|
do-${targ}: .PHONY ${targ}
|
2002-11-30 02:48:37 +03:00
|
|
|
@true
|
|
|
|
.endfor
|
|
|
|
|
2012-11-16 03:51:53 +04:00
|
|
|
do-tools: .PHONY .MAKE
|
|
|
|
${MAKEDIRTARGET} tools build_install
|
2001-10-24 07:21:20 +04:00
|
|
|
|
2012-08-17 20:22:27 +04:00
|
|
|
do-lib: .PHONY .MAKE
|
|
|
|
${MAKEDIRTARGET} lib build_install
|
|
|
|
|
|
|
|
do-compat-lib: .PHONY .MAKE
|
|
|
|
${MAKEDIRTARGET} compat build_install BOOTSTRAP_SUBDIRS="../../../lib"
|
2009-12-13 12:29:27 +03:00
|
|
|
|
2008-10-25 19:03:44 +04:00
|
|
|
do-top-obj: .PHONY .MAKE
|
|
|
|
${MAKEDIRTARGET} . obj NOSUBDIR=
|
|
|
|
|
2008-10-22 21:37:16 +04:00
|
|
|
do-tools-obj: .PHONY .MAKE
|
|
|
|
${MAKEDIRTARGET} tools obj
|
|
|
|
|
2006-01-21 22:01:15 +03:00
|
|
|
do-build: .PHONY .MAKE
|
2001-11-13 18:56:28 +03:00
|
|
|
.for targ in dependall install
|
2004-04-13 16:43:12 +04:00
|
|
|
${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no
|
2001-11-13 18:56:28 +03:00
|
|
|
.endfor
|
1994-02-07 08:08:57 +03:00
|
|
|
|
2006-01-21 22:01:15 +03:00
|
|
|
do-x11: .PHONY .MAKE
|
2008-11-10 02:02:28 +03:00
|
|
|
.if ${MKX11} != "no"
|
2015-01-07 23:42:01 +03:00
|
|
|
${MAKEDIRTARGET} external/mit/xorg/tools all
|
|
|
|
${MAKEDIRTARGET} external/mit/xorg/lib build_install
|
2015-06-27 19:21:07 +03:00
|
|
|
.if ${MKCOMPATX11} != "no"
|
2015-06-25 01:20:24 +03:00
|
|
|
${MAKEDIRTARGET} compat build_install BOOTSTRAP_SUBDIRS="../../../external/mit/xorg/lib"
|
|
|
|
.endif
|
2008-08-28 11:21:49 +04:00
|
|
|
.else
|
2008-11-10 02:02:28 +03:00
|
|
|
@echo "MKX11 is not enabled"
|
2008-08-28 11:21:49 +04:00
|
|
|
@false
|
2008-07-29 08:49:43 +04:00
|
|
|
.endif
|
2004-01-08 10:01:06 +03:00
|
|
|
|
2009-11-30 19:13:22 +03:00
|
|
|
do-extsrc: .PHONY .MAKE
|
|
|
|
.if ${MKEXTSRC} != "no"
|
|
|
|
${MAKEDIRTARGET} extsrc build
|
|
|
|
.else
|
|
|
|
@echo "MKEXTSRC is not enabled"
|
|
|
|
@false
|
|
|
|
.endif
|
|
|
|
|
2006-01-21 22:01:15 +03:00
|
|
|
do-obsolete: .PHONY .MAKE
|
2004-04-13 16:43:12 +04:00
|
|
|
${MAKEDIRTARGET} etc install-obsolete-lists
|
2003-02-22 06:20:45 +03:00
|
|
|
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
Overhaul and simplify the top level Makefile, and add some sanity checking.
- "make build" cannot be invoked from the command line at the same time as
any standard recursive target except "obj" and "cleandir", as things like
"make all release" can lead to unexpected results.
- Put everything in SUBDIR, and auto-weed missing directories. This allows
the standard targets to work as expected (including in tools, etc, and
distrib).
- Leverage .for loops to simplify the prerequisite dependall/install phase
of compile-time dependencies (lib/csu, lib, gnu/lib). These are now all
distilled into one component rule ("do-build").
- Use the actual targets of obj, cleandir, and includes; no need for double
indirection goop in this case.
- GC all the deprecated "domestic" cruft. We are officially using (and
fixing, where appropriate) the cryptosystem integrated into src/crypto.
- Collapse the whatis.db build rule into a dependency of "afterinstall",
and nuke the "_BUILD" cruft.
2001-10-19 06:35:45 +04:00
|
|
|
# Speedup stubs for some subtrees that don't need to run these rules.
|
|
|
|
# (Tells <bsd.subdir.mk> not to recurse for them.)
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
1999-02-16 06:37:26 +03:00
|
|
|
|
2012-04-21 12:28:00 +04:00
|
|
|
.for dir in bin etc distrib games libexec regress sbin usr.bin usr.sbin tools
|
2004-01-27 04:45:07 +03:00
|
|
|
includes-${dir}: .PHONY
|
2001-11-13 02:16:17 +03:00
|
|
|
@true
|
|
|
|
.endfor
|
|
|
|
.for dir in etc distrib regress
|
2004-01-27 04:45:07 +03:00
|
|
|
install-${dir}: .PHONY
|
2001-11-13 02:16:17 +03:00
|
|
|
@true
|
|
|
|
.endfor
|
|
|
|
|
2002-12-21 19:43:33 +03:00
|
|
|
#
|
2001-11-13 02:16:17 +03:00
|
|
|
# XXX this needs to change when distrib Makefiles are recursion compliant
|
2002-12-21 19:43:33 +03:00
|
|
|
# XXX many distrib subdirs need "cd etc && make snap_pre snap_kern" first...
|
|
|
|
#
|
2004-01-27 04:45:07 +03:00
|
|
|
dependall-distrib depend-distrib all-distrib: .PHONY
|
2001-10-13 01:05:08 +04:00
|
|
|
@true
|
2001-09-22 01:01:13 +04:00
|
|
|
|
2001-11-12 01:40:42 +03:00
|
|
|
.include <bsd.obj.mk>
|
2003-07-06 17:04:01 +04:00
|
|
|
.include <bsd.kernobj.mk>
|
2001-10-31 04:20:09 +03:00
|
|
|
.include <bsd.subdir.mk>
|