Makefile revision 17466
12061Sjkh#
217466Speter#	$Id: Makefile,v 1.93 1996/08/03 13:00:35 jkh 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
181594Srgrimes
1917308Speter#
2017308Speter# The intended user-driven targets are:
2117308Speter# world       - rebuild *everything*, including glue to help do upgrades.
2217308Speter# reinstall   - use an existing (eg: NFS mounted) build to do an update.
2317308Speter# update      - convenient way to update your source tree (eg: sup/cvs)
2417308Speter# most        - build user commands, no libraries or include files
2517308Speter# installmost - install user commands, no libraries or include files
2617308Speter# all         - run through SUBDIR and build everything.  This is an implicit
2717308Speter#               rule, not particularly useful for everybody.  Use 'world'.
2817308Speter
2917308Speter
302061Sjkh# Put initial settings here.
312061SjkhSUBDIR=
321594Srgrimes
337407Srgrimes# We must do include and lib first so that the perl *.ph generation
347407Srgrimes# works correctly as it uses the header files installed by this.
357108Sphk.if exists(include)
367108SphkSUBDIR+= include
377108Sphk.endif
387407Srgrimes.if exists(lib)
397407SrgrimesSUBDIR+= lib
407407Srgrimes.endif
417108Sphk
422061Sjkh.if exists(bin)
432061SjkhSUBDIR+= bin
442061Sjkh.endif
4517308Speter.if exists(games) && !defined(NOGAMES)
462061SjkhSUBDIR+= games
472061Sjkh.endif
482061Sjkh.if exists(gnu)
492061SjkhSUBDIR+= gnu
502061Sjkh.endif
513197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
522626ScsgrSUBDIR+= eBones
532626Scsgr.endif
542061Sjkh.if exists(libexec)
552061SjkhSUBDIR+= libexec
562061Sjkh.endif
572061Sjkh.if exists(sbin)
582061SjkhSUBDIR+= sbin
592061Sjkh.endif
602061Sjkh.if exists(share)
612061SjkhSUBDIR+= share
622061Sjkh.endif
632061Sjkh.if exists(sys)
642061SjkhSUBDIR+= sys
652061Sjkh.endif
662061Sjkh.if exists(usr.bin)
672061SjkhSUBDIR+= usr.bin
682061Sjkh.endif
692061Sjkh.if exists(usr.sbin)
702061SjkhSUBDIR+= usr.sbin
712061Sjkh.endif
722834Swollman.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
732834SwollmanSUBDIR+= secure
742834Swollman.endif
752834Swollman.if exists(lkm) && !defined(NOLKM)
762834SwollmanSUBDIR+= lkm
772834Swollman.endif
781594Srgrimes
794486Sphk# etc must be last for "distribute" to work
804486Sphk.if exists(etc) && make(distribute)
814486SphkSUBDIR+= etc
824486Sphk.endif
834486Sphk
842061Sjkh# These are last, since it is nice to at least get the base system
852061Sjkh# rebuilt before you do them.
862061Sjkh.if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
872061SjkhSUBDIR+= local
882061Sjkh.endif
892061Sjkh.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
902061SjkhSUBDIR+= ports
912061Sjkh.endif
922061Sjkh
9317308Speter# Handle -DNOOBJDIR, -DNOCLEAN and -DNOCLEANDIR
942061Sjkh.if defined(NOOBJDIR)
952061SjkhOBJDIR=
962061Sjkh.else
972061SjkhOBJDIR=		obj
982061Sjkh.endif
9912483Speter
10012483Speter.if defined(NOCLEAN)
10112483SpeterCLEANDIR=
10212483Speter.else
1032061Sjkh.if defined(NOCLEANDIR)
1042061SjkhCLEANDIR=	clean
1058854Srgrimes.else
1062061SjkhCLEANDIR=	cleandir
1072061Sjkh.endif
10812483Speter.endif
1092061Sjkh
11017308Speter#
11117308Speter# While building tools for bootstrapping, we dont need to waste time on
11217308Speter# profiled libraries or man pages.  This speeds things up somewhat.
11317308Speter#
11415603SmarkmMK_FLAGS=	-DNOMAN -DNOPROFILE
11515603Smarkm
11617308Speter#
11717308Speter# world
11817308Speter#
11917308Speter# Attempt to rebuild and reinstall *everything*, with reasonable chance of
12017308Speter# success, regardless of how old your existing system is.
12117308Speter#
12217308Speter# >> Beware, it overwrites the local build environment! <<
12317308Speter#
12417308Speterworld:
12517308Speter.if target(pre-world)
12617308Speter	@echo "--------------------------------------------------------------"
12717308Speter	@echo " Making 'pre-world' target"
12817308Speter	@echo "--------------------------------------------------------------"
12917308Speter	cd ${.CURDIR} && ${MAKE} pre-world
13017308Speter	@echo
13116550Sjkh.endif
1322061Sjkh	@echo "--------------------------------------------------------------"
13317308Speter	@echo " Making hierarchy"
1342061Sjkh	@echo "--------------------------------------------------------------"
13517308Speter	cd ${.CURDIR} && ${MAKE} hierarchy
1362061Sjkh	@echo
13717308Speter	@echo "--------------------------------------------------------------"
13817308Speter	@echo " Rebuilding /usr/share/mk"
13917308Speter	@echo "--------------------------------------------------------------"
14017308Speter	cd ${.CURDIR} && ${MAKE} mk
14117308Speter	@echo
14217308Speter	@echo "--------------------------------------------------------------"
14317308Speter	@echo " Cleaning up the source tree"
14417308Speter	@echo "--------------------------------------------------------------"
14517308Speter.if defined(NOCLEAN)
14617308Speter	@echo "Not cleaning anything! I sure hope you know what you are doing!"
14717308Speter.else
14817466Speter	cd ${.CURDIR} && ${MAKE} ${CLEANDIR}
14917308Speter.endif
15017308Speter.endif
15117308Speter	@echo
15217466Speter.if !defined(NOOBJDIR)
15317308Speter	@echo "--------------------------------------------------------------"
15417308Speter	@echo " Rebuilding the obj tree"
15517308Speter	@echo "--------------------------------------------------------------"
15617308Speter	cd ${.CURDIR} && ${MAKE} obj
15717466Speter	@echo
15817308Speter.endif
15917308Speter	@echo "--------------------------------------------------------------"
16017308Speter	@echo " Rebuilding bootstrap tools"
16117308Speter	@echo "--------------------------------------------------------------"
16217308Speter	cd ${.CURDIR} && ${MAKE} bootstrap
16317308Speter	@echo
16417308Speter	@echo "--------------------------------------------------------------"
16517308Speter	@echo " Rebuilding tools necessary to build the include files"
16617308Speter	@echo "--------------------------------------------------------------"
16717308Speter	cd ${.CURDIR} && ${MAKE} include-tools
16817308Speter	@echo
16917308Speter	@echo "--------------------------------------------------------------"
17017308Speter	@echo " Rebuilding /usr/include"
17117308Speter	@echo "--------------------------------------------------------------"
17217308Speter	cd ${.CURDIR} && ${MAKE} includes
17317308Speter	@echo
17417308Speter	@echo "--------------------------------------------------------------"
17517308Speter	@echo " Rebuilding tools needed to build the libraries"
17617308Speter	@echo "--------------------------------------------------------------"
17717308Speter	cd ${.CURDIR} && ${MAKE} lib-tools
17817308Speter	@echo
17917308Speter	@echo "--------------------------------------------------------------"
18017308Speter	@echo " Rebuilding /usr/lib"
18117308Speter	@echo "--------------------------------------------------------------"
18217308Speter	cd ${.CURDIR} && ${MAKE} libraries
18317308Speter	@echo
18417308Speter	@echo "--------------------------------------------------------------"
18517308Speter	@echo " Rebuilding C compiler, make, symorder, sgmlfmt and zic(8)"
18617308Speter	@echo "--------------------------------------------------------------"
18717308Speter	cd ${.CURDIR} && ${MAKE} build-tools
18817308Speter	@echo
18917308Speter	@echo "--------------------------------------------------------------"
19017308Speter	@echo " Rebuilding.. The whole thing"
19117308Speter	@echo "--------------------------------------------------------------"
19217308Speter	cd ${.CURDIR} && ${MAKE} depend && ${MAKE} all install
19317308Speter	cd ${.CURDIR}/share/man && ${MAKE} makedb
19416550Sjkh.if target(post-world)
19517308Speter	@echo
19617308Speter	@echo "--------------------------------------------------------------"
19717308Speter	@echo " Making 'post-world' target"
19817308Speter	@echo "--------------------------------------------------------------"
19916550Sjkh	cd ${.CURDIR} && ${MAKE} post-world
20016550Sjkh.endif
20117308Speter	@echo
20217308Speter	@echo "--------------------------------------------------------------"
20314545Sjkh	@echo "make world completed on `date`"
2042061Sjkh
20517308Speter#
20617308Speter# reinstall
20717308Speter#
20817308Speter# If you have a build server, you can NFS mount the source and obj directories
20917308Speter# and do a 'make reinstall' on the *client* to install new binaries from the
21017308Speter# most recent server build.
21117308Speter#
21217308Speterreinstall:
21312483Speter	@echo "--------------------------------------------------------------"
21417308Speter	@echo " Making hierarchy"
21512483Speter	@echo "--------------------------------------------------------------"
21617308Speter	cd ${.CURDIR} && ${MAKE} hierarchy
21712483Speter	@echo
2182061Sjkh	@echo "--------------------------------------------------------------"
21917308Speter	@echo " Rebuilding /usr/share/mk"
2202061Sjkh	@echo "--------------------------------------------------------------"
22117308Speter	cd ${.CURDIR} && ${MAKE} mk
22217308Speter	@echo
22317308Speter	@echo "--------------------------------------------------------------"
22417308Speter	@echo " Rebuilding /usr/include"
22517308Speter	@echo "--------------------------------------------------------------"
22617308Speter	cd ${.CURDIR} && ${MAKE} includes
22717308Speter	@echo
22817308Speter	@echo "--------------------------------------------------------------"
22917308Speter	@echo " Reinstalling..  The whole thing"
23017308Speter	@echo "--------------------------------------------------------------"
23117308Speter	@echo
23217308Speter	cd ${.CURDIR} && ${MAKE} install
23317308Speter	cd ${.CURDIR}/share/man && ${MAKE} makedb
2342061Sjkh
23517308Speter
23617308Speter#
23717308Speter# update
23817308Speter#
23917308Speter# Update the source tree, by running sup and/or running cvs to update to the
24017308Speter# latest copy.
24117308Speter#
2422302Spaulupdate:
2432302Spaul.if defined(SUP_UPDATE)
2442302Spaul	@echo "--------------------------------------------------------------"
2452302Spaul	@echo "Running sup"
2462302Spaul	@echo "--------------------------------------------------------------"
2472302Spaul	@sup -v ${SUPFILE}
24810760Sache.if defined(SUPFILE1)
24910760Sache	@sup -v ${SUPFILE1}
2502302Spaul.endif
25110760Sache.if defined(SUPFILE2)
25210760Sache	@sup -v ${SUPFILE2}
25310760Sache.endif
25410760Sache.endif
2552302Spaul.if defined(CVS_UPDATE)
2562302Spaul	@echo "--------------------------------------------------------------"
2572302Spaul	@echo "Updating /usr/src from cvs repository" ${CVSROOT}
2582302Spaul	@echo "--------------------------------------------------------------"
25916591Spst	cd ${.CURDIR} &&  cvs -q update -P -d
2602302Spaul.endif
2612302Spaul
26217308Speter
26317308Speter#
26417308Speter# most
26517308Speter#
26617308Speter# Build most of the user binaries on the existing system libs and includes.
26717308Speter#
26817308Spetermost:
2692061Sjkh	@echo "--------------------------------------------------------------"
27017308Speter	@echo " Building programs only"
2712061Sjkh	@echo "--------------------------------------------------------------"
27217308Speter	cd ${.CURDIR}/bin	&&	${MAKE} ${.MAKEFLAGS} all
27317308Speter	cd ${.CURDIR}/sbin	&&	${MAKE} ${.MAKEFLAGS} all
27417308Speter	cd ${.CURDIR}/libexec	&&	${MAKE} ${.MAKEFLAGS} all
27517308Speter	cd ${.CURDIR}/usr.bin	&&	${MAKE} ${.MAKEFLAGS} all
27617308Speter	cd ${.CURDIR}/usr.sbin	&&	${MAKE} ${.MAKEFLAGS} all
27717308Speter	cd ${.CURDIR}/gnu/libexec &&	${MAKE} ${.MAKEFLAGS} all
27817308Speter	cd ${.CURDIR}/gnu/usr.bin &&	${MAKE} ${.MAKEFLAGS} all
27917308Speter	cd ${.CURDIR}/gnu/usr.sbin &&	${MAKE} ${.MAKEFLAGS} all
28017308Speter#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
28117308Speter#	cd ${.CURDIR}/eBones	&&	${MAKE} ${.MAKEFLAGS} most
28217308Speter#.endif
28317308Speter#.if !defined(NOSECURE) && !defined(NOCRYPT)
28417308Speter#	cd ${.CURDIR}/secure	&&	${MAKE} ${.MAKEFLAGS} most
28517308Speter#.endif
2862061Sjkh
28717308Speter#
28817308Speter# installmost
28917308Speter#
29017308Speter# Install the binaries built by the 'most' target.  This does not include
29117308Speter# libraries or include files.
29217308Speter#
2933626Swollmaninstallmost:
2943626Swollman	@echo "--------------------------------------------------------------"
2953626Swollman	@echo " Installing programs only"
2963626Swollman	@echo "--------------------------------------------------------------"
2973626Swollman	cd ${.CURDIR}/bin	&&	${MAKE} ${.MAKEFLAGS} install
2983626Swollman	cd ${.CURDIR}/sbin	&&	${MAKE} ${.MAKEFLAGS} install
2993626Swollman	cd ${.CURDIR}/libexec	&&	${MAKE} ${.MAKEFLAGS} install
3003626Swollman	cd ${.CURDIR}/usr.bin	&&	${MAKE} ${.MAKEFLAGS} install
3013626Swollman	cd ${.CURDIR}/usr.sbin	&&	${MAKE} ${.MAKEFLAGS} install
3023626Swollman	cd ${.CURDIR}/gnu/libexec &&	${MAKE} ${.MAKEFLAGS} install
3033626Swollman	cd ${.CURDIR}/gnu/usr.bin &&	${MAKE} ${.MAKEFLAGS} install
3047059Sroberto	cd ${.CURDIR}/gnu/usr.sbin &&	${MAKE} ${.MAKEFLAGS} install
3053626Swollman#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
3063626Swollman#	cd ${.CURDIR}/eBones	&&	${MAKE} ${.MAKEFLAGS} installmost
3073626Swollman#.endif
3083626Swollman#.if !defined(NOSECURE) && !defined(NOCRYPT)
3093626Swollman#	cd ${.CURDIR}/secure	&&	${MAKE} ${.MAKEFLAGS} installmost
3103626Swollman#.endif
3113626Swollman
31217308Speter#
31317308Speter# ------------------------------------------------------------------------
31417308Speter#
31517308Speter# From here onwards are utility targets used by the 'make world' and
31617308Speter# related targets.  If your 'world' breaks, you may like to try to fix
31717308Speter# the problem and manually run the following targets to attempt to
31817308Speter# complete the build.  Beware, this is *not* guaranteed to work, you
31917308Speter# need to have a pretty good grip on the current state of the system
32017308Speter# to attempt to manually finish it.  If in doubt, 'make world' again.
32117308Speter#
3223626Swollman
32317308Speter#
32417308Speter# heirarchy - ensure that all the needed directories are present
32517308Speter#
32617308Speterhierarchy:
32717308Speter	cd ${.CURDIR}/etc &&		${MAKE} distrib-dirs
32817308Speter
32917308Speter#
33017308Speter# mk - update the /usr/share/mk makefiles.
33117308Speter#
3322061Sjkhmk:
33316663Sjkh	cd ${.CURDIR}/share/mk &&	${MAKE} install
3342061Sjkh
33517308Speter#
33617308Speter# bootstrap - [re]build tools needed to run the actual build, this includes
33717308Speter# tools needed by 'make depend', as some tools are needed to generate source
33817308Speter# for the dependency information to be gathered from.
33917308Speter#
34017308Speterbootstrap:
34117308Speter	cd ${.CURDIR}/usr.bin/make && ${MAKE} depend && \
34217308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
34317308Speter	cd ${.CURDIR}/usr.bin/xinstall && ${MAKE} depend && \
34417308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
34517406Sjkh	cd ${.CURDIR}/usr.bin/tsort && ${MAKE} depend && \
34617406Sjkh		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
34717308Speter	cd ${.CURDIR}/usr.bin/lex && ${MAKE} bootstrap && ${MAKE} depend && \
34817308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
34917308Speter
35017308Speter#
35117308Speter# include-tools - generally the same as 'bootstrap', except that it's for
35217308Speter# things that are specifically needed to generate include files.
35317308Speter#
35417308Speter# XXX should be merged with bootstrap, it's not worth keeeping them seperate
35517308Speter#
35617308Speterinclude-tools:
35717308Speter	cd ${.CURDIR}/usr.bin/rpcgen && ${MAKE} depend && \
35817308Speter		${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
35917308Speter
36017308Speter#
36117308Speter# includes - possibly generate and install the include files.
36217308Speter#
36314119Speterincludes:
3642061Sjkh.if defined(CLOBBER)
3657130Srgrimes	rm -rf ${DESTDIR}/usr/include/*
3667130Srgrimes	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
3677130Srgrimes		-p ${DESTDIR}/usr/include
3682061Sjkh.endif
3692061Sjkh	cd ${.CURDIR}/include &&		${MAKE} install
37017308Speter	cd ${.CURDIR}/gnu/include &&		${MAKE} install
3712685Srgrimes	cd ${.CURDIR}/gnu/lib/libreadline &&	${MAKE} beforeinstall
3726927Snate	cd ${.CURDIR}/gnu/lib/libregex &&	${MAKE} beforeinstall
3732685Srgrimes	cd ${.CURDIR}/gnu/lib/libg++ &&         ${MAKE} beforeinstall
3743518Sache	cd ${.CURDIR}/gnu/lib/libdialog &&      ${MAKE} beforeinstall
3753197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
3763197Scsgr	cd ${.CURDIR}/eBones/include &&		${MAKE} beforeinstall
37712166Sjkh	cd ${.CURDIR}/eBones/lib/libkrb &&	${MAKE} beforeinstall
37812485Sjkh	cd ${.CURDIR}/eBones/lib/libkadm &&	${MAKE} beforeinstall
3793197Scsgr.endif
3802061Sjkh	cd ${.CURDIR}/lib/libc &&		${MAKE} beforeinstall
3812061Sjkh	cd ${.CURDIR}/lib/libcurses &&		${MAKE} beforeinstall
3822061Sjkh	cd ${.CURDIR}/lib/libedit &&		${MAKE} beforeinstall
38316786Snate	cd ${.CURDIR}/lib/libftpio &&		${MAKE} beforeinstall
3842883Sphk	cd ${.CURDIR}/lib/libmd &&		${MAKE} beforeinstall
38517308Speter	cd ${.CURDIR}/lib/libmytinfo &&         ${MAKE} beforeinstall
38617308Speter	cd ${.CURDIR}/lib/libncurses &&		${MAKE} beforeinstall
3877281Srgrimes.if !defined(WANT_CSRG_LIBM)
3883242Spaul	cd ${.CURDIR}/lib/msun &&		${MAKE} beforeinstall
3893242Spaul.endif
3907171Sats	cd ${.CURDIR}/lib/libpcap &&		${MAKE} beforeinstall
3912061Sjkh	cd ${.CURDIR}/lib/librpcsvc &&		${MAKE} beforeinstall
3923213Spst	cd ${.CURDIR}/lib/libskey &&		${MAKE} beforeinstall
39317308Speter	cd ${.CURDIR}/lib/libtcl &&		${MAKE} beforeinstall
39417308Speter	cd ${.CURDIR}/lib/libtermcap &&		${MAKE} beforeinstall
3955749Swollman	cd ${.CURDIR}/lib/libcom_err &&		${MAKE} beforeinstall
3965772Swollman	cd ${.CURDIR}/lib/libss &&		${MAKE} beforeinstall
39717308Speter	cd ${.CURDIR}/lib/libscsi &&		${MAKE} beforeinstall
39817308Speter	cd ${.CURDIR}/lib/libutil &&		${MAKE} beforeinstall
3992061Sjkh
40017308Speter#
40117308Speter# lib-tools - build tools to compile and install the libraries.
40217308Speter#
4035366Snatelib-tools:
40417308Speter	cd ${.CURDIR}/gnu/usr.bin/ld && ${MAKE} depend && \
40517308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
40617308Speter	cd ${.CURDIR}/usr.bin/ar && ${MAKE} depend && \
40717308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
40817308Speter	cd ${.CURDIR}/usr.bin/ranlib && ${MAKE} depend && \
40917308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
41017308Speter	cd ${.CURDIR}/usr.bin/nm && ${MAKE} depend && \
41117308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
41217308Speter	cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
41317308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
41417308Speter	cd ${.CURDIR}/usr.bin/compile_et && ${MAKE} depend && \
41517308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} && \
4165728Swollman		rm -f /usr/sbin/compile_et
41717308Speter	cd ${.CURDIR}/usr.bin/mk_cmds && ${MAKE} depend && \
41817308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4195366Snate
42017308Speter#
42117308Speter# libraries - build and install the libraries
42217308Speter#
4232061Sjkhlibraries:
4248295Srgrimes.if exists(lib/libcompat)
42517308Speter	cd ${.CURDIR}/lib/libcompat && ${MAKE} depend && \
42617308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4278295Srgrimes.endif
4288489Srgrimes.if exists(lib/libncurses)
42917308Speter	cd ${.CURDIR}/lib/libncurses && ${MAKE} depend && \
43017308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4318489Srgrimes.endif
4328489Srgrimes.if exists(lib/libtermcap)
43317308Speter	cd ${.CURDIR}/lib/libtermcap && ${MAKE} depend && \
43417308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4358489Srgrimes.endif
43617308Speter.if exists(lib)
43717308Speter	cd ${.CURDIR}/lib/csu/i386 && ${MAKE} depend && \
43817308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
43917308Speter.endif
4408295Srgrimes.if exists(gnu)
44117308Speter	cd ${.CURDIR}/gnu/lib && ${MAKE} depend && \
44217308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
44317308Speter	cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && ${MAKE} depend && \
44417308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4458295Srgrimes.endif
4462160Scsgr.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
44717308Speter	cd ${.CURDIR}/secure/lib && ${MAKE} depend && \
44817308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4492160Scsgr.endif
4502279Spaul.if exists(lib)
45117308Speter	cd ${.CURDIR}/lib && ${MAKE} depend && \
45217308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4532279Spaul.endif
45417234Sjraynard.if exists(usr.bin/lex/lib)
45517308Speter	cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
45617308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
45711772Snate.endif
4583197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
45917308Speter	cd ${.CURDIR}/eBones/lib && ${MAKE} depend && \
46017308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4612626Scsgr.endif
4628304Srgrimes.if exists(usr.sbin/pcvt/keycap)
46317308Speter	cd ${.CURDIR}/usr.sbin/pcvt/keycap && ${MAKE} depend && \
46417308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4658304Srgrimes.endif
4662061Sjkh
46717308Speter#
46817308Speter# build-tools - build and install any other tools needed to complete the
46917308Speter# compile and install.
47017308Speter#
47111806Sphkbuild-tools:
47217308Speter	cd ${.CURDIR}/gnu/usr.bin/cc && ${MAKE} depend && \
47317308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
47417308Speter	cd ${.CURDIR}/usr.bin/symorder && ${MAKE} depend && \
47517308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
47617308Speter	cd ${.CURDIR}/usr.bin/sgmlfmt && ${MAKE} depend && \
47717308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} 
47817308Speter	cd ${.CURDIR}/share/sgml && ${MAKE} depend && \
47917308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} 
48017308Speter	cd ${.CURDIR}/usr.sbin/zic && ${MAKE} depend && \
48117308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4822061Sjkh
4831594Srgrimes.include <bsd.subdir.mk>
484