2 # $Id: Makefile,v 1.185 1998/05/27 18:50:01 peter Exp $
4 # While porting to the another architecture include the bootstrap instead
7 .if exists(${.CURDIR}/Makefile.${MACHINE}) && defined(BOOTSTRAP_WORLD)
8 .include "${.CURDIR}/Makefile.${MACHINE}"
11 # Make command line options:
12 # -DCLOBBER will remove /usr/include
13 # -DMAKE_KERBEROS4 to build KerberosIV
14 # -DALLLANG to build documentation for all languages
15 # (where available -- see share/doc/Makefile)
17 # -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
18 # -DNOCLEAN do not clean at all
19 # -DNOTOOLS do not rebuild any tools first
20 # -DNOCRYPT will prevent building of crypt versions
21 # -DNOLKM do not build loadable kernel modules
22 # -DNOOBJDIR do not run ``${MAKE} obj''
23 # -DNOPROFILE do not build profiled libraries
24 # -DNOSECURE do not go into secure subdir
25 # -DNOGAMES do not go into games subdir
26 # -DNOSHARE do not go into share subdir
27 # -DNOINFO do not make or install info files
28 # -DNOLIBC_R do not build libc_r.
29 # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
32 # The intended user-driven targets are:
33 # buildworld - rebuild *everything*, including glue to help do upgrades
34 # installworld- install everything built by "buildworld"
35 # world - buildworld + installworld
36 # update - convenient way to update your source tree (eg: sup/cvs)
37 # most - build user commands, no libraries or include files
38 # installmost - install user commands, no libraries or include files
40 # Standard targets (not defined here) are documented in the makefiles in
41 # /usr/share/mk. These include:
42 # obj depend all install clean cleandepend cleanobj
44 .if (!make(world)) && (!make(buildworld)) && (!make(installworld))
45 .MAKEFLAGS:= -m ${.CURDIR}/share/mk ${.MAKEFLAGS}
48 # Put initial settings here.
51 # We must do share/info early so that installation of info `dir'
52 # entries works correctly. Do it first since it is less likely to
53 # grow dependencies on include and lib than vice versa.
54 .if exists(share/info)
58 # We must do include and lib early so that the perl *.ph generation
59 # works correctly as it uses the header files installed by this.
70 .if exists(games) && !defined(NOGAMES)
76 .if exists(kerberosIV) && exists(crypto) && !defined(NOCRYPT) && \
77 defined(MAKE_KERBEROS4)
86 .if exists(share) && !defined(NOSHARE)
98 .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
101 .if exists(lkm) && !defined(NOLKM)
105 # etc must be last for "distribute" to work
106 .if exists(etc) && make(distribute)
110 # These are last, since it is nice to at least get the base system
111 # rebuilt before you do them.
112 .if defined(LOCAL_DIRS)
113 .for _DIR in ${LOCAL_DIRS}
114 .if exists(${_DIR}) & exists(${_DIR}/Makefile)
120 # Handle -DNOOBJDIR, -DNOCLEAN and -DNOCLEANDIR
121 .if defined(NOOBJDIR)
130 .if defined(NOCLEANDIR)
131 CLEANDIR= clean cleandepend
137 .if !defined(NOCLEAN) && ${.MAKEFLAGS:M-j} == ""
140 .if defined(_NODEPEND)
147 SUPFLAGS?= -g -L 2 -P -
150 # While building tools for bootstrapping, we don't need to waste time on
151 # shared or profiled libraries, shared linkage, or documentation, except
152 # when the tools won't get cleaned we must use the defaults for shared
153 # libraries and shared linkage (and this doesn't waste time).
154 # XXX actually, we do need to waste time building shared libraries.
157 MK_FLAGS= -DNOINFO -DNOMAN -DNOPROFILE
159 MK_FLAGS= -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED
165 # Attempt to rebuild and reinstall *everything*, with reasonable chance of
166 # success, regardless of how old your existing system is.
168 # >> Beware, it overwrites the local build environment! <<
171 @echo "--------------------------------------------------------------"
172 @echo "make world started on `LC_TIME=C date`"
173 @echo "--------------------------------------------------------------"
174 .if target(pre-world)
176 @echo "--------------------------------------------------------------"
177 @echo " Making 'pre-world' target"
178 @echo "--------------------------------------------------------------"
179 cd ${.CURDIR}; ${MAKE} pre-world
181 cd ${.CURDIR}; ${MAKE} buildworld
182 cd ${.CURDIR}; ${MAKE} -B installworld
183 .if target(post-world)
185 @echo "--------------------------------------------------------------"
186 @echo " Making 'post-world' target"
187 @echo "--------------------------------------------------------------"
188 cd ${.CURDIR}; ${MAKE} post-world
191 @echo "--------------------------------------------------------------"
192 @echo "make world completed on `LC_TIME=C date`"
193 @echo "--------------------------------------------------------------"
195 .if defined(MAKEOBJDIRPREFIX)
196 WORLDTMP= ${MAKEOBJDIRPREFIX}${.CURDIR}/tmp
198 WORLDTMP= /usr/obj${.CURDIR}/tmp
200 STRICTTMPPATH= ${WORLDTMP}/sbin:${WORLDTMP}/usr/sbin:${WORLDTMP}/bin:${WORLDTMP}/usr/bin
201 TMPPATH= ${STRICTTMPPATH}:${PATH}
203 # XXX COMPILER_PATH is needed for finding cc1, ld and as
204 # XXX GCC_EXEC_PREFIX is for *crt.o. It is probably unnecssary now
205 # tbat LIBRARY_PATH is set. We still can't use -nostdlib, since gcc
206 # wouldn't link *crt.o or libgcc if it were used.
207 # XXX LD_LIBRARY_PATH is for ld.so. It is also used by ld, although we don't
208 # want that - all compile-time library paths should be resolved by gcc.
209 # It fails for set[ug]id executables (are any used?).
210 COMPILER_ENV= BISON_SIMPLE=${WORLDTMP}/usr/share/misc/bison.simple \
211 COMPILER_PATH=${WORLDTMP}/usr/libexec:${WORLDTMP}/usr/bin \
212 GCC_EXEC_PREFIX=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib/ \
213 LD_LIBRARY_PATH=${WORLDTMP}${SHLIBDIR} \
214 LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib
216 BMAKEENV= PATH=${TMPPATH} ${COMPILER_ENV} NOEXTRADEPEND=t \
217 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec:/usr/libexec
218 XMAKEENV= PATH=${STRICTTMPPATH} ${COMPILER_ENV} \
219 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
220 CFLAGS="-nostdinc ${CFLAGS}" # XXX -nostdlib
222 # used to compile and install 'make' in temporary build tree
223 MAKETMP= ${WORLDTMP}/make
224 IBMAKE= ${BMAKEENV} MAKEOBJDIR=${MAKETMP} ${MAKE} DESTDIR=${WORLDTMP}
226 BMAKE= ${BMAKEENV} ${WORLDTMP}/usr/bin/make DESTDIR=${WORLDTMP}
227 # cross make used for compilation
228 XMAKE= ${XMAKEENV} ${WORLDTMP}/usr/bin/make DESTDIR=${WORLDTMP}
229 # cross make used for final installation
230 IXMAKE= ${XMAKEENV} ${WORLDTMP}/usr/bin/make
235 # Attempt to rebuild the entire system, with reasonable chance of
236 # success, regardless of how old your existing system is.
239 .if !defined(NOCLEAN)
241 @echo "--------------------------------------------------------------"
242 @echo " Cleaning up the temporary build tree"
243 @echo "--------------------------------------------------------------"
245 chflags -R noschg ${WORLDTMP}/
248 .if !defined(NOTOOLS)
250 @echo "--------------------------------------------------------------"
252 @echo "--------------------------------------------------------------"
253 mkdir -p ${WORLDTMP}/usr/bin ${MAKETMP}
255 cd ${.CURDIR}/usr.bin/make; \
256 MAKEOBJDIRPREFIX=""; unset MAKEOBJDIRPREFIX; \
257 ${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} all; \
258 ${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} install; \
259 ${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} clean \
263 @echo "--------------------------------------------------------------"
264 @echo " Making hierarchy"
265 @echo "--------------------------------------------------------------"
266 cd ${.CURDIR}; ${BMAKE} hierarchy
267 .if !defined(NOCLEAN)
269 @echo "--------------------------------------------------------------"
270 @echo " Cleaning up the obj tree"
271 @echo "--------------------------------------------------------------"
272 cd ${.CURDIR}; ${BMAKE} ${CLEANDIR:S/^/par-/}
274 .if !defined(NOOBJDIR)
276 @echo "--------------------------------------------------------------"
277 @echo " Rebuilding the obj tree"
278 @echo "--------------------------------------------------------------"
279 cd ${.CURDIR}; ${BMAKE} par-${OBJDIR}
281 .if !defined(NOTOOLS)
283 @echo "--------------------------------------------------------------"
284 @echo " Rebuilding bootstrap tools"
285 @echo "--------------------------------------------------------------"
286 cd ${.CURDIR}; ${BMAKE} bootstrap
288 @echo "--------------------------------------------------------------"
289 @echo " Rebuilding tools necessary to build the include files"
290 @echo "--------------------------------------------------------------"
291 cd ${.CURDIR}; ${BMAKE} include-tools
294 @echo "--------------------------------------------------------------"
295 @echo " Rebuilding ${DESTDIR}/usr/include"
296 @echo "--------------------------------------------------------------"
297 cd ${.CURDIR}; SHARED=copies ${BMAKE} includes
299 @echo "--------------------------------------------------------------"
300 @echo " Rebuilding bootstrap libraries"
301 @echo "--------------------------------------------------------------"
302 cd ${.CURDIR}; ${BMAKE} bootstrap-libraries
303 .if !defined(NOTOOLS)
305 @echo "--------------------------------------------------------------"
306 @echo " Rebuilding tools needed to build libraries"
307 @echo "--------------------------------------------------------------"
308 cd ${.CURDIR}; ${BMAKE} lib-tools
310 .if !defined(NOTOOLS)
312 @echo "--------------------------------------------------------------"
313 @echo " Rebuilding all other tools needed to build the world"
314 @echo "--------------------------------------------------------------"
315 cd ${.CURDIR}; ${BMAKE} build-tools
317 .if !defined(_NODEPEND)
319 @echo "--------------------------------------------------------------"
320 @echo " Rebuilding dependencies"
321 @echo "--------------------------------------------------------------"
322 cd ${.CURDIR}; ${XMAKE} par-depend
325 @echo "--------------------------------------------------------------"
326 @echo " Building libraries"
327 @echo "--------------------------------------------------------------"
328 cd ${.CURDIR}; ${XMAKE} -DNOINFO -DNOMAN libraries
330 @echo "--------------------------------------------------------------"
331 @echo " Building everything.."
332 @echo "--------------------------------------------------------------"
333 cd ${.CURDIR}; ${XMAKE} all
338 # Installs everything compiled by a 'buildworld'.
341 cd ${.CURDIR}; ${IXMAKE} reinstall
346 # If you have a build server, you can NFS mount the source and obj directories
347 # and do a 'make reinstall' on the *client* to install new binaries from the
348 # most recent server build.
351 @echo "--------------------------------------------------------------"
352 @echo " Making hierarchy"
353 @echo "--------------------------------------------------------------"
354 cd ${.CURDIR}; ${MAKE} hierarchy
356 @echo "--------------------------------------------------------------"
357 @echo " Installing everything.."
358 @echo "--------------------------------------------------------------"
359 cd ${.CURDIR}; ${MAKE} install
361 @echo "--------------------------------------------------------------"
362 @echo " Re-scanning the shared libraries.."
363 @echo "--------------------------------------------------------------"
364 cd ${.CURDIR}; ldconfig -R
366 @echo "--------------------------------------------------------------"
367 @echo " Rebuilding man page indexes"
368 @echo "--------------------------------------------------------------"
369 cd ${.CURDIR}/share/man; ${MAKE} makedb
374 # Update the source tree, by running sup and/or running cvs to update to the
378 .if defined(SUP_UPDATE)
379 @echo "--------------------------------------------------------------"
380 @echo "Running ${SUP}"
381 @echo "--------------------------------------------------------------"
382 @${SUP} ${SUPFLAGS} ${SUPFILE}
383 .if defined(SUPFILE1)
384 @${SUP} ${SUPFLAGS} ${SUPFILE1}
386 .if defined(SUPFILE2)
387 @${SUP} ${SUPFLAGS} ${SUPFILE2}
390 .if defined(CVS_UPDATE)
391 @echo "--------------------------------------------------------------"
392 @echo "Updating /usr/src from cvs repository" ${CVSROOT}
393 @echo "--------------------------------------------------------------"
394 cd ${.CURDIR}; cvs -q update -P -d
400 # Build most of the user binaries on the existing system libs and includes.
403 @echo "--------------------------------------------------------------"
404 @echo " Building programs only"
405 @echo "--------------------------------------------------------------"
406 cd ${.CURDIR}/bin; ${MAKE} all
407 cd ${.CURDIR}/sbin; ${MAKE} all
408 cd ${.CURDIR}/libexec; ${MAKE} all
409 cd ${.CURDIR}/usr.bin; ${MAKE} all
410 cd ${.CURDIR}/usr.sbin; ${MAKE} all
411 cd ${.CURDIR}/gnu/libexec; ${MAKE} all
412 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} all
413 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} all
414 #.if defined(MAKE_KERBEROS4) && !defined(NOCRYPT)
415 # cd ${.CURDIR}/kerberosIV; ${MAKE} most
417 #.if !defined(NOSECURE) && !defined(NOCRYPT)
418 # cd ${.CURDIR}/secure; ${MAKE} most
424 # Install the binaries built by the 'most' target. This does not include
425 # libraries or include files.
428 @echo "--------------------------------------------------------------"
429 @echo " Installing programs only"
430 @echo "--------------------------------------------------------------"
431 cd ${.CURDIR}/bin; ${MAKE} install
432 cd ${.CURDIR}/sbin; ${MAKE} install
433 cd ${.CURDIR}/libexec; ${MAKE} install
434 cd ${.CURDIR}/usr.bin; ${MAKE} install
435 cd ${.CURDIR}/usr.sbin; ${MAKE} install
436 cd ${.CURDIR}/gnu/libexec; ${MAKE} install
437 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} install
438 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} install
439 #.if defined(MAKE_KERBEROS4) && !defined(NOCRYPT)
440 # cd ${.CURDIR}/kerberosIV; ${MAKE} installmost
442 #.if !defined(NOSECURE) && !defined(NOCRYPT)
443 # cd ${.CURDIR}/secure; ${MAKE} installmost
447 # ------------------------------------------------------------------------
449 # From here onwards are utility targets used by the 'make world' and
450 # related targets. If your 'world' breaks, you may like to try to fix
451 # the problem and manually run the following targets to attempt to
452 # complete the build. Beware, this is *not* guaranteed to work, you
453 # need to have a pretty good grip on the current state of the system
454 # to attempt to manually finish it. If in doubt, 'make world' again.
458 # heirarchy - ensure that all the needed directories are present
461 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
464 # bootstrap - [re]build tools needed to run the actual build, this includes
465 # tools needed by 'make depend', as some tools are needed to generate source
466 # for the dependency information to be gathered from.
470 rm -f ${DESTDIR}/usr/src/sys
471 ln -s ${.CURDIR}/sys ${DESTDIR}/usr/src
472 cd ${.CURDIR}/include; find -dx . | cpio -dump ${DESTDIR}/usr/include
473 .for d in net netinet posix4 sys vm machine
474 if [ -h ${DESTDIR}/usr/include/$d ]; then \
475 rm -f ${DESTDIR}/usr/include/$d ; \
479 find -dx net netinet posix4 sys vm -name '*.h' -o -type d | \
480 cpio -dump ${DESTDIR}/usr/include
481 mkdir -p ${DESTDIR}/usr/include/machine
482 cd ${.CURDIR}/sys/i386/include; find -dx . -name '*.h' -o -type d | \
483 cpio -dump ${DESTDIR}/usr/include/machine
485 cd ${.CURDIR}/usr.bin/make; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
486 ${MAKE} ${MK_FLAGS} all; \
487 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
488 cd ${.CURDIR}/usr.bin/xinstall; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
489 ${MAKE} ${MK_FLAGS} all; \
490 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
491 cd ${.CURDIR}/usr.bin/lex; ${MAKE} bootstrap; \
492 ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
493 ${MAKE} ${MK_FLAGS} -DNOLIB all; \
494 ${MAKE} ${MK_FLAGS} -DNOLIB -B install ${CLEANDIR}
496 cd ${.CURDIR}/include && ${MAKE} copies
498 .if !defined(NOOBJDIR)
499 cd ${.CURDIR}/usr.bin/lex; ${MAKE} ${OBJDIR}
503 # include-tools - generally the same as 'bootstrap', except that it's for
504 # things that are specifically needed to generate include files.
506 # XXX should be merged with bootstrap, it's not worth keeeping them separate.
507 # Well, maybe it is now. We force 'cleandepend' here to avoid dependencies
508 # on cleaned away headers in ${WORLDTMP}.
511 .for d in usr.bin/compile_et usr.bin/rpcgen
512 cd ${.CURDIR}/$d; ${MAKE} cleandepend; \
513 ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
514 ${MAKE} ${MK_FLAGS} all; \
515 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
519 # includes - possibly generate and install the include files.
523 rm -rf ${DESTDIR}/usr/include/*
524 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
525 -p ${DESTDIR}/usr/include
527 cd ${.CURDIR}/include; ${MAKE} -B all install
528 cd ${.CURDIR}/gnu/include; ${MAKE} install
529 cd ${.CURDIR}/gnu/lib/libmp; ${MAKE} beforeinstall
530 cd ${.CURDIR}/gnu/lib/libobjc; ${MAKE} beforeinstall
531 cd ${.CURDIR}/gnu/lib/libreadline; ${MAKE} beforeinstall
532 cd ${.CURDIR}/gnu/lib/libregex; ${MAKE} beforeinstall
533 cd ${.CURDIR}/gnu/lib/libstdc++; ${MAKE} beforeinstall
534 cd ${.CURDIR}/gnu/lib/libg++; ${MAKE} beforeinstall
535 cd ${.CURDIR}/gnu/lib/libdialog; ${MAKE} beforeinstall
536 cd ${.CURDIR}/gnu/lib/libgmp; ${MAKE} beforeinstall
537 .if exists(secure) && !defined(NOCRYPT)
538 cd ${.CURDIR}/secure/lib/libdes; ${MAKE} beforeinstall
540 .if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
541 cd ${.CURDIR}/kerberosIV/lib/libacl; ${MAKE} beforeinstall
542 cd ${.CURDIR}/kerberosIV/lib/libkadm; ${MAKE} beforeinstall
543 cd ${.CURDIR}/kerberosIV/lib/libkafs; ${MAKE} beforeinstall
544 cd ${.CURDIR}/kerberosIV/lib/libkdb; ${MAKE} beforeinstall
545 cd ${.CURDIR}/kerberosIV/lib/libkrb; ${MAKE} beforeinstall
546 cd ${.CURDIR}/kerberosIV/lib/libtelnet; ${MAKE} beforeinstall
548 cd ${.CURDIR}/lib/libtelnet; ${MAKE} beforeinstall
550 .if exists(${.CURDIR}/lib/csu/${MACHINE})
551 cd ${.CURDIR}/lib/csu/${MACHINE}; ${MAKE} beforeinstall
553 cd ${.CURDIR}/lib/libalias; ${MAKE} beforeinstall
554 cd ${.CURDIR}/lib/libc; ${MAKE} beforeinstall
555 cd ${.CURDIR}/lib/libcalendar; ${MAKE} beforeinstall
556 cd ${.CURDIR}/lib/libcurses; ${MAKE} beforeinstall
557 cd ${.CURDIR}/lib/libdisk; ${MAKE} beforeinstall
558 cd ${.CURDIR}/lib/libedit; ${MAKE} beforeinstall
559 cd ${.CURDIR}/lib/libftpio; ${MAKE} beforeinstall
560 cd ${.CURDIR}/lib/libmd; ${MAKE} beforeinstall
561 cd ${.CURDIR}/lib/libmytinfo; ${MAKE} beforeinstall
562 cd ${.CURDIR}/lib/libncurses; ${MAKE} beforeinstall
563 .if !defined(WANT_CSRG_LIBM)
564 cd ${.CURDIR}/lib/msun; ${MAKE} beforeinstall
566 cd ${.CURDIR}/lib/libopie; ${MAKE} beforeinstall
567 cd ${.CURDIR}/lib/libpcap; ${MAKE} beforeinstall
568 cd ${.CURDIR}/lib/librpcsvc; ${MAKE} beforeinstall
569 cd ${.CURDIR}/lib/libskey; ${MAKE} beforeinstall
570 .if !defined(NOTCL) && exists (${.CURDIR}/contrib/tcl) && \
571 exists(${.CURDIR}/usr.bin/tclsh) && exists (${.CURDIR}/lib/libtcl)
572 cd ${.CURDIR}/lib/libtcl; ${MAKE} installhdrs
574 cd ${.CURDIR}/lib/libtermcap; ${MAKE} beforeinstall
575 cd ${.CURDIR}/lib/libcom_err; ${MAKE} beforeinstall
576 cd ${.CURDIR}/lib/libss; ${MAKE} -B hdrs beforeinstall
577 cd ${.CURDIR}/lib/libscsi; ${MAKE} beforeinstall
578 cd ${.CURDIR}/lib/libutil; ${MAKE} beforeinstall
579 cd ${.CURDIR}/lib/libvgl; ${MAKE} beforeinstall
580 cd ${.CURDIR}/lib/libz; ${MAKE} beforeinstall
581 cd ${.CURDIR}/usr.bin/f2c; ${MAKE} beforeinstall
582 cd ${.CURDIR}/usr.bin/lex; ${MAKE} beforeinstall
585 # lib-tools - build tools to compile and install the libraries.
587 # XXX gperf is required for cc
588 # XXX a new ld and tsort is required for cc
604 gnu/usr.bin/binutils \
607 cd ${.CURDIR}/$d; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
608 ${MAKE} ${MK_FLAGS} all; \
609 ${MAKE} ${MK_FLAGS} -B install; \
610 ${MAKE} ${MK_FLAGS:S/-DNOPIC//} -B ${CLEANDIR} ${OBJDIR}
614 # We have to know too much about ordering and subdirs in the lib trees:
616 # To satisfy shared library linkage when only the libraries being built
619 # libcom_err must be built before libss.
620 # libcrypt and libmd must be built before libskey.
621 # libm must be built before libtcl.
622 # libmytinfo must be built before libdialog and libncurses.
623 # libncurses must be built before libdialog.
624 # libtermcap must be built before libcurses, libedit and libreadline.
626 # Some libraries are built conditionally and/or are in inconsistently
629 .if exists(lib/csu/${MACHINE}.pcc)
630 _csu=lib/csu/${MACHINE}.pcc
632 _csu=lib/csu/${MACHINE}
635 _libcrypt= lib/libcrypt
636 .if !defined(NOSECURE) && !defined(NOCRYPT)
637 _libcrypt+= secure/lib/libcrypt
640 .if defined(WANT_CSRG_LIBM)
647 # bootstrap-libraries - build just enough libraries for the bootstrap
648 # tools, and install them under ${WORLDTMP}.
650 # Build csu and libgcc early so that some tools get linked to the new
651 # versions (too late for the main tools, however). Then build the
652 # necessary prerequisite libraries (libtermcap just needs to be before
653 # libcurses, and this only matters for the NOCLEAN case when NOPIC is
656 # This is mostly wrong. The build tools must run on the host system,
657 # so they should use host libraries. We depend on the target being
658 # similar enough to the host for new target libraries to work on the
662 .for _lib in ${_csu} gnu/usr.bin/cc/libgcc lib/libtermcap \
663 gnu/lib/libregex gnu/lib/libreadline lib/libc \
664 lib/libcrypt lib/libcurses lib/libedit ${_libm} \
665 lib/libmd lib/libutil lib/libz usr.bin/lex/lib
666 .if exists(${.CURDIR}/${_lib})
667 cd ${.CURDIR}/${_lib}; \
668 ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
669 ${MAKE} ${MK_FLAGS} all; \
670 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
675 # libraries - build all libraries, and install them under ${DESTDIR}.
677 # The ordering is not as special as for bootstrap-libraries. Build
678 # the prerequisites first, then build almost everything else in
679 # alphabetical order.
682 .for _lib in lib/libcom_err ${_libcrypt} ${_libm} lib/libmytinfo \
683 lib/libncurses lib/libtermcap \
684 gnu/lib gnu/usr.bin/cc/libgcc lib usr.bin/lex/lib usr.sbin/pcvt/keycap
685 .if exists(${.CURDIR}/${_lib})
686 cd ${.CURDIR}/${_lib}; ${MAKE} all; ${MAKE} -B install
689 .if exists(${.CURDIR}/secure/lib) && !defined(NOCRYPT) && !defined(NOSECURE)
690 cd ${.CURDIR}/secure/lib; ${MAKE} all; ${MAKE} -B install
692 .if exists(${.CURDIR}/kerberosIV/lib) && !defined(NOCRYPT) && \
693 defined(MAKE_KERBEROS4)
694 cd ${.CURDIR}/kerberosIV/lib; ${MAKE} all; ${MAKE} -B install
698 # build-tools - build and install any other tools needed to complete the
699 # compile and install.
701 # bc and cpp are required to build groff. Otherwise, the order here is
702 # mostly historical, i.e., bogus.
703 # chmod is used to build gcc's tmpmultilib[2] at obscure times.
705 # XXX uname is a bug - the target should not depend on the host.
729 gnu/usr.bin/man/makewhatis \
731 gnu/usr.bin/perl/perl \
733 gnu/usr.bin/texinfo \
766 cd ${.CURDIR}/$d; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
767 ${MAKE} ${MK_FLAGS} all; \
768 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
771 .for __target in clean cleandepend cleandir depend obj
772 .for entry in ${SUBDIR}
773 ${entry}.${__target}__D: .PHONY
774 @if test -d ${.CURDIR}/${entry}.${MACHINE}; then \
775 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE}"; \
776 edir=${entry}.${MACHINE}; \
777 cd ${.CURDIR}/$${edir}; \
779 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
781 cd ${.CURDIR}/$${edir}; \
783 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
785 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
790 .include <bsd.subdir.mk>