4 # Make command line options:
5 # -DMAKE_KERBEROS4 to build KerberosIV
6 # -DMAKE_KERBEROS5 to build Kerberos5
7 # -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
8 # -DNOCLEAN do not clean at all
9 # -DNOCRYPT will prevent building of crypt versions
10 # -DNOPROFILE do not build profiled libraries
11 # -DNOSECURE do not go into secure subdir
12 # -DNOGAMES do not go into games subdir
13 # -DNOSHARE do not go into share subdir
14 # -DNOINFO do not make or install info files
15 # -DNOLIBC_R do not build libc_r.
16 # -DNO_FORTRAN do not build g77 and related libraries.
17 # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
18 # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
19 # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
22 # The intended user-driven targets are:
23 # buildworld - rebuild *everything*, including glue to help do upgrades
24 # installworld- install everything built by "buildworld"
25 # update - convenient way to update your source tree (eg: sup/cvs)
26 # most - build user commands, no libraries or include files
27 # installmost - install user commands, no libraries or include files
29 # Standard targets (not defined here) are documented in the makefiles in
30 # /usr/share/mk. These include:
31 # obj depend all install clean cleandepend cleanobj
33 # Put initial settings here.
36 # We must do share/info early so that installation of info `dir'
37 # entries works correctly. Do it first since it is less likely to
38 # grow dependencies on include and lib than vice versa.
39 .if exists(${.CURDIR}/share/info)
43 # We must do include and lib early so that the perl *.ph generation
44 # works correctly as it uses the header files installed by this.
45 .if exists(${.CURDIR}/include)
48 .if exists(${.CURDIR}/lib)
52 .if exists(${.CURDIR}/bin)
55 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
58 .if exists(${.CURDIR}/gnu)
61 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
62 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS4)
65 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
66 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS5)
69 .if exists(${.CURDIR}/libexec)
72 .if exists(${.CURDIR}/sbin)
75 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
78 .if exists(${.CURDIR}/sys)
81 .if exists(${.CURDIR}/usr.bin)
84 .if exists(${.CURDIR}/usr.sbin)
87 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
91 # etc must be last for "distribute" to work
92 .if exists(${.CURDIR}/etc)
96 # These are last, since it is nice to at least get the base system
97 # rebuilt before you do them.
98 .if defined(LOCAL_DIRS)
99 .for _DIR in ${LOCAL_DIRS}
100 .if exists(${.CURDIR}/${_DIR}) & exists(${.CURDIR}/${_DIR}/Makefile)
106 .if defined(NOCLEANDIR)
107 CLEANDIR= clean cleandepend
113 SUPFLAGS?= -g -L 2 -P -
115 MAKEOBJDIRPREFIX?= /usr/obj
116 TARGET_ARCH?= ${MACHINE_ARCH}
117 BUILD_ARCH!= sysctl -n hw.machine_arch
118 .if ${BUILD_ARCH} == ${MACHINE_ARCH}
119 OBJTREE= ${MAKEOBJDIRPREFIX}
121 OBJTREE= ${MAKEOBJDIRPREFIX}/${MACHINE_ARCH}
123 WORLDTMP= ${OBJTREE}${.CURDIR}/${BUILD_ARCH}
124 # /usr/games added for fortune which depend on strfile
125 STRICTTMPPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
126 TMPPATH= ${STRICTTMPPATH}:${PATH}
130 INSTALLTMP= ${TMPDIR}/install.${TMPPID}
133 # Building a world goes through the following stages
135 # bootstrap-tool stage [BMAKE]
136 # This stage is responsible for creating programs that
137 # are needed for backward compatibility reasons. They
138 # are not built as cross-tools.
139 # build-tool stage [TMAKE]
140 # This stage is responsible for creating the object
141 # tree and building any tools that are needed during
143 # cross-tool stage [XMAKE]
144 # This stage is responsible for creating any tools that
145 # are needed for cross-builds. A cross-compiler is one
147 # world stage [WMAKE]
148 # This stage actually builds the world.
149 # install stage (optional) [IMAKE]
150 # This stage installs a previously built world.
153 # Common environment for bootstrap related stages
154 BOOTSTRAPENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
155 DESTDIR=${WORLDTMP} \
156 INSTALL="sh ${.CURDIR}/tools/install.sh" \
157 MACHINE_ARCH=${BUILD_ARCH} \
158 TOOLS_PREFIX=${WORLDTMP} \
161 # Common environment for world related stages
162 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
163 COMPILER_PATH=${WORLDTMP}/usr/libexec:${WORLDTMP}/usr/bin \
164 LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib \
165 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
166 PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.6.0
168 # bootstrap-tool stage
169 BMAKEENV= ${BOOTSTRAPENV}
170 BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DNOMAN -DNOINFO -DNOHTML
173 TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
174 INSTALL="sh ${.CURDIR}/tools/install.sh" \
176 TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1
179 XMAKEENV= ${BOOTSTRAPENV} \
180 TARGET_ARCH=${MACHINE_ARCH}
181 XMAKE= ${XMAKEENV} ${MAKE} -f Makefile.inc1 -DNOMAN -DNOINFO -DNOHTML \
182 -DNO_FORTRAN -DNO_GDB
185 WMAKEENV= ${CROSSENV} \
186 DESTDIR=${WORLDTMP} \
187 INSTALL="sh ${.CURDIR}/tools/install.sh" \
189 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
192 IMAKEENV= ${CROSSENV} \
193 PATH=${STRICTTMPPATH}:${INSTALLTMP}
194 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
196 USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \
197 usr/libexec/${OBJFORMAT} usr/sbin usr/share/misc
199 .if ${MACHINE_ARCH} == "i386" && ${MACHINE} == "pc98"
200 USRDIRS+= usr/libexec/aout
203 INCDIRS= arpa g++/std objc protocols readline rpc rpcsvc openssl \
209 # Attempt to rebuild the entire system, with reasonable chance of
210 # success, regardless of how old your existing system is.
213 .if !defined(NOSECURE) && !defined(NO_OPENSSL) && exists(${.CURDIR}/secure) && \
214 (!defined(USA_RESIDENT) || (${USA_RESIDENT} != NO && \
215 ${USA_RESIDENT} != YES))
217 @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
218 @echo ">>> You must define the value of USA_RESIDENT as 'YES' or"
219 @echo ">>> 'NO' as appropriate, in the environment or /etc/make.conf"
220 @echo ">>> before building can proceed."
221 @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
226 @echo "--------------------------------------------------------------"
227 @echo ">>> Rebuilding the temporary build tree"
228 @echo "--------------------------------------------------------------"
229 .if !defined(NOCLEAN)
232 for dir in bin games include lib sbin; do \
233 rm -rf ${WORLDTMP}/usr/$$dir; \
235 rm -f ${WORLDTMP}/sys
236 # XXX - Work-around for broken cc/cc_tools/Makefile.
237 # This is beyond dirty...
238 rm -f ${OBJTREE}${.CURDIR}/gnu/usr.bin/cc/cc_tools/.depend
240 .for _dir in ${USRDIRS}
241 mkdir -p ${WORLDTMP}/${_dir}
243 .for _dir in ${INCDIRS}
244 mkdir -p ${WORLDTMP}/usr/include/${_dir}
246 ln -sf ${.CURDIR}/sys ${WORLDTMP}/sys
248 @echo "--------------------------------------------------------------"
249 @echo ">>> stage 1: bootstrap tools"
250 @echo "--------------------------------------------------------------"
251 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
252 .if !defined(NOCLEAN)
254 @echo "--------------------------------------------------------------"
255 @echo ">>> stage 2: cleaning up the object tree"
256 @echo "--------------------------------------------------------------"
257 cd ${.CURDIR}; ${TMAKE} ${CLEANDIR:S/^/par-/}
260 @echo "--------------------------------------------------------------"
261 @echo ">>> stage 2: rebuilding the object tree"
262 @echo "--------------------------------------------------------------"
263 cd ${.CURDIR}; ${TMAKE} par-obj
265 @echo "--------------------------------------------------------------"
266 @echo ">>> stage 2: build tools"
267 @echo "--------------------------------------------------------------"
268 cd ${.CURDIR}; ${TMAKE} build-tools
270 @echo "--------------------------------------------------------------"
271 @echo ">>> stage 3: cross tools"
272 @echo "--------------------------------------------------------------"
273 cd ${.CURDIR}; ${XMAKE} cross-tools
275 @echo "--------------------------------------------------------------"
276 @echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
277 @echo "--------------------------------------------------------------"
278 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks includes
280 @echo "--------------------------------------------------------------"
281 @echo ">>> stage 4: building libraries"
282 @echo "--------------------------------------------------------------"
283 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
285 @echo "--------------------------------------------------------------"
286 @echo ">>> stage 4: make dependencies"
287 @echo "--------------------------------------------------------------"
288 cd ${.CURDIR}; ${WMAKE} par-depend
290 @echo "--------------------------------------------------------------"
291 @echo ">>> stage 4: building everything.."
292 @echo "--------------------------------------------------------------"
293 cd ${.CURDIR}; ${WMAKE} all
296 @echo "--------------------------------------------------------------"
297 @echo ">>> Building everything.."
298 @echo "--------------------------------------------------------------"
299 cd ${.CURDIR}; ${WMAKE} all
304 # Installs everything compiled by a 'buildworld'.
307 mkdir -p ${INSTALLTMP}
308 for prog in [ awk cat chflags chown date echo egrep find grep \
309 install ln make makewhatis mtree mv perl rm sed sh sysctl \
310 test true uname wc zic; do \
311 cp `which $$prog` ${INSTALLTMP}; \
313 cd ${.CURDIR}; ${IMAKE} reinstall
319 # If you have a build server, you can NFS mount the source and obj directories
320 # and do a 'make reinstall' on the *client* to install new binaries from the
321 # most recent server build.
324 @echo "--------------------------------------------------------------"
325 @echo ">>> Making hierarchy"
326 @echo "--------------------------------------------------------------"
327 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
329 @echo "--------------------------------------------------------------"
330 @echo ">>> Installing everything.."
331 @echo "--------------------------------------------------------------"
332 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
335 @echo "--------------------------------------------------------------"
336 @echo ">>> Rebuilding man page indices"
337 @echo "--------------------------------------------------------------"
338 cd ${.CURDIR}/share/man; ${MAKE} makedb
342 # buildkernel and installkernel
344 # Which kernels to build and/or install is specified by setting
345 # KERNEL. If not defined a GENERIC kernel is built/installed.
346 # Only the existing (depending MACHINE) config files are used
347 # for building kernels and only the first of these is designated
348 # as the one being installed.
350 # Note that we have to use MACHINE instead of MACHINE_ARCH when
351 # we're in kernel-land. Since only MACHINE_ARCH is (expected) to
352 # be set to cross-build, we have to make sure MACHINE is set
357 # The only exotic MACHINE_ARCH/MACHINE combination valid at this
358 # time is i386/pc98. In all other cases set MACHINE equal to
360 .if ${MACHINE_ARCH} != "i386" || ${MACHINE} != "pc98"
361 MACHINE= ${MACHINE_ARCH}
364 KRNLSRCDIR= ${.CURDIR}/sys
365 KRNLCONFDIR= ${KRNLSRCDIR}/${MACHINE}/conf
366 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
368 .if !defined(NOCLEAN)
374 .for _kernel in ${KERNEL}
375 .if exists(${KRNLCONFDIR}/${_kernel})
376 BUILDKERNELS+= ${_kernel}
377 .if empty(INSTALLKERNEL)
378 INSTALLKERNEL= ${_kernel}
386 # Builds all kernels defined by BUILDKERNELS.
390 @echo "--------------------------------------------------------------"
391 @echo ">>> Rebuilding kernel(s)"
392 @echo "--------------------------------------------------------------"
393 .for _kernel in ${BUILDKERNELS}
394 @echo "===> ${_kernel}"
395 mkdir -p ${KRNLOBJDIR}
396 .if !defined(NO_KERNELCONFIG)
399 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} ${_kernel}
401 cd ${KRNLOBJDIR}/${_kernel}; \
402 MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx \
403 ${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/Makefile
404 .if !defined(NO_KERNELDEPEND)
405 cd ${KRNLOBJDIR}/${_kernel}; \
406 ${WMAKEENV} MACHINE=${MACHINE} ${MAKE} KERNEL=kernel depend
408 cd ${KRNLOBJDIR}/${_kernel}; \
409 ${WMAKEENV} MACHINE=${MACHINE} ${MAKE} KERNEL=kernel all
415 # Install the kernel defined by INSTALLKERNEL
418 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
419 ${CROSSENV} MACHINE=${MACHINE} ${MAKE} KERNEL=kernel install
424 # Update the source tree, by running sup and/or running cvs to update to the
428 .if defined(SUP_UPDATE)
429 @echo "--------------------------------------------------------------"
430 @echo ">>> Running ${SUP}"
431 @echo "--------------------------------------------------------------"
433 @${SUP} ${SUPFLAGS} ${SUPFILE}
435 .if defined(SUPFILE1)
436 @${SUP} ${SUPFLAGS} ${SUPFILE1}
438 .if defined(SUPFILE2)
439 @${SUP} ${SUPFLAGS} ${SUPFILE2}
441 .if defined(PORTSSUPFILE)
442 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
445 .if defined(CVS_UPDATE)
446 @echo "--------------------------------------------------------------"
447 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
448 @echo "--------------------------------------------------------------"
449 cd ${.CURDIR}; cvs -q update -A -P -d
455 # Build most of the user binaries on the existing system libs and includes.
458 @echo "--------------------------------------------------------------"
459 @echo ">>> Building programs only"
460 @echo "--------------------------------------------------------------"
461 cd ${.CURDIR}/bin; ${MAKE} all
462 cd ${.CURDIR}/sbin; ${MAKE} all
463 cd ${.CURDIR}/libexec; ${MAKE} all
464 cd ${.CURDIR}/usr.bin; ${MAKE} all
465 cd ${.CURDIR}/usr.sbin; ${MAKE} all
466 cd ${.CURDIR}/gnu/libexec; ${MAKE} all
467 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} all
468 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} all
473 # Install the binaries built by the 'most' target. This does not include
474 # libraries or include files.
477 @echo "--------------------------------------------------------------"
478 @echo ">>> Installing programs only"
479 @echo "--------------------------------------------------------------"
480 cd ${.CURDIR}/bin; ${MAKE} install
481 cd ${.CURDIR}/sbin; ${MAKE} install
482 cd ${.CURDIR}/libexec; ${MAKE} install
483 cd ${.CURDIR}/usr.bin; ${MAKE} install
484 cd ${.CURDIR}/usr.sbin; ${MAKE} install
485 cd ${.CURDIR}/gnu/libexec; ${MAKE} install
486 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} install
487 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} install
490 # ------------------------------------------------------------------------
492 # From here onwards are utility targets used by the 'make world' and
493 # related targets. If your 'world' breaks, you may like to try to fix
494 # the problem and manually run the following targets to attempt to
495 # complete the build. Beware, this is *not* guaranteed to work, you
496 # need to have a pretty good grip on the current state of the system
497 # to attempt to manually finish it. If in doubt, 'make world' again.
501 # bootstrap-tools: Build tools needed for compatibility
503 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
504 _strfile= games/fortune/strfile
508 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef usr.sbin/config \
509 gnu/usr.bin/gperf gnu/usr.bin/texinfo
510 cd ${.CURDIR}/${_tool}; \
518 # build-tools: Build special purpose build tools
520 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
521 _games= games/adventure games/hack games/phantasia
524 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
525 _share= share/syscons/scrnmaps
528 .if !defined(NO_FORTRAN)
529 _fortran= gnu/usr.bin/cc/f771
532 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
533 !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
534 _libroken4= kerberosIV/lib/libroken
537 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
538 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
539 _libkrb5= kerberos5/lib/libroken kerberos5/lib/libasn1 kerberos5/lib/libhdb \
544 _perl= gnu/usr.bin/perl
548 .for _tool in bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
549 ${_libroken4} ${_libkrb5} lib/libncurses ${_share} ${_perl}
550 cd ${.CURDIR}/${_tool}; ${MAKE} build-tools
554 # cross-tools: Build cross-building tools
556 # WARNING: Because the bootstrap tools are expected to run on the
557 # build-machine, MACHINE_ARCH is *always* set to BUILD_ARCH when this
558 # target is being made. TARGET_ARCH is *always* set to reflect the
559 # target-machine (which you can set by specifying MACHINE_ARCH on
560 # make's command-line, get it?).
561 # The reason is simple: we build these tools not to be run on the
562 # architecture we're cross-building, but on the architecture we're
563 # currently building on (ie the host-machine) and we expect these
564 # tools to produce output for the architecture we're trying to
567 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
568 _elf2exe= usr.sbin/elf2exe
571 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
572 _btxld= usr.sbin/btxld
575 # XXX - MACHINE should actually be TARGET. But we don't set that...
576 .if ${TARGET_ARCH} == "i386" && ${MACHINE} == "pc98"
577 _aout_tools= usr.bin/size usr.bin/strip gnu/usr.bin/as gnu/usr.bin/ld
581 .for _tool in ${_aout_tools} ${_btxld} ${_elf2exe} usr.bin/genassym \
582 usr.bin/gensetdefs gnu/usr.bin/binutils usr.bin/objformat gnu/usr.bin/cc
583 cd ${.CURDIR}/${_tool}; \
591 # hierarchy - ensure that all the needed directories are present
594 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
597 # includes - possibly generate and install the include files.
600 cd ${.CURDIR}/include; ${MAKE} -B all install
601 cd ${.CURDIR}/gnu/include; ${MAKE} install
602 cd ${.CURDIR}/gnu/lib/libmp; ${MAKE} beforeinstall
603 cd ${.CURDIR}/gnu/lib/libobjc; ${MAKE} beforeinstall
604 cd ${.CURDIR}/gnu/lib/libreadline/readline; ${MAKE} beforeinstall
605 cd ${.CURDIR}/gnu/lib/libregex; ${MAKE} beforeinstall
606 cd ${.CURDIR}/gnu/lib/libstdc++; ${MAKE} beforeinstall
607 cd ${.CURDIR}/gnu/lib/libdialog; ${MAKE} beforeinstall
608 cd ${.CURDIR}/gnu/lib/libgmp; ${MAKE} beforeinstall
609 cd ${.CURDIR}/gnu/usr.bin/cc/cc1plus; ${MAKE} beforeinstall
610 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT)
611 .if exists(${.CURDIR}/secure/lib/libcrypto)
612 cd ${.CURDIR}/secure/lib/libcrypto; ${MAKE} beforeinstall
614 .if exists(${.CURDIR}/secure/lib/libssl)
615 cd ${.CURDIR}/secure/lib/libssl; ${MAKE} beforeinstall
618 .if exists(${.CURDIR}/kerberosIV) && !defined(NOCRYPT) && \
619 defined(MAKE_KERBEROS4)
620 cd ${.CURDIR}/kerberosIV/lib/libacl; ${MAKE} beforeinstall
621 cd ${.CURDIR}/kerberosIV/lib/libkadm; ${MAKE} beforeinstall
622 cd ${.CURDIR}/kerberosIV/lib/libkafs; ${MAKE} beforeinstall
623 cd ${.CURDIR}/kerberosIV/lib/libkdb; ${MAKE} beforeinstall
624 cd ${.CURDIR}/kerberosIV/lib/libkrb; ${MAKE} beforeinstall
625 cd ${.CURDIR}/kerberosIV/lib/libtelnet; ${MAKE} beforeinstall
627 cd ${.CURDIR}/lib/libtelnet; ${MAKE} beforeinstall
629 .if exists(${.CURDIR}/kerberos5) && !defined(NOCRYPT) && \
630 defined(MAKE_KERBEROS5)
631 cd ${.CURDIR}/kerberos5/lib/libasn1; ${MAKE} beforeinstall
632 cd ${.CURDIR}/kerberos5/lib/libhdb; ${MAKE} beforeinstall
633 cd ${.CURDIR}/kerberos5/lib/libkadm5clnt; ${MAKE} beforeinstall
634 cd ${.CURDIR}/kerberos5/lib/libkadm5srv; ${MAKE} beforeinstall
635 cd ${.CURDIR}/kerberos5/lib/libkafs5; ${MAKE} beforeinstall
636 cd ${.CURDIR}/kerberos5/lib/libkrb5; ${MAKE} beforeinstall
637 cd ${.CURDIR}/kerberos5/lib/libsl; ${MAKE} beforeinstall
639 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH})
640 cd ${.CURDIR}/lib/csu/${MACHINE_ARCH}; ${MAKE} beforeinstall
642 cd ${.CURDIR}/lib/libalias; ${MAKE} beforeinstall
643 cd ${.CURDIR}/lib/libatm; ${MAKE} beforeinstall
644 cd ${.CURDIR}/lib/libdevstat; ${MAKE} beforeinstall
645 cd ${.CURDIR}/lib/libc; ${MAKE} beforeinstall
646 cd ${.CURDIR}/lib/libcalendar; ${MAKE} beforeinstall
647 cd ${.CURDIR}/lib/libcam; ${MAKE} beforeinstall
648 cd ${.CURDIR}/lib/libdisk; ${MAKE} beforeinstall
649 cd ${.CURDIR}/lib/libedit; ${MAKE} beforeinstall
650 cd ${.CURDIR}/lib/libftpio; ${MAKE} beforeinstall
651 cd ${.CURDIR}/lib/libkvm; ${MAKE} beforeinstall
652 cd ${.CURDIR}/lib/libmd; ${MAKE} beforeinstall
653 .if !defined(WANT_CSRG_LIBM)
654 cd ${.CURDIR}/lib/msun; ${MAKE} beforeinstall
656 cd ${.CURDIR}/lib/libncp; ${MAKE} beforeinstall
657 cd ${.CURDIR}/lib/libncurses; ${MAKE} beforeinstall
658 cd ${.CURDIR}/lib/libnetgraph; ${MAKE} beforeinstall
659 cd ${.CURDIR}/lib/libopie; ${MAKE} beforeinstall
660 cd ${.CURDIR}/lib/libpam/libpam; ${MAKE} beforeinstall
661 cd ${.CURDIR}/lib/libpcap; ${MAKE} beforeinstall
662 cd ${.CURDIR}/lib/libradius; ${MAKE} beforeinstall
663 cd ${.CURDIR}/lib/librpcsvc; ${MAKE} beforeinstall
664 cd ${.CURDIR}/lib/libskey; ${MAKE} beforeinstall
665 cd ${.CURDIR}/lib/libstand; ${MAKE} beforeinstall
666 cd ${.CURDIR}/lib/libtacplus; ${MAKE} beforeinstall
667 cd ${.CURDIR}/lib/libcom_err; ${MAKE} beforeinstall
668 cd ${.CURDIR}/lib/libss; ${MAKE} -B hdrs beforeinstall
669 cd ${.CURDIR}/lib/libutil; ${MAKE} beforeinstall
670 cd ${.CURDIR}/lib/libvgl; ${MAKE} beforeinstall
671 cd ${.CURDIR}/lib/libwrap; ${MAKE} beforeinstall
672 cd ${.CURDIR}/lib/libz; ${MAKE} beforeinstall
673 cd ${.CURDIR}/usr.bin/lex; ${MAKE} beforeinstall
676 # libraries - build all libraries, and install them under ${DESTDIR}.
678 # The following dependencies exist between the libraries:
683 # libdialog: libncurses
684 # libedit: libncurses
688 # libpam: libcom_err libcrypt libcrypto libgcc_pic libkrb libopie libradius \
689 # libskey libtacplus libutil libz libssh
691 # libreadline: libncurses
692 # libskey: libcrypt libmd
697 # Across directories this comes down to (rougly):
699 # gnu/lib: lib/libm lib/libncurses
700 # kerberosIV/lib kerberos5/lib: lib/libcrypt
701 # lib/libpam: secure/lib/libcrypto kerberosIV/lib/libkrb gnu/lib/libgcc \
702 # secure/lib/libssh lib/libz
703 # secure/lib: lib/libmd
705 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}.pcc)
706 _csu= lib/csu/${MACHINE_ARCH}.pcc
707 .elif ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf"
708 _csu= lib/csu/i386-elf
710 _csu= lib/csu/${MACHINE_ARCH}
713 .if !defined(NOSECURE) && !defined(NOCRYPT)
714 _secure_lib= secure/lib
717 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
718 _kerberosIV_lib= kerberosIV/lib
721 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
722 _kerberos5_lib= kerberos5/lib
725 .if defined(WANT_CSRG_LIBM)
731 .if ${MACHINE_ARCH} == "i386"
732 _libkeycap= usr.sbin/pcvt/keycap
736 .for _lib in ${_csu} lib/libmd lib/libcrypt ${_secure_lib} ${_kerberosIV_lib} \
737 ${_kerberos5_lib} gnu/lib/libgcc lib/libcom_err ${_libm} lib/libncurses \
738 lib/libopie lib/libradius lib/libskey lib/libtacplus lib/libutil \
739 lib/libz lib gnu/lib \
740 ${_libperl} usr.bin/lex/lib ${_libkeycap}
741 .if exists(${.CURDIR}/${_lib})
742 cd ${.CURDIR}/${_lib}; \
749 .for __target in clean cleandepend cleandir depend obj
750 .for entry in ${SUBDIR}
751 ${entry}.${__target}__D: .PHONY
752 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
753 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
754 edir=${entry}.${MACHINE_ARCH}; \
755 cd ${.CURDIR}/$${edir}; \
757 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
759 cd ${.CURDIR}/$${edir}; \
761 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
763 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
766 .include <bsd.subdir.mk>