Makefile revision 21386
155714Skris#
255714Skris#	$Id: Makefile,v 1.111 1996/12/20 08:18:47 asami Exp $
355714Skris#
455714Skris# Make command line options:
555714Skris#	-DCLOBBER will remove /usr/include
655714Skris#	-DMAKE_LOCAL to add ./local to the SUBDIR list
755714Skris#	-DMAKE_PORTS to add ./ports to the SUBDIR list
855714Skris#	-DMAKE_EBONES to build eBones (KerberosIV)
955714Skris#	-DALLLANG to build documentation for all languages
1055714Skris#	  (where available -- see share/doc/Makefile)
1155714Skris#
1255714Skris#	-DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
1355714Skris#	-DNOCLEAN do not clean at all
1455714Skris#	-DNOCRYPT will prevent building of crypt versions
1555714Skris#	-DNOLKM do not build loadable kernel modules
1655714Skris#	-DNOOBJDIR do not run ``${MAKE} obj''
1755714Skris#	-DNOPROFILE do not build profiled libraries
1855714Skris#	-DNOSECURE do not go into secure subdir
1955714Skris#	-DNOGAMES do not go into games subdir
2055714Skris#	-DNOSHARE do not go into share subdir
2155714Skris
2255714Skris#
23109998Smarkm# The intended user-driven targets are:
24109998Smarkm# world       - rebuild *everything*, including glue to help do upgrades.
25109998Smarkm# reinstall   - use an existing (eg: NFS mounted) build to do an update.
26109998Smarkm# update      - convenient way to update your source tree (eg: sup/cvs)
27109998Smarkm# most        - build user commands, no libraries or include files
28109998Smarkm# installmost - install user commands, no libraries or include files
29109998Smarkm#
30109998Smarkm# Standard targets (not defined here) are documented in the makefiles in
31109998Smarkm# /usr/share/mk.  These include:
32109998Smarkm#		obj depend all install clean cleandepend cleanobj
33109998Smarkm
34109998Smarkm
35109998Smarkm# Put initial settings here.
36109998SmarkmSUBDIR=
37109998Smarkm
38109998Smarkm# We must do include and lib first so that the perl *.ph generation
39109998Smarkm# works correctly as it uses the header files installed by this.
40109998Smarkm.if exists(include)
41109998SmarkmSUBDIR+= include
42109998Smarkm.endif
43109998Smarkm.if exists(lib)
44109998SmarkmSUBDIR+= lib
45109998Smarkm.endif
46109998Smarkm
47109998Smarkm.if exists(bin)
4855714SkrisSUBDIR+= bin
4955714Skris.endif
5055714Skris.if exists(games) && !defined(NOGAMES)
5155714SkrisSUBDIR+= games
5255714Skris.endif
5355714Skris.if exists(gnu)
5455714SkrisSUBDIR+= gnu
5559191Skris.endif
5655714Skris.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
5755714SkrisSUBDIR+= eBones
5855714Skris.endif
5955714Skris.if exists(libexec)
6055714SkrisSUBDIR+= libexec
6155714Skris.endif
6255714Skris.if exists(sbin)
6355714SkrisSUBDIR+= sbin
6455714Skris.endif
6555714Skris.if exists(share) && !defined(NOSHARE)
6655714SkrisSUBDIR+= share
6755714Skris.endif
6855714Skris.if exists(sys)
6955714SkrisSUBDIR+= sys
7055714Skris.endif
7155714Skris.if exists(usr.bin)
7255714SkrisSUBDIR+= usr.bin
7355714Skris.endif
7455714Skris.if exists(usr.sbin)
7555714SkrisSUBDIR+= usr.sbin
7655714Skris.endif
7776866Skris.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
7876866SkrisSUBDIR+= secure
7976866Skris.endif
8076866Skris.if exists(lkm) && !defined(NOLKM)
8176866SkrisSUBDIR+= lkm
8276866Skris.endif
8376866Skris
8455714Skris# etc must be last for "distribute" to work
8559191Skris.if exists(etc) && make(distribute)
8659191SkrisSUBDIR+= etc
8776866Skris.endif
8876866Skris
8955714Skris# These are last, since it is nice to at least get the base system
9055714Skris# rebuilt before you do them.
9155714Skris.if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
9255714SkrisSUBDIR+= local
9355714Skris.endif
9455714Skris.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
9555714SkrisSUBDIR+= ports
96109998Smarkm.endif
9789837Skris
9889837Skris# Handle -DNOOBJDIR, -DNOCLEAN and -DNOCLEANDIR
9989837Skris.if defined(NOOBJDIR)
10089837SkrisOBJDIR=
10159191Skris.else
10259191SkrisOBJDIR=		obj
10359191Skris.endif
10459191Skris
10559191Skris.if defined(NOCLEAN)
10655714SkrisCLEANDIR=
10755714Skris.else
10855714Skris.if defined(NOCLEANDIR)
10955714SkrisCLEANDIR=	clean
11055714Skris.else
11155714SkrisCLEANDIR=	cleandir
11268651Skris.endif
11368651Skris.endif
11468651Skris
11568651SkrisSUP?=           sup
11655714SkrisSUPFLAGS?=      -v
11755714Skris
11855714Skris#
11955714Skris# While building tools for bootstrapping, we dont need to waste time on
12076866Skris# profiled libraries or man pages.  This speeds things up somewhat.
12176866Skris#
12276866SkrisMK_FLAGS=	-DNOMAN -DNOPROFILE
12376866Skris
12476866Skris#
12576866Skris# world
12676866Skris#
12776866Skris# Attempt to rebuild and reinstall *everything*, with reasonable chance of
12855714Skris# success, regardless of how old your existing system is.
12955714Skris#
13055714Skris# >> Beware, it overwrites the local build environment! <<
13155714Skris#
13255714Skrisworld:
13355714Skris	@echo "--------------------------------------------------------------"
13455714Skris	@echo "make world started on `LC_TIME=C date`"
13555714Skris	@echo "--------------------------------------------------------------"
13655714Skris.if target(pre-world)
13755714Skris	@echo "--------------------------------------------------------------"
13855714Skris	@echo " Making 'pre-world' target"
13955714Skris	@echo "--------------------------------------------------------------"
14055714Skris	cd ${.CURDIR} && ${MAKE} pre-world
14155714Skris	@echo
14255714Skris.endif
143109998Smarkm	@echo "--------------------------------------------------------------"
14455714Skris	@echo " Making hierarchy"
14555714Skris	@echo "--------------------------------------------------------------"
14655714Skris	cd ${.CURDIR} && ${MAKE} hierarchy
14755714Skris	@echo
14855714Skris	@echo "--------------------------------------------------------------"
14955714Skris	@echo " Rebuilding /usr/share/mk"
15055714Skris	@echo "--------------------------------------------------------------"
15155714Skris	cd ${.CURDIR} && ${MAKE} mk
15255714Skris	@echo
15355714Skris	@echo "--------------------------------------------------------------"
15455714Skris	@echo " Cleaning up the source tree"
15555714Skris	@echo "--------------------------------------------------------------"
15655714Skris.if defined(NOCLEAN)
15755714Skris	@echo "Not cleaning anything! I sure hope you know what you are doing!"
15855714Skris.else
15955714Skris	cd ${.CURDIR} && ${MAKE} ${CLEANDIR}
16055714Skris.endif
16155714Skris	@echo
16255714Skris.if !defined(NOOBJDIR)
16355714Skris	@echo "--------------------------------------------------------------"
16455714Skris	@echo " Rebuilding the obj tree"
16555714Skris	@echo "--------------------------------------------------------------"
16655714Skris	cd ${.CURDIR} && ${MAKE} obj
16755714Skris	@echo
16855714Skris.endif
16955714Skris	@echo "--------------------------------------------------------------"
17055714Skris	@echo " Rebuilding bootstrap tools"
17155714Skris	@echo "--------------------------------------------------------------"
172109998Smarkm	cd ${.CURDIR} && ${MAKE} bootstrap
173109998Smarkm	@echo
174109998Smarkm	@echo "--------------------------------------------------------------"
175109998Smarkm	@echo " Rebuilding tools necessary to build the include files"
17655714Skris	@echo "--------------------------------------------------------------"
17755714Skris	cd ${.CURDIR} && ${MAKE} include-tools
17855714Skris	@echo
17955714Skris	@echo "--------------------------------------------------------------"
18055714Skris	@echo " Rebuilding /usr/include"
18155714Skris	@echo "--------------------------------------------------------------"
18255714Skris	cd ${.CURDIR} && ${MAKE} includes
18355714Skris	@echo
18455714Skris	@echo "--------------------------------------------------------------"
18555714Skris	@echo " Rebuilding tools needed to build the libraries"
18655714Skris	@echo "--------------------------------------------------------------"
18755714Skris	cd ${.CURDIR} && ${MAKE} lib-tools
18855714Skris	@echo
18955714Skris	@echo "--------------------------------------------------------------"
19055714Skris	@echo " Rebuilding /usr/lib"
19155714Skris	@echo "--------------------------------------------------------------"
19255714Skris	cd ${.CURDIR} && ${MAKE} libraries
19355714Skris	@echo
19455714Skris	@echo "--------------------------------------------------------------"
19555714Skris	@echo " Rebuilding sgml tools, symorder, groff and zic(8)"
19655714Skris	@echo "--------------------------------------------------------------"
19755714Skris	cd ${.CURDIR} && ${MAKE} build-tools
19855714Skris	@echo
19955714Skris	@echo "--------------------------------------------------------------"
20055714Skris	@echo " Rebuilding dependencies"
20155714Skris	@echo "--------------------------------------------------------------"
20255714Skris	cd ${.CURDIR} && ${MAKE} depend
20355714Skris	@echo
20455714Skris	@echo "--------------------------------------------------------------"
20555714Skris	@echo " Building everything.."
20655714Skris	@echo "--------------------------------------------------------------"
20755714Skris	cd ${.CURDIR} && ${MAKE} all
20855714Skris	@echo
20955714Skris	@echo "--------------------------------------------------------------"
21055714Skris	@echo " Installing everything.."
21155714Skris	@echo "--------------------------------------------------------------"
21255714Skris	cd ${.CURDIR} && ${MAKE} install
21355714Skris	@echo
21455714Skris	@echo "--------------------------------------------------------------"
21555714Skris	@echo " Rebuilding man page indexes"
21655714Skris	@echo "--------------------------------------------------------------"
21755714Skris	cd ${.CURDIR}/share/man && ${MAKE} makedb
21872613Skris.if target(post-world)
21955714Skris	@echo
22055714Skris	@echo "--------------------------------------------------------------"
22155714Skris	@echo " Making 'post-world' target"
22255714Skris	@echo "--------------------------------------------------------------"
22355714Skris	cd ${.CURDIR} && ${MAKE} post-world
22455714Skris.endif
22555714Skris	@echo
22655714Skris	@echo "--------------------------------------------------------------"
22755714Skris	@echo "make world completed on `LC_TIME=C date`"
22855714Skris	@echo "--------------------------------------------------------------"
22989837Skris
23089837Skris#
23189837Skris# reinstall
23289837Skris#
23355714Skris# If you have a build server, you can NFS mount the source and obj directories
23489837Skris# and do a 'make reinstall' on the *client* to install new binaries from the
23589837Skris# most recent server build.
23689837Skris#
23789837Skrisreinstall:
23889837Skris	@echo "--------------------------------------------------------------"
23989837Skris	@echo " Making hierarchy"
24089837Skris	@echo "--------------------------------------------------------------"
24189837Skris	cd ${.CURDIR} && ${MAKE} hierarchy
24289837Skris	@echo
24389837Skris	@echo "--------------------------------------------------------------"
24489837Skris	@echo " Rebuilding /usr/share/mk"
24589837Skris	@echo "--------------------------------------------------------------"
24655714Skris	cd ${.CURDIR} && ${MAKE} mk
24755714Skris	@echo
24855714Skris	@echo "--------------------------------------------------------------"
24989837Skris	@echo " Installing everything.."
25068651Skris	@echo "--------------------------------------------------------------"
25168651Skris	cd ${.CURDIR} && ${MAKE} install
25255714Skris	@echo
25389837Skris	@echo "--------------------------------------------------------------"
25489837Skris	@echo " Rebuilding man page indexes"
25589837Skris	@echo "--------------------------------------------------------------"
25655714Skris	cd ${.CURDIR}/share/man && ${MAKE} makedb
25768651Skris
25855714Skris
25955714Skris#
26055714Skris# update
26155714Skris#
26255714Skris# Update the source tree, by running sup and/or running cvs to update to the
26355714Skris# latest copy.
26455714Skris#
26555714Skrisupdate:
26655714Skris.if defined(SUP_UPDATE)
26759191Skris	@echo "--------------------------------------------------------------"
26859191Skris	@echo "Running sup"
26959191Skris	@echo "--------------------------------------------------------------"
27059191Skris	@${SUP} ${SUPFLAGS} ${SUPFILE}
27189837Skris.if defined(SUPFILE1)
272109998Smarkm	@${SUP} ${SUPFLAGS} ${SUPFILE1}
273109998Smarkm.endif
274109998Smarkm.if defined(SUPFILE2)
275109998Smarkm	@${SUP} ${SUPFLAGS} ${SUPFILE2}
276109998Smarkm.endif
277109998Smarkm.endif
278109998Smarkm.if defined(CVS_UPDATE)
279109998Smarkm	@echo "--------------------------------------------------------------"
280109998Smarkm	@echo "Updating /usr/src from cvs repository" ${CVSROOT}
28189837Skris	@echo "--------------------------------------------------------------"
28289837Skris	cd ${.CURDIR} &&  cvs -q update -P -d
28355714Skris.endif
28468651Skris
28555714Skris
28655714Skris#
28755714Skris# most
28855714Skris#
28955714Skris# Build most of the user binaries on the existing system libs and includes.
29055714Skris#
29155714Skrismost:
29255714Skris	@echo "--------------------------------------------------------------"
29355714Skris	@echo " Building programs only"
29455714Skris	@echo "--------------------------------------------------------------"
29555714Skris	cd ${.CURDIR}/bin	&&	${MAKE} ${.MAKEFLAGS} all
29655714Skris	cd ${.CURDIR}/sbin	&&	${MAKE} ${.MAKEFLAGS} all
29755714Skris	cd ${.CURDIR}/libexec	&&	${MAKE} ${.MAKEFLAGS} all
29855714Skris	cd ${.CURDIR}/usr.bin	&&	${MAKE} ${.MAKEFLAGS} all
29955714Skris	cd ${.CURDIR}/usr.sbin	&&	${MAKE} ${.MAKEFLAGS} all
30055714Skris	cd ${.CURDIR}/gnu/libexec &&	${MAKE} ${.MAKEFLAGS} all
30155714Skris	cd ${.CURDIR}/gnu/usr.bin &&	${MAKE} ${.MAKEFLAGS} all
30255714Skris	cd ${.CURDIR}/gnu/usr.sbin &&	${MAKE} ${.MAKEFLAGS} all
30355714Skris#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
30455714Skris#	cd ${.CURDIR}/eBones	&&	${MAKE} ${.MAKEFLAGS} most
30555714Skris#.endif
30655714Skris#.if !defined(NOSECURE) && !defined(NOCRYPT)
30755714Skris#	cd ${.CURDIR}/secure	&&	${MAKE} ${.MAKEFLAGS} most
30855714Skris#.endif
30955714Skris
31055714Skris#
31155714Skris# installmost
31255714Skris#
31355714Skris# Install the binaries built by the 'most' target.  This does not include
31455714Skris# libraries or include files.
31555714Skris#
31655714Skrisinstallmost:
31755714Skris	@echo "--------------------------------------------------------------"
31855714Skris	@echo " Installing programs only"
31955714Skris	@echo "--------------------------------------------------------------"
32055714Skris	cd ${.CURDIR}/bin	&&	${MAKE} ${.MAKEFLAGS} install
32155714Skris	cd ${.CURDIR}/sbin	&&	${MAKE} ${.MAKEFLAGS} install
32255714Skris	cd ${.CURDIR}/libexec	&&	${MAKE} ${.MAKEFLAGS} install
32355714Skris	cd ${.CURDIR}/usr.bin	&&	${MAKE} ${.MAKEFLAGS} install
32455714Skris	cd ${.CURDIR}/usr.sbin	&&	${MAKE} ${.MAKEFLAGS} install
32555714Skris	cd ${.CURDIR}/gnu/libexec &&	${MAKE} ${.MAKEFLAGS} install
32655714Skris	cd ${.CURDIR}/gnu/usr.bin &&	${MAKE} ${.MAKEFLAGS} install
32755714Skris	cd ${.CURDIR}/gnu/usr.sbin &&	${MAKE} ${.MAKEFLAGS} install
32855714Skris#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
32955714Skris#	cd ${.CURDIR}/eBones	&&	${MAKE} ${.MAKEFLAGS} installmost
33055714Skris#.endif
33168651Skris#.if !defined(NOSECURE) && !defined(NOCRYPT)
33268651Skris#	cd ${.CURDIR}/secure	&&	${MAKE} ${.MAKEFLAGS} installmost
33368651Skris#.endif
33468651Skris
33589837Skris#
336100928Snectar# ------------------------------------------------------------------------
337100928Snectar#
338100928Snectar# From here onwards are utility targets used by the 'make world' and
339100928Snectar# related targets.  If your 'world' breaks, you may like to try to fix
340100928Snectar# the problem and manually run the following targets to attempt to
341100928Snectar# complete the build.  Beware, this is *not* guaranteed to work, you
342100928Snectar# need to have a pretty good grip on the current state of the system
343100928Snectar# to attempt to manually finish it.  If in doubt, 'make world' again.
344100928Snectar#
34589837Skris
34689837Skris#
347100928Snectar# heirarchy - ensure that all the needed directories are present
348100928Snectar#
349100928Snectarhierarchy:
350100928Snectar	cd ${.CURDIR}/etc &&		${MAKE} distrib-dirs
351100928Snectar
352100928Snectar#
353100928Snectar# mk - update the /usr/share/mk makefiles.
354109998Smarkm#
355109998Smarkmmk:
356109998Smarkm	cd ${.CURDIR}/share/mk &&	${MAKE} install
357109998Smarkm
35855714Skris#
35955714Skris# bootstrap - [re]build tools needed to run the actual build, this includes
36055714Skris# tools needed by 'make depend', as some tools are needed to generate source
36155714Skris# for the dependency information to be gathered from.
36255714Skris#
36355714Skrisbootstrap:
36455714Skris	cd ${.CURDIR}/usr.bin/make && ${MAKE} depend && \
36555714Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
36655714Skris	cd ${.CURDIR}/usr.bin/xinstall && ${MAKE} depend && \
36755714Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
36855714Skris	cd ${.CURDIR}/usr.bin/lex && ${MAKE} bootstrap && ${MAKE} depend && \
36955714Skris		${MAKE} ${MK_FLAGS} -DNOLIB all install ${CLEANDIR} ${OBJDIR}
37055714Skris
37155714Skris#
37255714Skris# include-tools - generally the same as 'bootstrap', except that it's for
37355714Skris# things that are specifically needed to generate include files.
37455714Skris#
37555714Skris# XXX should be merged with bootstrap, it's not worth keeeping them seperate
37655714Skris#
37755714Skrisinclude-tools:
37855714Skris	cd ${.CURDIR}/usr.bin/rpcgen && ${MAKE} depend && \
37955714Skris		${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
38055714Skris
38155714Skris#
38255714Skris# includes - possibly generate and install the include files.
38355714Skris#
38455714Skrisincludes:
38555714Skris.if defined(CLOBBER)
38655714Skris	rm -rf ${DESTDIR}/usr/include/*
38755714Skris	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
38855714Skris		-p ${DESTDIR}/usr/include
38955714Skris.endif
39055714Skris	cd ${.CURDIR}/include/rpcsvc &&		${MAKE} all
39155714Skris	cd ${.CURDIR}/include &&		${MAKE} install
39255714Skris	cd ${.CURDIR}/gnu/include &&		${MAKE} install
39355714Skris	cd ${.CURDIR}/gnu/lib/libreadline &&	${MAKE} beforeinstall
39455714Skris	cd ${.CURDIR}/gnu/lib/libregex &&	${MAKE} beforeinstall
39555714Skris	cd ${.CURDIR}/gnu/lib/libstdc++ &&      ${MAKE} beforeinstall
39655714Skris	cd ${.CURDIR}/gnu/lib/libg++ &&         ${MAKE} beforeinstall
397100936Snectar	cd ${.CURDIR}/gnu/lib/libdialog &&      ${MAKE} beforeinstall
39855714Skris.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
39955714Skris	cd ${.CURDIR}/eBones/include &&		${MAKE} beforeinstall
400101618Snectar	cd ${.CURDIR}/eBones/lib/libkrb &&	${MAKE} beforeinstall
401101618Snectar	cd ${.CURDIR}/eBones/lib/libkadm &&	${MAKE} beforeinstall
402101618Snectar.endif
403100936Snectar	cd ${.CURDIR}/lib/libc &&		${MAKE} beforeinstall
404100936Snectar	cd ${.CURDIR}/lib/libcurses &&		${MAKE} beforeinstall
405100936Snectar	cd ${.CURDIR}/lib/libedit &&		${MAKE} beforeinstall
40655714Skris	cd ${.CURDIR}/lib/libftpio &&		${MAKE} beforeinstall
40755714Skris	cd ${.CURDIR}/lib/libmd &&		${MAKE} beforeinstall
40855714Skris	cd ${.CURDIR}/lib/libmytinfo &&         ${MAKE} beforeinstall
40955714Skris	cd ${.CURDIR}/lib/libncurses &&		${MAKE} beforeinstall
41055714Skris.if !defined(WANT_CSRG_LIBM)
411101613Snectar	cd ${.CURDIR}/lib/msun &&		${MAKE} beforeinstall
412100936Snectar.endif
413100936Snectar	cd ${.CURDIR}/lib/libpcap &&		${MAKE} beforeinstall
414100936Snectar	cd ${.CURDIR}/lib/librpcsvc &&		${MAKE} beforeinstall
415100936Snectar	cd ${.CURDIR}/lib/libskey &&		${MAKE} beforeinstall
416100936Snectar	cd ${.CURDIR}/lib/libtcl &&		${MAKE} beforeinstall
417100936Snectar	cd ${.CURDIR}/lib/libtermcap &&		${MAKE} beforeinstall
418100936Snectar	cd ${.CURDIR}/lib/libcom_err &&		${MAKE} beforeinstall
419100936Snectar	cd ${.CURDIR}/lib/libss &&		${MAKE} beforeinstall
420100936Snectar	cd ${.CURDIR}/lib/libscsi &&		${MAKE} beforeinstall
421100936Snectar	cd ${.CURDIR}/lib/libutil &&		${MAKE} beforeinstall
422100936Snectar
423100936Snectar#
42455714Skris# lib-tools - build tools to compile and install the libraries.
425109998Smarkm#
426109998Smarkmlib-tools:
427109998Smarkm	cd ${.CURDIR}/usr.bin/tsort && ${MAKE} depend && \
428109998Smarkm		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
429109998Smarkm	cd ${.CURDIR}/gnu/usr.bin/ld && ${MAKE} depend && \
430109998Smarkm		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
431109998Smarkm	cd ${.CURDIR}/gnu/usr.bin/as && ${MAKE} depend && \
432109998Smarkm		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
433109998Smarkm	cd ${.CURDIR}/usr.bin/ar && ${MAKE} depend && \
43459191Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
43555714Skris	cd ${.CURDIR}/usr.bin/ranlib && ${MAKE} depend && \
43655714Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
43755714Skris	cd ${.CURDIR}/usr.bin/nm && ${MAKE} depend && \
43855714Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
43955714Skris	cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
44055714Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
44155714Skris	cd ${.CURDIR}/usr.bin/yacc && ${MAKE} depend && \
44255714Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
44355714Skris	cd ${.CURDIR}/usr.bin/compile_et && ${MAKE} depend && \
44455714Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} && \
44555714Skris		rm -f /usr/sbin/compile_et
44655714Skris	cd ${.CURDIR}/usr.bin/mk_cmds && ${MAKE} depend && \
44755714Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
44855714Skris	cd ${.CURDIR}/gnu/usr.bin/bison && ${MAKE} depend && \
44955714Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
45055714Skris	cd ${.CURDIR}/gnu/usr.bin/gperf && ${MAKE} depend && \
45159191Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
45259191Skris	cd ${.CURDIR}/gnu/usr.bin/cc && ${MAKE} depend && \
45359191Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
45459191Skris
45559191Skris#
45659191Skris# libraries - build and install the libraries
45759191Skris#
45859191Skrislibraries:
45959191Skris.if exists(lib/libcompat)
46059191Skris	cd ${.CURDIR}/lib/libcompat && ${MAKE} depend && \
46159191Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
46259191Skris.endif
46359191Skris.if exists(lib/libncurses)
46455714Skris	cd ${.CURDIR}/lib/libncurses && ${MAKE} depend && \
46555714Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
46655714Skris.endif
46755714Skris.if exists(lib/libtermcap)
46855714Skris	cd ${.CURDIR}/lib/libtermcap && ${MAKE} depend && \
46955714Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
47055714Skris.endif
47155714Skris.if exists(lib)
47255714Skris	cd ${.CURDIR}/lib/csu/i386 && ${MAKE} depend && \
47355714Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
47455714Skris.endif
47555714Skris.if exists(gnu)
47655714Skris	cd ${.CURDIR}/gnu/lib && ${MAKE} depend && \
47755714Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
47855714Skris.endif
47955714Skris.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
48055714Skris	cd ${.CURDIR}/secure/lib && ${MAKE} depend && \
48155714Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
48255714Skris.endif
48355714Skris.if exists(lib)
48455714Skris	cd ${.CURDIR}/lib && ${MAKE} depend && \
48555714Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
48655714Skris.endif
48755714Skris.if exists(usr.bin/lex/lib)
48855714Skris	cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
48955714Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
49055714Skris.endif
49155714Skris.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
49255714Skris	cd ${.CURDIR}/eBones/lib && ${MAKE} depend && \
49355714Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
49455714Skris.endif
49576866Skris.if exists(usr.sbin/pcvt/keycap)
496109998Smarkm	cd ${.CURDIR}/usr.sbin/pcvt/keycap && ${MAKE} depend && \
497109998Smarkm		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
498109998Smarkm.endif
499109998Smarkm
50076866Skris#
50176866Skris# build-tools - build and install any other tools needed to complete the
50276866Skris# compile and install.
50376866Skris#
50476866Skrisbuild-tools:
50576866Skris.for d in				\
50676866Skris		usr.bin/symorder	\
50755714Skris		usr.bin/sgmls		\
50855714Skris		usr.bin/sgmlfmt		\
50959191Skris		share/sgml		\
51059191Skris		usr.sbin/zic		\
51159191Skris		gnu/usr.bin/awk		\
51259191Skris		gnu/usr.bin/groff
51359191Skris	cd ${.CURDIR}/$d && ${MAKE} depend && \
51459191Skris		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
51559191Skris.endfor
51659191Skris
51759191Skris.include <bsd.subdir.mk>
51859191Skris