2002-12-02 11:27:03 +03:00
|
|
|
# $NetBSD: Makefile,v 1.192 2002/12/02 08:27:03 lukem Exp $
|
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
|
|
|
|
# information, see http://www.netbsd.org/developers/releng/index.html
|
|
|
|
#
|
|
|
|
# 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.
|
1999-04-01 06:49:12 +04:00
|
|
|
# MKMAN, if set to `no', will prevent building of manual pages.
|
2002-06-20 12:21:59 +04:00
|
|
|
# MKOBJDIRS, if not set to `no', will build object directories at
|
1999-11-30 20:48:11 +03:00
|
|
|
# an appropriate point in a build.
|
1999-04-01 06:49:12 +04:00
|
|
|
# MKSHARE, if set to `no', will prevent building and installing
|
|
|
|
# anything in /usr/share.
|
2001-06-10 17:15:29 +04:00
|
|
|
# UPDATE, if defined, 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
|
|
|
#
|
|
|
|
# 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:
|
|
|
|
# Builds a full release of NetBSD in DESTDIR. If BUILD_DONE is
|
2000-03-11 03:10:20 +03:00
|
|
|
# set, this is an empty target.
|
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:
|
|
|
|
# Does a `make build,' and then tars up the DESTDIR files
|
1999-04-01 06:49:12 +04:00
|
|
|
# into RELEASEDIR, in release(7) format. (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.
|
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.
|
2001-11-13 20:47:16 +03:00
|
|
|
# obj: creates object directories.
|
2001-11-13 02:16:17 +03:00
|
|
|
# do-tools: builds host toolchain.
|
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.
|
2002-04-11 23:31:06 +04:00
|
|
|
# do-lib-csu: builds and installs prerequisites from lib/csu.
|
2002-09-14 20:46:24 +04:00
|
|
|
# do-lib-libc: builds and installs prerequisites from lib/libc.
|
2001-10-24 07:21:20 +04:00
|
|
|
# do-lib: builds and installs prerequisites from lib.
|
|
|
|
# do-gnu-lib: builds and installs prerequisites from gnu/lib.
|
2002-11-12 17:33:48 +03:00
|
|
|
# do-ld.so: builds and installs prerequisites from libexec/ld.*_so.
|
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.
|
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-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}.
|
|
|
|
_SRC_TOP_OBJ_=
|
|
|
|
|
2001-10-31 04:20:09 +03:00
|
|
|
.include <bsd.own.mk>
|
1993-03-22 11:43:59 +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.
|
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-03-11 10:49:24 +03:00
|
|
|
_SUBDIR= tools lib include gnu bin games libexec sbin usr.bin
|
2002-08-22 06:23:23 +04:00
|
|
|
_SUBDIR+= usr.sbin share rescue sys etc distrib regress
|
1996-08-11 03:29:00 +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
|
|
|
# Weed out directories that don't exist.
|
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}
|
2001-11-13 18:56:28 +03:00
|
|
|
.if exists(${dir}/Makefile) && (${BUILD_${dir}:Uyes} != "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
|
|
|
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)
|
1993-05-22 11:15:13 +04:00
|
|
|
regression-tests:
|
|
|
|
@echo Running regression tests...
|
2001-11-13 02:16:17 +03:00
|
|
|
@(cd ${.CURDIR}/regress && ${MAKE} regress)
|
1994-06-14 08:40:29 +04:00
|
|
|
.endif
|
1994-02-07 08:08:57 +03:00
|
|
|
|
2002-06-26 04:10:16 +04:00
|
|
|
.if defined(UNPRIVED)
|
|
|
|
NOPOSTINSTALL= # defined
|
|
|
|
.endif
|
|
|
|
|
2002-06-19 04:17:11 +04:00
|
|
|
afterinstall:
|
2001-11-25 00:53:16 +03:00
|
|
|
.if ${MKMAN} != "no"
|
2001-11-13 02:16:17 +03:00
|
|
|
(cd ${.CURDIR}/share/man && ${MAKE} 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
|
2001-11-25 00:53:16 +03:00
|
|
|
.if defined(UNPRIVED) && (${MKINFO} != "no")
|
2002-03-01 09:02:41 +03:00
|
|
|
(cd ${.CURDIR}/gnu/usr.bin/texinfo/install-info && ${MAKE} infodir-meta)
|
2001-11-25 00:53:16 +03:00
|
|
|
.endif
|
2002-06-26 04:10:16 +04:00
|
|
|
.if !defined(NOPOSTINSTALL)
|
2002-06-26 20:28:18 +04:00
|
|
|
(cd ${.CURDIR} && ${MAKE} postinstall-check)
|
2002-06-19 04:17:11 +04:00
|
|
|
.endif
|
2002-04-29 16:09:13 +04:00
|
|
|
|
|
|
|
postinstall-check:
|
2002-04-27 12:11:53 +04:00
|
|
|
@echo " === Post installation checks ==="
|
2002-05-07 06:11:07 +04:00
|
|
|
sh ${.CURDIR}/etc/postinstall -s ${.CURDIR} -d ${DESTDIR}/ check
|
2002-04-27 12:11:53 +04:00
|
|
|
@echo " ================================"
|
|
|
|
|
2002-04-29 16:14:36 +04:00
|
|
|
postinstall-fix: .NOTMAIN
|
|
|
|
@echo " === Post installation fixes ==="
|
2002-05-07 06:11:07 +04:00
|
|
|
sh ${.CURDIR}/etc/postinstall -s ${.CURDIR} -d ${DESTDIR}/ fix
|
2002-04-29 16:14:36 +04:00
|
|
|
@echo " ================================"
|
|
|
|
|
2001-11-25 00:53:16 +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".
|
1999-02-11 17:49:49 +03:00
|
|
|
|
2001-11-15 22:32:19 +03:00
|
|
|
BUILDTARGETS+= check-tools
|
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(UPDATE) && !defined(NOCLEANDIR)
|
|
|
|
BUILDTARGETS+= cleandir
|
2001-09-22 16:30:13 +04:00
|
|
|
.endif
|
2001-11-13 20:47:16 +03:00
|
|
|
.if ${MKOBJDIRS} != "no"
|
|
|
|
BUILDTARGETS+= obj
|
|
|
|
.endif
|
2001-10-19 07:19:01 +04:00
|
|
|
.if ${USETOOLS} == "yes"
|
2001-11-13 02:16:17 +03:00
|
|
|
BUILDTARGETS+= do-tools
|
2001-10-01 21:19:17 +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(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
|
2002-11-12 17:33:48 +03:00
|
|
|
BUILDTARGETS+= do-lib-csu do-lib-libc do-lib do-gnu-lib do-ld.so do-build
|
2001-09-22 16:30:13 +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
|
|
|
# Enforce proper ordering of some rules.
|
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}
|
|
|
|
includes-lib: includes-include includes-sys
|
|
|
|
includes-gnu: includes-lib
|
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
|
|
|
# Build the system and install into DESTDIR.
|
2001-08-14 18:04:35 +04:00
|
|
|
|
2002-12-02 11:23:41 +03:00
|
|
|
START_TIME!= date
|
|
|
|
|
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:
|
|
|
|
.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}
|
2002-05-03 02:13:30 +04:00
|
|
|
@(cd ${.CURDIR} && ${MAKE} ${tgt})
|
2001-10-30 20:59:10 +03:00
|
|
|
.endfor
|
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
|
|
|
|
2001-11-25 21:31:12 +03:00
|
|
|
# Build a full distribution, but not a release (i.e. no sets into
|
|
|
|
# ${RELEASEDIR}).
|
|
|
|
|
2002-06-26 04:10:16 +04:00
|
|
|
distribution:
|
2002-07-11 03:44:54 +04:00
|
|
|
(cd ${.CURDIR} && ${MAKE} NOPOSTINSTALL=1 build)
|
2001-11-25 21:31:12 +03:00
|
|
|
(cd ${.CURDIR}/etc && ${MAKE} INSTALL_DONE=1 distribution)
|
2002-07-10 22:55:20 +04:00
|
|
|
.if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/"
|
|
|
|
(cd ${.CURDIR}/distrib/sets && ${MAKE} checkflist)
|
|
|
|
.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-07-10 22:55:20 +04:00
|
|
|
# Build a release or snapshot (implies "make build"). Note that
|
|
|
|
# in this case, the set lists will be checked before the tar files
|
|
|
|
# are made.
|
2001-06-10 17:02:54 +04:00
|
|
|
|
2002-06-26 04:10:16 +04:00
|
|
|
release snapshot:
|
|
|
|
(cd ${.CURDIR} && ${MAKE} NOPOSTINSTALL=1 build)
|
2001-11-13 02:16:17 +03:00
|
|
|
(cd ${.CURDIR}/etc && ${MAKE} INSTALL_DONE=1 release)
|
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
|
|
|
|
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.
|
2001-06-10 17:02:54 +04:00
|
|
|
|
2001-11-15 22:32:19 +03:00
|
|
|
check-tools:
|
* 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
|
|
|
.if ${TOOLCHAIN_MISSING} == "yes" && !defined(EXTERNAL_TOOLCHAIN)
|
|
|
|
@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
|
|
|
|
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-distrib-dirs:
|
2001-10-31 22:41:54 +03:00
|
|
|
.if !defined(DESTDIR) || ${DESTDIR} == ""
|
2001-11-13 02:16:17 +03:00
|
|
|
(cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
|
2001-10-31 22:41:54 +03:00
|
|
|
.else
|
2001-11-13 02:16:17 +03:00
|
|
|
(cd ${.CURDIR}/etc && ${MAKE} DESTDIR=${DESTDIR} distrib-dirs)
|
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
|
|
|
|
do-${targ}: ${targ}
|
|
|
|
@true
|
|
|
|
.endfor
|
|
|
|
|
2002-09-14 20:46:24 +04:00
|
|
|
.for dir in tools lib/csu lib/libc lib gnu/lib
|
2001-10-24 07:21:20 +04:00
|
|
|
do-${dir:S/\//-/}:
|
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 targ in dependall install
|
2002-05-03 02:13:30 +04:00
|
|
|
(cd ${.CURDIR}/${dir} && ${MAKE} ${targ})
|
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
|
|
|
|
.endfor
|
2001-10-24 07:21:20 +04:00
|
|
|
|
2002-11-12 17:33:48 +03:00
|
|
|
do-ld.so:
|
2002-08-26 08:40:20 +04:00
|
|
|
.for targ in dependall install
|
2002-11-12 17:33:48 +03:00
|
|
|
.if (${OBJECT_FMT} == "a.out")
|
|
|
|
(cd ${.CURDIR}/libexec/ld.aout_so && ${MAKE} ${targ})
|
|
|
|
.endif
|
|
|
|
.if (${OBJECT_FMT} == "ELF")
|
2002-08-26 08:40:20 +04:00
|
|
|
(cd ${.CURDIR}/libexec/ld.elf_so && ${MAKE} ${targ})
|
2002-11-12 17:33:48 +03:00
|
|
|
.endif
|
2002-08-26 08:40:20 +04:00
|
|
|
.endfor
|
|
|
|
|
2001-10-24 07:21:20 +04:00
|
|
|
do-build:
|
2001-11-13 18:56:28 +03:00
|
|
|
.for targ in dependall install
|
2002-05-03 02:13:30 +04:00
|
|
|
(cd ${.CURDIR} && ${MAKE} ${targ} BUILD_tools=no BUILD_lib=no)
|
2001-11-13 18:56:28 +03:00
|
|
|
.endfor
|
1994-02-07 08:08:57 +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.)
|
1999-02-16 06:37:26 +03:00
|
|
|
|
2001-11-13 02:16:17 +03:00
|
|
|
.for dir in bin etc distrib games libexec regress sbin usr.sbin tools
|
|
|
|
includes-${dir}:
|
|
|
|
@true
|
|
|
|
.endfor
|
|
|
|
.for dir in etc distrib regress
|
|
|
|
install-${dir}:
|
|
|
|
@true
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
# XXX this needs to change when distrib Makefiles are recursion compliant
|
|
|
|
dependall-distrib depend-distrib all-distrib:
|
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>
|
2001-10-31 04:20:09 +03:00
|
|
|
.include <bsd.subdir.mk>
|
2001-10-29 22:48:35 +03:00
|
|
|
|
2001-11-01 19:34:21 +03:00
|
|
|
build-docs: ${.CURDIR}/BUILDING
|
2002-09-21 12:19:27 +04:00
|
|
|
${.CURDIR}/BUILDING: doc/BUILDING.mdoc
|
2001-11-01 19:34:21 +03:00
|
|
|
groff -mdoc -Tascii -P-b -P-u -P-o $> >$@
|