version 1.126, 2001/08/02 06:13:33 |
version 1.131, 2001/09/22 12:30:13 |
|
|
# MKSHARE, if set to `no', will prevent building and installing |
# MKSHARE, if set to `no', will prevent building and installing |
# anything in /usr/share. |
# anything in /usr/share. |
# NBUILDJOBS is the number of jobs to start in parallel during a |
# NBUILDJOBS is the number of jobs to start in parallel during a |
# 'make build'. It defaults to 1. |
# `make build'. It defaults to 1. |
# UPDATE, if defined, will avoid a `make cleandir' at the start of |
# UPDATE, if defined, will avoid a `make cleandir' at the start of |
# `make build', as well as having the effects listed in |
# `make build', as well as having the effects listed in |
# /usr/share/mk/bsd.README. |
# /usr/share/mk/bsd.README. |
|
|
# |
# |
# Sub targets of `make build,' in order: |
# Sub targets of `make build,' in order: |
# buildstartmsg: displays the start time of the build. |
# buildstartmsg: displays the start time of the build. |
# beforeinstall: creates the distribution directories. |
# do-make-tools: builds host toolchain. |
|
# do-distrib-dirs: creates the distribution directories. |
# do-force-domestic: check's that FORCE_DOMESTIC isn't set (deprecated.) |
# do-force-domestic: check's that FORCE_DOMESTIC isn't set (deprecated.) |
# do-share-mk: installs /usr/share/mk files. |
# do-cleandir: cleans the tree. |
# do-cleandir: clean's the tree. |
# do-make-obj: creates object directories if required. |
# do-make-obj: create's object directories if required. |
|
# do-check-egcs: check's that we have a modern enough compiler (deprecated.) |
|
# do-make-includes: install include files. |
# do-make-includes: install include files. |
# do-lib-csu: build & install startup object files. |
# do-lib-csu: build & install startup object files. |
# do-lib: build & install system libraries. |
# do-lib: build & install system libraries. |
|
|
.include <bsd.own.mk> |
.include <bsd.own.mk> |
|
|
MKOBJDIRS ?= no |
MKOBJDIRS ?= no |
HAVE_EGCS!= ${CXX} --version | egrep "^(2\.[89]|egcs)" ; echo |
|
|
|
.if defined(NBUILDJOBS) |
.if defined(NBUILDJOBS) |
_J= -j${NBUILDJOBS} |
_J= -j${NBUILDJOBS} |
.endif |
.endif |
|
|
.if defined(DESTDIR) |
|
_M=-m ${DESTDIR}/usr/share/mk |
|
.endif |
|
|
|
# NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW |
# NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW |
|
|
SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys |
SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys |
|
|
@echo -n "Build finished at: " |
@echo -n "Build finished at: " |
@date |
@date |
|
|
# 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. |
|
|
|
beforeinstall: |
|
.ifndef NODISTRIBDIRS |
|
.ifndef DESTDIR |
|
.if exists(share/mk) |
|
(cd ${.CURDIR}/etc && \ |
|
${MAKE} -m ${.CURDIR}/share/mk DESTDIR=/ distrib-dirs) |
|
.else |
|
(cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs) |
|
.endif |
|
.else |
|
(cd ${.CURDIR}/etc && ${MAKE} distrib-dirs) |
|
.endif |
|
.endif |
|
|
|
afterinstall: |
afterinstall: |
.if ${MKMAN} != "no" && !defined(_BUILD) |
.if ${MKMAN} != "no" && !defined(_BUILD) |
${MAKE} ${_M} whatis.db |
${MAKE} ${_M} whatis.db |
|
|
.else |
.else |
build: |
build: |
@${MAKE} ${_M} buildstartmsg |
@${MAKE} ${_M} buildstartmsg |
@${MAKE} ${_M} beforeinstall |
@${MAKE} ${_M} do-make-tools |
|
@${MAKE} ${_M} do-distrib-dirs |
@${MAKE} ${_M} do-force-domestic |
@${MAKE} ${_M} do-force-domestic |
@${MAKE} ${_M} do-share-mk |
|
@${MAKE} ${_M} do-cleandir |
@${MAKE} ${_M} do-cleandir |
@${MAKE} ${_M} do-make-obj |
@${MAKE} ${_M} do-make-obj |
@${MAKE} ${_M} do-check-egcs |
|
@${MAKE} ${_M} do-make-includes |
@${MAKE} ${_M} do-make-includes |
@${MAKE} ${_M} do-lib-csu |
@${MAKE} ${_M} do-lib-csu |
@${MAKE} ${_M} do-lib |
@${MAKE} ${_M} do-lib |
|
|
@${MAKE} ${_M} buildendmsg |
@${MAKE} ${_M} buildendmsg |
.endif |
.endif |
|
|
|
do-make-tools: |
|
.if ${MKOBJDIRS} != "no" |
|
cd ${.CURDIR}/tools && ${MAKE} ${_M} obj |
|
.endif |
|
cd ${.CURDIR}/tools && ${MAKE} ${_M} build |
|
|
|
do-distrib-dirs: |
|
.ifndef NODISTRIBDIRS |
|
.ifndef DESTDIR |
|
(cd ${.CURDIR}/etc && ${MAKE} ${_M} DESTDIR=/ distrib-dirs) |
|
.else |
|
(cd ${.CURDIR}/etc && ${MAKE} ${_M} DESTDIR=${DESTDIR} distrib-dirs) |
|
.endif |
|
.endif |
|
|
do-force-domestic: |
do-force-domestic: |
.if defined(FORCE_DOMESTIC) |
.if defined(FORCE_DOMESTIC) |
@echo '*** CAPUTE!' |
@echo '*** CAPUTE!' |
Line 168 do-force-domestic: |
|
Line 158 do-force-domestic: |
|
@false |
@false |
.endif |
.endif |
|
|
do-share-mk: |
|
.if ${MKSHARE} != "no" |
|
(cd ${.CURDIR}/share/mk && ${MAKE} install) |
|
.endif |
|
|
|
do-cleandir: |
do-cleandir: |
.if !defined(UPDATE) && !defined(NOCLEANDIR) |
.if !defined(UPDATE) && !defined(NOCLEANDIR) |
${MAKE} ${_J} ${_M} cleandir |
${MAKE} ${_J} ${_M} cleandir |
|
|
${MAKE} ${_J} ${_M} obj |
${MAKE} ${_J} ${_M} obj |
.endif |
.endif |
|
|
do-check-egcs: |
|
.if empty(HAVE_EGCS) |
|
.if defined(DESTDIR) |
|
@echo "*** CAPUTE!" |
|
@echo " You attempted to compile the world without egcs. You must" |
|
@echo " first install a native egcs compiler." |
|
@false |
|
.else |
|
(cd ${.CURDIR}/gnu/usr.bin/egcs && \ |
|
${MAKE} ${_M} ${_J} dependall MKMAN=no && \ |
|
${MAKE} ${_M} MKMAN=no install && ${MAKE} ${_M} cleandir) |
|
.endif |
|
.endif |
|
|
|
do-make-includes: |
do-make-includes: |
.if !defined(NOINCLUDES) |
.if !defined(NOINCLUDES) |
${MAKE} ${_M} includes |
${MAKE} ${_M} includes |
|
|
release snapshot: build |
release snapshot: build |
(cd ${.CURDIR}/etc && ${MAKE} ${_M} INSTALL_DONE=1 release) |
(cd ${.CURDIR}/etc && ${MAKE} ${_M} INSTALL_DONE=1 release) |
|
|
|
# Speedup stubs for some subtrees that don't need to run these rules |
|
includes-bin includes-games includes-libexec includes-regress \ |
|
includes-sbin includes-usr.sbin: |
|
@${TRUE} |
|
|
|
.if !exists(${.CURDIR}/share/mk) |
|
.BEGIN: |
|
@echo 'BUILD ABORTED: share/mk does not exist, cannot run make.' |
|
@false |
|
.endif |
|
|
.include <bsd.subdir.mk> |
.include <bsd.subdir.mk> |
|
|
|
_M:= -m ${.CURDIR}/share/mk |