Makefile revision 25979
12061Sjkh#
225979Sjkh#	$Id: Makefile,v 1.125 1997/05/13 18:11:38 peter Exp $
32061Sjkh#
42061Sjkh# Make command line options:
515603Smarkm#	-DCLOBBER will remove /usr/include
625979Sjkh#	-DLOCAL_DIRS to add additional dirs to the SUBDIR list
73197Scsgr#	-DMAKE_EBONES to build eBones (KerberosIV)
820710Sasami#	-DALLLANG to build documentation for all languages
920710Sasami#	  (where available -- see share/doc/Makefile)
103197Scsgr#
112061Sjkh#	-DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
1212483Speter#	-DNOCLEAN do not clean at all
132160Scsgr#	-DNOCRYPT will prevent building of crypt versions
142834Swollman#	-DNOLKM do not build loadable kernel modules
152061Sjkh#	-DNOOBJDIR do not run ``${MAKE} obj''
162061Sjkh#	-DNOPROFILE do not build profiled libraries
172160Scsgr#	-DNOSECURE do not go into secure subdir
1817308Speter#	-DNOGAMES do not go into games subdir
1919320Sadam#	-DNOSHARE do not go into share subdir
2021536Sjmacd#       -DNOINFO do not make or install info files
2125399Sjb#       -DNOLIBC_R do not build libc_r.
221594Srgrimes
2317308Speter#
2417308Speter# The intended user-driven targets are:
2517308Speter# world       - rebuild *everything*, including glue to help do upgrades.
2617308Speter# reinstall   - use an existing (eg: NFS mounted) build to do an update.
2717308Speter# update      - convenient way to update your source tree (eg: sup/cvs)
2817308Speter# most        - build user commands, no libraries or include files
2917308Speter# installmost - install user commands, no libraries or include files
3019175Sbde#
3119175Sbde# Standard targets (not defined here) are documented in the makefiles in
3219175Sbde# /usr/share/mk.  These include:
3319175Sbde#		obj depend all install clean cleandepend cleanobj
3417308Speter
3525647Sbde.MAKEFLAGS:=	${.MAKEFLAGS} -m ${.CURDIR}/share/mk
3617308Speter
372061Sjkh# Put initial settings here.
382061SjkhSUBDIR=
391594Srgrimes
4025313Sbde# We must do share/info early so that installation of info `dir'
4125313Sbde# entries works correctly.  Do it first since it is less likely to
4225313Sbde# grow dependencies on include and lib than vice versa.
4325313Sbde.if exists(share/info)
4425313SbdeSUBDIR+= share/info
4525313Sbde.endif
4625313Sbde
4725313Sbde# We must do include and lib early so that the perl *.ph generation
487407Srgrimes# works correctly as it uses the header files installed by this.
497108Sphk.if exists(include)
507108SphkSUBDIR+= include
517108Sphk.endif
527407Srgrimes.if exists(lib)
537407SrgrimesSUBDIR+= lib
547407Srgrimes.endif
557108Sphk
562061Sjkh.if exists(bin)
572061SjkhSUBDIR+= bin
582061Sjkh.endif
5917308Speter.if exists(games) && !defined(NOGAMES)
602061SjkhSUBDIR+= games
612061Sjkh.endif
622061Sjkh.if exists(gnu)
632061SjkhSUBDIR+= gnu
642061Sjkh.endif
653197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
662626ScsgrSUBDIR+= eBones
672626Scsgr.endif
682061Sjkh.if exists(libexec)
692061SjkhSUBDIR+= libexec
702061Sjkh.endif
712061Sjkh.if exists(sbin)
722061SjkhSUBDIR+= sbin
732061Sjkh.endif
7419320Sadam.if exists(share) && !defined(NOSHARE)
752061SjkhSUBDIR+= share
762061Sjkh.endif
772061Sjkh.if exists(sys)
782061SjkhSUBDIR+= sys
792061Sjkh.endif
802061Sjkh.if exists(usr.bin)
812061SjkhSUBDIR+= usr.bin
822061Sjkh.endif
832061Sjkh.if exists(usr.sbin)
842061SjkhSUBDIR+= usr.sbin
852061Sjkh.endif
862834Swollman.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
872834SwollmanSUBDIR+= secure
882834Swollman.endif
892834Swollman.if exists(lkm) && !defined(NOLKM)
902834SwollmanSUBDIR+= lkm
912834Swollman.endif
921594Srgrimes
934486Sphk# etc must be last for "distribute" to work
944486Sphk.if exists(etc) && make(distribute)
954486SphkSUBDIR+= etc
964486Sphk.endif
974486Sphk
982061Sjkh# These are last, since it is nice to at least get the base system
992061Sjkh# rebuilt before you do them.
10025979Sjkh.if defined(LOCAL_DIRS)
10125979Sjkh.for _DIR in ${LOCAL_DIRS}
10225979Sjkh.if exists(${_DIR}) & exists(${_DIR}/Makefile)
10325979SjkhSUBDIR+= ${_DIR}
1042061Sjkh.endif
10525979Sjkh.endfor
1062061Sjkh.endif
1072061Sjkh
10817308Speter# Handle -DNOOBJDIR, -DNOCLEAN and -DNOCLEANDIR
1092061Sjkh.if defined(NOOBJDIR)
1102061SjkhOBJDIR=
1112061Sjkh.else
1122061SjkhOBJDIR=		obj
1132061Sjkh.endif
11412483Speter
11512483Speter.if defined(NOCLEAN)
11612483SpeterCLEANDIR=
11712483Speter.else
1182061Sjkh.if defined(NOCLEANDIR)
1192061SjkhCLEANDIR=	clean
1208854Srgrimes.else
1212061SjkhCLEANDIR=	cleandir
1222061Sjkh.endif
12312483Speter.endif
1242061Sjkh
12518714SacheSUP?=           sup
12618714SacheSUPFLAGS?=      -v
12718714Sache
12817308Speter#
12917308Speter# While building tools for bootstrapping, we dont need to waste time on
13017308Speter# profiled libraries or man pages.  This speeds things up somewhat.
13117308Speter#
13221536SjmacdMK_FLAGS=	-DNOINFO -DNOMAN -DNOPROFILE
13315603Smarkm
13417308Speter#
13517308Speter# world
13617308Speter#
13717308Speter# Attempt to rebuild and reinstall *everything*, with reasonable chance of
13817308Speter# success, regardless of how old your existing system is.
13917308Speter#
14017308Speter# >> Beware, it overwrites the local build environment! <<
14117308Speter#
14217308Speterworld:
14318362Sjkh	@echo "--------------------------------------------------------------"
14419966Sache	@echo "make world started on `LC_TIME=C date`"
14518362Sjkh	@echo "--------------------------------------------------------------"
14617308Speter.if target(pre-world)
14717308Speter	@echo "--------------------------------------------------------------"
14817308Speter	@echo " Making 'pre-world' target"
14917308Speter	@echo "--------------------------------------------------------------"
15017308Speter	cd ${.CURDIR} && ${MAKE} pre-world
15117308Speter	@echo
15216550Sjkh.endif
1532061Sjkh	@echo "--------------------------------------------------------------"
15417308Speter	@echo " Making hierarchy"
1552061Sjkh	@echo "--------------------------------------------------------------"
15617308Speter	cd ${.CURDIR} && ${MAKE} hierarchy
1572061Sjkh	@echo
15817308Speter	@echo "--------------------------------------------------------------"
15917308Speter	@echo " Cleaning up the source tree"
16017308Speter	@echo "--------------------------------------------------------------"
16117308Speter.if defined(NOCLEAN)
16217308Speter	@echo "Not cleaning anything! I sure hope you know what you are doing!"
16317308Speter.else
16417466Speter	cd ${.CURDIR} && ${MAKE} ${CLEANDIR}
16517308Speter.endif
16617308Speter	@echo
16717466Speter.if !defined(NOOBJDIR)
16817308Speter	@echo "--------------------------------------------------------------"
16917308Speter	@echo " Rebuilding the obj tree"
17017308Speter	@echo "--------------------------------------------------------------"
17117308Speter	cd ${.CURDIR} && ${MAKE} obj
17217466Speter	@echo
17317308Speter.endif
17417308Speter	@echo "--------------------------------------------------------------"
17517308Speter	@echo " Rebuilding bootstrap tools"
17617308Speter	@echo "--------------------------------------------------------------"
17717308Speter	cd ${.CURDIR} && ${MAKE} bootstrap
17817308Speter	@echo
17917308Speter	@echo "--------------------------------------------------------------"
18017308Speter	@echo " Rebuilding tools necessary to build the include files"
18117308Speter	@echo "--------------------------------------------------------------"
18217308Speter	cd ${.CURDIR} && ${MAKE} include-tools
18317308Speter	@echo
18417308Speter	@echo "--------------------------------------------------------------"
18517308Speter	@echo " Rebuilding /usr/include"
18617308Speter	@echo "--------------------------------------------------------------"
18717308Speter	cd ${.CURDIR} && ${MAKE} includes
18817308Speter	@echo
18917308Speter	@echo "--------------------------------------------------------------"
19017308Speter	@echo " Rebuilding tools needed to build the libraries"
19117308Speter	@echo "--------------------------------------------------------------"
19217308Speter	cd ${.CURDIR} && ${MAKE} lib-tools
19317308Speter	@echo
19417308Speter	@echo "--------------------------------------------------------------"
19517308Speter	@echo " Rebuilding /usr/lib"
19617308Speter	@echo "--------------------------------------------------------------"
19717308Speter	cd ${.CURDIR} && ${MAKE} libraries
19817308Speter	@echo
19917308Speter	@echo "--------------------------------------------------------------"
20018392Speter	@echo " Rebuilding sgml tools, symorder, groff and zic(8)"
20117308Speter	@echo "--------------------------------------------------------------"
20217308Speter	cd ${.CURDIR} && ${MAKE} build-tools
20317308Speter	@echo
20417308Speter	@echo "--------------------------------------------------------------"
20517962Speter	@echo " Rebuilding dependencies"
20617308Speter	@echo "--------------------------------------------------------------"
20717962Speter	cd ${.CURDIR} && ${MAKE} depend
20817962Speter	@echo
20917962Speter	@echo "--------------------------------------------------------------"
21017962Speter	@echo " Building everything.."
21117962Speter	@echo "--------------------------------------------------------------"
21217962Speter	cd ${.CURDIR} && ${MAKE} all
21317962Speter	@echo
21417962Speter	@echo "--------------------------------------------------------------"
21517962Speter	@echo " Installing everything.."
21617962Speter	@echo "--------------------------------------------------------------"
21717962Speter	cd ${.CURDIR} && ${MAKE} install
21817962Speter	@echo
21917962Speter	@echo "--------------------------------------------------------------"
22017962Speter	@echo " Rebuilding man page indexes"
22117962Speter	@echo "--------------------------------------------------------------"
22217308Speter	cd ${.CURDIR}/share/man && ${MAKE} makedb
22316550Sjkh.if target(post-world)
22417308Speter	@echo
22517308Speter	@echo "--------------------------------------------------------------"
22617308Speter	@echo " Making 'post-world' target"
22717308Speter	@echo "--------------------------------------------------------------"
22816550Sjkh	cd ${.CURDIR} && ${MAKE} post-world
22916550Sjkh.endif
23017308Speter	@echo
23117308Speter	@echo "--------------------------------------------------------------"
23219966Sache	@echo "make world completed on `LC_TIME=C date`"
23317962Speter	@echo "--------------------------------------------------------------"
2342061Sjkh
23517308Speter#
23617308Speter# reinstall
23717308Speter#
23817308Speter# If you have a build server, you can NFS mount the source and obj directories
23917308Speter# and do a 'make reinstall' on the *client* to install new binaries from the
24017308Speter# most recent server build.
24117308Speter#
24217308Speterreinstall:
24312483Speter	@echo "--------------------------------------------------------------"
24417308Speter	@echo " Making hierarchy"
24512483Speter	@echo "--------------------------------------------------------------"
24617308Speter	cd ${.CURDIR} && ${MAKE} hierarchy
24712483Speter	@echo
2482061Sjkh	@echo "--------------------------------------------------------------"
24917962Speter	@echo " Installing everything.."
25017962Speter	@echo "--------------------------------------------------------------"
25117308Speter	cd ${.CURDIR} && ${MAKE} install
25217962Speter	@echo
25317962Speter	@echo "--------------------------------------------------------------"
25417962Speter	@echo " Rebuilding man page indexes"
25517962Speter	@echo "--------------------------------------------------------------"
25617308Speter	cd ${.CURDIR}/share/man && ${MAKE} makedb
2572061Sjkh
25817308Speter
25917308Speter#
26017308Speter# update
26117308Speter#
26217308Speter# Update the source tree, by running sup and/or running cvs to update to the
26317308Speter# latest copy.
26417308Speter#
2652302Spaulupdate:
2662302Spaul.if defined(SUP_UPDATE)
2672302Spaul	@echo "--------------------------------------------------------------"
2682302Spaul	@echo "Running sup"
2692302Spaul	@echo "--------------------------------------------------------------"
27018714Sache	@${SUP} ${SUPFLAGS} ${SUPFILE}
27110760Sache.if defined(SUPFILE1)
27218714Sache	@${SUP} ${SUPFLAGS} ${SUPFILE1}
2732302Spaul.endif
27410760Sache.if defined(SUPFILE2)
27518714Sache	@${SUP} ${SUPFLAGS} ${SUPFILE2}
27610760Sache.endif
27710760Sache.endif
2782302Spaul.if defined(CVS_UPDATE)
2792302Spaul	@echo "--------------------------------------------------------------"
2802302Spaul	@echo "Updating /usr/src from cvs repository" ${CVSROOT}
2812302Spaul	@echo "--------------------------------------------------------------"
28216591Spst	cd ${.CURDIR} &&  cvs -q update -P -d
2832302Spaul.endif
2842302Spaul
28517308Speter
28617308Speter#
28717308Speter# most
28817308Speter#
28917308Speter# Build most of the user binaries on the existing system libs and includes.
29017308Speter#
29117308Spetermost:
2922061Sjkh	@echo "--------------------------------------------------------------"
29317308Speter	@echo " Building programs only"
2942061Sjkh	@echo "--------------------------------------------------------------"
29517308Speter	cd ${.CURDIR}/bin	&&	${MAKE} ${.MAKEFLAGS} all
29617308Speter	cd ${.CURDIR}/sbin	&&	${MAKE} ${.MAKEFLAGS} all
29717308Speter	cd ${.CURDIR}/libexec	&&	${MAKE} ${.MAKEFLAGS} all
29817308Speter	cd ${.CURDIR}/usr.bin	&&	${MAKE} ${.MAKEFLAGS} all
29917308Speter	cd ${.CURDIR}/usr.sbin	&&	${MAKE} ${.MAKEFLAGS} all
30017308Speter	cd ${.CURDIR}/gnu/libexec &&	${MAKE} ${.MAKEFLAGS} all
30117308Speter	cd ${.CURDIR}/gnu/usr.bin &&	${MAKE} ${.MAKEFLAGS} all
30217308Speter	cd ${.CURDIR}/gnu/usr.sbin &&	${MAKE} ${.MAKEFLAGS} all
30317308Speter#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
30417308Speter#	cd ${.CURDIR}/eBones	&&	${MAKE} ${.MAKEFLAGS} most
30517308Speter#.endif
30617308Speter#.if !defined(NOSECURE) && !defined(NOCRYPT)
30717308Speter#	cd ${.CURDIR}/secure	&&	${MAKE} ${.MAKEFLAGS} most
30817308Speter#.endif
3092061Sjkh
31017308Speter#
31117308Speter# installmost
31217308Speter#
31317308Speter# Install the binaries built by the 'most' target.  This does not include
31417308Speter# libraries or include files.
31517308Speter#
3163626Swollmaninstallmost:
3173626Swollman	@echo "--------------------------------------------------------------"
3183626Swollman	@echo " Installing programs only"
3193626Swollman	@echo "--------------------------------------------------------------"
3203626Swollman	cd ${.CURDIR}/bin	&&	${MAKE} ${.MAKEFLAGS} install
3213626Swollman	cd ${.CURDIR}/sbin	&&	${MAKE} ${.MAKEFLAGS} install
3223626Swollman	cd ${.CURDIR}/libexec	&&	${MAKE} ${.MAKEFLAGS} install
3233626Swollman	cd ${.CURDIR}/usr.bin	&&	${MAKE} ${.MAKEFLAGS} install
3243626Swollman	cd ${.CURDIR}/usr.sbin	&&	${MAKE} ${.MAKEFLAGS} install
3253626Swollman	cd ${.CURDIR}/gnu/libexec &&	${MAKE} ${.MAKEFLAGS} install
3263626Swollman	cd ${.CURDIR}/gnu/usr.bin &&	${MAKE} ${.MAKEFLAGS} install
3277059Sroberto	cd ${.CURDIR}/gnu/usr.sbin &&	${MAKE} ${.MAKEFLAGS} install
3283626Swollman#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
3293626Swollman#	cd ${.CURDIR}/eBones	&&	${MAKE} ${.MAKEFLAGS} installmost
3303626Swollman#.endif
3313626Swollman#.if !defined(NOSECURE) && !defined(NOCRYPT)
3323626Swollman#	cd ${.CURDIR}/secure	&&	${MAKE} ${.MAKEFLAGS} installmost
3333626Swollman#.endif
3343626Swollman
33517308Speter#
33617308Speter# ------------------------------------------------------------------------
33717308Speter#
33817308Speter# From here onwards are utility targets used by the 'make world' and
33917308Speter# related targets.  If your 'world' breaks, you may like to try to fix
34017308Speter# the problem and manually run the following targets to attempt to
34117308Speter# complete the build.  Beware, this is *not* guaranteed to work, you
34217308Speter# need to have a pretty good grip on the current state of the system
34317308Speter# to attempt to manually finish it.  If in doubt, 'make world' again.
34417308Speter#
3453626Swollman
34617308Speter#
34717308Speter# heirarchy - ensure that all the needed directories are present
34817308Speter#
34917308Speterhierarchy:
35017308Speter	cd ${.CURDIR}/etc &&		${MAKE} distrib-dirs
35117308Speter
35217308Speter#
35317308Speter# bootstrap - [re]build tools needed to run the actual build, this includes
35417308Speter# tools needed by 'make depend', as some tools are needed to generate source
35517308Speter# for the dependency information to be gathered from.
35617308Speter#
35717308Speterbootstrap:
35817820Sjkh	cd ${.CURDIR}/usr.bin/make && ${MAKE} depend && \
35917308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
36017820Sjkh	cd ${.CURDIR}/usr.bin/xinstall && ${MAKE} depend && \
36117308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
36217820Sjkh	cd ${.CURDIR}/usr.bin/lex && ${MAKE} bootstrap && ${MAKE} depend && \
36317467Speter		${MAKE} ${MK_FLAGS} -DNOLIB all install ${CLEANDIR} ${OBJDIR}
36417308Speter
36517308Speter#
36617308Speter# include-tools - generally the same as 'bootstrap', except that it's for
36717308Speter# things that are specifically needed to generate include files.
36817308Speter#
36917308Speter# XXX should be merged with bootstrap, it's not worth keeeping them seperate
37017308Speter#
37117308Speterinclude-tools:
37217820Sjkh	cd ${.CURDIR}/usr.bin/rpcgen && ${MAKE} depend && \
37317820Sjkh		${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
37417308Speter
37517308Speter#
37617308Speter# includes - possibly generate and install the include files.
37717308Speter#
37814119Speterincludes:
3792061Sjkh.if defined(CLOBBER)
3807130Srgrimes	rm -rf ${DESTDIR}/usr/include/*
3817130Srgrimes	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
3827130Srgrimes		-p ${DESTDIR}/usr/include
3832061Sjkh.endif
38425783Speter	cd ${.CURDIR}/include &&		${MAKE} all install
38517308Speter	cd ${.CURDIR}/gnu/include &&		${MAKE} install
3862685Srgrimes	cd ${.CURDIR}/gnu/lib/libreadline &&	${MAKE} beforeinstall
3876927Snate	cd ${.CURDIR}/gnu/lib/libregex &&	${MAKE} beforeinstall
38818674Speter	cd ${.CURDIR}/gnu/lib/libstdc++ &&      ${MAKE} beforeinstall
3892685Srgrimes	cd ${.CURDIR}/gnu/lib/libg++ &&         ${MAKE} beforeinstall
3903518Sache	cd ${.CURDIR}/gnu/lib/libdialog &&      ${MAKE} beforeinstall
3913197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
3923197Scsgr	cd ${.CURDIR}/eBones/include &&		${MAKE} beforeinstall
39312166Sjkh	cd ${.CURDIR}/eBones/lib/libkrb &&	${MAKE} beforeinstall
39412485Sjkh	cd ${.CURDIR}/eBones/lib/libkadm &&	${MAKE} beforeinstall
3953197Scsgr.endif
39625313Sbde	cd ${.CURDIR}/lib/csu/i386 &&		${MAKE} beforeinstall
3972061Sjkh	cd ${.CURDIR}/lib/libc &&		${MAKE} beforeinstall
3982061Sjkh	cd ${.CURDIR}/lib/libcurses &&		${MAKE} beforeinstall
3992061Sjkh	cd ${.CURDIR}/lib/libedit &&		${MAKE} beforeinstall
40016786Snate	cd ${.CURDIR}/lib/libftpio &&		${MAKE} beforeinstall
4012883Sphk	cd ${.CURDIR}/lib/libmd &&		${MAKE} beforeinstall
40217308Speter	cd ${.CURDIR}/lib/libmytinfo &&         ${MAKE} beforeinstall
40317308Speter	cd ${.CURDIR}/lib/libncurses &&		${MAKE} beforeinstall
4047281Srgrimes.if !defined(WANT_CSRG_LIBM)
4053242Spaul	cd ${.CURDIR}/lib/msun &&		${MAKE} beforeinstall
4063242Spaul.endif
4077171Sats	cd ${.CURDIR}/lib/libpcap &&		${MAKE} beforeinstall
4082061Sjkh	cd ${.CURDIR}/lib/librpcsvc &&		${MAKE} beforeinstall
4093213Spst	cd ${.CURDIR}/lib/libskey &&		${MAKE} beforeinstall
41017308Speter	cd ${.CURDIR}/lib/libtcl &&		${MAKE} beforeinstall
41117308Speter	cd ${.CURDIR}/lib/libtermcap &&		${MAKE} beforeinstall
4125749Swollman	cd ${.CURDIR}/lib/libcom_err &&		${MAKE} beforeinstall
4135772Swollman	cd ${.CURDIR}/lib/libss &&		${MAKE} beforeinstall
41417308Speter	cd ${.CURDIR}/lib/libscsi &&		${MAKE} beforeinstall
41517308Speter	cd ${.CURDIR}/lib/libutil &&		${MAKE} beforeinstall
4162061Sjkh
41717308Speter#
41817308Speter# lib-tools - build tools to compile and install the libraries.
41917308Speter#
4205366Snatelib-tools:
42117820Sjkh	cd ${.CURDIR}/usr.bin/tsort && ${MAKE} depend && \
42217467Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
42317820Sjkh	cd ${.CURDIR}/gnu/usr.bin/ld && ${MAKE} depend && \
42417308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
42518674Speter	cd ${.CURDIR}/gnu/usr.bin/as && ${MAKE} depend && \
42618674Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
42717820Sjkh	cd ${.CURDIR}/usr.bin/ar && ${MAKE} depend && \
42817308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
42917820Sjkh	cd ${.CURDIR}/usr.bin/ranlib && ${MAKE} depend && \
43017308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
43117820Sjkh	cd ${.CURDIR}/usr.bin/nm && ${MAKE} depend && \
43217308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
43317820Sjkh	cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
43417308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
43517820Sjkh	cd ${.CURDIR}/usr.bin/compile_et && ${MAKE} depend && \
43617308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} && \
4375728Swollman		rm -f /usr/sbin/compile_et
43817820Sjkh	cd ${.CURDIR}/usr.bin/mk_cmds && ${MAKE} depend && \
43917308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
44021922Sjkh	cd ${.CURDIR}/usr.bin/uudecode && ${MAKE} depend && \
44121922Sjkh		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
44218392Speter	cd ${.CURDIR}/gnu/usr.bin/bison && ${MAKE} depend && \
44318392Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
44418392Speter	cd ${.CURDIR}/gnu/usr.bin/gperf && ${MAKE} depend && \
44518392Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
44618392Speter	cd ${.CURDIR}/gnu/usr.bin/cc && ${MAKE} depend && \
44718392Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4485366Snate
44917308Speter#
45017308Speter# libraries - build and install the libraries
45117308Speter#
4522061Sjkhlibraries:
45324754Sjdp.if exists(lib/csu/i386)
45424754Sjdp	cd ${.CURDIR}/lib/csu/i386 && ${MAKE} depend && \
45524754Sjdp		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
45624754Sjdp.endif
4578295Srgrimes.if exists(lib/libcompat)
45817820Sjkh	cd ${.CURDIR}/lib/libcompat && ${MAKE} depend && \
45917308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4608295Srgrimes.endif
4618489Srgrimes.if exists(lib/libncurses)
46217820Sjkh	cd ${.CURDIR}/lib/libncurses && ${MAKE} depend && \
46317308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4648489Srgrimes.endif
4658489Srgrimes.if exists(lib/libtermcap)
46617820Sjkh	cd ${.CURDIR}/lib/libtermcap && ${MAKE} depend && \
46717308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4688489Srgrimes.endif
4698295Srgrimes.if exists(gnu)
47017820Sjkh	cd ${.CURDIR}/gnu/lib && ${MAKE} depend && \
47117308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4728295Srgrimes.endif
4732160Scsgr.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
47417820Sjkh	cd ${.CURDIR}/secure/lib && ${MAKE} depend && \
47517308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4762160Scsgr.endif
4772279Spaul.if exists(lib)
47817820Sjkh	cd ${.CURDIR}/lib && ${MAKE} depend && \
47917308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4802279Spaul.endif
48117234Sjraynard.if exists(usr.bin/lex/lib)
48217820Sjkh	cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
48317308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
48411772Snate.endif
4853197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
48617820Sjkh	cd ${.CURDIR}/eBones/lib && ${MAKE} depend && \
48717308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4882626Scsgr.endif
4898304Srgrimes.if exists(usr.sbin/pcvt/keycap)
49017820Sjkh	cd ${.CURDIR}/usr.sbin/pcvt/keycap && ${MAKE} depend && \
49117308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4928304Srgrimes.endif
4932061Sjkh
49417308Speter#
49517308Speter# build-tools - build and install any other tools needed to complete the
49617308Speter# compile and install.
49717308Speter#
49811806Sphkbuild-tools:
49919175Sbde.for d in				\
50021673Sjkh		share/info		\
50121536Sjmacd		gnu/usr.bin/texinfo     \
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