Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/Makefile,v rcsdiff: /ftp/cvs/cvsroot/src/Makefile,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.142 retrieving revision 1.146 diff -u -p -r1.142 -r1.146 --- src/Makefile 2001/10/24 02:45:34 1.142 +++ src/Makefile 2001/10/31 01:20:09 1.146 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.142 2001/10/24 02:45:34 tv Exp $ +# $NetBSD: Makefile,v 1.146 2001/10/31 01:20:09 tv Exp $ # 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 @@ -49,9 +49,16 @@ # do-make-tools: builds host toolchain. # do-distrib-dirs: creates the distribution directories. # includes: installs include files. +# do-lib-csu: builds and installs prerequisites from lib/csu. +# do-lib: builds and installs prerequisites from lib. +# do-gnu-lib: builds and installs prerequisites from gnu/lib. # do-build: builds and installs the entire system. -.include "${.CURDIR}/share/mk/bsd.own.mk" +.if ${.MAKEFLAGS:M${.CURDIR}/share/mk} == "" +.MAKEFLAGS: -m ${.CURDIR}/share/mk +.endif + +.include # Sanity check: make sure that "make build" is not invoked simultaneously # with a standard recursive target. @@ -70,10 +77,7 @@ _J= -j${NBUILDJOBS} .endif -.if ${USETOOLS} == "yes" -_SUBDIR+= tools -.endif -_SUBDIR+= lib include gnu bin games libexec sbin usr.bin \ +_SUBDIR= tools lib include gnu bin games libexec sbin usr.bin \ usr.sbin share sys etc distrib regress # Weed out directories that don't exist. @@ -87,13 +91,13 @@ SUBDIR+= ${dir} .if exists(regress) regression-tests: @echo Running regression tests... - @cd ${.CURDIR}/regress && ${MAKE} ${_M} regress + @cd ${.CURDIR}/regress && ${MAKE} regress .endif .if ${MKMAN} != "no" afterinstall: whatis.db whatis.db: - cd ${.CURDIR}/share/man && ${MAKE} ${_M} makedb + cd ${.CURDIR}/share/man && ${MAKE} makedb .endif # Targets (in order!) called by "make build". @@ -113,7 +117,7 @@ BUILDTARGETS+= do-distrib-dirs .if !defined(NOINCLUDES) BUILDTARGETS+= includes .endif -BUILDTARGETS+= do-build +BUILDTARGETS+= do-lib-csu do-lib do-gnu-lib do-build # Enforce proper ordering of some rules. @@ -128,32 +132,36 @@ build: @echo "Build already installed into ${DESTDIR}" .else @echo -n "Build started at: " && date - @${MAKE} ${_J} ${_M} ${BUILDTARGETS} +.for tgt in ${BUILDTARGETS} + ${MAKE} ${_J} ${tgt} +.endfor @echo -n "Build finished at: " && date .endif # Build a release or snapshot (implies "make build"). release snapshot: build - cd ${.CURDIR}/etc && ${MAKE} ${_M} INSTALL_DONE=1 release + cd ${.CURDIR}/etc && ${MAKE} INSTALL_DONE=1 release # Special components of the "make build" process. do-make-tools: - cd ${.CURDIR}/tools && ${MAKE} ${_M} build + cd ${.CURDIR}/tools && ${MAKE} build do-distrib-dirs: - cd ${.CURDIR}/etc && ${MAKE} ${_M} DESTDIR=${DESTDIR} distrib-dirs + cd ${.CURDIR}/etc && ${MAKE} DESTDIR=${DESTDIR} distrib-dirs -do-build: .for dir in lib/csu lib gnu/lib +do-${dir:S/\//-/}: .for targ in dependall install cd ${.CURDIR}/${dir} && \ - ${MAKE} ${_M} ${_J} MKSHARE=no MKLINT=no ${targ} + ${MAKE} ${_J} MKSHARE=no MKLINT=no ${targ} .endfor .endfor - ${MAKE} ${_M} ${_J} dependall - ${MAKE} ${_M} ${_J} install + +do-build: + ${MAKE} ${_J} dependall + ${MAKE} ${_J} install # Speedup stubs for some subtrees that don't need to run these rules. # (Tells not to recurse for them.) @@ -164,6 +172,19 @@ dependall-tools depend-tools all-tools i dependall-distrib depend-distrib all-distrib install-distrib includes-distrib: @true -.include "${.CURDIR}/share/mk/bsd.subdir.mk" +.include + +# Rules for building the BUILDING.* documentation files. + +build-docs: ${.CURDIR}/BUILDING.txt ${.CURDIR}/BUILDING.html + +.SUFFIXES: .mdoc .html .txt + +.mdoc.html: ${.CURDIR}/Makefile + groff -mdoc2html -Tlatin1 -P-b -P-u -P-o -ww -mtty-char $< >$@ -_M:= -m ${.CURDIR}/share/mk +# The awk expression changes line endings from LF to CR-LF to make +# this readable on many more platforms than just Un*x. +.mdoc.txt: ${.CURDIR}/Makefile + groff -mdoc -Tascii -P-b -P-u -P-o $< | \ + awk 'BEGIN{ORS="\r\n"}{print}' >$@