4 # Make command line options:
5 # -DMAKE_KERBEROS4 to build KerberosIV
6 # -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
7 # -DNOCLEAN do not clean at all
8 # -DNOCRYPT will prevent building of crypt versions
9 # -DNOPROFILE do not build profiled libraries
10 # -DNOSECURE do not go into secure subdir
11 # -DNOGAMES do not go into games subdir
12 # -DNOSHARE do not go into share subdir
13 # -DNOINFO do not make or install info files
14 # -DNOLIBC_R do not build libc_r.
15 # -DNO_FORTRAN do not build g77 and related libraries.
16 # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
19 # The intended user-driven targets are:
20 # buildworld - rebuild *everything*, including glue to help do upgrades
21 # installworld- install everything built by "buildworld"
22 # update - convenient way to update your source tree (eg: sup/cvs)
23 # most - build user commands, no libraries or include files
24 # installmost - install user commands, no libraries or include files
26 # Standard targets (not defined here) are documented in the makefiles in
27 # /usr/share/mk. These include:
28 # obj depend all install clean cleandepend cleanobj
30 # Put initial settings here.
33 # We must do share/info early so that installation of info `dir'
34 # entries works correctly. Do it first since it is less likely to
35 # grow dependencies on include and lib than vice versa.
36 .if exists(${.CURDIR}/share/info)
40 # We must do include and lib early so that the perl *.ph generation
41 # works correctly as it uses the header files installed by this.
42 .if exists(${.CURDIR}/include)
45 .if exists(${.CURDIR}/lib)
49 .if exists(${.CURDIR}/bin)
52 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
55 .if exists(${.CURDIR}/gnu)
58 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
59 !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
62 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
63 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
66 .if exists(${.CURDIR}/libexec)
69 .if exists(${.CURDIR}/sbin)
72 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
75 .if exists(${.CURDIR}/sys)
78 .if exists(${.CURDIR}/usr.bin)
81 .if exists(${.CURDIR}/usr.sbin)
84 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
88 # etc must be last for "distribute" to work
89 .if exists(${.CURDIR}/etc)
93 # These are last, since it is nice to at least get the base system
94 # rebuilt before you do them.
95 .if defined(LOCAL_DIRS)
96 .for _DIR in ${LOCAL_DIRS}
97 .if exists(${.CURDIR}/${_DIR}) & exists(${.CURDIR}/${_DIR}/Makefile)
103 .if defined(NOCLEANDIR)
104 CLEANDIR= clean cleandepend
110 SUPFLAGS?= -g -L 2 -P -
112 MAKEOBJDIRPREFIX?= /usr/obj
113 TARGET_ARCH?= ${MACHINE_ARCH}
114 BUILD_ARCH!= sysctl -n hw.machine_arch
115 .if ${BUILD_ARCH} == ${MACHINE_ARCH}
116 OBJTREE= ${MAKEOBJDIRPREFIX}
118 OBJTREE= ${MAKEOBJDIRPREFIX}/${MACHINE_ARCH}
120 WORLDTMP= ${OBJTREE}${.CURDIR}/${BUILD_ARCH}
121 # /usr/games added for fortune which depend on strfile
122 STRICTTMPPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
123 TMPPATH= ${STRICTTMPPATH}:${PATH}
126 # Building a world goes through the following stages
128 # bootstrap-tool stage [BMAKE]
129 # This stage is responsible for creating programs that
130 # are needed for backward compatibility reasons. They
131 # are not built as cross-tools.
132 # build-tool stage [TMAKE]
133 # This stage is responsible for creating the object
134 # tree and building any tools that are needed during
136 # cross-tool stage [XMAKE]
137 # This stage is responsible for creating any tools that
138 # are needed for cross-builds. A cross-compiler is one
140 # world stage [WMAKE]
141 # This stage actually builds the world.
142 # install stage (optional) [IMAKE]
143 # This stage installs a previously built world.
146 # Common environment for bootstrap related stages
147 BOOTSTRAPENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
148 DESTDIR=${WORLDTMP} \
149 INSTALL="sh ${.CURDIR}/tools/install.sh" \
150 MACHINE_ARCH=${BUILD_ARCH} \
151 TOOLS_PREFIX=${WORLDTMP} \
154 # Common environment for world related stages
155 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
156 COMPILER_PATH=${WORLDTMP}/usr/libexec:${WORLDTMP}/usr/bin \
157 LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib \
158 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
159 PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.00503
161 # bootstrap-tool stage
162 BMAKEENV= ${BOOTSTRAPENV}
163 BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DNOMAN -DNOINFO -DNOHTML
166 TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
167 INSTALL="sh ${.CURDIR}/tools/install.sh" \
169 TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1
172 XMAKEENV= ${BOOTSTRAPENV} \
173 TARGET_ARCH=${MACHINE_ARCH}
174 XMAKE= ${XMAKEENV} ${MAKE} -f Makefile.inc1 -DNOMAN -DNOINFO -DNOHTML \
175 -DNO_FORTRAN -DNO_GDB
178 WMAKEENV= ${CROSSENV} \
179 DESTDIR=${WORLDTMP} \
180 INSTALL="sh ${.CURDIR}/tools/install.sh" \
182 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
185 IMAKEENV= ${CROSSENV}
186 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
188 USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \
189 usr/libexec/${OBJFORMAT} usr/sbin usr/share/misc
191 .if ${MACHINE_ARCH} == "i386" && ${MACHINE} == "pc98"
192 USRDIRS+= usr/libexec/aout
195 INCDIRS= arpa g++/std objc protocols readline rpc rpcsvc openssl \
201 # Attempt to rebuild the entire system, with reasonable chance of
202 # success, regardless of how old your existing system is.
205 .if !defined(NOSECURE) && exists(${.CURDIR}/secure) && \
206 (!defined(USA_RESIDENT) || (${USA_RESIDENT} != NO && \
207 ${USA_RESIDENT} != YES))
209 @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
210 @echo ">>> You must define the value of USA_RESIDENT as 'YES' or"
211 @echo ">>> 'NO' as appropriate, in the environment or /etc/make.conf"
212 @echo ">>> before building can proceed."
213 @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
218 @echo "--------------------------------------------------------------"
219 @echo ">>> Rebuilding the temporary build tree"
220 @echo "--------------------------------------------------------------"
221 .if !defined(NOCLEAN)
224 for dir in bin games include lib sbin; do \
225 rm -rf ${WORLDTMP}/usr/$$dir; \
227 rm -f ${WORLDTMP}/sys
228 # XXX - Work-around for broken cc/cc_tools/Makefile.
229 # This is beyond dirty...
230 rm -f ${OBJTREE}${.CURDIR}/gnu/usr.bin/cc/cc_tools/.depend
232 .for _dir in ${USRDIRS}
233 mkdir -p ${WORLDTMP}/${_dir}
235 .for _dir in ${INCDIRS}
236 mkdir -p ${WORLDTMP}/usr/include/${_dir}
238 ln -sf ${.CURDIR}/sys ${WORLDTMP}/sys
240 @echo "--------------------------------------------------------------"
241 @echo ">>> stage 1: bootstrap tools"
242 @echo "--------------------------------------------------------------"
243 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
244 .if !defined(NOCLEAN)
246 @echo "--------------------------------------------------------------"
247 @echo ">>> stage 2: cleaning up the object tree"
248 @echo "--------------------------------------------------------------"
249 cd ${.CURDIR}; ${TMAKE} ${CLEANDIR:S/^/par-/}
252 @echo "--------------------------------------------------------------"
253 @echo ">>> stage 2: rebuilding the object tree"
254 @echo "--------------------------------------------------------------"
255 cd ${.CURDIR}; ${TMAKE} par-obj
257 @echo "--------------------------------------------------------------"
258 @echo ">>> stage 2: build tools"
259 @echo "--------------------------------------------------------------"
260 cd ${.CURDIR}; ${TMAKE} build-tools
262 @echo "--------------------------------------------------------------"
263 @echo ">>> stage 3: cross tools"
264 @echo "--------------------------------------------------------------"
265 cd ${.CURDIR}; ${XMAKE} cross-tools
267 @echo "--------------------------------------------------------------"
268 @echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
269 @echo "--------------------------------------------------------------"
270 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks includes
272 @echo "--------------------------------------------------------------"
273 @echo ">>> stage 4: building libraries"
274 @echo "--------------------------------------------------------------"
275 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN libraries
277 @echo "--------------------------------------------------------------"
278 @echo ">>> stage 4: make dependencies"
279 @echo "--------------------------------------------------------------"
280 cd ${.CURDIR}; ${WMAKE} par-depend
282 @echo "--------------------------------------------------------------"
283 @echo ">>> stage 4: building everything.."
284 @echo "--------------------------------------------------------------"
285 cd ${.CURDIR}; ${WMAKE} all
288 @echo "--------------------------------------------------------------"
289 @echo ">>> Building everything.."
290 @echo "--------------------------------------------------------------"
291 cd ${.CURDIR}; ${WMAKE} all
296 # Installs everything compiled by a 'buildworld'.
299 cd ${.CURDIR}; ${IMAKE} reinstall
304 # If you have a build server, you can NFS mount the source and obj directories
305 # and do a 'make reinstall' on the *client* to install new binaries from the
306 # most recent server build.
309 @echo "--------------------------------------------------------------"
310 @echo ">>> Making hierarchy"
311 @echo "--------------------------------------------------------------"
312 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
314 @echo "--------------------------------------------------------------"
315 @echo ">>> Installing everything.."
316 @echo "--------------------------------------------------------------"
317 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
320 @echo "--------------------------------------------------------------"
321 @echo ">>> Rebuilding man page indices"
322 @echo "--------------------------------------------------------------"
323 cd ${.CURDIR}/share/man; ${MAKE} makedb
327 # buildkernel and installkernel
329 # Which kernels to build and/or install is specified by setting
330 # KERNEL. If not defined a GENERIC kernel is built/installed.
331 # Only the existing (depending MACHINE) config files are used
332 # for building kernels and only the first of these is designated
333 # as the one being installed.
335 # Note that we have to use MACHINE instead of MACHINE_ARCH when
336 # we're in kernel-land. Since only MACHINE_ARCH is (expected) to
337 # be set to cross-build, we have to make sure MACHINE is set
340 KERNEL?= GENERIC GENERIC98
342 # The only exotic MACHINE_ARCH/MACHINE combination valid at this
343 # time is i386/pc98. In all other cases set MACHINE equal to
345 .if ${MACHINE_ARCH} != "i386" || ${MACHINE} != "pc98"
346 MACHINE= ${MACHINE_ARCH}
349 KRNLSRCDIR= ${.CURDIR}/sys
350 KRNLCONFDIR= ${KRNLSRCDIR}/${MACHINE}/conf
351 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
353 .if !defined(NOCLEAN)
359 .for _kernel in ${KERNEL}
360 .if exists(${KRNLCONFDIR}/${_kernel})
361 BUILDKERNELS+= ${_kernel}
362 .if empty(INSTALLKERNEL)
363 INSTALLKERNEL= ${_kernel}
371 # Builds all kernels defined by BUILDKERNELS.
375 @echo "--------------------------------------------------------------"
376 @echo ">>> Rebuilding kernel(s)"
377 @echo "--------------------------------------------------------------"
378 .for _kernel in ${BUILDKERNELS}
379 @echo "===> ${_kernel}"
382 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} ${_kernel}
383 cd ${KRNLOBJDIR}/${_kernel}; \
384 MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx \
385 ${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/Makefile; \
386 ${WMAKEENV} MACHINE=${MACHINE} ${MAKE} depend; \
387 ${WMAKEENV} MACHINE=${MACHINE} ${MAKE} all
393 # Install the kernel defined by INSTALLKERNEL
396 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
397 ${IMAKEENV} MACHINE=${MACHINE} ${MAKE} install
402 # Update the source tree, by running sup and/or running cvs to update to the
406 .if defined(SUP_UPDATE)
407 @echo "--------------------------------------------------------------"
408 @echo ">>> Running ${SUP}"
409 @echo "--------------------------------------------------------------"
411 @${SUP} ${SUPFLAGS} ${SUPFILE}
413 .if defined(SUPFILE1)
414 @${SUP} ${SUPFLAGS} ${SUPFILE1}
416 .if defined(SUPFILE2)
417 @${SUP} ${SUPFLAGS} ${SUPFILE2}
419 .if defined(PORTSSUPFILE)
420 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
423 .if defined(CVS_UPDATE)
424 @echo "--------------------------------------------------------------"
425 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
426 @echo "--------------------------------------------------------------"
427 cd ${.CURDIR}; cvs -q update -P -d
433 # Build most of the user binaries on the existing system libs and includes.
436 @echo "--------------------------------------------------------------"
437 @echo ">>> Building programs only"
438 @echo "--------------------------------------------------------------"
439 cd ${.CURDIR}/bin; ${MAKE} all
440 cd ${.CURDIR}/sbin; ${MAKE} all
441 cd ${.CURDIR}/libexec; ${MAKE} all
442 cd ${.CURDIR}/usr.bin; ${MAKE} all
443 cd ${.CURDIR}/usr.sbin; ${MAKE} all
444 cd ${.CURDIR}/gnu/libexec; ${MAKE} all
445 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} all
446 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} all
451 # Install the binaries built by the 'most' target. This does not include
452 # libraries or include files.
455 @echo "--------------------------------------------------------------"
456 @echo ">>> Installing programs only"
457 @echo "--------------------------------------------------------------"
458 cd ${.CURDIR}/bin; ${MAKE} install
459 cd ${.CURDIR}/sbin; ${MAKE} install
460 cd ${.CURDIR}/libexec; ${MAKE} install
461 cd ${.CURDIR}/usr.bin; ${MAKE} install
462 cd ${.CURDIR}/usr.sbin; ${MAKE} install
463 cd ${.CURDIR}/gnu/libexec; ${MAKE} install
464 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} install
465 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} install
468 # ------------------------------------------------------------------------
470 # From here onwards are utility targets used by the 'make world' and
471 # related targets. If your 'world' breaks, you may like to try to fix
472 # the problem and manually run the following targets to attempt to
473 # complete the build. Beware, this is *not* guaranteed to work, you
474 # need to have a pretty good grip on the current state of the system
475 # to attempt to manually finish it. If in doubt, 'make world' again.
479 # bootstrap-tools: Build tools needed for compatibility
481 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
482 _strfile= games/fortune/strfile
486 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef usr.sbin/config \
488 cd ${.CURDIR}/${_tool}; \
496 # build-tools: Build special purpose build tools
498 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
499 _games= games/adventure games/hack games/phantasia
502 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
503 _share= share/syscons/scrnmaps
506 .if !defined(NO_FORTRAN)
507 _fortran= gnu/usr.bin/cc/f771
510 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
511 !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
512 _libroken4= kerberosIV/lib/libroken
515 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
516 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
517 _libroken5= kerberos5/lib/libroken
521 .for _tool in bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
522 ${_libroken4} ${_libroken5} lib/libncurses ${_share}
523 cd ${.CURDIR}/${_tool}; ${MAKE} build-tools
527 # cross-tools: Build cross-building tools
529 # WARNING: Because the bootstrap tools are expected to run on the
530 # build-machine, MACHINE_ARCH is *always* set to BUILD_ARCH when this
531 # target is being made. TARGET_ARCH is *always* set to reflect the
532 # target-machine (which you can set by specifying MACHINE_ARCH on
533 # make's command-line, get it?).
534 # The reason is simple: we build these tools not to be run on the
535 # architecture we're cross-building, but on the architecture we're
536 # currently building on (ie the host-machine) and we expect these
537 # tools to produce output for the architecture we're trying to
540 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
541 _elf2exe= usr.sbin/elf2exe
544 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
545 _btxld= usr.sbin/btxld
548 # XXX - MACHINE should actually be TARGET. But we don't set that...
549 .if ${TARGET_ARCH} == "i386" && ${MACHINE} == "pc98"
550 _aout_tools= usr.bin/size usr.bin/strip gnu/usr.bin/as gnu/usr.bin/ld
554 .for _tool in ${_aout_tools} ${_btxld} ${_elf2exe} usr.bin/genassym \
555 usr.bin/gensetdefs gnu/usr.bin/binutils usr.bin/objformat gnu/usr.bin/cc
556 cd ${.CURDIR}/${_tool}; \
564 # hierarchy - ensure that all the needed directories are present
567 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
570 # includes - possibly generate and install the include files.
573 cd ${.CURDIR}/include; ${MAKE} -B all install
574 cd ${.CURDIR}/gnu/include; ${MAKE} install
575 cd ${.CURDIR}/gnu/lib/libmp; ${MAKE} beforeinstall
576 cd ${.CURDIR}/gnu/lib/libobjc; ${MAKE} beforeinstall
577 cd ${.CURDIR}/gnu/lib/libreadline; ${MAKE} beforeinstall
578 cd ${.CURDIR}/gnu/lib/libregex; ${MAKE} beforeinstall
579 cd ${.CURDIR}/gnu/lib/libstdc++; ${MAKE} beforeinstall
580 cd ${.CURDIR}/gnu/lib/libdialog; ${MAKE} beforeinstall
581 cd ${.CURDIR}/gnu/lib/libgmp; ${MAKE} beforeinstall
582 cd ${.CURDIR}/gnu/usr.bin/cc/cc1plus; ${MAKE} beforeinstall
583 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT)
584 .if exists(${.CURDIR}/secure/lib/libcrypto)
585 cd ${.CURDIR}/secure/lib/libcrypto; ${MAKE} beforeinstall
587 cd ${.CURDIR}/secure/lib/libdes; ${MAKE} beforeinstall
588 .if exists(${.CURDIR}/secure/lib/libssl)
589 cd ${.CURDIR}/secure/lib/libssl; ${MAKE} beforeinstall
592 .if exists(${.CURDIR}/kerberosIV) && !defined(NOCRYPT) && \
593 defined(MAKE_KERBEROS4)
594 cd ${.CURDIR}/kerberosIV/lib/libacl; ${MAKE} beforeinstall
595 cd ${.CURDIR}/kerberosIV/lib/libkadm; ${MAKE} beforeinstall
596 cd ${.CURDIR}/kerberosIV/lib/libkafs; ${MAKE} beforeinstall
597 cd ${.CURDIR}/kerberosIV/lib/libkdb; ${MAKE} beforeinstall
598 cd ${.CURDIR}/kerberosIV/lib/libkrb; ${MAKE} beforeinstall
599 cd ${.CURDIR}/kerberosIV/lib/libtelnet; ${MAKE} beforeinstall
601 cd ${.CURDIR}/lib/libtelnet; ${MAKE} beforeinstall
603 .if exists(${.CURDIR}/kerberos5) && !defined(NOCRYPT) && \
604 defined(MAKE_KERBEROS5)
605 cd ${.CURDIR}/kerberos5/lib/libasn1; ${MAKE} beforeinstall
606 cd ${.CURDIR}/kerberos5/lib/libhdb; ${MAKE} beforeinstall
607 cd ${.CURDIR}/kerberos5/lib/libkadm5clnt; ${MAKE} beforeinstall
608 cd ${.CURDIR}/kerberos5/lib/libkadm5srv; ${MAKE} beforeinstall
609 cd ${.CURDIR}/kerberos5/lib/libkafs5; ${MAKE} beforeinstall
610 cd ${.CURDIR}/kerberos5/lib/libkrb5; ${MAKE} beforeinstall
611 cd ${.CURDIR}/kerberos5/lib/libsl; ${MAKE} beforeinstall
613 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH})
614 cd ${.CURDIR}/lib/csu/${MACHINE_ARCH}; ${MAKE} beforeinstall
616 cd ${.CURDIR}/lib/libalias; ${MAKE} beforeinstall
617 cd ${.CURDIR}/lib/libatm; ${MAKE} beforeinstall
618 cd ${.CURDIR}/lib/libdevstat; ${MAKE} beforeinstall
619 cd ${.CURDIR}/lib/libc; ${MAKE} beforeinstall
620 cd ${.CURDIR}/lib/libcalendar; ${MAKE} beforeinstall
621 cd ${.CURDIR}/lib/libcam; ${MAKE} beforeinstall
622 cd ${.CURDIR}/lib/libdisk; ${MAKE} beforeinstall
623 cd ${.CURDIR}/lib/libedit; ${MAKE} beforeinstall
624 cd ${.CURDIR}/lib/libftpio; ${MAKE} beforeinstall
625 cd ${.CURDIR}/lib/libkvm; ${MAKE} beforeinstall
626 cd ${.CURDIR}/lib/libmd; ${MAKE} beforeinstall
627 .if !defined(WANT_CSRG_LIBM)
628 cd ${.CURDIR}/lib/msun; ${MAKE} beforeinstall
630 cd ${.CURDIR}/lib/libncp; ${MAKE} beforeinstall
631 cd ${.CURDIR}/lib/libncurses; ${MAKE} beforeinstall
632 cd ${.CURDIR}/lib/libnetgraph; ${MAKE} beforeinstall
633 cd ${.CURDIR}/lib/libopie; ${MAKE} beforeinstall
634 cd ${.CURDIR}/lib/libpam/libpam; ${MAKE} beforeinstall
635 cd ${.CURDIR}/lib/libpcap; ${MAKE} beforeinstall
636 cd ${.CURDIR}/lib/libradius; ${MAKE} beforeinstall
637 cd ${.CURDIR}/lib/librpcsvc; ${MAKE} beforeinstall
638 cd ${.CURDIR}/lib/libskey; ${MAKE} beforeinstall
639 cd ${.CURDIR}/lib/libstand; ${MAKE} beforeinstall
640 cd ${.CURDIR}/lib/libtacplus; ${MAKE} beforeinstall
641 cd ${.CURDIR}/lib/libcom_err; ${MAKE} beforeinstall
642 cd ${.CURDIR}/lib/libss; ${MAKE} -B hdrs beforeinstall
643 cd ${.CURDIR}/lib/libutil; ${MAKE} beforeinstall
644 cd ${.CURDIR}/lib/libvgl; ${MAKE} beforeinstall
645 cd ${.CURDIR}/lib/libwrap; ${MAKE} beforeinstall
646 cd ${.CURDIR}/lib/libz; ${MAKE} beforeinstall
647 cd ${.CURDIR}/usr.bin/lex; ${MAKE} beforeinstall
650 # libraries - build all libraries, and install them under ${DESTDIR}.
652 # The following dependencies exist between the libraries:
657 # libdialog: libncurses
658 # libedit: libncurses
662 # libpam: libcom_err libcrypt libdes libgcc_pic libkrb libradius libskey \
665 # libreadline: libncurses
666 # libskey: libcrypt libmd
671 # Across directories this comes down to (rougly):
673 # gnu/lib: lib/libm lib/libncurses
674 # kerberosIV/lib kerberos5/lib: lib/libcrypt
675 # lib/libpam: secure/lib/libdes kerberosIV/lib/libkrb gnu/lib/libgcc
676 # secure/lib: lib/libmd
678 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}.pcc)
679 _csu= lib/csu/${MACHINE_ARCH}.pcc
680 .elif ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf"
681 _csu= lib/csu/i386-elf
683 _csu= lib/csu/${MACHINE_ARCH}
686 .if !defined(NOSECURE) && !defined(NOCRYPT)
687 _secure_lib= secure/lib
690 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
691 _kerberosIV_lib= kerberosIV/lib
694 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
695 _kerberos5_lib= kerberos5/lib
698 .if defined(WANT_CSRG_LIBM)
705 _libperl= gnu/usr.bin/perl/libperl
708 .if ${MACHINE_ARCH} == "i386"
709 _libkeycap= usr.sbin/pcvt/keycap
713 .for _lib in ${_csu} lib/libmd lib/libcrypt ${_secure_lib} ${_kerberosIV_lib} \
714 ${_kerberos5_lib} gnu/lib/libgcc lib/libcom_err ${_libm} lib/libncurses \
715 lib/libradius lib/libskey lib/libtacplus lib/libutil lib gnu/lib \
716 ${_libperl} usr.bin/lex/lib ${_libkeycap}
717 .if exists(${.CURDIR}/${_lib})
718 cd ${.CURDIR}/${_lib}; \
725 .for __target in clean cleandepend cleandir depend obj
726 .for entry in ${SUBDIR}
727 ${entry}.${__target}__D: .PHONY
728 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
729 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
730 edir=${entry}.${MACHINE_ARCH}; \
731 cd ${.CURDIR}/$${edir}; \
733 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
735 cd ${.CURDIR}/$${edir}; \
737 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
739 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
742 .include <bsd.subdir.mk>