Makefile revision 28357
1#
2#	$Id: Makefile,v 1.135 1997/08/17 21:14:22 andreas Exp $
3#
4# Make command line options:
5#	-DCLOBBER will remove /usr/include
6#	-DMAKE_EBONES to build eBones (KerberosIV)
7#	-DALLLANG to build documentation for all languages
8#	  (where available -- see share/doc/Makefile)
9#
10#	-DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
11#	-DNOCLEAN do not clean at all
12#	-DNOCRYPT will prevent building of crypt versions
13#	-DNOLKM do not build loadable kernel modules
14#	-DNOOBJDIR do not run ``${MAKE} obj''
15#	-DNOPROFILE do not build profiled libraries
16#	-DNOSECURE do not go into secure subdir
17#	-DNOGAMES do not go into games subdir
18#	-DNOSHARE do not go into share subdir
19#	-DNOINFO do not make or install info files
20#	-DNOLIBC_R do not build libc_r.
21#	LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
22
23#
24# The intended user-driven targets are:
25# buildworld  - rebuild *everything*, including glue to help do upgrades
26# installworld- install everything built by "buildworld"
27# world       - buildworld + installworld
28# update      - convenient way to update your source tree (eg: sup/cvs)
29# most        - build user commands, no libraries or include files
30# installmost - install user commands, no libraries or include files
31#
32# Standard targets (not defined here) are documented in the makefiles in
33# /usr/share/mk.  These include:
34#		obj depend all install clean cleandepend cleanobj
35
36.if (!make(world)) && (!make(buildworld)) && (!make(installworld))
37.MAKEFLAGS:=	${.MAKEFLAGS} -m ${.CURDIR}/share/mk
38.endif
39
40# Put initial settings here.
41SUBDIR=
42
43# We must do include and lib first so that the perl *.ph generation
44# works correctly as it uses the header files installed by this.
45.if exists(include)
46SUBDIR+= include
47.endif
48.if exists(lib)
49SUBDIR+= lib
50.endif
51
52.if exists(bin)
53SUBDIR+= bin
54.endif
55.if exists(games) && !defined(NOGAMES)
56SUBDIR+= games
57.endif
58.if exists(gnu)
59SUBDIR+= gnu
60.endif
61.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
62SUBDIR+= eBones
63.endif
64.if exists(libexec)
65SUBDIR+= libexec
66.endif
67.if exists(sbin)
68SUBDIR+= sbin
69.endif
70.if exists(share) && !defined(NOSHARE)
71SUBDIR+= share
72.endif
73.if exists(sys)
74SUBDIR+= sys
75.endif
76.if exists(usr.bin)
77SUBDIR+= usr.bin
78.endif
79.if exists(usr.sbin)
80SUBDIR+= usr.sbin
81.endif
82.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
83SUBDIR+= secure
84.endif
85.if exists(lkm) && !defined(NOLKM)
86SUBDIR+= lkm
87.endif
88
89# etc must be last for "distribute" to work
90.if exists(etc) && make(distribute)
91SUBDIR+= etc
92.endif
93
94# These are last, since it is nice to at least get the base system
95# rebuilt before you do them.
96.if defined(LOCAL_DIRS)
97.for _DIR in ${LOCAL_DIRS}
98.if exists(${_DIR}) & exists(${_DIR}/Makefile)
99SUBDIR+= ${_DIR}
100.endif
101.endfor
102.endif
103
104# Handle -DNOOBJDIR, -DNOCLEAN and -DNOCLEANDIR
105.if defined(NOOBJDIR)
106OBJDIR=
107.else
108OBJDIR=		obj
109.endif
110
111.if defined(NOCLEAN)
112CLEANDIR=
113.else
114.if defined(NOCLEANDIR)
115CLEANDIR=	clean
116.else
117CLEANDIR=	cleandir
118.endif
119.endif
120
121SUP?=		sup
122SUPFLAGS?=	-v
123
124#
125# While building tools for bootstrapping, we dont need to waste time on
126# profiled libraries or man pages.  This speeds things up somewhat.
127#
128MK_FLAGS=	-DNOINFO -DNOMAN -DNOPROFILE
129
130#
131# world
132#
133# Attempt to rebuild and reinstall *everything*, with reasonable chance of
134# success, regardless of how old your existing system is.
135#
136# >> Beware, it overwrites the local build environment! <<
137#
138world:
139	@echo "--------------------------------------------------------------"
140	@echo "make world started on `LC_TIME=C date`"
141	@echo "--------------------------------------------------------------"
142.if target(pre-world)
143	@echo
144	@echo "--------------------------------------------------------------"
145	@echo " Making 'pre-world' target"
146	@echo "--------------------------------------------------------------"
147	cd ${.CURDIR} && ${MAKE} pre-world
148.endif
149	cd ${.CURDIR} && ${MAKE} buildworld
150	cd ${.CURDIR} && ${MAKE} installworld
151.if target(post-world)
152	@echo
153	@echo "--------------------------------------------------------------"
154	@echo " Making 'post-world' target"
155	@echo "--------------------------------------------------------------"
156	cd ${.CURDIR} && ${MAKE} post-world
157.endif
158	@echo
159	@echo "--------------------------------------------------------------"
160	@echo "make world completed on `LC_TIME=C date`"
161	@echo "--------------------------------------------------------------"
162
163.if defined(MAKEOBJDIRPREFIX)
164WORLDTMP=	${MAKEOBJDIRPREFIX}${.CURDIR}/tmp
165.else
166WORLDTMP=	/usr/obj${.CURDIR}/tmp
167.endif
168STRICTTMPPATH=	${WORLDTMP}/sbin:${WORLDTMP}/usr/sbin:${WORLDTMP}/bin:${WORLDTMP}/usr/bin
169TMPPATH=	${STRICTTMPPATH}:${PATH}
170
171# XXX COMPILER_PATH is needed for finding cc1, ld and as
172# XXX GCC_EXEC_PREFIX is for *crt.o.  It is probably unnecssary now
173#	tbat LIBRARY_PATH is set.  We still can't use -nostdlib, since gcc
174#	wouldn't link *crt.o or libgcc if it were used.
175# XXX LD_LIBRARY_PATH is for ld.so.  It is also used by ld, although we don't
176#	want that - all compile-time library paths should be resolved by gcc.
177#	It fails for set[ug]id executables (are any used?).
178COMPILER_ENV=	BISON_SIMPLE=${WORLDTMP}/usr/share/misc/bison.simple \
179		COMPILER_PATH=${WORLDTMP}/usr/libexec:${WORLDTMP}/usr/bin \
180		GCC_EXEC_PREFIX=${WORLDTMP}/usr/lib/ \
181		LD_LIBRARY_PATH=${WORLDTMP}${SHLIBDIR} \
182		LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib
183
184BMAKEENV=	PATH=${TMPPATH} ${COMPILER_ENV} NOEXTRADEPEND=t
185XMAKEENV=	PATH=${STRICTTMPPATH} ${COMPILER_ENV} \
186		CC='cc -nostdinc'	# XXX -nostdlib
187
188# used to compile and install 'make' in temporary build tree
189IBMAKE=	${BMAKEENV} ${MAKE} DESTDIR=${WORLDTMP}
190# bootstrap make
191BMAKE=	${BMAKEENV} ${WORLDTMP}/usr/bin/${MAKE} DESTDIR=${WORLDTMP}
192# cross make used for compilation
193XMAKE=	${XMAKEENV} ${WORLDTMP}/usr/bin/${MAKE} DESTDIR=${WORLDTMP}
194# cross make used for final installation
195IXMAKE=	${XMAKEENV} ${WORLDTMP}/usr/bin/${MAKE}
196
197#
198# buildworld
199#
200# Attempt to rebuild the entire system, with reasonable chance of
201# success, regardless of how old your existing system is.
202#
203buildworld:
204.if !defined(NOCLEAN)
205	@echo
206	@echo "--------------------------------------------------------------"
207	@echo " Cleaning up the temporary build tree"
208	@echo "--------------------------------------------------------------"
209	mkdir -p ${WORLDTMP}
210	chflags -R noschg ${WORLDTMP}/
211	rm -rf ${WORLDTMP}
212.endif
213	@echo
214	@echo "--------------------------------------------------------------"
215	@echo " Making make"
216	@echo "--------------------------------------------------------------"
217	mkdir -p ${WORLDTMP}/usr/bin
218	cd ${.CURDIR}/usr.bin/make && \
219		${IBMAKE} -I${.CURDIR}/share/mk ${OBJDIR} clean cleandepend depend && \
220		${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} all install clean cleandepend
221	@echo
222	@echo "--------------------------------------------------------------"
223	@echo " Making hierarchy"
224	@echo "--------------------------------------------------------------"
225	cd ${.CURDIR} && ${BMAKE} hierarchy
226.if !defined(NOCLEAN)
227	@echo
228	@echo "--------------------------------------------------------------"
229	@echo " Cleaning up the obj tree"
230	@echo "--------------------------------------------------------------"
231	cd ${.CURDIR} && ${BMAKE} ${CLEANDIR}
232.endif
233.if !defined(NOOBJDIR)
234	@echo
235	@echo "--------------------------------------------------------------"
236	@echo " Rebuilding the obj tree"
237	@echo "--------------------------------------------------------------"
238	cd ${.CURDIR} && ${BMAKE} obj
239.endif
240	@echo
241	@echo "--------------------------------------------------------------"
242	@echo " Rebuilding bootstrap tools"
243	@echo "--------------------------------------------------------------"
244	cd ${.CURDIR} && ${BMAKE} bootstrap
245	@echo
246	@echo "--------------------------------------------------------------"
247	@echo " Rebuilding tools necessary to build the include files"
248	@echo "--------------------------------------------------------------"
249	cd ${.CURDIR} && ${BMAKE} include-tools
250	@echo
251	@echo "--------------------------------------------------------------"
252	@echo " Rebuilding /usr/include"
253	@echo "--------------------------------------------------------------"
254	cd ${.CURDIR} && ${BMAKE} includes
255	@echo
256	@echo "--------------------------------------------------------------"
257	@echo " Rebuilding tools needed to build the libraries"
258	@echo "--------------------------------------------------------------"
259	cd ${.CURDIR} && ${BMAKE} lib-tools
260	@echo
261	@echo "--------------------------------------------------------------"
262	@echo " Rebuilding /usr/lib"
263	@echo "--------------------------------------------------------------"
264	cd ${.CURDIR} && ${BMAKE} libraries
265	@echo
266	@echo "--------------------------------------------------------------"
267	@echo " Rebuilding all other tools needed to build the world"
268	@echo "--------------------------------------------------------------"
269	cd ${.CURDIR} && ${BMAKE} build-tools
270	@echo
271	@echo "--------------------------------------------------------------"
272	@echo " Rebuilding dependencies"
273	@echo "--------------------------------------------------------------"
274	cd ${.CURDIR} && ${XMAKE} depend
275	@echo
276	@echo "--------------------------------------------------------------"
277	@echo " Building everything.."
278	@echo "--------------------------------------------------------------"
279	cd ${.CURDIR} && ${XMAKE} all
280
281#
282# installworld
283#
284# Installs everything compiled by a 'buildworld'.
285#
286installworld:
287	cd ${.CURDIR} && ${IXMAKE} reinstall
288
289#
290# reinstall
291#
292# If you have a build server, you can NFS mount the source and obj directories
293# and do a 'make reinstall' on the *client* to install new binaries from the
294# most recent server build.
295#
296reinstall:
297	@echo "--------------------------------------------------------------"
298	@echo " Making hierarchy"
299	@echo "--------------------------------------------------------------"
300	cd ${.CURDIR} && ${MAKE} hierarchy
301	@echo
302	@echo "--------------------------------------------------------------"
303	@echo " Installing everything.."
304	@echo "--------------------------------------------------------------"
305	cd ${.CURDIR} && ${MAKE} install
306	@echo
307	@echo "--------------------------------------------------------------"
308	@echo " Rebuilding man page indexes"
309	@echo "--------------------------------------------------------------"
310	cd ${.CURDIR}/share/man && ${MAKE} makedb
311
312#
313# update
314#
315# Update the source tree, by running sup and/or running cvs to update to the
316# latest copy.
317#
318update:
319.if defined(SUP_UPDATE)
320	@echo "--------------------------------------------------------------"
321	@echo "Running sup"
322	@echo "--------------------------------------------------------------"
323	@${SUP} ${SUPFLAGS} ${SUPFILE}
324.if defined(SUPFILE1)
325	@${SUP} ${SUPFLAGS} ${SUPFILE1}
326.endif
327.if defined(SUPFILE2)
328	@${SUP} ${SUPFLAGS} ${SUPFILE2}
329.endif
330.endif
331.if defined(CVS_UPDATE)
332	@echo "--------------------------------------------------------------"
333	@echo "Updating /usr/src from cvs repository" ${CVSROOT}
334	@echo "--------------------------------------------------------------"
335	cd ${.CURDIR} && cvs -q update -P -d
336.endif
337
338#
339# most
340#
341# Build most of the user binaries on the existing system libs and includes.
342#
343most:
344	@echo "--------------------------------------------------------------"
345	@echo " Building programs only"
346	@echo "--------------------------------------------------------------"
347	cd ${.CURDIR}/bin	&&	${MAKE} ${.MAKEFLAGS} all
348	cd ${.CURDIR}/sbin	&&	${MAKE} ${.MAKEFLAGS} all
349	cd ${.CURDIR}/libexec	&&	${MAKE} ${.MAKEFLAGS} all
350	cd ${.CURDIR}/usr.bin	&&	${MAKE} ${.MAKEFLAGS} all
351	cd ${.CURDIR}/usr.sbin	&&	${MAKE} ${.MAKEFLAGS} all
352	cd ${.CURDIR}/gnu/libexec &&	${MAKE} ${.MAKEFLAGS} all
353	cd ${.CURDIR}/gnu/usr.bin &&	${MAKE} ${.MAKEFLAGS} all
354	cd ${.CURDIR}/gnu/usr.sbin &&	${MAKE} ${.MAKEFLAGS} all
355#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
356#	cd ${.CURDIR}/eBones	&&	${MAKE} ${.MAKEFLAGS} most
357#.endif
358#.if !defined(NOSECURE) && !defined(NOCRYPT)
359#	cd ${.CURDIR}/secure	&&	${MAKE} ${.MAKEFLAGS} most
360#.endif
361
362#
363# installmost
364#
365# Install the binaries built by the 'most' target.  This does not include
366# libraries or include files.
367#
368installmost:
369	@echo "--------------------------------------------------------------"
370	@echo " Installing programs only"
371	@echo "--------------------------------------------------------------"
372	cd ${.CURDIR}/bin	&&	${MAKE} ${.MAKEFLAGS} install
373	cd ${.CURDIR}/sbin	&&	${MAKE} ${.MAKEFLAGS} install
374	cd ${.CURDIR}/libexec	&&	${MAKE} ${.MAKEFLAGS} install
375	cd ${.CURDIR}/usr.bin	&&	${MAKE} ${.MAKEFLAGS} install
376	cd ${.CURDIR}/usr.sbin	&&	${MAKE} ${.MAKEFLAGS} install
377	cd ${.CURDIR}/gnu/libexec &&	${MAKE} ${.MAKEFLAGS} install
378	cd ${.CURDIR}/gnu/usr.bin &&	${MAKE} ${.MAKEFLAGS} install
379	cd ${.CURDIR}/gnu/usr.sbin &&	${MAKE} ${.MAKEFLAGS} install
380#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
381#	cd ${.CURDIR}/eBones	&&	${MAKE} ${.MAKEFLAGS} installmost
382#.endif
383#.if !defined(NOSECURE) && !defined(NOCRYPT)
384#	cd ${.CURDIR}/secure	&&	${MAKE} ${.MAKEFLAGS} installmost
385#.endif
386
387#
388# ------------------------------------------------------------------------
389#
390# From here onwards are utility targets used by the 'make world' and
391# related targets.  If your 'world' breaks, you may like to try to fix
392# the problem and manually run the following targets to attempt to
393# complete the build.  Beware, this is *not* guaranteed to work, you
394# need to have a pretty good grip on the current state of the system
395# to attempt to manually finish it.  If in doubt, 'make world' again.
396#
397
398#
399# heirarchy - ensure that all the needed directories are present
400#
401hierarchy:
402	cd ${.CURDIR}/etc &&		${MAKE} distrib-dirs
403
404#
405# bootstrap - [re]build tools needed to run the actual build, this includes
406# tools needed by 'make depend', as some tools are needed to generate source
407# for the dependency information to be gathered from.
408#
409bootstrap:
410.if defined(DESTDIR)
411	rm -f ${DESTDIR}/usr/src/sys
412	ln -s ${.CURDIR}/sys ${DESTDIR}/usr/src
413	cd ${.CURDIR}/include && find -dx . | cpio -dump ${DESTDIR}/usr/include
414	cd ${.CURDIR}/include && make symlinks
415.endif
416	cd ${.CURDIR}/usr.bin/make && ${MAKE} depend && \
417		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
418	cd ${.CURDIR}/usr.bin/xinstall && ${MAKE} depend && \
419		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
420	cd ${.CURDIR}/usr.bin/lex && ${MAKE} bootstrap && ${MAKE} depend && \
421		${MAKE} ${MK_FLAGS} -DNOLIB all install ${CLEANDIR} ${OBJDIR}
422
423#
424# include-tools - generally the same as 'bootstrap', except that it's for
425# things that are specifically needed to generate include files.
426#
427# XXX should be merged with bootstrap, it's not worth keeeping them separate.
428# Well, maybe it is now.  We force 'cleandepend' here to avoid dependencies
429# on cleaned away headers in ${WORLDTMP}.
430#
431include-tools:
432	cd ${.CURDIR}/usr.bin/rpcgen && ${MAKE} cleandepend depend && \
433		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
434
435#
436# includes - possibly generate and install the include files.
437#
438includes:
439.if defined(CLOBBER)
440	rm -rf ${DESTDIR}/usr/include/*
441	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
442		-p ${DESTDIR}/usr/include
443.endif
444	cd ${.CURDIR}/include &&		${MAKE} all installhdrs symlinks
445	cd ${.CURDIR}/gnu/include &&		${MAKE} install
446	cd ${.CURDIR}/gnu/lib/libreadline &&	${MAKE} beforeinstall
447	cd ${.CURDIR}/gnu/lib/libregex &&	${MAKE} beforeinstall
448	cd ${.CURDIR}/gnu/lib/libstdc++ &&	${MAKE} beforeinstall
449	cd ${.CURDIR}/gnu/lib/libg++ &&		${MAKE} beforeinstall
450	cd ${.CURDIR}/gnu/lib/libdialog &&	${MAKE} beforeinstall
451	cd ${.CURDIR}/gnu/lib/libgmp &&		${MAKE} beforeinstall
452.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
453	cd ${.CURDIR}/eBones/include &&		${MAKE} beforeinstall
454	cd ${.CURDIR}/eBones/lib/libkrb &&	${MAKE} beforeinstall
455	cd ${.CURDIR}/eBones/lib/libkadm &&	${MAKE} beforeinstall
456.endif
457	cd ${.CURDIR}/lib/csu/i386 &&		${MAKE} beforeinstall
458	cd ${.CURDIR}/lib/libalias &&		${MAKE} beforeinstall
459	cd ${.CURDIR}/lib/libc &&		${MAKE} beforeinstall
460	cd ${.CURDIR}/lib/libcurses &&		${MAKE} beforeinstall
461	cd ${.CURDIR}/lib/libedit &&		${MAKE} beforeinstall
462	cd ${.CURDIR}/lib/libftpio &&		${MAKE} beforeinstall
463	cd ${.CURDIR}/lib/libmd &&		${MAKE} beforeinstall
464	cd ${.CURDIR}/lib/libmytinfo &&		${MAKE} beforeinstall
465	cd ${.CURDIR}/lib/libncurses &&		${MAKE} beforeinstall
466.if !defined(WANT_CSRG_LIBM)
467	cd ${.CURDIR}/lib/msun &&		${MAKE} beforeinstall
468.endif
469	cd ${.CURDIR}/lib/libpcap &&		${MAKE} beforeinstall
470	cd ${.CURDIR}/lib/librpcsvc &&		${MAKE} beforeinstall
471	cd ${.CURDIR}/lib/libskey &&		${MAKE} beforeinstall
472.if !defined(NOTCL) && exists (${.CURDIR}/contrib/tcl) && \
473	exists(${.CURDIR}/usr.bin/tclsh) && exists (${.CURDIR}/lib/libtcl)
474	cd ${.CURDIR}/lib/libtcl &&		${MAKE} beforeinstall
475.endif
476	cd ${.CURDIR}/lib/libtermcap &&		${MAKE} beforeinstall
477	cd ${.CURDIR}/lib/libcom_err &&		${MAKE} beforeinstall
478	cd ${.CURDIR}/lib/libss &&		${MAKE} beforeinstall
479	cd ${.CURDIR}/lib/libscsi &&		${MAKE} beforeinstall
480	cd ${.CURDIR}/lib/libutil &&		${MAKE} beforeinstall
481	cd ${.CURDIR}/lib/libz &&		${MAKE} beforeinstall
482
483#
484# lib-tools - build tools to compile and install the libraries.
485#
486# XXX gperf is required for cc
487# XXX a new ld and tsort is required for cc
488lib-tools:
489.for d in				\
490		gnu/usr.bin/gperf	\
491		gnu/usr.bin/ld		\
492		usr.bin/tsort		\
493		gnu/usr.bin/as		\
494		gnu/usr.bin/bison	\
495		gnu/usr.bin/cc		\
496		usr.bin/ar		\
497		usr.bin/compile_et	\
498		usr.bin/lex/lib		\
499		usr.bin/mk_cmds		\
500		usr.bin/nm		\
501		usr.bin/ranlib		\
502		usr.bin/uudecode
503	cd ${.CURDIR}/$d && ${MAKE} depend && \
504		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
505.endfor
506
507#
508# libraries - build and install the libraries
509#
510libraries:
511.if exists(lib/csu/i386)
512	cd ${.CURDIR}/lib/csu/i386 && ${MAKE} depend && \
513		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
514.endif
515.if exists(lib/libcompat)
516	cd ${.CURDIR}/lib/libcompat && ${MAKE} depend && \
517		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
518.endif
519.if exists(lib/libncurses)
520	cd ${.CURDIR}/lib/libncurses && ${MAKE} depend && \
521		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
522.endif
523.if exists(lib/libtermcap)
524	cd ${.CURDIR}/lib/libtermcap && ${MAKE} depend && \
525		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
526.endif
527.if exists(gnu)
528	cd ${.CURDIR}/gnu/lib && ${MAKE} depend && \
529		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
530.endif
531.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
532	cd ${.CURDIR}/secure/lib && ${MAKE} depend && \
533		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
534.endif
535.if exists(lib)
536	cd ${.CURDIR}/lib && ${MAKE} depend && \
537		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
538.endif
539.if exists(usr.bin/lex/lib)
540	cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
541		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
542.endif
543.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
544	cd ${.CURDIR}/eBones/lib && ${MAKE} depend && \
545		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
546.endif
547.if exists(usr.sbin/pcvt/keycap)
548	cd ${.CURDIR}/usr.sbin/pcvt/keycap && ${MAKE} depend && \
549		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
550.endif
551
552#
553# build-tools - build and install any other tools needed to complete the
554# compile and install.
555# ifdef stale
556# bc and cpp are required to build groff.  Otherwise, the order here is
557# mostly historical, i.e., bogus.
558# chmod is used to build gcc's tmpmultilib[2] at obscure times.
559# endif stale
560# XXX uname is a bug - the target should not depend on the host.
561#
562build-tools:
563.for d in				\
564		bin/cat 		\
565		bin/chmod		\
566		bin/cp 			\
567		bin/date		\
568		bin/dd			\
569		bin/echo		\
570		bin/expr		\
571		bin/hostname		\
572		bin/ln			\
573		bin/ls			\
574		bin/mkdir		\
575		bin/mv			\
576		bin/rm			\
577		bin/sh			\
578		bin/test		\
579		gnu/usr.bin/awk		\
580		gnu/usr.bin/bc		\
581		gnu/usr.bin/grep	\
582		gnu/usr.bin/groff	\
583		gnu/usr.bin/gzip	\
584		gnu/usr.bin/man/makewhatis	\
585		gnu/usr.bin/sort	\
586		gnu/usr.bin/texinfo     \
587		share/info		\
588		usr.bin/basename	\
589		usr.bin/cap_mkdb	\
590		usr.bin/chflags		\
591		usr.bin/cmp		\
592		usr.bin/col		\
593		usr.bin/cpp		\
594		usr.bin/expand		\
595		usr.bin/file2c		\
596		usr.bin/find		\
597		usr.bin/gencat		\
598		usr.bin/lorder		\
599		usr.bin/m4		\
600		usr.bin/mkdep		\
601		usr.bin/paste		\
602		usr.bin/sed		\
603		usr.bin/size		\
604		usr.bin/soelim		\
605		usr.bin/strip		\
606		usr.bin/symorder	\
607		usr.bin/touch		\
608		usr.bin/tr		\
609		usr.bin/true		\
610		usr.bin/uname		\
611		usr.bin/uuencode	\
612		usr.bin/vgrind		\
613		usr.bin/vi		\
614		usr.bin/wc		\
615		usr.bin/yacc		\
616		usr.sbin/chown		\
617		usr.sbin/mtree		\
618		usr.sbin/zic
619	cd ${.CURDIR}/$d && ${MAKE} depend && \
620		${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
621.endfor
622
623.include <bsd.subdir.mk>
624