Makefile revision 19966
12061Sjkh#
219966Sache#	$Id: Makefile,v 1.109 1996/11/01 19:03:33 adam Exp $
32061Sjkh#
42061Sjkh# Make command line options:
515603Smarkm#	-DCLOBBER will remove /usr/include
62061Sjkh#	-DMAKE_LOCAL to add ./local to the SUBDIR list
72061Sjkh#	-DMAKE_PORTS to add ./ports to the SUBDIR list
83197Scsgr#	-DMAKE_EBONES to build eBones (KerberosIV)
93197Scsgr#
102061Sjkh#	-DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
1112483Speter#	-DNOCLEAN do not clean at all
122160Scsgr#	-DNOCRYPT will prevent building of crypt versions
132834Swollman#	-DNOLKM do not build loadable kernel modules
142061Sjkh#	-DNOOBJDIR do not run ``${MAKE} obj''
152061Sjkh#	-DNOPROFILE do not build profiled libraries
162160Scsgr#	-DNOSECURE do not go into secure subdir
1717308Speter#	-DNOGAMES do not go into games subdir
1819320Sadam#	-DNOSHARE do not go into share subdir
191594Srgrimes
2017308Speter#
2117308Speter# The intended user-driven targets are:
2217308Speter# world       - rebuild *everything*, including glue to help do upgrades.
2317308Speter# reinstall   - use an existing (eg: NFS mounted) build to do an update.
2417308Speter# update      - convenient way to update your source tree (eg: sup/cvs)
2517308Speter# most        - build user commands, no libraries or include files
2617308Speter# installmost - install user commands, no libraries or include files
2719175Sbde#
2819175Sbde# Standard targets (not defined here) are documented in the makefiles in
2919175Sbde# /usr/share/mk.  These include:
3019175Sbde#		obj depend all install clean cleandepend cleanobj
3117308Speter
3217308Speter
332061Sjkh# Put initial settings here.
342061SjkhSUBDIR=
351594Srgrimes
367407Srgrimes# We must do include and lib first so that the perl *.ph generation
377407Srgrimes# works correctly as it uses the header files installed by this.
387108Sphk.if exists(include)
397108SphkSUBDIR+= include
407108Sphk.endif
417407Srgrimes.if exists(lib)
427407SrgrimesSUBDIR+= lib
437407Srgrimes.endif
447108Sphk
452061Sjkh.if exists(bin)
462061SjkhSUBDIR+= bin
472061Sjkh.endif
4817308Speter.if exists(games) && !defined(NOGAMES)
492061SjkhSUBDIR+= games
502061Sjkh.endif
512061Sjkh.if exists(gnu)
522061SjkhSUBDIR+= gnu
532061Sjkh.endif
543197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
552626ScsgrSUBDIR+= eBones
562626Scsgr.endif
572061Sjkh.if exists(libexec)
582061SjkhSUBDIR+= libexec
592061Sjkh.endif
602061Sjkh.if exists(sbin)
612061SjkhSUBDIR+= sbin
622061Sjkh.endif
6319320Sadam.if exists(share) && !defined(NOSHARE)
642061SjkhSUBDIR+= share
652061Sjkh.endif
662061Sjkh.if exists(sys)
672061SjkhSUBDIR+= sys
682061Sjkh.endif
692061Sjkh.if exists(usr.bin)
702061SjkhSUBDIR+= usr.bin
712061Sjkh.endif
722061Sjkh.if exists(usr.sbin)
732061SjkhSUBDIR+= usr.sbin
742061Sjkh.endif
752834Swollman.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
762834SwollmanSUBDIR+= secure
772834Swollman.endif
782834Swollman.if exists(lkm) && !defined(NOLKM)
792834SwollmanSUBDIR+= lkm
802834Swollman.endif
811594Srgrimes
824486Sphk# etc must be last for "distribute" to work
834486Sphk.if exists(etc) && make(distribute)
844486SphkSUBDIR+= etc
854486Sphk.endif
864486Sphk
872061Sjkh# These are last, since it is nice to at least get the base system
882061Sjkh# rebuilt before you do them.
892061Sjkh.if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
902061SjkhSUBDIR+= local
912061Sjkh.endif
922061Sjkh.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
932061SjkhSUBDIR+= ports
942061Sjkh.endif
952061Sjkh
9617308Speter# Handle -DNOOBJDIR, -DNOCLEAN and -DNOCLEANDIR
972061Sjkh.if defined(NOOBJDIR)
982061SjkhOBJDIR=
992061Sjkh.else
1002061SjkhOBJDIR=		obj
1012061Sjkh.endif
10212483Speter
10312483Speter.if defined(NOCLEAN)
10412483SpeterCLEANDIR=
10512483Speter.else
1062061Sjkh.if defined(NOCLEANDIR)
1072061SjkhCLEANDIR=	clean
1088854Srgrimes.else
1092061SjkhCLEANDIR=	cleandir
1102061Sjkh.endif
11112483Speter.endif
1122061Sjkh
11318714SacheSUP?=           sup
11418714SacheSUPFLAGS?=      -v
11518714Sache
11617308Speter#
11717308Speter# While building tools for bootstrapping, we dont need to waste time on
11817308Speter# profiled libraries or man pages.  This speeds things up somewhat.
11917308Speter#
12015603SmarkmMK_FLAGS=	-DNOMAN -DNOPROFILE
12115603Smarkm
12217308Speter#
12317308Speter# world
12417308Speter#
12517308Speter# Attempt to rebuild and reinstall *everything*, with reasonable chance of
12617308Speter# success, regardless of how old your existing system is.
12717308Speter#
12817308Speter# >> Beware, it overwrites the local build environment! <<
12917308Speter#
13017308Speterworld:
13118362Sjkh	@echo "--------------------------------------------------------------"
13219966Sache	@echo "make world started on `LC_TIME=C date`"
13318362Sjkh	@echo "--------------------------------------------------------------"
13417308Speter.if target(pre-world)
13517308Speter	@echo "--------------------------------------------------------------"
13617308Speter	@echo " Making 'pre-world' target"
13717308Speter	@echo "--------------------------------------------------------------"
13817308Speter	cd ${.CURDIR} && ${MAKE} pre-world
13917308Speter	@echo
14016550Sjkh.endif
1412061Sjkh	@echo "--------------------------------------------------------------"
14217308Speter	@echo " Making hierarchy"
1432061Sjkh	@echo "--------------------------------------------------------------"
14417308Speter	cd ${.CURDIR} && ${MAKE} hierarchy
1452061Sjkh	@echo
14617308Speter	@echo "--------------------------------------------------------------"
14717308Speter	@echo " Rebuilding /usr/share/mk"
14817308Speter	@echo "--------------------------------------------------------------"
14917308Speter	cd ${.CURDIR} && ${MAKE} mk
15017308Speter	@echo
15117308Speter	@echo "--------------------------------------------------------------"
15217308Speter	@echo " Cleaning up the source tree"
15317308Speter	@echo "--------------------------------------------------------------"
15417308Speter.if defined(NOCLEAN)
15517308Speter	@echo "Not cleaning anything! I sure hope you know what you are doing!"
15617308Speter.else
15717466Speter	cd ${.CURDIR} && ${MAKE} ${CLEANDIR}
15817308Speter.endif
15917308Speter	@echo
16017466Speter.if !defined(NOOBJDIR)
16117308Speter	@echo "--------------------------------------------------------------"
16217308Speter	@echo " Rebuilding the obj tree"
16317308Speter	@echo "--------------------------------------------------------------"
16417308Speter	cd ${.CURDIR} && ${MAKE} obj
16517466Speter	@echo
16617308Speter.endif
16717308Speter	@echo "--------------------------------------------------------------"
16817308Speter	@echo " Rebuilding bootstrap tools"
16917308Speter	@echo "--------------------------------------------------------------"
17017308Speter	cd ${.CURDIR} && ${MAKE} bootstrap
17117308Speter	@echo
17217308Speter	@echo "--------------------------------------------------------------"
17317308Speter	@echo " Rebuilding tools necessary to build the include files"
17417308Speter	@echo "--------------------------------------------------------------"
17517308Speter	cd ${.CURDIR} && ${MAKE} include-tools
17617308Speter	@echo
17717308Speter	@echo "--------------------------------------------------------------"
17817308Speter	@echo " Rebuilding /usr/include"
17917308Speter	@echo "--------------------------------------------------------------"
18017308Speter	cd ${.CURDIR} && ${MAKE} includes
18117308Speter	@echo
18217308Speter	@echo "--------------------------------------------------------------"
18317308Speter	@echo " Rebuilding tools needed to build the libraries"
18417308Speter	@echo "--------------------------------------------------------------"
18517308Speter	cd ${.CURDIR} && ${MAKE} lib-tools
18617308Speter	@echo
18717308Speter	@echo "--------------------------------------------------------------"
18817308Speter	@echo " Rebuilding /usr/lib"
18917308Speter	@echo "--------------------------------------------------------------"
19017308Speter	cd ${.CURDIR} && ${MAKE} libraries
19117308Speter	@echo
19217308Speter	@echo "--------------------------------------------------------------"
19318392Speter	@echo " Rebuilding sgml tools, symorder, groff and zic(8)"
19417308Speter	@echo "--------------------------------------------------------------"
19517308Speter	cd ${.CURDIR} && ${MAKE} build-tools
19617308Speter	@echo
19717308Speter	@echo "--------------------------------------------------------------"
19817962Speter	@echo " Rebuilding dependencies"
19917308Speter	@echo "--------------------------------------------------------------"
20017962Speter	cd ${.CURDIR} && ${MAKE} depend
20117962Speter	@echo
20217962Speter	@echo "--------------------------------------------------------------"
20317962Speter	@echo " Building everything.."
20417962Speter	@echo "--------------------------------------------------------------"
20517962Speter	cd ${.CURDIR} && ${MAKE} all
20617962Speter	@echo
20717962Speter	@echo "--------------------------------------------------------------"
20817962Speter	@echo " Installing everything.."
20917962Speter	@echo "--------------------------------------------------------------"
21017962Speter	cd ${.CURDIR} && ${MAKE} install
21117962Speter	@echo
21217962Speter	@echo "--------------------------------------------------------------"
21317962Speter	@echo " Rebuilding man page indexes"
21417962Speter	@echo "--------------------------------------------------------------"
21517308Speter	cd ${.CURDIR}/share/man && ${MAKE} makedb
21616550Sjkh.if target(post-world)
21717308Speter	@echo
21817308Speter	@echo "--------------------------------------------------------------"
21917308Speter	@echo " Making 'post-world' target"
22017308Speter	@echo "--------------------------------------------------------------"
22116550Sjkh	cd ${.CURDIR} && ${MAKE} post-world
22216550Sjkh.endif
22317308Speter	@echo
22417308Speter	@echo "--------------------------------------------------------------"
22519966Sache	@echo "make world completed on `LC_TIME=C date`"
22617962Speter	@echo "--------------------------------------------------------------"
2272061Sjkh
22817308Speter#
22917308Speter# reinstall
23017308Speter#
23117308Speter# If you have a build server, you can NFS mount the source and obj directories
23217308Speter# and do a 'make reinstall' on the *client* to install new binaries from the
23317308Speter# most recent server build.
23417308Speter#
23517308Speterreinstall:
23612483Speter	@echo "--------------------------------------------------------------"
23717308Speter	@echo " Making hierarchy"
23812483Speter	@echo "--------------------------------------------------------------"
23917308Speter	cd ${.CURDIR} && ${MAKE} hierarchy
24012483Speter	@echo
2412061Sjkh	@echo "--------------------------------------------------------------"
24217308Speter	@echo " Rebuilding /usr/share/mk"
2432061Sjkh	@echo "--------------------------------------------------------------"
24417308Speter	cd ${.CURDIR} && ${MAKE} mk
24517308Speter	@echo
24617308Speter	@echo "--------------------------------------------------------------"
24717962Speter	@echo " Installing everything.."
24817962Speter	@echo "--------------------------------------------------------------"
24917308Speter	cd ${.CURDIR} && ${MAKE} install
25017962Speter	@echo
25117962Speter	@echo "--------------------------------------------------------------"
25217962Speter	@echo " Rebuilding man page indexes"
25317962Speter	@echo "--------------------------------------------------------------"
25417308Speter	cd ${.CURDIR}/share/man && ${MAKE} makedb
2552061Sjkh
25617308Speter
25717308Speter#
25817308Speter# update
25917308Speter#
26017308Speter# Update the source tree, by running sup and/or running cvs to update to the
26117308Speter# latest copy.
26217308Speter#
2632302Spaulupdate:
2642302Spaul.if defined(SUP_UPDATE)
2652302Spaul	@echo "--------------------------------------------------------------"
2662302Spaul	@echo "Running sup"
2672302Spaul	@echo "--------------------------------------------------------------"
26818714Sache	@${SUP} ${SUPFLAGS} ${SUPFILE}
26910760Sache.if defined(SUPFILE1)
27018714Sache	@${SUP} ${SUPFLAGS} ${SUPFILE1}
2712302Spaul.endif
27210760Sache.if defined(SUPFILE2)
27318714Sache	@${SUP} ${SUPFLAGS} ${SUPFILE2}
27410760Sache.endif
27510760Sache.endif
2762302Spaul.if defined(CVS_UPDATE)
2772302Spaul	@echo "--------------------------------------------------------------"
2782302Spaul	@echo "Updating /usr/src from cvs repository" ${CVSROOT}
2792302Spaul	@echo "--------------------------------------------------------------"
28016591Spst	cd ${.CURDIR} &&  cvs -q update -P -d
2812302Spaul.endif
2822302Spaul
28317308Speter
28417308Speter#
28517308Speter# most
28617308Speter#
28717308Speter# Build most of the user binaries on the existing system libs and includes.
28817308Speter#
28917308Spetermost:
2902061Sjkh	@echo "--------------------------------------------------------------"
29117308Speter	@echo " Building programs only"
2922061Sjkh	@echo "--------------------------------------------------------------"
29317308Speter	cd ${.CURDIR}/bin	&&	${MAKE} ${.MAKEFLAGS} all
29417308Speter	cd ${.CURDIR}/sbin	&&	${MAKE} ${.MAKEFLAGS} all
29517308Speter	cd ${.CURDIR}/libexec	&&	${MAKE} ${.MAKEFLAGS} all
29617308Speter	cd ${.CURDIR}/usr.bin	&&	${MAKE} ${.MAKEFLAGS} all
29717308Speter	cd ${.CURDIR}/usr.sbin	&&	${MAKE} ${.MAKEFLAGS} all
29817308Speter	cd ${.CURDIR}/gnu/libexec &&	${MAKE} ${.MAKEFLAGS} all
29917308Speter	cd ${.CURDIR}/gnu/usr.bin &&	${MAKE} ${.MAKEFLAGS} all
30017308Speter	cd ${.CURDIR}/gnu/usr.sbin &&	${MAKE} ${.MAKEFLAGS} all
30117308Speter#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
30217308Speter#	cd ${.CURDIR}/eBones	&&	${MAKE} ${.MAKEFLAGS} most
30317308Speter#.endif
30417308Speter#.if !defined(NOSECURE) && !defined(NOCRYPT)
30517308Speter#	cd ${.CURDIR}/secure	&&	${MAKE} ${.MAKEFLAGS} most
30617308Speter#.endif
3072061Sjkh
30817308Speter#
30917308Speter# installmost
31017308Speter#
31117308Speter# Install the binaries built by the 'most' target.  This does not include
31217308Speter# libraries or include files.
31317308Speter#
3143626Swollmaninstallmost:
3153626Swollman	@echo "--------------------------------------------------------------"
3163626Swollman	@echo " Installing programs only"
3173626Swollman	@echo "--------------------------------------------------------------"
3183626Swollman	cd ${.CURDIR}/bin	&&	${MAKE} ${.MAKEFLAGS} install
3193626Swollman	cd ${.CURDIR}/sbin	&&	${MAKE} ${.MAKEFLAGS} install
3203626Swollman	cd ${.CURDIR}/libexec	&&	${MAKE} ${.MAKEFLAGS} install
3213626Swollman	cd ${.CURDIR}/usr.bin	&&	${MAKE} ${.MAKEFLAGS} install
3223626Swollman	cd ${.CURDIR}/usr.sbin	&&	${MAKE} ${.MAKEFLAGS} install
3233626Swollman	cd ${.CURDIR}/gnu/libexec &&	${MAKE} ${.MAKEFLAGS} install
3243626Swollman	cd ${.CURDIR}/gnu/usr.bin &&	${MAKE} ${.MAKEFLAGS} install
3257059Sroberto	cd ${.CURDIR}/gnu/usr.sbin &&	${MAKE} ${.MAKEFLAGS} install
3263626Swollman#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
3273626Swollman#	cd ${.CURDIR}/eBones	&&	${MAKE} ${.MAKEFLAGS} installmost
3283626Swollman#.endif
3293626Swollman#.if !defined(NOSECURE) && !defined(NOCRYPT)
3303626Swollman#	cd ${.CURDIR}/secure	&&	${MAKE} ${.MAKEFLAGS} installmost
3313626Swollman#.endif
3323626Swollman
33317308Speter#
33417308Speter# ------------------------------------------------------------------------
33517308Speter#
33617308Speter# From here onwards are utility targets used by the 'make world' and
33717308Speter# related targets.  If your 'world' breaks, you may like to try to fix
33817308Speter# the problem and manually run the following targets to attempt to
33917308Speter# complete the build.  Beware, this is *not* guaranteed to work, you
34017308Speter# need to have a pretty good grip on the current state of the system
34117308Speter# to attempt to manually finish it.  If in doubt, 'make world' again.
34217308Speter#
3433626Swollman
34417308Speter#
34517308Speter# heirarchy - ensure that all the needed directories are present
34617308Speter#
34717308Speterhierarchy:
34817308Speter	cd ${.CURDIR}/etc &&		${MAKE} distrib-dirs
34917308Speter
35017308Speter#
35117308Speter# mk - update the /usr/share/mk makefiles.
35217308Speter#
3532061Sjkhmk:
35416663Sjkh	cd ${.CURDIR}/share/mk &&	${MAKE} install
3552061Sjkh
35617308Speter#
35717308Speter# bootstrap - [re]build tools needed to run the actual build, this includes
35817308Speter# tools needed by 'make depend', as some tools are needed to generate source
35917308Speter# for the dependency information to be gathered from.
36017308Speter#
36117308Speterbootstrap:
36217820Sjkh	cd ${.CURDIR}/usr.bin/make && ${MAKE} depend && \
36317308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
36417820Sjkh	cd ${.CURDIR}/usr.bin/xinstall && ${MAKE} depend && \
36517308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
36617820Sjkh	cd ${.CURDIR}/usr.bin/lex && ${MAKE} bootstrap && ${MAKE} depend && \
36717467Speter		${MAKE} ${MK_FLAGS} -DNOLIB all install ${CLEANDIR} ${OBJDIR}
36817308Speter
36917308Speter#
37017308Speter# include-tools - generally the same as 'bootstrap', except that it's for
37117308Speter# things that are specifically needed to generate include files.
37217308Speter#
37317308Speter# XXX should be merged with bootstrap, it's not worth keeeping them seperate
37417308Speter#
37517308Speterinclude-tools:
37617820Sjkh	cd ${.CURDIR}/usr.bin/rpcgen && ${MAKE} depend && \
37717820Sjkh		${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
37817308Speter
37917308Speter#
38017308Speter# includes - possibly generate and install the include files.
38117308Speter#
38214119Speterincludes:
3832061Sjkh.if defined(CLOBBER)
3847130Srgrimes	rm -rf ${DESTDIR}/usr/include/*
3857130Srgrimes	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
3867130Srgrimes		-p ${DESTDIR}/usr/include
3872061Sjkh.endif
38817962Speter	cd ${.CURDIR}/include/rpcsvc &&		${MAKE} all
3892061Sjkh	cd ${.CURDIR}/include &&		${MAKE} install
39017308Speter	cd ${.CURDIR}/gnu/include &&		${MAKE} install
3912685Srgrimes	cd ${.CURDIR}/gnu/lib/libreadline &&	${MAKE} beforeinstall
3926927Snate	cd ${.CURDIR}/gnu/lib/libregex &&	${MAKE} beforeinstall
39318674Speter	cd ${.CURDIR}/gnu/lib/libstdc++ &&      ${MAKE} beforeinstall
3942685Srgrimes	cd ${.CURDIR}/gnu/lib/libg++ &&         ${MAKE} beforeinstall
3953518Sache	cd ${.CURDIR}/gnu/lib/libdialog &&      ${MAKE} beforeinstall
3963197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
3973197Scsgr	cd ${.CURDIR}/eBones/include &&		${MAKE} beforeinstall
39812166Sjkh	cd ${.CURDIR}/eBones/lib/libkrb &&	${MAKE} beforeinstall
39912485Sjkh	cd ${.CURDIR}/eBones/lib/libkadm &&	${MAKE} beforeinstall
4003197Scsgr.endif
4012061Sjkh	cd ${.CURDIR}/lib/libc &&		${MAKE} beforeinstall
4022061Sjkh	cd ${.CURDIR}/lib/libcurses &&		${MAKE} beforeinstall
4032061Sjkh	cd ${.CURDIR}/lib/libedit &&		${MAKE} beforeinstall
40416786Snate	cd ${.CURDIR}/lib/libftpio &&		${MAKE} beforeinstall
4052883Sphk	cd ${.CURDIR}/lib/libmd &&		${MAKE} beforeinstall
40617308Speter	cd ${.CURDIR}/lib/libmytinfo &&         ${MAKE} beforeinstall
40717308Speter	cd ${.CURDIR}/lib/libncurses &&		${MAKE} beforeinstall
4087281Srgrimes.if !defined(WANT_CSRG_LIBM)
4093242Spaul	cd ${.CURDIR}/lib/msun &&		${MAKE} beforeinstall
4103242Spaul.endif
4117171Sats	cd ${.CURDIR}/lib/libpcap &&		${MAKE} beforeinstall
4122061Sjkh	cd ${.CURDIR}/lib/librpcsvc &&		${MAKE} beforeinstall
4133213Spst	cd ${.CURDIR}/lib/libskey &&		${MAKE} beforeinstall
41417308Speter	cd ${.CURDIR}/lib/libtcl &&		${MAKE} beforeinstall
41517308Speter	cd ${.CURDIR}/lib/libtermcap &&		${MAKE} beforeinstall
4165749Swollman	cd ${.CURDIR}/lib/libcom_err &&		${MAKE} beforeinstall
4175772Swollman	cd ${.CURDIR}/lib/libss &&		${MAKE} beforeinstall
41817308Speter	cd ${.CURDIR}/lib/libscsi &&		${MAKE} beforeinstall
41917308Speter	cd ${.CURDIR}/lib/libutil &&		${MAKE} beforeinstall
4202061Sjkh
42117308Speter#
42217308Speter# lib-tools - build tools to compile and install the libraries.
42317308Speter#
4245366Snatelib-tools:
42517820Sjkh	cd ${.CURDIR}/usr.bin/tsort && ${MAKE} depend && \
42617467Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
42717820Sjkh	cd ${.CURDIR}/gnu/usr.bin/ld && ${MAKE} depend && \
42817308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
42918674Speter	cd ${.CURDIR}/gnu/usr.bin/as && ${MAKE} depend && \
43018674Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
43117820Sjkh	cd ${.CURDIR}/usr.bin/ar && ${MAKE} depend && \
43217308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
43317820Sjkh	cd ${.CURDIR}/usr.bin/ranlib && ${MAKE} depend && \
43417308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
43517820Sjkh	cd ${.CURDIR}/usr.bin/nm && ${MAKE} depend && \
43617308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
43717820Sjkh	cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
43817308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
43917820Sjkh	cd ${.CURDIR}/usr.bin/compile_et && ${MAKE} depend && \
44017308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} && \
4415728Swollman		rm -f /usr/sbin/compile_et
44217820Sjkh	cd ${.CURDIR}/usr.bin/mk_cmds && ${MAKE} depend && \
44317308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
44418392Speter	cd ${.CURDIR}/gnu/usr.bin/bison && ${MAKE} depend && \
44518392Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
44618392Speter	cd ${.CURDIR}/gnu/usr.bin/gperf && ${MAKE} depend && \
44718392Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
44818392Speter	cd ${.CURDIR}/gnu/usr.bin/cc && ${MAKE} depend && \
44918392Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4505366Snate
45117308Speter#
45217308Speter# libraries - build and install the libraries
45317308Speter#
4542061Sjkhlibraries:
4558295Srgrimes.if exists(lib/libcompat)
45617820Sjkh	cd ${.CURDIR}/lib/libcompat && ${MAKE} depend && \
45717308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4588295Srgrimes.endif
4598489Srgrimes.if exists(lib/libncurses)
46017820Sjkh	cd ${.CURDIR}/lib/libncurses && ${MAKE} depend && \
46117308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4628489Srgrimes.endif
4638489Srgrimes.if exists(lib/libtermcap)
46417820Sjkh	cd ${.CURDIR}/lib/libtermcap && ${MAKE} depend && \
46517308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4668489Srgrimes.endif
46717308Speter.if exists(lib)
46817820Sjkh	cd ${.CURDIR}/lib/csu/i386 && ${MAKE} depend && \
46917308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
47017308Speter.endif
4718295Srgrimes.if exists(gnu)
47217820Sjkh	cd ${.CURDIR}/gnu/lib && ${MAKE} depend && \
47317308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4748295Srgrimes.endif
4752160Scsgr.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
47617820Sjkh	cd ${.CURDIR}/secure/lib && ${MAKE} depend && \
47717308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4782160Scsgr.endif
4792279Spaul.if exists(lib)
48017820Sjkh	cd ${.CURDIR}/lib && ${MAKE} depend && \
48117308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4822279Spaul.endif
48317234Sjraynard.if exists(usr.bin/lex/lib)
48417820Sjkh	cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
48517308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
48611772Snate.endif
4873197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
48817820Sjkh	cd ${.CURDIR}/eBones/lib && ${MAKE} depend && \
48917308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4902626Scsgr.endif
4918304Srgrimes.if exists(usr.sbin/pcvt/keycap)
49217820Sjkh	cd ${.CURDIR}/usr.sbin/pcvt/keycap && ${MAKE} depend && \
49317308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4948304Srgrimes.endif
4952061Sjkh
49617308Speter#
49717308Speter# build-tools - build and install any other tools needed to complete the
49817308Speter# compile and install.
49917308Speter#
50011806Sphkbuild-tools:
50119175Sbde.for d in				\
50219175Sbde		usr.bin/symorder	\
50319175Sbde		usr.bin/sgmls		\
50419175Sbde		usr.bin/sgmlfmt		\
50519175Sbde		share/sgml		\
50619175Sbde		usr.sbin/zic		\
50719175Sbde		gnu/usr.bin/awk		\
50819175Sbde		gnu/usr.bin/groff
50919175Sbde	cd ${.CURDIR}/$d && ${MAKE} depend && \
51017308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
51119175Sbde.endfor
5122061Sjkh
5131594Srgrimes.include <bsd.subdir.mk>
514