Makefile revision 17308
12061Sjkh#
217308Speter#	$Id: Makefile,v 1.90 1996/07/21 00:05:31 jraynard 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
14817308Speter.if defined(NOCLEANDIR)
14917308Speter	cd ${.CURDIR} && ${MAKE} clean
15017308Speter.else
15117308Speter	cd ${.CURDIR} && ${MAKE} cleandir
15217308Speter.endif
15317308Speter.endif
15417308Speter	@echo
15517308Speter.if !defined(NOOBJ)
15617308Speter	@echo "--------------------------------------------------------------"
15717308Speter	@echo " Rebuilding the obj tree"
15817308Speter	@echo "--------------------------------------------------------------"
15917308Speter	cd ${.CURDIR} && ${MAKE} obj
16017308Speter.endif
16117308Speter	@echo
16217308Speter	@echo "--------------------------------------------------------------"
16317308Speter	@echo " Rebuilding bootstrap tools"
16417308Speter	@echo "--------------------------------------------------------------"
16517308Speter	cd ${.CURDIR} && ${MAKE} bootstrap
16617308Speter	@echo
16717308Speter	@echo "--------------------------------------------------------------"
16817308Speter	@echo " Rebuilding tools necessary to build the include files"
16917308Speter	@echo "--------------------------------------------------------------"
17017308Speter	cd ${.CURDIR} && ${MAKE} include-tools
17117308Speter	@echo
17217308Speter	@echo "--------------------------------------------------------------"
17317308Speter	@echo " Rebuilding /usr/include"
17417308Speter	@echo "--------------------------------------------------------------"
17517308Speter	cd ${.CURDIR} && ${MAKE} includes
17617308Speter	@echo
17717308Speter	@echo "--------------------------------------------------------------"
17817308Speter	@echo " Rebuilding tools needed to build the libraries"
17917308Speter	@echo "--------------------------------------------------------------"
18017308Speter	cd ${.CURDIR} && ${MAKE} lib-tools
18117308Speter	@echo
18217308Speter	@echo "--------------------------------------------------------------"
18317308Speter	@echo " Rebuilding /usr/lib"
18417308Speter	@echo "--------------------------------------------------------------"
18517308Speter	cd ${.CURDIR} && ${MAKE} libraries
18617308Speter	@echo
18717308Speter	@echo "--------------------------------------------------------------"
18817308Speter	@echo " Rebuilding C compiler, make, symorder, sgmlfmt and zic(8)"
18917308Speter	@echo "--------------------------------------------------------------"
19017308Speter	cd ${.CURDIR} && ${MAKE} build-tools
19117308Speter	@echo
19217308Speter	@echo "--------------------------------------------------------------"
19317308Speter	@echo " Rebuilding.. The whole thing"
19417308Speter	@echo "--------------------------------------------------------------"
19517308Speter	cd ${.CURDIR} && ${MAKE} depend && ${MAKE} all install
19617308Speter	cd ${.CURDIR}/share/man && ${MAKE} makedb
19716550Sjkh.if target(post-world)
19817308Speter	@echo
19917308Speter	@echo "--------------------------------------------------------------"
20017308Speter	@echo " Making 'post-world' target"
20117308Speter	@echo "--------------------------------------------------------------"
20216550Sjkh	cd ${.CURDIR} && ${MAKE} post-world
20316550Sjkh.endif
20417308Speter	@echo
20517308Speter	@echo "--------------------------------------------------------------"
20614545Sjkh	@echo "make world completed on `date`"
2072061Sjkh
20817308Speter#
20917308Speter# reinstall
21017308Speter#
21117308Speter# If you have a build server, you can NFS mount the source and obj directories
21217308Speter# and do a 'make reinstall' on the *client* to install new binaries from the
21317308Speter# most recent server build.
21417308Speter#
21517308Speterreinstall:
21612483Speter	@echo "--------------------------------------------------------------"
21717308Speter	@echo " Making hierarchy"
21812483Speter	@echo "--------------------------------------------------------------"
21917308Speter	cd ${.CURDIR} && ${MAKE} hierarchy
22012483Speter	@echo
2212061Sjkh	@echo "--------------------------------------------------------------"
22217308Speter	@echo " Rebuilding /usr/share/mk"
2232061Sjkh	@echo "--------------------------------------------------------------"
22417308Speter	cd ${.CURDIR} && ${MAKE} mk
22517308Speter	@echo
22617308Speter	@echo "--------------------------------------------------------------"
22717308Speter	@echo " Rebuilding /usr/include"
22817308Speter	@echo "--------------------------------------------------------------"
22917308Speter	cd ${.CURDIR} && ${MAKE} includes
23017308Speter	@echo
23117308Speter	@echo "--------------------------------------------------------------"
23217308Speter	@echo " Reinstalling..  The whole thing"
23317308Speter	@echo "--------------------------------------------------------------"
23417308Speter	@echo
23517308Speter	cd ${.CURDIR} && ${MAKE} install
23617308Speter	cd ${.CURDIR}/share/man && ${MAKE} makedb
2372061Sjkh
23817308Speter
23917308Speter#
24017308Speter# update
24117308Speter#
24217308Speter# Update the source tree, by running sup and/or running cvs to update to the
24317308Speter# latest copy.
24417308Speter#
2452302Spaulupdate:
2462302Spaul.if defined(SUP_UPDATE)
2472302Spaul	@echo "--------------------------------------------------------------"
2482302Spaul	@echo "Running sup"
2492302Spaul	@echo "--------------------------------------------------------------"
2502302Spaul	@sup -v ${SUPFILE}
25110760Sache.if defined(SUPFILE1)
25210760Sache	@sup -v ${SUPFILE1}
2532302Spaul.endif
25410760Sache.if defined(SUPFILE2)
25510760Sache	@sup -v ${SUPFILE2}
25610760Sache.endif
25710760Sache.endif
2582302Spaul.if defined(CVS_UPDATE)
2592302Spaul	@echo "--------------------------------------------------------------"
2602302Spaul	@echo "Updating /usr/src from cvs repository" ${CVSROOT}
2612302Spaul	@echo "--------------------------------------------------------------"
26216591Spst	cd ${.CURDIR} &&  cvs -q update -P -d
2632302Spaul.endif
2642302Spaul
26517308Speter
26617308Speter#
26717308Speter# most
26817308Speter#
26917308Speter# Build most of the user binaries on the existing system libs and includes.
27017308Speter#
27117308Spetermost:
2722061Sjkh	@echo "--------------------------------------------------------------"
27317308Speter	@echo " Building programs only"
2742061Sjkh	@echo "--------------------------------------------------------------"
27517308Speter	cd ${.CURDIR}/bin	&&	${MAKE} ${.MAKEFLAGS} all
27617308Speter	cd ${.CURDIR}/sbin	&&	${MAKE} ${.MAKEFLAGS} all
27717308Speter	cd ${.CURDIR}/libexec	&&	${MAKE} ${.MAKEFLAGS} all
27817308Speter	cd ${.CURDIR}/usr.bin	&&	${MAKE} ${.MAKEFLAGS} all
27917308Speter	cd ${.CURDIR}/usr.sbin	&&	${MAKE} ${.MAKEFLAGS} all
28017308Speter	cd ${.CURDIR}/gnu/libexec &&	${MAKE} ${.MAKEFLAGS} all
28117308Speter	cd ${.CURDIR}/gnu/usr.bin &&	${MAKE} ${.MAKEFLAGS} all
28217308Speter	cd ${.CURDIR}/gnu/usr.sbin &&	${MAKE} ${.MAKEFLAGS} all
28317308Speter#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
28417308Speter#	cd ${.CURDIR}/eBones	&&	${MAKE} ${.MAKEFLAGS} most
28517308Speter#.endif
28617308Speter#.if !defined(NOSECURE) && !defined(NOCRYPT)
28717308Speter#	cd ${.CURDIR}/secure	&&	${MAKE} ${.MAKEFLAGS} most
28817308Speter#.endif
2892061Sjkh
29017308Speter#
29117308Speter# installmost
29217308Speter#
29317308Speter# Install the binaries built by the 'most' target.  This does not include
29417308Speter# libraries or include files.
29517308Speter#
2963626Swollmaninstallmost:
2973626Swollman	@echo "--------------------------------------------------------------"
2983626Swollman	@echo " Installing programs only"
2993626Swollman	@echo "--------------------------------------------------------------"
3003626Swollman	cd ${.CURDIR}/bin	&&	${MAKE} ${.MAKEFLAGS} install
3013626Swollman	cd ${.CURDIR}/sbin	&&	${MAKE} ${.MAKEFLAGS} install
3023626Swollman	cd ${.CURDIR}/libexec	&&	${MAKE} ${.MAKEFLAGS} install
3033626Swollman	cd ${.CURDIR}/usr.bin	&&	${MAKE} ${.MAKEFLAGS} install
3043626Swollman	cd ${.CURDIR}/usr.sbin	&&	${MAKE} ${.MAKEFLAGS} install
3053626Swollman	cd ${.CURDIR}/gnu/libexec &&	${MAKE} ${.MAKEFLAGS} install
3063626Swollman	cd ${.CURDIR}/gnu/usr.bin &&	${MAKE} ${.MAKEFLAGS} install
3077059Sroberto	cd ${.CURDIR}/gnu/usr.sbin &&	${MAKE} ${.MAKEFLAGS} install
3083626Swollman#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
3093626Swollman#	cd ${.CURDIR}/eBones	&&	${MAKE} ${.MAKEFLAGS} installmost
3103626Swollman#.endif
3113626Swollman#.if !defined(NOSECURE) && !defined(NOCRYPT)
3123626Swollman#	cd ${.CURDIR}/secure	&&	${MAKE} ${.MAKEFLAGS} installmost
3133626Swollman#.endif
3143626Swollman
31517308Speter#
31617308Speter# ------------------------------------------------------------------------
31717308Speter#
31817308Speter# From here onwards are utility targets used by the 'make world' and
31917308Speter# related targets.  If your 'world' breaks, you may like to try to fix
32017308Speter# the problem and manually run the following targets to attempt to
32117308Speter# complete the build.  Beware, this is *not* guaranteed to work, you
32217308Speter# need to have a pretty good grip on the current state of the system
32317308Speter# to attempt to manually finish it.  If in doubt, 'make world' again.
32417308Speter#
3253626Swollman
32617308Speter#
32717308Speter# heirarchy - ensure that all the needed directories are present
32817308Speter#
32917308Speterhierarchy:
33017308Speter	cd ${.CURDIR}/etc &&		${MAKE} distrib-dirs
33117308Speter
33217308Speter#
33317308Speter# mk - update the /usr/share/mk makefiles.
33417308Speter#
3352061Sjkhmk:
33616663Sjkh	cd ${.CURDIR}/share/mk &&	${MAKE} install
3372061Sjkh
33817308Speter#
33917308Speter# bootstrap - [re]build tools needed to run the actual build, this includes
34017308Speter# tools needed by 'make depend', as some tools are needed to generate source
34117308Speter# for the dependency information to be gathered from.
34217308Speter#
34317308Speterbootstrap:
34417308Speter	cd ${.CURDIR}/usr.bin/make && ${MAKE} depend && \
34517308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
34617308Speter	cd ${.CURDIR}/usr.bin/xinstall && ${MAKE} depend && \
34717308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
34817308Speter	cd ${.CURDIR}/usr.bin/lex && ${MAKE} bootstrap && ${MAKE} depend && \
34917308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
35017308Speter
35117308Speter#
35217308Speter# include-tools - generally the same as 'bootstrap', except that it's for
35317308Speter# things that are specifically needed to generate include files.
35417308Speter#
35517308Speter# XXX should be merged with bootstrap, it's not worth keeeping them seperate
35617308Speter#
35717308Speterinclude-tools:
35817308Speter	cd ${.CURDIR}/usr.bin/rpcgen && ${MAKE} depend && \
35917308Speter		${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
36017308Speter
36117308Speter#
36217308Speter# includes - possibly generate and install the include files.
36317308Speter#
36414119Speterincludes:
3652061Sjkh.if defined(CLOBBER)
3667130Srgrimes	rm -rf ${DESTDIR}/usr/include/*
3677130Srgrimes	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
3687130Srgrimes		-p ${DESTDIR}/usr/include
3692061Sjkh.endif
3702061Sjkh	cd ${.CURDIR}/include &&		${MAKE} install
37117308Speter	cd ${.CURDIR}/gnu/include &&		${MAKE} install
3722685Srgrimes	cd ${.CURDIR}/gnu/lib/libreadline &&	${MAKE} beforeinstall
3736927Snate	cd ${.CURDIR}/gnu/lib/libregex &&	${MAKE} beforeinstall
3742685Srgrimes	cd ${.CURDIR}/gnu/lib/libg++ &&         ${MAKE} beforeinstall
3753518Sache	cd ${.CURDIR}/gnu/lib/libdialog &&      ${MAKE} beforeinstall
3763197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
3773197Scsgr	cd ${.CURDIR}/eBones/include &&		${MAKE} beforeinstall
37812166Sjkh	cd ${.CURDIR}/eBones/lib/libkrb &&	${MAKE} beforeinstall
37912485Sjkh	cd ${.CURDIR}/eBones/lib/libkadm &&	${MAKE} beforeinstall
3803197Scsgr.endif
3812061Sjkh	cd ${.CURDIR}/lib/libc &&		${MAKE} beforeinstall
3822061Sjkh	cd ${.CURDIR}/lib/libcurses &&		${MAKE} beforeinstall
3832061Sjkh	cd ${.CURDIR}/lib/libedit &&		${MAKE} beforeinstall
38416786Snate	cd ${.CURDIR}/lib/libftpio &&		${MAKE} beforeinstall
3852883Sphk	cd ${.CURDIR}/lib/libmd &&		${MAKE} beforeinstall
38617308Speter	cd ${.CURDIR}/lib/libmytinfo &&         ${MAKE} beforeinstall
38717308Speter	cd ${.CURDIR}/lib/libncurses &&		${MAKE} beforeinstall
3887281Srgrimes.if !defined(WANT_CSRG_LIBM)
3893242Spaul	cd ${.CURDIR}/lib/msun &&		${MAKE} beforeinstall
3903242Spaul.endif
3917171Sats	cd ${.CURDIR}/lib/libpcap &&		${MAKE} beforeinstall
3922061Sjkh	cd ${.CURDIR}/lib/librpcsvc &&		${MAKE} beforeinstall
3933213Spst	cd ${.CURDIR}/lib/libskey &&		${MAKE} beforeinstall
39417308Speter	cd ${.CURDIR}/lib/libtcl &&		${MAKE} beforeinstall
39517308Speter	cd ${.CURDIR}/lib/libtermcap &&		${MAKE} beforeinstall
3965749Swollman	cd ${.CURDIR}/lib/libcom_err &&		${MAKE} beforeinstall
3975772Swollman	cd ${.CURDIR}/lib/libss &&		${MAKE} beforeinstall
39817308Speter	cd ${.CURDIR}/lib/libscsi &&		${MAKE} beforeinstall
39917308Speter	cd ${.CURDIR}/lib/libutil &&		${MAKE} beforeinstall
4002061Sjkh
40117308Speter#
40217308Speter# lib-tools - build tools to compile and install the libraries.
40317308Speter#
4045366Snatelib-tools:
40517308Speter	cd ${.CURDIR}/gnu/usr.bin/ld && ${MAKE} depend && \
40617308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
40717308Speter	cd ${.CURDIR}/usr.bin/ar && ${MAKE} depend && \
40817308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
40917308Speter	cd ${.CURDIR}/usr.bin/ranlib && ${MAKE} depend && \
41017308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
41117308Speter	cd ${.CURDIR}/usr.bin/nm && ${MAKE} depend && \
41217308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
41317308Speter	cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
41417308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
41517308Speter	cd ${.CURDIR}/usr.bin/compile_et && ${MAKE} depend && \
41617308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} && \
4175728Swollman		rm -f /usr/sbin/compile_et
41817308Speter	cd ${.CURDIR}/usr.bin/mk_cmds && ${MAKE} depend && \
41917308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4205366Snate
42117308Speter#
42217308Speter# libraries - build and install the libraries
42317308Speter#
4242061Sjkhlibraries:
4258295Srgrimes.if exists(lib/libcompat)
42617308Speter	cd ${.CURDIR}/lib/libcompat && ${MAKE} depend && \
42717308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4288295Srgrimes.endif
4298489Srgrimes.if exists(lib/libncurses)
43017308Speter	cd ${.CURDIR}/lib/libncurses && ${MAKE} depend && \
43117308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4328489Srgrimes.endif
4338489Srgrimes.if exists(lib/libtermcap)
43417308Speter	cd ${.CURDIR}/lib/libtermcap && ${MAKE} depend && \
43517308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4368489Srgrimes.endif
43717308Speter.if exists(lib)
43817308Speter	cd ${.CURDIR}/lib/csu/i386 && ${MAKE} depend && \
43917308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
44017308Speter.endif
4418295Srgrimes.if exists(gnu)
44217308Speter	cd ${.CURDIR}/gnu/lib && ${MAKE} depend && \
44317308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
44417308Speter	cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && ${MAKE} depend && \
44517308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4468295Srgrimes.endif
4472160Scsgr.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
44817308Speter	cd ${.CURDIR}/secure/lib && ${MAKE} depend && \
44917308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4502160Scsgr.endif
4512279Spaul.if exists(lib)
45217308Speter	cd ${.CURDIR}/lib && ${MAKE} depend && \
45317308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4542279Spaul.endif
45517234Sjraynard.if exists(usr.bin/lex/lib)
45617308Speter	cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
45717308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
45811772Snate.endif
4593197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
46017308Speter	cd ${.CURDIR}/eBones/lib && ${MAKE} depend && \
46117308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4622626Scsgr.endif
4638304Srgrimes.if exists(usr.sbin/pcvt/keycap)
46417308Speter	cd ${.CURDIR}/usr.sbin/pcvt/keycap && ${MAKE} depend && \
46517308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4668304Srgrimes.endif
4672061Sjkh
46817308Speter#
46917308Speter# build-tools - build and install any other tools needed to complete the
47017308Speter# compile and install.
47117308Speter#
47211806Sphkbuild-tools:
47317308Speter	cd ${.CURDIR}/gnu/usr.bin/cc && ${MAKE} depend && \
47417308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
47517308Speter	cd ${.CURDIR}/usr.bin/symorder && ${MAKE} depend && \
47617308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
47717308Speter	cd ${.CURDIR}/usr.bin/sgmlfmt && ${MAKE} depend && \
47817308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} 
47917308Speter	cd ${.CURDIR}/share/sgml && ${MAKE} depend && \
48017308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} 
48117308Speter	cd ${.CURDIR}/usr.sbin/zic && ${MAKE} depend && \
48217308Speter		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4832061Sjkh
4841594Srgrimes.include <bsd.subdir.mk>
485