]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - Makefile
Merge from -stable; NOTCL hook in beforeinstall.
[FreeBSD/FreeBSD.git] / Makefile
1 #
2 #       $Id: Makefile,v 1.133 1997/08/05 03:49:45 asami 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.
41 SUBDIR=
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)
46 SUBDIR+= include
47 .endif
48 .if exists(lib)
49 SUBDIR+= lib
50 .endif
51
52 .if exists(bin)
53 SUBDIR+= bin
54 .endif
55 .if exists(games) && !defined(NOGAMES)
56 SUBDIR+= games
57 .endif
58 .if exists(gnu)
59 SUBDIR+= gnu
60 .endif
61 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
62 SUBDIR+= eBones
63 .endif
64 .if exists(libexec)
65 SUBDIR+= libexec
66 .endif
67 .if exists(sbin)
68 SUBDIR+= sbin
69 .endif
70 .if exists(share) && !defined(NOSHARE)
71 SUBDIR+= share
72 .endif
73 .if exists(sys)
74 SUBDIR+= sys
75 .endif
76 .if exists(usr.bin)
77 SUBDIR+= usr.bin
78 .endif
79 .if exists(usr.sbin)
80 SUBDIR+= usr.sbin
81 .endif
82 .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
83 SUBDIR+= secure
84 .endif
85 .if exists(lkm) && !defined(NOLKM)
86 SUBDIR+= lkm
87 .endif
88
89 # etc must be last for "distribute" to work
90 .if exists(etc) && make(distribute)
91 SUBDIR+= 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)
99 SUBDIR+= ${_DIR}
100 .endif
101 .endfor
102 .endif
103
104 # Handle -DNOOBJDIR, -DNOCLEAN and -DNOCLEANDIR
105 .if defined(NOOBJDIR)
106 OBJDIR=
107 .else
108 OBJDIR=         obj
109 .endif
110
111 .if defined(NOCLEAN)
112 CLEANDIR=
113 .else
114 .if defined(NOCLEANDIR)
115 CLEANDIR=       clean
116 .else
117 CLEANDIR=       cleandir
118 .endif
119 .endif
120
121 SUP?=           sup
122 SUPFLAGS?=      -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 #
128 MK_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 #
138 world:
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)
164 WORLDTMP=       ${MAKEOBJDIRPREFIX}${.CURDIR}/tmp
165 .else
166 WORLDTMP=       /usr/obj${.CURDIR}/tmp
167 .endif
168 STRICTTMPPATH=  ${WORLDTMP}/sbin:${WORLDTMP}/usr/sbin:${WORLDTMP}/bin:${WORLDTMP}/usr/bin
169 TMPPATH=        ${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?).
178 COMPILER_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
184 BMAKEENV=       PATH=${TMPPATH} ${COMPILER_ENV} NOEXTRADEPEND=t
185 XMAKEENV=       PATH=${STRICTTMPPATH} ${COMPILER_ENV} \
186                 CC='cc -nostdinc'       # XXX -nostdlib
187
188 # used to compile and install 'make' in temporary build tree
189 IBMAKE= ${BMAKEENV} ${MAKE} DESTDIR=${WORLDTMP}
190 # bootstrap make
191 BMAKE=  ${BMAKEENV} ${WORLDTMP}/usr/bin/${MAKE} DESTDIR=${WORLDTMP}
192 # cross make used for compilation
193 XMAKE=  ${XMAKEENV} ${WORLDTMP}/usr/bin/${MAKE} DESTDIR=${WORLDTMP}
194 # cross make used for final installation
195 IXMAKE= ${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 #
203 buildworld:
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 #
286 installworld:
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 #
296 reinstall:
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 #
318 update:
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 #
343 most:
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 #
368 installmost:
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 #
401 hierarchy:
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 #
409 bootstrap:
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 #
431 include-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 #
438 includes:
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 install
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 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
452         cd ${.CURDIR}/eBones/include &&         ${MAKE} beforeinstall
453         cd ${.CURDIR}/eBones/lib/libkrb &&      ${MAKE} beforeinstall
454         cd ${.CURDIR}/eBones/lib/libkadm &&     ${MAKE} beforeinstall
455 .endif
456         cd ${.CURDIR}/lib/csu/i386 &&           ${MAKE} beforeinstall
457         cd ${.CURDIR}/lib/libalias &&           ${MAKE} beforeinstall
458         cd ${.CURDIR}/lib/libc &&               ${MAKE} beforeinstall
459         cd ${.CURDIR}/lib/libcurses &&          ${MAKE} beforeinstall
460         cd ${.CURDIR}/lib/libedit &&            ${MAKE} beforeinstall
461         cd ${.CURDIR}/lib/libftpio &&           ${MAKE} beforeinstall
462         cd ${.CURDIR}/lib/libmd &&              ${MAKE} beforeinstall
463         cd ${.CURDIR}/lib/libmytinfo &&         ${MAKE} beforeinstall
464         cd ${.CURDIR}/lib/libncurses &&         ${MAKE} beforeinstall
465 .if !defined(WANT_CSRG_LIBM)
466         cd ${.CURDIR}/lib/msun &&               ${MAKE} beforeinstall
467 .endif
468         cd ${.CURDIR}/lib/libpcap &&            ${MAKE} beforeinstall
469         cd ${.CURDIR}/lib/librpcsvc &&          ${MAKE} beforeinstall
470         cd ${.CURDIR}/lib/libskey &&            ${MAKE} beforeinstall
471 .if !defined(NOTCL) && exists (${.CURDIR}/contrib/tcl) && \
472         exists(${.CURDIR}/usr.bin/tclsh) && exists (${.CURDIR}/lib/libtcl)
473         cd ${.CURDIR}/lib/libtcl &&             ${MAKE} beforeinstall
474 .endif
475         cd ${.CURDIR}/lib/libtermcap &&         ${MAKE} beforeinstall
476         cd ${.CURDIR}/lib/libcom_err &&         ${MAKE} beforeinstall
477         cd ${.CURDIR}/lib/libss &&              ${MAKE} beforeinstall
478         cd ${.CURDIR}/lib/libscsi &&            ${MAKE} beforeinstall
479         cd ${.CURDIR}/lib/libutil &&            ${MAKE} beforeinstall
480         cd ${.CURDIR}/lib/libz &&               ${MAKE} beforeinstall
481
482 #
483 # lib-tools - build tools to compile and install the libraries.
484 #
485 # XXX gperf is required for cc
486 # XXX a new ld and tsort is required for cc
487 lib-tools:
488 .for d in                               \
489                 gnu/usr.bin/gperf       \
490                 gnu/usr.bin/ld          \
491                 usr.bin/tsort           \
492                 gnu/usr.bin/as          \
493                 gnu/usr.bin/bison       \
494                 gnu/usr.bin/cc          \
495                 usr.bin/ar              \
496                 usr.bin/compile_et      \
497                 usr.bin/lex/lib         \
498                 usr.bin/mk_cmds         \
499                 usr.bin/nm              \
500                 usr.bin/ranlib          \
501                 usr.bin/uudecode
502         cd ${.CURDIR}/$d && ${MAKE} depend && \
503                 ${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
504 .endfor
505
506 #
507 # libraries - build and install the libraries
508 #
509 libraries:
510 .if exists(lib/csu/i386)
511         cd ${.CURDIR}/lib/csu/i386 && ${MAKE} depend && \
512                 ${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
513 .endif
514 .if exists(lib/libcompat)
515         cd ${.CURDIR}/lib/libcompat && ${MAKE} depend && \
516                 ${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
517 .endif
518 .if exists(lib/libncurses)
519         cd ${.CURDIR}/lib/libncurses && ${MAKE} depend && \
520                 ${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
521 .endif
522 .if exists(lib/libtermcap)
523         cd ${.CURDIR}/lib/libtermcap && ${MAKE} depend && \
524                 ${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
525 .endif
526 .if exists(gnu)
527         cd ${.CURDIR}/gnu/lib && ${MAKE} depend && \
528                 ${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
529 .endif
530 .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
531         cd ${.CURDIR}/secure/lib && ${MAKE} depend && \
532                 ${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
533 .endif
534 .if exists(lib)
535         cd ${.CURDIR}/lib && ${MAKE} depend && \
536                 ${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
537 .endif
538 .if exists(usr.bin/lex/lib)
539         cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
540                 ${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
541 .endif
542 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
543         cd ${.CURDIR}/eBones/lib && ${MAKE} depend && \
544                 ${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
545 .endif
546 .if exists(usr.sbin/pcvt/keycap)
547         cd ${.CURDIR}/usr.sbin/pcvt/keycap && ${MAKE} depend && \
548                 ${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
549 .endif
550
551 #
552 # build-tools - build and install any other tools needed to complete the
553 # compile and install.
554 # ifdef stale
555 # bc and cpp are required to build groff.  Otherwise, the order here is
556 # mostly historical, i.e., bogus.
557 # chmod is used to build gcc's tmpmultilib[2] at obscure times.
558 # endif stale
559 # XXX uname is a bug - the target should not depend on the host.
560 #
561 build-tools:
562 .for d in                               \
563                 bin/cat                 \
564                 bin/chmod               \
565                 bin/cp                  \
566                 bin/date                \
567                 bin/dd                  \
568                 bin/echo                \
569                 bin/expr                \
570                 bin/hostname            \
571                 bin/ln                  \
572                 bin/ls                  \
573                 bin/mkdir               \
574                 bin/mv                  \
575                 bin/rm                  \
576                 bin/sh                  \
577                 bin/test                \
578                 gnu/usr.bin/awk         \
579                 gnu/usr.bin/bc          \
580                 gnu/usr.bin/grep        \
581                 gnu/usr.bin/groff       \
582                 gnu/usr.bin/gzip        \
583                 gnu/usr.bin/man/makewhatis      \
584                 gnu/usr.bin/sort        \
585                 gnu/usr.bin/texinfo     \
586                 share/info              \
587                 usr.bin/basename        \
588                 usr.bin/cap_mkdb        \
589                 usr.bin/chflags         \
590                 usr.bin/cmp             \
591                 usr.bin/col             \
592                 usr.bin/cpp             \
593                 usr.bin/expand          \
594                 usr.bin/file2c          \
595                 usr.bin/find            \
596                 usr.bin/gencat          \
597                 usr.bin/lorder          \
598                 usr.bin/m4              \
599                 usr.bin/mkdep           \
600                 usr.bin/paste           \
601                 usr.bin/sed             \
602                 usr.bin/size            \
603                 usr.bin/soelim          \
604                 usr.bin/strip           \
605                 usr.bin/symorder        \
606                 usr.bin/touch           \
607                 usr.bin/tr              \
608                 usr.bin/true            \
609                 usr.bin/uname           \
610                 usr.bin/uuencode        \
611                 usr.bin/vgrind          \
612                 usr.bin/vi              \
613                 usr.bin/wc              \
614                 usr.bin/yacc            \
615                 usr.sbin/chown          \
616                 usr.sbin/mtree          \
617                 usr.sbin/zic
618         cd ${.CURDIR}/$d && ${MAKE} depend && \
619                 ${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
620 .endfor
621
622 .include <bsd.subdir.mk>