Makefile revision 27356
12061Sjkh#
226510Sjfieber#	$Id: Makefile,v 1.129 1997/06/08 14:03:23 jhay Exp $
32061Sjkh#
42061Sjkh# Make command line options:
515603Smarkm#	-DCLOBBER will remove /usr/include
63197Scsgr#	-DMAKE_EBONES to build eBones (KerberosIV)
720710Sasami#	-DALLLANG to build documentation for all languages
820710Sasami#	  (where available -- see share/doc/Makefile)
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
1921536Sjmacd#       -DNOINFO do not make or install info files
2025399Sjb#       -DNOLIBC_R do not build libc_r.
2125980Sasami#	LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
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 "--------------------------------------------------------------"
20026510Sjfieber	@echo " Rebuilding 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
39126504Sjhay	cd ${.CURDIR}/gnu/lib/libmp &&		${MAKE} beforeinstall
3923197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
3933197Scsgr	cd ${.CURDIR}/eBones/include &&		${MAKE} beforeinstall
39412166Sjkh	cd ${.CURDIR}/eBones/lib/libkrb &&	${MAKE} beforeinstall
39512485Sjkh	cd ${.CURDIR}/eBones/lib/libkadm &&	${MAKE} beforeinstall
3963197Scsgr.endif
39725313Sbde	cd ${.CURDIR}/lib/csu/i386 &&		${MAKE} beforeinstall
39826152Speter	cd ${.CURDIR}/lib/libalias &&		${MAKE} beforeinstall
3992061Sjkh	cd ${.CURDIR}/lib/libc &&		${MAKE} beforeinstall
4002061Sjkh	cd ${.CURDIR}/lib/libcurses &&		${MAKE} beforeinstall
4012061Sjkh	cd ${.CURDIR}/lib/libedit &&		${MAKE} beforeinstall
40216786Snate	cd ${.CURDIR}/lib/libftpio &&		${MAKE} beforeinstall
4032883Sphk	cd ${.CURDIR}/lib/libmd &&		${MAKE} beforeinstall
40417308Speter	cd ${.CURDIR}/lib/libmytinfo &&         ${MAKE} beforeinstall
40517308Speter	cd ${.CURDIR}/lib/libncurses &&		${MAKE} beforeinstall
4067281Srgrimes.if !defined(WANT_CSRG_LIBM)
4073242Spaul	cd ${.CURDIR}/lib/msun &&		${MAKE} beforeinstall
4083242Spaul.endif
4097171Sats	cd ${.CURDIR}/lib/libpcap &&		${MAKE} beforeinstall
4102061Sjkh	cd ${.CURDIR}/lib/librpcsvc &&		${MAKE} beforeinstall
4113213Spst	cd ${.CURDIR}/lib/libskey &&		${MAKE} beforeinstall
41217308Speter	cd ${.CURDIR}/lib/libtcl &&		${MAKE} beforeinstall
41317308Speter	cd ${.CURDIR}/lib/libtermcap &&		${MAKE} beforeinstall
4145749Swollman	cd ${.CURDIR}/lib/libcom_err &&		${MAKE} beforeinstall
4155772Swollman	cd ${.CURDIR}/lib/libss &&		${MAKE} beforeinstall
41617308Speter	cd ${.CURDIR}/lib/libscsi &&		${MAKE} beforeinstall
41717308Speter	cd ${.CURDIR}/lib/libutil &&		${MAKE} beforeinstall
41826504Sjhay	cd ${.CURDIR}/lib/libz &&		${MAKE} beforeinstall
4192061Sjkh
42017308Speter#
42117308Speter# lib-tools - build tools to compile and install the libraries.
42217308Speter#
4235366Snatelib-tools:
42417820Sjkh	cd ${.CURDIR}/usr.bin/tsort && ${MAKE} depend && \
42517467Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
42617820Sjkh	cd ${.CURDIR}/gnu/usr.bin/ld && ${MAKE} depend && \
42717308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
42818674Speter	cd ${.CURDIR}/gnu/usr.bin/as && ${MAKE} depend && \
42918674Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
43017820Sjkh	cd ${.CURDIR}/usr.bin/ar && ${MAKE} depend && \
43117308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
43217820Sjkh	cd ${.CURDIR}/usr.bin/ranlib && ${MAKE} depend && \
43317308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
43417820Sjkh	cd ${.CURDIR}/usr.bin/nm && ${MAKE} depend && \
43517308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
43617820Sjkh	cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
43717308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
43817820Sjkh	cd ${.CURDIR}/usr.bin/compile_et && ${MAKE} depend && \
43917308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} && \
4405728Swollman		rm -f /usr/sbin/compile_et
44117820Sjkh	cd ${.CURDIR}/usr.bin/mk_cmds && ${MAKE} depend && \
44217308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
44321922Sjkh	cd ${.CURDIR}/usr.bin/uudecode && ${MAKE} depend && \
44421922Sjkh		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
44518392Speter	cd ${.CURDIR}/gnu/usr.bin/bison && ${MAKE} depend && \
44618392Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
44718392Speter	cd ${.CURDIR}/gnu/usr.bin/gperf && ${MAKE} depend && \
44818392Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
44918392Speter	cd ${.CURDIR}/gnu/usr.bin/cc && ${MAKE} depend && \
45018392Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4515366Snate
45217308Speter#
45317308Speter# libraries - build and install the libraries
45417308Speter#
4552061Sjkhlibraries:
45624754Sjdp.if exists(lib/csu/i386)
45724754Sjdp	cd ${.CURDIR}/lib/csu/i386 && ${MAKE} depend && \
45824754Sjdp		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
45924754Sjdp.endif
4608295Srgrimes.if exists(lib/libcompat)
46117820Sjkh	cd ${.CURDIR}/lib/libcompat && ${MAKE} depend && \
46217308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4638295Srgrimes.endif
4648489Srgrimes.if exists(lib/libncurses)
46517820Sjkh	cd ${.CURDIR}/lib/libncurses && ${MAKE} depend && \
46617308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4678489Srgrimes.endif
4688489Srgrimes.if exists(lib/libtermcap)
46917820Sjkh	cd ${.CURDIR}/lib/libtermcap && ${MAKE} depend && \
47017308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4718489Srgrimes.endif
4728295Srgrimes.if exists(gnu)
47317820Sjkh	cd ${.CURDIR}/gnu/lib && ${MAKE} depend && \
47417308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4758295Srgrimes.endif
4762160Scsgr.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
47717820Sjkh	cd ${.CURDIR}/secure/lib && ${MAKE} depend && \
47817308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4792160Scsgr.endif
4802279Spaul.if exists(lib)
48117820Sjkh	cd ${.CURDIR}/lib && ${MAKE} depend && \
48217308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4832279Spaul.endif
48417234Sjraynard.if exists(usr.bin/lex/lib)
48517820Sjkh	cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
48617308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
48711772Snate.endif
4883197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
48917820Sjkh	cd ${.CURDIR}/eBones/lib && ${MAKE} depend && \
49017308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4912626Scsgr.endif
4928304Srgrimes.if exists(usr.sbin/pcvt/keycap)
49317820Sjkh	cd ${.CURDIR}/usr.sbin/pcvt/keycap && ${MAKE} depend && \
49417308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4958304Srgrimes.endif
4962061Sjkh
49717308Speter#
49817308Speter# build-tools - build and install any other tools needed to complete the
49917308Speter# compile and install.
50017308Speter#
50111806Sphkbuild-tools:
50219175Sbde.for d in				\
50321673Sjkh		share/info		\
50421536Sjmacd		gnu/usr.bin/texinfo     \
50519175Sbde		usr.bin/symorder	\
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