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}
129 # Building a world goes through the following stages
131 # bootstrap-tool stage [BMAKE]
132 # This stage is responsible for creating programs that
133 # are needed for backward compatibility reasons. They
134 # are not built as cross-tools.
135 # build-tool stage [TMAKE]
136 # This stage is responsible for creating the object
137 # tree and building any tools that are needed during
139 # cross-tool stage [XMAKE]
140 # This stage is responsible for creating any tools that
141 # are needed for cross-builds. A cross-compiler is one
143 # world stage [WMAKE]
144 # This stage actually builds the world.
145 # install stage (optional) [IMAKE]
146 # This stage installs a previously built world.
149 # Common environment for bootstrap related stages
150 BOOTSTRAPENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
151 DESTDIR=${WORLDTMP} \
152 INSTALL="sh ${.CURDIR}/tools/install.sh" \
153 MACHINE_ARCH=${BUILD_ARCH} \
154 TOOLS_PREFIX=${WORLDTMP} \
157 # Common environment for world related stages
158 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
159 COMPILER_PATH=${WORLDTMP}/usr/libexec:${WORLDTMP}/usr/bin \
160 LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib \
161 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
162 PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.00503
164 # bootstrap-tool stage
165 BMAKEENV= ${BOOTSTRAPENV}
166 BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DNOMAN -DNOINFO -DNOHTML
169 TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
170 INSTALL="sh ${.CURDIR}/tools/install.sh" \
172 TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1
175 XMAKEENV= ${BOOTSTRAPENV} \
176 TARGET_ARCH=${MACHINE_ARCH}
177 XMAKE= ${XMAKEENV} ${MAKE} -f Makefile.inc1 -DNOMAN -DNOINFO -DNOHTML \
178 -DNO_FORTRAN -DNO_GDB
181 WMAKEENV= ${CROSSENV} \
182 DESTDIR=${WORLDTMP} \
183 INSTALL="sh ${.CURDIR}/tools/install.sh" \
185 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
188 IMAKEENV= ${CROSSENV}
189 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
191 USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \
192 usr/libexec/${OBJFORMAT} usr/sbin usr/share/misc
194 .if ${MACHINE_ARCH} == "i386" && ${MACHINE} == "pc98"
195 USRDIRS+= usr/libexec/aout
198 INCDIRS= arpa g++/std objc protocols readline rpc rpcsvc openssl \
204 # Attempt to rebuild the entire system, with reasonable chance of
205 # success, regardless of how old your existing system is.
208 .if !defined(NOSECURE) && !defined(NO_OPENSSL) && exists(${.CURDIR}/secure) && \
209 (!defined(USA_RESIDENT) || (${USA_RESIDENT} != NO && \
210 ${USA_RESIDENT} != YES))
212 @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
213 @echo ">>> You must define the value of USA_RESIDENT as 'YES' or"
214 @echo ">>> 'NO' as appropriate, in the environment or /etc/make.conf"
215 @echo ">>> before building can proceed."
216 @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
221 @echo "--------------------------------------------------------------"
222 @echo ">>> Rebuilding the temporary build tree"
223 @echo "--------------------------------------------------------------"
224 .if !defined(NOCLEAN)
227 for dir in bin games include lib sbin; do \
228 rm -rf ${WORLDTMP}/usr/$$dir; \
230 rm -f ${WORLDTMP}/sys
231 # XXX - Work-around for broken cc/cc_tools/Makefile.
232 # This is beyond dirty...
233 rm -f ${OBJTREE}${.CURDIR}/gnu/usr.bin/cc/cc_tools/.depend
235 .for _dir in ${USRDIRS}
236 mkdir -p ${WORLDTMP}/${_dir}
238 .for _dir in ${INCDIRS}
239 mkdir -p ${WORLDTMP}/usr/include/${_dir}
241 ln -sf ${.CURDIR}/sys ${WORLDTMP}/sys
243 @echo "--------------------------------------------------------------"
244 @echo ">>> stage 1: bootstrap tools"
245 @echo "--------------------------------------------------------------"
246 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
247 .if !defined(NOCLEAN)
249 @echo "--------------------------------------------------------------"
250 @echo ">>> stage 2: cleaning up the object tree"
251 @echo "--------------------------------------------------------------"
252 cd ${.CURDIR}; ${TMAKE} ${CLEANDIR:S/^/par-/}
255 @echo "--------------------------------------------------------------"
256 @echo ">>> stage 2: rebuilding the object tree"
257 @echo "--------------------------------------------------------------"
258 cd ${.CURDIR}; ${TMAKE} par-obj
260 @echo "--------------------------------------------------------------"
261 @echo ">>> stage 2: build tools"
262 @echo "--------------------------------------------------------------"
263 cd ${.CURDIR}; ${TMAKE} build-tools
265 @echo "--------------------------------------------------------------"
266 @echo ">>> stage 3: cross tools"
267 @echo "--------------------------------------------------------------"
268 cd ${.CURDIR}; ${XMAKE} cross-tools
270 @echo "--------------------------------------------------------------"
271 @echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
272 @echo "--------------------------------------------------------------"
273 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks includes
275 @echo "--------------------------------------------------------------"
276 @echo ">>> stage 4: building libraries"
277 @echo "--------------------------------------------------------------"
278 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
280 @echo "--------------------------------------------------------------"
281 @echo ">>> stage 4: make dependencies"
282 @echo "--------------------------------------------------------------"
283 cd ${.CURDIR}; ${WMAKE} par-depend
285 @echo "--------------------------------------------------------------"
286 @echo ">>> stage 4: building everything.."
287 @echo "--------------------------------------------------------------"
288 cd ${.CURDIR}; ${WMAKE} all
291 @echo "--------------------------------------------------------------"
292 @echo ">>> Building everything.."
293 @echo "--------------------------------------------------------------"
294 cd ${.CURDIR}; ${WMAKE} all
299 # Installs everything compiled by a 'buildworld'.
302 cd ${.CURDIR}; ${IMAKE} reinstall
307 # If you have a build server, you can NFS mount the source and obj directories
308 # and do a 'make reinstall' on the *client* to install new binaries from the
309 # most recent server build.
312 @echo "--------------------------------------------------------------"
313 @echo ">>> Making hierarchy"
314 @echo "--------------------------------------------------------------"
315 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
317 @echo "--------------------------------------------------------------"
318 @echo ">>> Installing everything.."
319 @echo "--------------------------------------------------------------"
320 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
323 @echo "--------------------------------------------------------------"
324 @echo ">>> Rebuilding man page indices"
325 @echo "--------------------------------------------------------------"
326 cd ${.CURDIR}/share/man; ${MAKE} makedb
330 # buildkernel and installkernel
332 # Which kernels to build and/or install is specified by setting
333 # KERNEL. If not defined a GENERIC kernel is built/installed.
334 # Only the existing (depending MACHINE) config files are used
335 # for building kernels and only the first of these is designated
336 # as the one being installed.
338 # Note that we have to use MACHINE instead of MACHINE_ARCH when
339 # we're in kernel-land. Since only MACHINE_ARCH is (expected) to
340 # be set to cross-build, we have to make sure MACHINE is set
345 # The only exotic MACHINE_ARCH/MACHINE combination valid at this
346 # time is i386/pc98. In all other cases set MACHINE equal to
348 .if ${MACHINE_ARCH} != "i386" || ${MACHINE} != "pc98"
349 MACHINE= ${MACHINE_ARCH}
352 KRNLSRCDIR= ${.CURDIR}/sys
353 KRNLCONFDIR= ${KRNLSRCDIR}/${MACHINE}/conf
354 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
356 .if !defined(NOCLEAN)
362 .for _kernel in ${KERNEL}
363 .if exists(${KRNLCONFDIR}/${_kernel})
364 BUILDKERNELS+= ${_kernel}
365 .if empty(INSTALLKERNEL)
366 INSTALLKERNEL= ${_kernel}
374 # Builds all kernels defined by BUILDKERNELS.
378 @echo "--------------------------------------------------------------"
379 @echo ">>> Rebuilding kernel(s)"
380 @echo "--------------------------------------------------------------"
381 .for _kernel in ${BUILDKERNELS}
382 @echo "===> ${_kernel}"
383 mkdir -p ${KRNLOBJDIR}
384 .if !defined(NO_KERNELCONFIG)
387 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} ${_kernel}
389 cd ${KRNLOBJDIR}/${_kernel}; \
390 MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx \
391 ${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/Makefile
392 .if !defined(NO_KERNELDEPEND)
393 cd ${KRNLOBJDIR}/${_kernel}; \
394 ${WMAKEENV} MACHINE=${MACHINE} KERNEL=${_kernel} \
397 cd ${KRNLOBJDIR}/${_kernel}; \
398 ${WMAKEENV} MACHINE=${MACHINE} KERNEL=${_kernel} ${MAKE} all
404 # Install the kernel defined by INSTALLKERNEL
407 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
408 ${IMAKEENV} MACHINE=${MACHINE} KERNEL=${INSTALLKERNEL} \
409 ${MAKE} KERNEL=${INSTALLKERNEL} install
414 # Update the source tree, by running sup and/or running cvs to update to the
418 .if defined(SUP_UPDATE)
419 @echo "--------------------------------------------------------------"
420 @echo ">>> Running ${SUP}"
421 @echo "--------------------------------------------------------------"
423 @${SUP} ${SUPFLAGS} ${SUPFILE}
425 .if defined(SUPFILE1)
426 @${SUP} ${SUPFLAGS} ${SUPFILE1}
428 .if defined(SUPFILE2)
429 @${SUP} ${SUPFLAGS} ${SUPFILE2}
431 .if defined(PORTSSUPFILE)
432 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
435 .if defined(CVS_UPDATE)
436 @echo "--------------------------------------------------------------"
437 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
438 @echo "--------------------------------------------------------------"
439 cd ${.CURDIR}; cvs -q update -A -P -d
445 # Build most of the user binaries on the existing system libs and includes.
448 @echo "--------------------------------------------------------------"
449 @echo ">>> Building programs only"
450 @echo "--------------------------------------------------------------"
451 cd ${.CURDIR}/bin; ${MAKE} all
452 cd ${.CURDIR}/sbin; ${MAKE} all
453 cd ${.CURDIR}/libexec; ${MAKE} all
454 cd ${.CURDIR}/usr.bin; ${MAKE} all
455 cd ${.CURDIR}/usr.sbin; ${MAKE} all
456 cd ${.CURDIR}/gnu/libexec; ${MAKE} all
457 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} all
458 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} all
463 # Install the binaries built by the 'most' target. This does not include
464 # libraries or include files.
467 @echo "--------------------------------------------------------------"
468 @echo ">>> Installing programs only"
469 @echo "--------------------------------------------------------------"
470 cd ${.CURDIR}/bin; ${MAKE} install
471 cd ${.CURDIR}/sbin; ${MAKE} install
472 cd ${.CURDIR}/libexec; ${MAKE} install
473 cd ${.CURDIR}/usr.bin; ${MAKE} install
474 cd ${.CURDIR}/usr.sbin; ${MAKE} install
475 cd ${.CURDIR}/gnu/libexec; ${MAKE} install
476 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} install
477 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} install
480 # ------------------------------------------------------------------------
482 # From here onwards are utility targets used by the 'make world' and
483 # related targets. If your 'world' breaks, you may like to try to fix
484 # the problem and manually run the following targets to attempt to
485 # complete the build. Beware, this is *not* guaranteed to work, you
486 # need to have a pretty good grip on the current state of the system
487 # to attempt to manually finish it. If in doubt, 'make world' again.
491 # bootstrap-tools: Build tools needed for compatibility
493 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
494 _strfile= games/fortune/strfile
498 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef usr.sbin/config \
499 gnu/usr.bin/gperf gnu/usr.bin/texinfo
500 cd ${.CURDIR}/${_tool}; \
508 # build-tools: Build special purpose build tools
510 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
511 _games= games/adventure games/hack games/phantasia
514 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
515 _share= share/syscons/scrnmaps
518 .if !defined(NO_FORTRAN)
519 _fortran= gnu/usr.bin/cc/f771
522 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
523 !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
524 _libroken4= kerberosIV/lib/libroken
527 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
528 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
529 _libkrb5= kerberos5/lib/libroken kerberos5/lib/libasn1 kerberos5/lib/libhdb \
534 .for _tool in bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
535 ${_libroken4} ${_libkrb5} lib/libncurses ${_share}
536 cd ${.CURDIR}/${_tool}; ${MAKE} build-tools
540 # cross-tools: Build cross-building tools
542 # WARNING: Because the bootstrap tools are expected to run on the
543 # build-machine, MACHINE_ARCH is *always* set to BUILD_ARCH when this
544 # target is being made. TARGET_ARCH is *always* set to reflect the
545 # target-machine (which you can set by specifying MACHINE_ARCH on
546 # make's command-line, get it?).
547 # The reason is simple: we build these tools not to be run on the
548 # architecture we're cross-building, but on the architecture we're
549 # currently building on (ie the host-machine) and we expect these
550 # tools to produce output for the architecture we're trying to
553 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
554 _elf2exe= usr.sbin/elf2exe
557 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
558 _btxld= usr.sbin/btxld
561 # XXX - MACHINE should actually be TARGET. But we don't set that...
562 .if ${TARGET_ARCH} == "i386" && ${MACHINE} == "pc98"
563 _aout_tools= usr.bin/size usr.bin/strip gnu/usr.bin/as gnu/usr.bin/ld
567 .for _tool in ${_aout_tools} ${_btxld} ${_elf2exe} usr.bin/genassym \
568 usr.bin/gensetdefs gnu/usr.bin/binutils usr.bin/objformat gnu/usr.bin/cc
569 cd ${.CURDIR}/${_tool}; \
577 # hierarchy - ensure that all the needed directories are present
580 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
583 # includes - possibly generate and install the include files.
586 cd ${.CURDIR}/include; ${MAKE} -B all install
587 cd ${.CURDIR}/gnu/include; ${MAKE} install
588 cd ${.CURDIR}/gnu/lib/libmp; ${MAKE} beforeinstall
589 cd ${.CURDIR}/gnu/lib/libobjc; ${MAKE} beforeinstall
590 cd ${.CURDIR}/gnu/lib/libreadline/readline; ${MAKE} beforeinstall
591 cd ${.CURDIR}/gnu/lib/libregex; ${MAKE} beforeinstall
592 cd ${.CURDIR}/gnu/lib/libstdc++; ${MAKE} beforeinstall
593 cd ${.CURDIR}/gnu/lib/libdialog; ${MAKE} beforeinstall
594 cd ${.CURDIR}/gnu/lib/libgmp; ${MAKE} beforeinstall
595 cd ${.CURDIR}/gnu/usr.bin/cc/cc1plus; ${MAKE} beforeinstall
596 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT)
597 .if exists(${.CURDIR}/secure/lib/libcrypto)
598 cd ${.CURDIR}/secure/lib/libcrypto; ${MAKE} beforeinstall
600 .if exists(${.CURDIR}/secure/lib/libssl)
601 cd ${.CURDIR}/secure/lib/libssl; ${MAKE} beforeinstall
604 .if exists(${.CURDIR}/kerberosIV) && !defined(NOCRYPT) && \
605 defined(MAKE_KERBEROS4)
606 cd ${.CURDIR}/kerberosIV/lib/libacl; ${MAKE} beforeinstall
607 cd ${.CURDIR}/kerberosIV/lib/libkadm; ${MAKE} beforeinstall
608 cd ${.CURDIR}/kerberosIV/lib/libkafs; ${MAKE} beforeinstall
609 cd ${.CURDIR}/kerberosIV/lib/libkdb; ${MAKE} beforeinstall
610 cd ${.CURDIR}/kerberosIV/lib/libkrb; ${MAKE} beforeinstall
611 cd ${.CURDIR}/kerberosIV/lib/libtelnet; ${MAKE} beforeinstall
613 cd ${.CURDIR}/lib/libtelnet; ${MAKE} beforeinstall
615 .if exists(${.CURDIR}/kerberos5) && !defined(NOCRYPT) && \
616 defined(MAKE_KERBEROS5)
617 cd ${.CURDIR}/kerberos5/lib/libasn1; ${MAKE} beforeinstall
618 cd ${.CURDIR}/kerberos5/lib/libhdb; ${MAKE} beforeinstall
619 cd ${.CURDIR}/kerberos5/lib/libkadm5clnt; ${MAKE} beforeinstall
620 cd ${.CURDIR}/kerberos5/lib/libkadm5srv; ${MAKE} beforeinstall
621 cd ${.CURDIR}/kerberos5/lib/libkafs5; ${MAKE} beforeinstall
622 cd ${.CURDIR}/kerberos5/lib/libkrb5; ${MAKE} beforeinstall
623 cd ${.CURDIR}/kerberos5/lib/libsl; ${MAKE} beforeinstall
625 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH})
626 cd ${.CURDIR}/lib/csu/${MACHINE_ARCH}; ${MAKE} beforeinstall
628 cd ${.CURDIR}/lib/libalias; ${MAKE} beforeinstall
629 cd ${.CURDIR}/lib/libatm; ${MAKE} beforeinstall
630 cd ${.CURDIR}/lib/libdevstat; ${MAKE} beforeinstall
631 cd ${.CURDIR}/lib/libc; ${MAKE} beforeinstall
632 cd ${.CURDIR}/lib/libcalendar; ${MAKE} beforeinstall
633 cd ${.CURDIR}/lib/libcam; ${MAKE} beforeinstall
634 cd ${.CURDIR}/lib/libdisk; ${MAKE} beforeinstall
635 cd ${.CURDIR}/lib/libedit; ${MAKE} beforeinstall
636 cd ${.CURDIR}/lib/libftpio; ${MAKE} beforeinstall
637 cd ${.CURDIR}/lib/libkvm; ${MAKE} beforeinstall
638 cd ${.CURDIR}/lib/libmd; ${MAKE} beforeinstall
639 .if !defined(WANT_CSRG_LIBM)
640 cd ${.CURDIR}/lib/msun; ${MAKE} beforeinstall
642 cd ${.CURDIR}/lib/libncp; ${MAKE} beforeinstall
643 cd ${.CURDIR}/lib/libncurses; ${MAKE} beforeinstall
644 cd ${.CURDIR}/lib/libnetgraph; ${MAKE} beforeinstall
645 cd ${.CURDIR}/lib/libopie; ${MAKE} beforeinstall
646 cd ${.CURDIR}/lib/libpam/libpam; ${MAKE} beforeinstall
647 cd ${.CURDIR}/lib/libpcap; ${MAKE} beforeinstall
648 cd ${.CURDIR}/lib/libradius; ${MAKE} beforeinstall
649 cd ${.CURDIR}/lib/librpcsvc; ${MAKE} beforeinstall
650 cd ${.CURDIR}/lib/libskey; ${MAKE} beforeinstall
651 cd ${.CURDIR}/lib/libstand; ${MAKE} beforeinstall
652 cd ${.CURDIR}/lib/libtacplus; ${MAKE} beforeinstall
653 cd ${.CURDIR}/lib/libcom_err; ${MAKE} beforeinstall
654 cd ${.CURDIR}/lib/libss; ${MAKE} -B hdrs beforeinstall
655 cd ${.CURDIR}/lib/libutil; ${MAKE} beforeinstall
656 cd ${.CURDIR}/lib/libvgl; ${MAKE} beforeinstall
657 cd ${.CURDIR}/lib/libwrap; ${MAKE} beforeinstall
658 cd ${.CURDIR}/lib/libz; ${MAKE} beforeinstall
659 cd ${.CURDIR}/usr.bin/lex; ${MAKE} beforeinstall
662 # libraries - build all libraries, and install them under ${DESTDIR}.
664 # The following dependencies exist between the libraries:
669 # libdialog: libncurses
670 # libedit: libncurses
674 # libpam: libcom_err libcrypt libcrypto libgcc_pic libkrb libopie libradius \
675 # libskey libtacplus libutil libz libssh
677 # libreadline: libncurses
678 # libskey: libcrypt libmd
683 # Across directories this comes down to (rougly):
685 # gnu/lib: lib/libm lib/libncurses
686 # kerberosIV/lib kerberos5/lib: lib/libcrypt
687 # lib/libpam: secure/lib/libcrypto kerberosIV/lib/libkrb gnu/lib/libgcc \
688 # secure/lib/libssh lib/libz
689 # secure/lib: lib/libmd
691 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}.pcc)
692 _csu= lib/csu/${MACHINE_ARCH}.pcc
693 .elif ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf"
694 _csu= lib/csu/i386-elf
696 _csu= lib/csu/${MACHINE_ARCH}
699 .if !defined(NOSECURE) && !defined(NOCRYPT)
700 _secure_lib= secure/lib
703 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
704 _kerberosIV_lib= kerberosIV/lib
707 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
708 _kerberos5_lib= kerberos5/lib
711 .if defined(WANT_CSRG_LIBM)
718 _libperl= gnu/usr.bin/perl/libperl
721 .if ${MACHINE_ARCH} == "i386"
722 _libkeycap= usr.sbin/pcvt/keycap
726 .for _lib in ${_csu} lib/libmd lib/libcrypt ${_secure_lib} ${_kerberosIV_lib} \
727 ${_kerberos5_lib} gnu/lib/libgcc lib/libcom_err ${_libm} lib/libncurses \
728 lib/libopie lib/libradius lib/libskey lib/libtacplus lib/libutil \
729 lib/libz lib gnu/lib \
730 ${_libperl} usr.bin/lex/lib ${_libkeycap}
731 .if exists(${.CURDIR}/${_lib})
732 cd ${.CURDIR}/${_lib}; \
739 .for __target in clean cleandepend cleandir depend obj
740 .for entry in ${SUBDIR}
741 ${entry}.${__target}__D: .PHONY
742 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
743 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
744 edir=${entry}.${MACHINE_ARCH}; \
745 cd ${.CURDIR}/$${edir}; \
747 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
749 cd ${.CURDIR}/$${edir}; \
751 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
753 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
756 .include <bsd.subdir.mk>