Makefile revision 17466
11541Srgrimes#
21541Srgrimes#	$Id: Makefile,v 1.93 1996/08/03 13:00:35 jkh Exp $
31541Srgrimes#
41541Srgrimes# Make command line options:
51541Srgrimes#	-DCLOBBER will remove /usr/include
61541Srgrimes#	-DMAKE_LOCAL to add ./local to the SUBDIR list
71541Srgrimes#	-DMAKE_PORTS to add ./ports to the SUBDIR list
81541Srgrimes#	-DMAKE_EBONES to build eBones (KerberosIV)
91541Srgrimes#
101541Srgrimes#	-DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
111541Srgrimes#	-DNOCLEAN do not clean at all
121541Srgrimes#	-DNOCRYPT will prevent building of crypt versions
131541Srgrimes#	-DNOLKM do not build loadable kernel modules
141541Srgrimes#	-DNOOBJDIR do not run ``${MAKE} obj''
151541Srgrimes#	-DNOPROFILE do not build profiled libraries
161541Srgrimes#	-DNOSECURE do not go into secure subdir
171541Srgrimes#	-DNOGAMES do not go into games subdir
181541Srgrimes
191541Srgrimes#
201541Srgrimes# The intended user-driven targets are:
211541Srgrimes# world       - rebuild *everything*, including glue to help do upgrades.
221541Srgrimes# reinstall   - use an existing (eg: NFS mounted) build to do an update.
231541Srgrimes# update      - convenient way to update your source tree (eg: sup/cvs)
241541Srgrimes# most        - build user commands, no libraries or include files
251541Srgrimes# installmost - install user commands, no libraries or include files
261541Srgrimes# all         - run through SUBDIR and build everything.  This is an implicit
271541Srgrimes#               rule, not particularly useful for everybody.  Use 'world'.
281541Srgrimes
291541Srgrimes
301541Srgrimes# Put initial settings here.
311541SrgrimesSUBDIR=
321541Srgrimes
331541Srgrimes# We must do include and lib first so that the perl *.ph generation
341541Srgrimes# works correctly as it uses the header files installed by this.
351541Srgrimes.if exists(include)
361817SdgSUBDIR+= include
371541Srgrimes.endif
381541Srgrimes.if exists(lib)
391541SrgrimesSUBDIR+= lib
401541Srgrimes.endif
411541Srgrimes
421541Srgrimes.if exists(bin)
431541SrgrimesSUBDIR+= bin
441541Srgrimes.endif
451541Srgrimes.if exists(games) && !defined(NOGAMES)
461541SrgrimesSUBDIR+= games
471541Srgrimes.endif
481541Srgrimes.if exists(gnu)
491541SrgrimesSUBDIR+= gnu
501541Srgrimes.endif
511541Srgrimes.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
521541SrgrimesSUBDIR+= eBones
531541Srgrimes.endif
541541Srgrimes.if exists(libexec)
551541SrgrimesSUBDIR+= libexec
561541Srgrimes.endif
571541Srgrimes.if exists(sbin)
581541SrgrimesSUBDIR+= sbin
591541Srgrimes.endif
601541Srgrimes.if exists(share)
611541SrgrimesSUBDIR+= share
621541Srgrimes.endif
631817Sdg.if exists(sys)
642112SwollmanSUBDIR+= sys
651541Srgrimes.endif
661541Srgrimes.if exists(usr.bin)
671541SrgrimesSUBDIR+= usr.bin
681541Srgrimes.endif
691541Srgrimes.if exists(usr.sbin)
701541SrgrimesSUBDIR+= usr.sbin
711541Srgrimes.endif
721541Srgrimes.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
732112SwollmanSUBDIR+= secure
742112Swollman.endif
751541Srgrimes.if exists(lkm) && !defined(NOLKM)
761541SrgrimesSUBDIR+= lkm
771541Srgrimes.endif
781541Srgrimes
791541Srgrimes# etc must be last for "distribute" to work
801541Srgrimes.if exists(etc) && make(distribute)
812112SwollmanSUBDIR+= etc
822112Swollman.endif
832112Swollman
842112Swollman# These are last, since it is nice to at least get the base system
852112Swollman# rebuilt before you do them.
862112Swollman.if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
872112SwollmanSUBDIR+= local
882112Swollman.endif
892112Swollman.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
901541SrgrimesSUBDIR+= ports
911541Srgrimes.endif
921541Srgrimes
931541Srgrimes# Handle -DNOOBJDIR, -DNOCLEAN and -DNOCLEANDIR
941541Srgrimes.if defined(NOOBJDIR)
951541SrgrimesOBJDIR=
961541Srgrimes.else
971541SrgrimesOBJDIR=		obj
981541Srgrimes.endif
991541Srgrimes
1001541Srgrimes.if defined(NOCLEAN)
1011541SrgrimesCLEANDIR=
1021541Srgrimes.else
1031541Srgrimes.if defined(NOCLEANDIR)
1041541SrgrimesCLEANDIR=	clean
1051541Srgrimes.else
1061541SrgrimesCLEANDIR=	cleandir
1071541Srgrimes.endif
1081541Srgrimes.endif
1091541Srgrimes
1101541Srgrimes#
1111541Srgrimes# While building tools for bootstrapping, we dont need to waste time on
1121541Srgrimes# profiled libraries or man pages.  This speeds things up somewhat.
1131541Srgrimes#
1141541SrgrimesMK_FLAGS=	-DNOMAN -DNOPROFILE
1151541Srgrimes
1161541Srgrimes#
1171541Srgrimes# world
1181541Srgrimes#
1191541Srgrimes# Attempt to rebuild and reinstall *everything*, with reasonable chance of
1201541Srgrimes# success, regardless of how old your existing system is.
1211541Srgrimes#
1221541Srgrimes# >> Beware, it overwrites the local build environment! <<
1231541Srgrimes#
1241541Srgrimesworld:
1251541Srgrimes.if target(pre-world)
1261541Srgrimes	@echo "--------------------------------------------------------------"
1271541Srgrimes	@echo " Making 'pre-world' target"
1281541Srgrimes	@echo "--------------------------------------------------------------"
1291541Srgrimes	cd ${.CURDIR} && ${MAKE} pre-world
1301541Srgrimes	@echo
1311541Srgrimes.endif
1321541Srgrimes	@echo "--------------------------------------------------------------"
1331541Srgrimes	@echo " Making hierarchy"
1341541Srgrimes	@echo "--------------------------------------------------------------"
1351541Srgrimes	cd ${.CURDIR} && ${MAKE} hierarchy
1361541Srgrimes	@echo
1371541Srgrimes	@echo "--------------------------------------------------------------"
1381541Srgrimes	@echo " Rebuilding /usr/share/mk"
1391541Srgrimes	@echo "--------------------------------------------------------------"
1401541Srgrimes	cd ${.CURDIR} && ${MAKE} mk
1411541Srgrimes	@echo
1421541Srgrimes	@echo "--------------------------------------------------------------"
1431541Srgrimes	@echo " Cleaning up the source tree"
1441541Srgrimes	@echo "--------------------------------------------------------------"
1451541Srgrimes.if defined(NOCLEAN)
1461541Srgrimes	@echo "Not cleaning anything! I sure hope you know what you are doing!"
1471541Srgrimes.else
1481541Srgrimes	cd ${.CURDIR} && ${MAKE} ${CLEANDIR}
1491541Srgrimes.endif
1501541Srgrimes.endif
1511541Srgrimes	@echo
1521541Srgrimes.if !defined(NOOBJDIR)
1531541Srgrimes	@echo "--------------------------------------------------------------"
1541541Srgrimes	@echo " Rebuilding the obj tree"
1551541Srgrimes	@echo "--------------------------------------------------------------"
1561541Srgrimes	cd ${.CURDIR} && ${MAKE} obj
1571541Srgrimes	@echo
1581541Srgrimes.endif
1591541Srgrimes	@echo "--------------------------------------------------------------"
1601541Srgrimes	@echo " Rebuilding bootstrap tools"
1611541Srgrimes	@echo "--------------------------------------------------------------"
1621541Srgrimes	cd ${.CURDIR} && ${MAKE} bootstrap
1631541Srgrimes	@echo
1641541Srgrimes	@echo "--------------------------------------------------------------"
1651541Srgrimes	@echo " Rebuilding tools necessary to build the include files"
1661541Srgrimes	@echo "--------------------------------------------------------------"
1671541Srgrimes	cd ${.CURDIR} && ${MAKE} include-tools
1681541Srgrimes	@echo
1691541Srgrimes	@echo "--------------------------------------------------------------"
1701541Srgrimes	@echo " Rebuilding /usr/include"
1711541Srgrimes	@echo "--------------------------------------------------------------"
1721541Srgrimes	cd ${.CURDIR} && ${MAKE} includes
1731541Srgrimes	@echo
1741541Srgrimes	@echo "--------------------------------------------------------------"
1751541Srgrimes	@echo " Rebuilding tools needed to build the libraries"
1761541Srgrimes	@echo "--------------------------------------------------------------"
1771541Srgrimes	cd ${.CURDIR} && ${MAKE} lib-tools
1781541Srgrimes	@echo
1791541Srgrimes	@echo "--------------------------------------------------------------"
1801541Srgrimes	@echo " Rebuilding /usr/lib"
1811541Srgrimes	@echo "--------------------------------------------------------------"
1821541Srgrimes	cd ${.CURDIR} && ${MAKE} libraries
1831541Srgrimes	@echo
1841541Srgrimes	@echo "--------------------------------------------------------------"
1851541Srgrimes	@echo " Rebuilding C compiler, make, symorder, sgmlfmt and zic(8)"
1861541Srgrimes	@echo "--------------------------------------------------------------"
1871541Srgrimes	cd ${.CURDIR} && ${MAKE} build-tools
1881541Srgrimes	@echo
1891541Srgrimes	@echo "--------------------------------------------------------------"
1901541Srgrimes	@echo " Rebuilding.. The whole thing"
1911541Srgrimes	@echo "--------------------------------------------------------------"
1921541Srgrimes	cd ${.CURDIR} && ${MAKE} depend && ${MAKE} all install
1931541Srgrimes	cd ${.CURDIR}/share/man && ${MAKE} makedb
1941541Srgrimes.if target(post-world)
1951541Srgrimes	@echo
1961541Srgrimes	@echo "--------------------------------------------------------------"
1971541Srgrimes	@echo " Making 'post-world' target"
1981541Srgrimes	@echo "--------------------------------------------------------------"
1991541Srgrimes	cd ${.CURDIR} && ${MAKE} post-world
2001541Srgrimes.endif
2011541Srgrimes	@echo
2021541Srgrimes	@echo "--------------------------------------------------------------"
2031541Srgrimes	@echo "make world completed on `date`"
2041541Srgrimes
2051541Srgrimes#
2061541Srgrimes# reinstall
2071541Srgrimes#
2081541Srgrimes# If you have a build server, you can NFS mount the source and obj directories
2091541Srgrimes# and do a 'make reinstall' on the *client* to install new binaries from the
2101541Srgrimes# most recent server build.
2111541Srgrimes#
2121541Srgrimesreinstall:
2131541Srgrimes	@echo "--------------------------------------------------------------"
2141541Srgrimes	@echo " Making hierarchy"
2151541Srgrimes	@echo "--------------------------------------------------------------"
2161541Srgrimes	cd ${.CURDIR} && ${MAKE} hierarchy
2171541Srgrimes	@echo
2181541Srgrimes	@echo "--------------------------------------------------------------"
2191541Srgrimes	@echo " Rebuilding /usr/share/mk"
2201541Srgrimes	@echo "--------------------------------------------------------------"
2211541Srgrimes	cd ${.CURDIR} && ${MAKE} mk
2221541Srgrimes	@echo
2231541Srgrimes	@echo "--------------------------------------------------------------"
2241541Srgrimes	@echo " Rebuilding /usr/include"
2251541Srgrimes	@echo "--------------------------------------------------------------"
2261541Srgrimes	cd ${.CURDIR} && ${MAKE} includes
2271541Srgrimes	@echo
2281541Srgrimes	@echo "--------------------------------------------------------------"
2291541Srgrimes	@echo " Reinstalling..  The whole thing"
2301541Srgrimes	@echo "--------------------------------------------------------------"
2311541Srgrimes	@echo
2321541Srgrimes	cd ${.CURDIR} && ${MAKE} install
2331541Srgrimes	cd ${.CURDIR}/share/man && ${MAKE} makedb
2341541Srgrimes
2351541Srgrimes
2361541Srgrimes#
2371541Srgrimes# update
2381541Srgrimes#
2391541Srgrimes# Update the source tree, by running sup and/or running cvs to update to the
2401541Srgrimes# latest copy.
2411541Srgrimes#
2421541Srgrimesupdate:
2431541Srgrimes.if defined(SUP_UPDATE)
2441541Srgrimes	@echo "--------------------------------------------------------------"
2451541Srgrimes	@echo "Running sup"
2461541Srgrimes	@echo "--------------------------------------------------------------"
2471541Srgrimes	@sup -v ${SUPFILE}
2481541Srgrimes.if defined(SUPFILE1)
2491541Srgrimes	@sup -v ${SUPFILE1}
2501541Srgrimes.endif
2511541Srgrimes.if defined(SUPFILE2)
2521541Srgrimes	@sup -v ${SUPFILE2}
2531541Srgrimes.endif
2541541Srgrimes.endif
2551541Srgrimes.if defined(CVS_UPDATE)
2561541Srgrimes	@echo "--------------------------------------------------------------"
2571541Srgrimes	@echo "Updating /usr/src from cvs repository" ${CVSROOT}
2581541Srgrimes	@echo "--------------------------------------------------------------"
2591541Srgrimes	cd ${.CURDIR} &&  cvs -q update -P -d
2601541Srgrimes.endif
2611541Srgrimes
2621541Srgrimes
2631541Srgrimes#
2641541Srgrimes# most
2651541Srgrimes#
2661541Srgrimes# Build most of the user binaries on the existing system libs and includes.
2671541Srgrimes#
2681541Srgrimesmost:
2691541Srgrimes	@echo "--------------------------------------------------------------"
2701541Srgrimes	@echo " Building programs only"
2711541Srgrimes	@echo "--------------------------------------------------------------"
2721541Srgrimes	cd ${.CURDIR}/bin	&&	${MAKE} ${.MAKEFLAGS} all
2731541Srgrimes	cd ${.CURDIR}/sbin	&&	${MAKE} ${.MAKEFLAGS} all
2741541Srgrimes	cd ${.CURDIR}/libexec	&&	${MAKE} ${.MAKEFLAGS} all
2751541Srgrimes	cd ${.CURDIR}/usr.bin	&&	${MAKE} ${.MAKEFLAGS} all
2761541Srgrimes	cd ${.CURDIR}/usr.sbin	&&	${MAKE} ${.MAKEFLAGS} all
2771541Srgrimes	cd ${.CURDIR}/gnu/libexec &&	${MAKE} ${.MAKEFLAGS} all
2781541Srgrimes	cd ${.CURDIR}/gnu/usr.bin &&	${MAKE} ${.MAKEFLAGS} all
2791541Srgrimes	cd ${.CURDIR}/gnu/usr.sbin &&	${MAKE} ${.MAKEFLAGS} all
2801541Srgrimes#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
2811541Srgrimes#	cd ${.CURDIR}/eBones	&&	${MAKE} ${.MAKEFLAGS} most
2821541Srgrimes#.endif
2831541Srgrimes#.if !defined(NOSECURE) && !defined(NOCRYPT)
2841541Srgrimes#	cd ${.CURDIR}/secure	&&	${MAKE} ${.MAKEFLAGS} most
2851541Srgrimes#.endif
2861541Srgrimes
2871541Srgrimes#
2881541Srgrimes# installmost
2891541Srgrimes#
2901541Srgrimes# Install the binaries built by the 'most' target.  This does not include
2911541Srgrimes# libraries or include files.
2921541Srgrimes#
2931541Srgrimesinstallmost:
2941541Srgrimes	@echo "--------------------------------------------------------------"
2951541Srgrimes	@echo " Installing programs only"
2961541Srgrimes	@echo "--------------------------------------------------------------"
2971541Srgrimes	cd ${.CURDIR}/bin	&&	${MAKE} ${.MAKEFLAGS} install
2981541Srgrimes	cd ${.CURDIR}/sbin	&&	${MAKE} ${.MAKEFLAGS} install
2991541Srgrimes	cd ${.CURDIR}/libexec	&&	${MAKE} ${.MAKEFLAGS} install
3001541Srgrimes	cd ${.CURDIR}/usr.bin	&&	${MAKE} ${.MAKEFLAGS} install
3011541Srgrimes	cd ${.CURDIR}/usr.sbin	&&	${MAKE} ${.MAKEFLAGS} install
3021541Srgrimes	cd ${.CURDIR}/gnu/libexec &&	${MAKE} ${.MAKEFLAGS} install
3031541Srgrimes	cd ${.CURDIR}/gnu/usr.bin &&	${MAKE} ${.MAKEFLAGS} install
3041541Srgrimes	cd ${.CURDIR}/gnu/usr.sbin &&	${MAKE} ${.MAKEFLAGS} install
3051541Srgrimes#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
3061549Srgrimes#	cd ${.CURDIR}/eBones	&&	${MAKE} ${.MAKEFLAGS} installmost
3071541Srgrimes#.endif
3081541Srgrimes#.if !defined(NOSECURE) && !defined(NOCRYPT)
3091541Srgrimes#	cd ${.CURDIR}/secure	&&	${MAKE} ${.MAKEFLAGS} installmost
3101549Srgrimes#.endif
3111549Srgrimes
3121549Srgrimes#
3131541Srgrimes# ------------------------------------------------------------------------
3141541Srgrimes#
3151541Srgrimes# From here onwards are utility targets used by the 'make world' and
3161541Srgrimes# related targets.  If your 'world' breaks, you may like to try to fix
3171541Srgrimes# the problem and manually run the following targets to attempt to
3181541Srgrimes# complete the build.  Beware, this is *not* guaranteed to work, you
3191541Srgrimes# need to have a pretty good grip on the current state of the system
3201541Srgrimes# to attempt to manually finish it.  If in doubt, 'make world' again.
3211541Srgrimes#
3221541Srgrimes
3231541Srgrimes#
3241541Srgrimes# heirarchy - ensure that all the needed directories are present
3251541Srgrimes#
3261541Srgrimeshierarchy:
3271541Srgrimes	cd ${.CURDIR}/etc &&		${MAKE} distrib-dirs
3281541Srgrimes
3291541Srgrimes#
3301541Srgrimes# mk - update the /usr/share/mk makefiles.
3311541Srgrimes#
3321541Srgrimesmk:
3331541Srgrimes	cd ${.CURDIR}/share/mk &&	${MAKE} install
3341541Srgrimes
3351541Srgrimes#
3361541Srgrimes# bootstrap - [re]build tools needed to run the actual build, this includes
3371541Srgrimes# tools needed by 'make depend', as some tools are needed to generate source
3381541Srgrimes# for the dependency information to be gathered from.
3391541Srgrimes#
3401541Srgrimesbootstrap:
3411541Srgrimes	cd ${.CURDIR}/usr.bin/make && ${MAKE} depend && \
3421541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
3431541Srgrimes	cd ${.CURDIR}/usr.bin/xinstall && ${MAKE} depend && \
3441541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
3451541Srgrimes	cd ${.CURDIR}/usr.bin/tsort && ${MAKE} depend && \
3461541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
3471541Srgrimes	cd ${.CURDIR}/usr.bin/lex && ${MAKE} bootstrap && ${MAKE} depend && \
3481541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
3491541Srgrimes
3501541Srgrimes#
3511541Srgrimes# include-tools - generally the same as 'bootstrap', except that it's for
3521541Srgrimes# things that are specifically needed to generate include files.
3531541Srgrimes#
3541541Srgrimes# XXX should be merged with bootstrap, it's not worth keeeping them seperate
3551541Srgrimes#
3561541Srgrimesinclude-tools:
3571541Srgrimes	cd ${.CURDIR}/usr.bin/rpcgen && ${MAKE} depend && \
3581541Srgrimes		${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
3591541Srgrimes
3601541Srgrimes#
3611541Srgrimes# includes - possibly generate and install the include files.
3621541Srgrimes#
3631541Srgrimesincludes:
3641541Srgrimes.if defined(CLOBBER)
3651541Srgrimes	rm -rf ${DESTDIR}/usr/include/*
3661541Srgrimes	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
3671541Srgrimes		-p ${DESTDIR}/usr/include
3681541Srgrimes.endif
3691541Srgrimes	cd ${.CURDIR}/include &&		${MAKE} install
3701541Srgrimes	cd ${.CURDIR}/gnu/include &&		${MAKE} install
3711541Srgrimes	cd ${.CURDIR}/gnu/lib/libreadline &&	${MAKE} beforeinstall
3721541Srgrimes	cd ${.CURDIR}/gnu/lib/libregex &&	${MAKE} beforeinstall
3731541Srgrimes	cd ${.CURDIR}/gnu/lib/libg++ &&         ${MAKE} beforeinstall
3741541Srgrimes	cd ${.CURDIR}/gnu/lib/libdialog &&      ${MAKE} beforeinstall
3751541Srgrimes.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
3761541Srgrimes	cd ${.CURDIR}/eBones/include &&		${MAKE} beforeinstall
3771541Srgrimes	cd ${.CURDIR}/eBones/lib/libkrb &&	${MAKE} beforeinstall
3781541Srgrimes	cd ${.CURDIR}/eBones/lib/libkadm &&	${MAKE} beforeinstall
3791541Srgrimes.endif
3801541Srgrimes	cd ${.CURDIR}/lib/libc &&		${MAKE} beforeinstall
3811541Srgrimes	cd ${.CURDIR}/lib/libcurses &&		${MAKE} beforeinstall
3821541Srgrimes	cd ${.CURDIR}/lib/libedit &&		${MAKE} beforeinstall
3831887Sdg	cd ${.CURDIR}/lib/libftpio &&		${MAKE} beforeinstall
3841541Srgrimes	cd ${.CURDIR}/lib/libmd &&		${MAKE} beforeinstall
3851541Srgrimes	cd ${.CURDIR}/lib/libmytinfo &&         ${MAKE} beforeinstall
3861541Srgrimes	cd ${.CURDIR}/lib/libncurses &&		${MAKE} beforeinstall
3871541Srgrimes.if !defined(WANT_CSRG_LIBM)
3881541Srgrimes	cd ${.CURDIR}/lib/msun &&		${MAKE} beforeinstall
3891541Srgrimes.endif
3901541Srgrimes	cd ${.CURDIR}/lib/libpcap &&		${MAKE} beforeinstall
3911541Srgrimes	cd ${.CURDIR}/lib/librpcsvc &&		${MAKE} beforeinstall
3921541Srgrimes	cd ${.CURDIR}/lib/libskey &&		${MAKE} beforeinstall
3931541Srgrimes	cd ${.CURDIR}/lib/libtcl &&		${MAKE} beforeinstall
3941541Srgrimes	cd ${.CURDIR}/lib/libtermcap &&		${MAKE} beforeinstall
3951541Srgrimes	cd ${.CURDIR}/lib/libcom_err &&		${MAKE} beforeinstall
3961541Srgrimes	cd ${.CURDIR}/lib/libss &&		${MAKE} beforeinstall
3971541Srgrimes	cd ${.CURDIR}/lib/libscsi &&		${MAKE} beforeinstall
3981541Srgrimes	cd ${.CURDIR}/lib/libutil &&		${MAKE} beforeinstall
3991541Srgrimes
4001541Srgrimes#
4011541Srgrimes# lib-tools - build tools to compile and install the libraries.
4021541Srgrimes#
4031541Srgrimeslib-tools:
4041541Srgrimes	cd ${.CURDIR}/gnu/usr.bin/ld && ${MAKE} depend && \
4051541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4061541Srgrimes	cd ${.CURDIR}/usr.bin/ar && ${MAKE} depend && \
4071541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4081541Srgrimes	cd ${.CURDIR}/usr.bin/ranlib && ${MAKE} depend && \
4091541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4101541Srgrimes	cd ${.CURDIR}/usr.bin/nm && ${MAKE} depend && \
4111541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4121541Srgrimes	cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
4131541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4141541Srgrimes	cd ${.CURDIR}/usr.bin/compile_et && ${MAKE} depend && \
4151541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} && \
4161541Srgrimes		rm -f /usr/sbin/compile_et
4171541Srgrimes	cd ${.CURDIR}/usr.bin/mk_cmds && ${MAKE} depend && \
4181541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4191541Srgrimes
4201541Srgrimes#
4211549Srgrimes# libraries - build and install the libraries
4221541Srgrimes#
4231541Srgrimeslibraries:
4241541Srgrimes.if exists(lib/libcompat)
4251541Srgrimes	cd ${.CURDIR}/lib/libcompat && ${MAKE} depend && \
4261541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4271541Srgrimes.endif
4281541Srgrimes.if exists(lib/libncurses)
4291541Srgrimes	cd ${.CURDIR}/lib/libncurses && ${MAKE} depend && \
4301541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4311541Srgrimes.endif
4321541Srgrimes.if exists(lib/libtermcap)
4331541Srgrimes	cd ${.CURDIR}/lib/libtermcap && ${MAKE} depend && \
4341541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4351541Srgrimes.endif
4361541Srgrimes.if exists(lib)
4371541Srgrimes	cd ${.CURDIR}/lib/csu/i386 && ${MAKE} depend && \
4381541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4391541Srgrimes.endif
4401541Srgrimes.if exists(gnu)
4411541Srgrimes	cd ${.CURDIR}/gnu/lib && ${MAKE} depend && \
4421541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4431541Srgrimes	cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && ${MAKE} depend && \
4441541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4451541Srgrimes.endif
4461541Srgrimes.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
4471541Srgrimes	cd ${.CURDIR}/secure/lib && ${MAKE} depend && \
4481541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4491541Srgrimes.endif
4501541Srgrimes.if exists(lib)
4511541Srgrimes	cd ${.CURDIR}/lib && ${MAKE} depend && \
4521541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4531541Srgrimes.endif
4541541Srgrimes.if exists(usr.bin/lex/lib)
4551541Srgrimes	cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
4561541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4571541Srgrimes.endif
4581541Srgrimes.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
4591541Srgrimes	cd ${.CURDIR}/eBones/lib && ${MAKE} depend && \
4601541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
4611541Srgrimes.endif
4621541Srgrimes.if exists(usr.sbin/pcvt/keycap)
4631541Srgrimes	cd ${.CURDIR}/usr.sbin/pcvt/keycap && ${MAKE} depend && \
4641541Srgrimes		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
465.endif
466
467#
468# build-tools - build and install any other tools needed to complete the
469# compile and install.
470#
471build-tools:
472	cd ${.CURDIR}/gnu/usr.bin/cc && ${MAKE} depend && \
473		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
474	cd ${.CURDIR}/usr.bin/symorder && ${MAKE} depend && \
475		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
476	cd ${.CURDIR}/usr.bin/sgmlfmt && ${MAKE} depend && \
477		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} 
478	cd ${.CURDIR}/share/sgml && ${MAKE} depend && \
479		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} 
480	cd ${.CURDIR}/usr.sbin/zic && ${MAKE} depend && \
481		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
482
483.include <bsd.subdir.mk>
484