2001-08-17 19:05:50 +04:00
|
|
|
# $NetBSD: Makefile,v 1.128 2001/08/17 15:05:50 thorpej 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.
|
1999-11-30 20:48:11 +03:00
|
|
|
# MKOBJDIRS, if not set to `no', will build object directories at
|
|
|
|
# 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.
|
1999-11-30 20:48:11 +03:00
|
|
|
# NBUILDJOBS is the number of jobs to start in parallel during a
|
2001-08-14 18:04:35 +04:00
|
|
|
# `make build'. It defaults to 1.
|
2001-06-10 17:15:29 +04:00
|
|
|
# UPDATE, if defined, will avoid a `make cleandir' at the start of
|
|
|
|
# `make build', as well as having the effects listed in
|
|
|
|
# /usr/share/mk/bsd.README.
|
|
|
|
# NOCLEANDIR, if defined, will avoid a `make cleandir' at the start
|
|
|
|
# of the `make build'.
|
2000-08-05 14:17:35 +04:00
|
|
|
# NOINCLUDES will avoid the `make includes' usually done by `make build'.
|
2001-06-10 17:15:29 +04:00
|
|
|
|
1999-04-01 06:49:12 +04:00
|
|
|
#
|
|
|
|
# Targets:
|
2000-03-11 03:10:20 +03:00
|
|
|
# build: builds a full release of netbsd in DESTDIR. If BUILD_DONE is
|
|
|
|
# set, this is an empty target.
|
1999-04-01 06:49:12 +04:00
|
|
|
# release: does a `make build,' and then tars up the DESTDIR files
|
|
|
|
# into RELEASEDIR, in release(7) format. (See etc/Makefile for
|
|
|
|
# more information on this.)
|
|
|
|
# snapshot: a synonym for release.
|
2001-06-10 17:02:54 +04:00
|
|
|
#
|
|
|
|
# Sub targets of `make build,' in order:
|
|
|
|
# buildstartmsg: displays the start time of the build.
|
|
|
|
# beforeinstall: creates the distribution directories.
|
|
|
|
# do-force-domestic: check's that FORCE_DOMESTIC isn't set (deprecated.)
|
|
|
|
# do-share-mk: installs /usr/share/mk files.
|
2001-08-14 18:04:35 +04:00
|
|
|
# do-cleandir: cleans the tree.
|
|
|
|
# do-make-obj: creates object directories if required.
|
|
|
|
# do-make-tools: builds host toolchain.
|
2001-06-10 17:02:54 +04:00
|
|
|
# do-make-includes: install include files.
|
|
|
|
# do-lib-csu: build & install startup object files.
|
|
|
|
# do-lib: build & install system libraries.
|
|
|
|
# do-gnu-lib: build & install gnu system libraries.
|
|
|
|
# do-dependall: builds & install the entire system.
|
|
|
|
# do-domestic: build & install the domestic tree (deprecated.)
|
|
|
|
# do-whatisdb: build & install the `whatis.db' man database.
|
|
|
|
# buildendmsg: displays the end time of the build.
|
1996-04-13 10:36:15 +04:00
|
|
|
|
2000-06-20 10:00:24 +04:00
|
|
|
.include <bsd.own.mk>
|
1993-03-22 11:43:59 +03:00
|
|
|
|
2001-08-14 18:04:35 +04:00
|
|
|
.if defined(USE_NEW_TOOLCHAIN)
|
|
|
|
.include "${.CURDIR}/tools/Makefile.tools"
|
|
|
|
.endif
|
|
|
|
|
1999-11-30 19:16:41 +03:00
|
|
|
MKOBJDIRS ?= no
|
1998-07-24 20:48:47 +04:00
|
|
|
|
1998-12-22 14:21:09 +03:00
|
|
|
.if defined(NBUILDJOBS)
|
|
|
|
_J= -j${NBUILDJOBS}
|
|
|
|
.endif
|
|
|
|
|
2000-04-10 18:47:22 +04:00
|
|
|
.if defined(DESTDIR)
|
|
|
|
_M=-m ${DESTDIR}/usr/share/mk
|
|
|
|
.endif
|
|
|
|
|
1993-03-22 11:43:59 +03:00
|
|
|
# NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW
|
1993-03-21 21:04:42 +03:00
|
|
|
|
1998-05-10 14:37:59 +04:00
|
|
|
SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys
|
2000-08-20 02:09:08 +04:00
|
|
|
.if make(cleandir) || make(obj)
|
2000-03-08 03:50:05 +03:00
|
|
|
SUBDIR+= distrib
|
2000-05-06 11:53:53 +04:00
|
|
|
.ifdef MAKEOBJDIRPREFIX
|
|
|
|
SUBDIR+= etc
|
|
|
|
.endif
|
2000-03-08 03:50:05 +03:00
|
|
|
.endif
|
1996-08-11 03:29:00 +04:00
|
|
|
|
2000-02-01 04:22:05 +03:00
|
|
|
includes-lib: includes-include includes-sys
|
|
|
|
|
1996-08-11 03:29:00 +04:00
|
|
|
.if exists(games)
|
|
|
|
SUBDIR+= games
|
|
|
|
.endif
|
|
|
|
|
1993-04-29 16:42:00 +04:00
|
|
|
SUBDIR+= gnu
|
1998-05-10 14:37:59 +04:00
|
|
|
# This is needed for libstdc++ and gen-params.
|
|
|
|
includes-gnu: includes-include includes-sys
|
1993-07-04 18:02:11 +04:00
|
|
|
|
1993-07-07 16:55:48 +04:00
|
|
|
.if exists(regress)
|
1993-05-22 11:10:28 +04:00
|
|
|
.ifmake !(install)
|
|
|
|
SUBDIR+= regress
|
|
|
|
.endif
|
|
|
|
|
1993-05-22 11:15:13 +04:00
|
|
|
regression-tests:
|
|
|
|
@echo Running regression tests...
|
2000-04-10 18:47:22 +04:00
|
|
|
@(cd ${.CURDIR}/regress && ${MAKE} ${_M} regress)
|
1993-07-07 16:55:48 +04:00
|
|
|
.endif
|
1993-05-22 11:10:28 +04:00
|
|
|
|
2001-06-10 17:02:54 +04:00
|
|
|
buildstartmsg:
|
1998-02-07 02:11:57 +03:00
|
|
|
@echo -n "Build started at: "
|
|
|
|
@date
|
2000-03-01 00:54:03 +03:00
|
|
|
|
2001-06-10 17:02:54 +04:00
|
|
|
buildendmsg:
|
|
|
|
@echo -n "Build finished at: "
|
|
|
|
@date
|
|
|
|
|
2000-10-07 21:18:17 +04:00
|
|
|
# If sharesrc is around, use its share/mk files to bootstrap until the
|
|
|
|
# mk files are installed (first step of make build). If installing to
|
|
|
|
# DESTDIR, don't bother, since the build will fail later on anyway.
|
|
|
|
|
2000-03-01 00:54:03 +03:00
|
|
|
beforeinstall:
|
2000-04-10 18:47:22 +04:00
|
|
|
.ifndef NODISTRIBDIRS
|
1995-12-10 01:39:46 +03:00
|
|
|
.ifndef DESTDIR
|
2000-10-07 21:18:17 +04:00
|
|
|
.if exists(share/mk)
|
2001-08-02 10:13:33 +04:00
|
|
|
(cd ${.CURDIR}/etc && \
|
|
|
|
${MAKE} -m ${.CURDIR}/share/mk DESTDIR=/ distrib-dirs)
|
2000-10-07 21:18:17 +04:00
|
|
|
.else
|
1995-12-10 01:39:46 +03:00
|
|
|
(cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
|
2000-10-07 21:18:17 +04:00
|
|
|
.endif
|
1996-03-18 12:55:25 +03:00
|
|
|
.else
|
2001-08-17 19:05:50 +04:00
|
|
|
(cd ${.CURDIR}/etc && ${MAKE} DESTDIR=${DESTDIR} distrib-dirs)
|
1995-12-10 01:39:46 +03:00
|
|
|
.endif
|
2000-04-10 18:47:22 +04:00
|
|
|
.endif
|
1995-10-06 15:05:36 +03:00
|
|
|
|
1994-02-07 08:08:57 +03:00
|
|
|
afterinstall:
|
1999-02-13 05:54:17 +03:00
|
|
|
.if ${MKMAN} != "no" && !defined(_BUILD)
|
2000-04-10 18:47:22 +04:00
|
|
|
${MAKE} ${_M} whatis.db
|
1994-06-14 08:40:29 +04:00
|
|
|
.endif
|
1994-02-07 08:08:57 +03:00
|
|
|
|
1999-01-28 18:36:48 +03:00
|
|
|
whatis.db:
|
2000-04-10 18:47:22 +04:00
|
|
|
(cd ${.CURDIR}/share/man && ${MAKE} ${_M} makedb)
|
1999-01-28 18:36:48 +03:00
|
|
|
|
1999-02-11 17:49:49 +03:00
|
|
|
# wrt info/dir below: It's safe to move this over top of /usr/share/info/dir,
|
|
|
|
# as the build will automatically remove/replace the non-pkg entries there.
|
|
|
|
|
2000-03-11 03:10:20 +03:00
|
|
|
.if defined(BUILD_DONE)
|
|
|
|
build:
|
|
|
|
@echo "Build installed into ${DESTDIR}"
|
|
|
|
.else
|
2001-06-10 17:12:32 +04:00
|
|
|
build:
|
|
|
|
@${MAKE} ${_M} buildstartmsg
|
|
|
|
@${MAKE} ${_M} beforeinstall
|
|
|
|
@${MAKE} ${_M} do-force-domestic
|
|
|
|
@${MAKE} ${_M} do-share-mk
|
|
|
|
@${MAKE} ${_M} do-cleandir
|
|
|
|
@${MAKE} ${_M} do-make-obj
|
2001-08-14 18:04:35 +04:00
|
|
|
@${MAKE} ${_M} do-make-tools
|
2001-06-10 17:12:32 +04:00
|
|
|
@${MAKE} ${_M} do-make-includes
|
|
|
|
@${MAKE} ${_M} do-lib-csu
|
|
|
|
@${MAKE} ${_M} do-lib
|
|
|
|
@${MAKE} ${_M} do-gnu-lib
|
|
|
|
@${MAKE} ${_M} do-dependall
|
|
|
|
@${MAKE} ${_M} do-domestic
|
|
|
|
@${MAKE} ${_M} do-whatisdb
|
|
|
|
@${MAKE} ${_M} buildendmsg
|
2001-06-10 17:02:54 +04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
do-force-domestic:
|
1999-04-25 23:13:05 +04:00
|
|
|
.if defined(FORCE_DOMESTIC)
|
|
|
|
@echo '*** CAPUTE!'
|
|
|
|
@echo ' The FORCE_DOMESTIC flag is not compatible with "make build".'
|
|
|
|
@echo ' Please correct the problem and try again.'
|
|
|
|
@false
|
|
|
|
.endif
|
2001-06-10 17:02:54 +04:00
|
|
|
|
|
|
|
do-share-mk:
|
1999-02-13 05:54:17 +03:00
|
|
|
.if ${MKSHARE} != "no"
|
2000-05-21 11:33:05 +04:00
|
|
|
(cd ${.CURDIR}/share/mk && ${MAKE} install)
|
1998-09-29 10:59:53 +04:00
|
|
|
.endif
|
2001-06-10 17:02:54 +04:00
|
|
|
|
|
|
|
do-cleandir:
|
2000-04-10 18:47:22 +04:00
|
|
|
.if !defined(UPDATE) && !defined(NOCLEANDIR)
|
2000-05-21 11:33:05 +04:00
|
|
|
${MAKE} ${_J} ${_M} cleandir
|
1998-10-16 09:05:09 +04:00
|
|
|
.endif
|
2001-06-10 17:02:54 +04:00
|
|
|
|
|
|
|
do-make-obj:
|
1999-12-04 06:52:28 +03:00
|
|
|
.if ${MKOBJDIRS} != "no"
|
2001-05-08 06:04:08 +04:00
|
|
|
${MAKE} ${_J} ${_M} obj
|
2001-08-14 18:04:35 +04:00
|
|
|
.if defined(USE_NEW_TOOLCHAIN)
|
|
|
|
cd ${.CURDIR}/tools && ${MAKE} ${_M} obj
|
1999-12-04 06:52:28 +03:00
|
|
|
.endif
|
2000-04-10 18:47:22 +04:00
|
|
|
.endif
|
2001-08-14 18:04:35 +04:00
|
|
|
|
|
|
|
do-make-tools:
|
|
|
|
.if defined(USE_NEW_TOOLCHAIN)
|
|
|
|
cd ${.CURDIR}/tools && ${MAKE} ${_M} build
|
1998-10-16 09:05:09 +04:00
|
|
|
.endif
|
2001-06-10 17:02:54 +04:00
|
|
|
|
|
|
|
do-make-includes:
|
2000-04-10 18:47:22 +04:00
|
|
|
.if !defined(NOINCLUDES)
|
|
|
|
${MAKE} ${_M} includes
|
1997-03-25 01:22:15 +03:00
|
|
|
.endif
|
2001-06-10 17:02:54 +04:00
|
|
|
|
|
|
|
do-lib-csu:
|
1998-07-26 21:28:58 +04:00
|
|
|
(cd ${.CURDIR}/lib/csu && \
|
2000-04-11 12:21:41 +04:00
|
|
|
${MAKE} ${_M} ${_J} MKSHARE=no dependall && \
|
|
|
|
${MAKE} ${_M} MKSHARE=no install)
|
2001-06-10 17:02:54 +04:00
|
|
|
|
|
|
|
do-lib:
|
1998-07-26 21:28:58 +04:00
|
|
|
(cd ${.CURDIR}/lib && \
|
2000-04-11 12:21:41 +04:00
|
|
|
${MAKE} ${_M} ${_J} MKSHARE=no dependall && \
|
|
|
|
${MAKE} ${_M} MKSHARE=no install)
|
2001-06-10 17:02:54 +04:00
|
|
|
|
|
|
|
do-gnu-lib:
|
1998-07-26 21:28:58 +04:00
|
|
|
(cd ${.CURDIR}/gnu/lib && \
|
2000-04-11 12:21:41 +04:00
|
|
|
${MAKE} ${_M} ${_J} MKSHARE=no dependall && \
|
|
|
|
${MAKE} ${_M} MKSHARE=no install)
|
2001-06-10 17:02:54 +04:00
|
|
|
|
|
|
|
do-dependall:
|
2000-04-10 18:47:22 +04:00
|
|
|
${MAKE} ${_M} ${_J} dependall && ${MAKE} ${_M} _BUILD= install
|
2001-06-10 17:02:54 +04:00
|
|
|
|
|
|
|
do-domestic:
|
1999-05-28 01:03:31 +04:00
|
|
|
.if defined(DOMESTIC) && !defined(EXPORTABLE_SYSTEM)
|
2000-04-10 18:47:22 +04:00
|
|
|
(cd ${.CURDIR}/${DOMESTIC} && ${MAKE} ${_M} ${_J} _SLAVE_BUILD= build)
|
1998-02-16 13:07:31 +03:00
|
|
|
.endif
|
2001-06-10 17:02:54 +04:00
|
|
|
|
|
|
|
do-whatisdb:
|
2000-04-10 18:47:22 +04:00
|
|
|
${MAKE} ${_M} whatis.db
|
1994-02-07 08:08:57 +03:00
|
|
|
|
1999-02-16 06:37:26 +03:00
|
|
|
release snapshot: build
|
2000-04-10 18:47:22 +04:00
|
|
|
(cd ${.CURDIR}/etc && ${MAKE} ${_M} INSTALL_DONE=1 release)
|
1999-02-16 06:37:26 +03:00
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
.include <bsd.subdir.mk>
|