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 # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
20 # The intended user-driven targets are:
21 # buildworld - rebuild *everything*, including glue to help do upgrades
22 # installworld- install everything built by "buildworld"
23 # update - convenient way to update your source tree (eg: sup/cvs)
24 # most - build user commands, no libraries or include files
25 # installmost - install user commands, no libraries or include files
27 # Standard targets (not defined here) are documented in the makefiles in
28 # /usr/share/mk. These include:
29 # obj depend all install clean cleandepend cleanobj
31 # Put initial settings here.
34 # We must do share/info early so that installation of info `dir'
35 # entries works correctly. Do it first since it is less likely to
36 # grow dependencies on include and lib than vice versa.
37 .if exists(${.CURDIR}/share/info)
41 # We must do include and lib early so that the perl *.ph generation
42 # works correctly as it uses the header files installed by this.
43 .if exists(${.CURDIR}/include)
46 .if exists(${.CURDIR}/lib)
50 .if exists(${.CURDIR}/bin)
53 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
56 .if exists(${.CURDIR}/gnu)
59 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
60 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS4)
63 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
64 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS5)
67 .if exists(${.CURDIR}/libexec)
70 .if exists(${.CURDIR}/sbin)
73 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
76 .if exists(${.CURDIR}/sys)
79 .if exists(${.CURDIR}/usr.bin)
82 .if exists(${.CURDIR}/usr.sbin)
85 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
89 # etc must be last for "distribute" to work
90 .if exists(${.CURDIR}/etc)
94 # These are last, since it is nice to at least get the base system
95 # rebuilt before you do them.
96 .if defined(LOCAL_DIRS)
97 .for _DIR in ${LOCAL_DIRS}
98 .if exists(${.CURDIR}/${_DIR}) & exists(${.CURDIR}/${_DIR}/Makefile)
104 .if defined(NOCLEANDIR)
105 CLEANDIR= clean cleandepend
111 SUPFLAGS?= -g -L 2 -P -
113 MAKEOBJDIRPREFIX?= /usr/obj
114 TARGET_ARCH?= ${MACHINE_ARCH}
115 BUILD_ARCH!= sysctl -n hw.machine_arch
116 .if ${BUILD_ARCH} == ${MACHINE_ARCH}
117 OBJTREE= ${MAKEOBJDIRPREFIX}
119 OBJTREE= ${MAKEOBJDIRPREFIX}/${MACHINE_ARCH}
121 WORLDTMP= ${OBJTREE}${.CURDIR}/${BUILD_ARCH}
122 # /usr/games added for fortune which depend on strfile
123 STRICTTMPPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
124 TMPPATH= ${STRICTTMPPATH}:${PATH}
127 # Building a world goes through the following stages
129 # bootstrap-tool stage [BMAKE]
130 # This stage is responsible for creating programs that
131 # are needed for backward compatibility reasons. They
132 # are not built as cross-tools.
133 # build-tool stage [TMAKE]
134 # This stage is responsible for creating the object
135 # tree and building any tools that are needed during
137 # cross-tool stage [XMAKE]
138 # This stage is responsible for creating any tools that
139 # are needed for cross-builds. A cross-compiler is one
141 # world stage [WMAKE]
142 # This stage actually builds the world.
143 # install stage (optional) [IMAKE]
144 # This stage installs a previously built world.
147 # Common environment for bootstrap related stages
148 BOOTSTRAPENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
149 DESTDIR=${WORLDTMP} \
150 INSTALL="sh ${.CURDIR}/tools/install.sh" \
151 MACHINE_ARCH=${BUILD_ARCH} \
152 TOOLS_PREFIX=${WORLDTMP} \
155 # Common environment for world related stages
156 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
157 COMPILER_PATH=${WORLDTMP}/usr/libexec:${WORLDTMP}/usr/bin \
158 LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib \
159 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
160 PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.00503
162 # bootstrap-tool stage
163 BMAKEENV= ${BOOTSTRAPENV}
164 BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DNOMAN -DNOINFO -DNOHTML
167 TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
168 INSTALL="sh ${.CURDIR}/tools/install.sh" \
170 TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1
173 XMAKEENV= ${BOOTSTRAPENV} \
174 TARGET_ARCH=${MACHINE_ARCH}
175 XMAKE= ${XMAKEENV} ${MAKE} -f Makefile.inc1 -DNOMAN -DNOINFO -DNOHTML \
176 -DNO_FORTRAN -DNO_GDB
179 WMAKEENV= ${CROSSENV} \
180 DESTDIR=${WORLDTMP} \
181 INSTALL="sh ${.CURDIR}/tools/install.sh" \
183 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
186 IMAKEENV= ${CROSSENV}
187 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
189 USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \
190 usr/libexec/${OBJFORMAT} usr/sbin usr/share/misc
192 .if ${MACHINE_ARCH} == "i386" && ${MACHINE} == "pc98"
193 USRDIRS+= usr/libexec/aout
196 INCDIRS= arpa g++/std objc protocols readline rpc rpcsvc openssl \
202 # Attempt to rebuild the entire system, with reasonable chance of
203 # success, regardless of how old your existing system is.
206 .if !defined(NOSECURE) && !defined(NO_OPENSSL) && exists(${.CURDIR}/secure) && \
207 (!defined(USA_RESIDENT) || (${USA_RESIDENT} != NO && \
208 ${USA_RESIDENT} != YES))
210 @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
211 @echo ">>> You must define the value of USA_RESIDENT as 'YES' or"
212 @echo ">>> 'NO' as appropriate, in the environment or /etc/make.conf"
213 @echo ">>> before building can proceed."
214 @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
219 @echo "--------------------------------------------------------------"
220 @echo ">>> Rebuilding the temporary build tree"
221 @echo "--------------------------------------------------------------"
222 .if !defined(NOCLEAN)
225 for dir in bin games include lib sbin; do \
226 rm -rf ${WORLDTMP}/usr/$$dir; \
228 rm -f ${WORLDTMP}/sys
229 # XXX - Work-around for broken cc/cc_tools/Makefile.
230 # This is beyond dirty...
231 rm -f ${OBJTREE}${.CURDIR}/gnu/usr.bin/cc/cc_tools/.depend
233 .for _dir in ${USRDIRS}
234 mkdir -p ${WORLDTMP}/${_dir}
236 .for _dir in ${INCDIRS}
237 mkdir -p ${WORLDTMP}/usr/include/${_dir}
239 ln -sf ${.CURDIR}/sys ${WORLDTMP}/sys
241 @echo "--------------------------------------------------------------"
242 @echo ">>> stage 1: bootstrap tools"
243 @echo "--------------------------------------------------------------"
244 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
245 .if !defined(NOCLEAN)
247 @echo "--------------------------------------------------------------"
248 @echo ">>> stage 2: cleaning up the object tree"
249 @echo "--------------------------------------------------------------"
250 cd ${.CURDIR}; ${TMAKE} ${CLEANDIR:S/^/par-/}
253 @echo "--------------------------------------------------------------"
254 @echo ">>> stage 2: rebuilding the object tree"
255 @echo "--------------------------------------------------------------"
256 cd ${.CURDIR}; ${TMAKE} par-obj
258 @echo "--------------------------------------------------------------"
259 @echo ">>> stage 2: build tools"
260 @echo "--------------------------------------------------------------"
261 cd ${.CURDIR}; ${TMAKE} build-tools
263 @echo "--------------------------------------------------------------"
264 @echo ">>> stage 3: cross tools"
265 @echo "--------------------------------------------------------------"
266 cd ${.CURDIR}; ${XMAKE} cross-tools
268 @echo "--------------------------------------------------------------"
269 @echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
270 @echo "--------------------------------------------------------------"
271 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks includes
273 @echo "--------------------------------------------------------------"
274 @echo ">>> stage 4: building libraries"
275 @echo "--------------------------------------------------------------"
276 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
278 @echo "--------------------------------------------------------------"
279 @echo ">>> stage 4: make dependencies"
280 @echo "--------------------------------------------------------------"
281 cd ${.CURDIR}; ${WMAKE} par-depend
283 @echo "--------------------------------------------------------------"
284 @echo ">>> stage 4: building everything.."
285 @echo "--------------------------------------------------------------"
286 cd ${.CURDIR}; ${WMAKE} all
289 @echo "--------------------------------------------------------------"
290 @echo ">>> Building everything.."
291 @echo "--------------------------------------------------------------"
292 cd ${.CURDIR}; ${WMAKE} all
297 # Installs everything compiled by a 'buildworld'.
300 cd ${.CURDIR}; ${IMAKE} reinstall
305 # If you have a build server, you can NFS mount the source and obj directories
306 # and do a 'make reinstall' on the *client* to install new binaries from the
307 # most recent server build.
310 @echo "--------------------------------------------------------------"
311 @echo ">>> Making hierarchy"
312 @echo "--------------------------------------------------------------"
313 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
315 @echo "--------------------------------------------------------------"
316 @echo ">>> Installing everything.."
317 @echo "--------------------------------------------------------------"
318 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
321 @echo "--------------------------------------------------------------"
322 @echo ">>> Rebuilding man page indices"
323 @echo "--------------------------------------------------------------"
324 cd ${.CURDIR}/share/man; ${MAKE} makedb
328 # buildkernel and installkernel
330 # Which kernels to build and/or install is specified by setting
331 # KERNEL. If not defined a GENERIC kernel is built/installed.
332 # Only the existing (depending MACHINE) config files are used
333 # for building kernels and only the first of these is designated
334 # as the one being installed.
336 # Note that we have to use MACHINE instead of MACHINE_ARCH when
337 # we're in kernel-land. Since only MACHINE_ARCH is (expected) to
338 # be set to cross-build, we have to make sure MACHINE is set
341 KERNEL?= GENERIC GENERIC98
343 # The only exotic MACHINE_ARCH/MACHINE combination valid at this
344 # time is i386/pc98. In all other cases set MACHINE equal to
346 .if ${MACHINE_ARCH} != "i386" || ${MACHINE} != "pc98"
347 MACHINE= ${MACHINE_ARCH}
350 KRNLSRCDIR= ${.CURDIR}/sys
351 KRNLCONFDIR= ${KRNLSRCDIR}/${MACHINE}/conf
352 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
354 .if !defined(NOCLEAN)
360 .for _kernel in ${KERNEL}
361 .if exists(${KRNLCONFDIR}/${_kernel})
362 BUILDKERNELS+= ${_kernel}
363 .if empty(INSTALLKERNEL)
364 INSTALLKERNEL= ${_kernel}
372 # Builds all kernels defined by BUILDKERNELS.
376 @echo "--------------------------------------------------------------"
377 @echo ">>> Rebuilding kernel(s)"
378 @echo "--------------------------------------------------------------"
379 .for _kernel in ${BUILDKERNELS}
380 @echo "===> ${_kernel}"
383 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} ${_kernel}
384 cd ${KRNLOBJDIR}/${_kernel}; \
385 MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx \
386 ${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/Makefile; \
387 ${WMAKEENV} MACHINE=${MACHINE} KERNEL=${_kernel} \
389 ${WMAKEENV} MACHINE=${MACHINE} KERNEL=${_kernel} ${MAKE} all
395 # Install the kernel defined by INSTALLKERNEL
398 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
399 ${IMAKEENV} MACHINE=${MACHINE} KERNEL=${INSTALLKERNEL} \
405 # Update the source tree, by running sup and/or running cvs to update to the
409 .if defined(SUP_UPDATE)
410 @echo "--------------------------------------------------------------"
411 @echo ">>> Running ${SUP}"
412 @echo "--------------------------------------------------------------"
414 @${SUP} ${SUPFLAGS} ${SUPFILE}
416 .if defined(SUPFILE1)
417 @${SUP} ${SUPFLAGS} ${SUPFILE1}
419 .if defined(SUPFILE2)
420 @${SUP} ${SUPFLAGS} ${SUPFILE2}
422 .if defined(PORTSSUPFILE)
423 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
426 .if defined(CVS_UPDATE)
427 @echo "--------------------------------------------------------------"
428 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
429 @echo "--------------------------------------------------------------"
430 cd ${.CURDIR}; cvs -q update -A -P -d
436 # Build most of the user binaries on the existing system libs and includes.
439 @echo "--------------------------------------------------------------"
440 @echo ">>> Building programs only"
441 @echo "--------------------------------------------------------------"
442 cd ${.CURDIR}/bin; ${MAKE} all
443 cd ${.CURDIR}/sbin; ${MAKE} all
444 cd ${.CURDIR}/libexec; ${MAKE} all
445 cd ${.CURDIR}/usr.bin; ${MAKE} all
446 cd ${.CURDIR}/usr.sbin; ${MAKE} all
447 cd ${.CURDIR}/gnu/libexec; ${MAKE} all
448 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} all
449 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} all
454 # Install the binaries built by the 'most' target. This does not include
455 # libraries or include files.
458 @echo "--------------------------------------------------------------"
459 @echo ">>> Installing programs only"
460 @echo "--------------------------------------------------------------"
461 cd ${.CURDIR}/bin; ${MAKE} install
462 cd ${.CURDIR}/sbin; ${MAKE} install
463 cd ${.CURDIR}/libexec; ${MAKE} install
464 cd ${.CURDIR}/usr.bin; ${MAKE} install
465 cd ${.CURDIR}/usr.sbin; ${MAKE} install
466 cd ${.CURDIR}/gnu/libexec; ${MAKE} install
467 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} install
468 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} install
471 # ------------------------------------------------------------------------
473 # From here onwards are utility targets used by the 'make world' and
474 # related targets. If your 'world' breaks, you may like to try to fix
475 # the problem and manually run the following targets to attempt to
476 # complete the build. Beware, this is *not* guaranteed to work, you
477 # need to have a pretty good grip on the current state of the system
478 # to attempt to manually finish it. If in doubt, 'make world' again.
482 # bootstrap-tools: Build tools needed for compatibility
484 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
485 _strfile= games/fortune/strfile
489 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef usr.sbin/config \
491 cd ${.CURDIR}/${_tool}; \
499 # build-tools: Build special purpose build tools
501 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
502 _games= games/adventure games/hack games/phantasia
505 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
506 _share= share/syscons/scrnmaps
509 .if !defined(NO_FORTRAN)
510 _fortran= gnu/usr.bin/cc/f771
513 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
514 !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
515 _libroken4= kerberosIV/lib/libroken
518 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
519 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
520 _libkrb5= kerberos5/lib/libroken kerberos5/lib/libasn1 kerberos5/lib/libhdb \
525 .for _tool in bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
526 ${_libroken4} ${_libkrb5} lib/libncurses ${_share}
527 cd ${.CURDIR}/${_tool}; ${MAKE} build-tools
531 # cross-tools: Build cross-building tools
533 # WARNING: Because the bootstrap tools are expected to run on the
534 # build-machine, MACHINE_ARCH is *always* set to BUILD_ARCH when this
535 # target is being made. TARGET_ARCH is *always* set to reflect the
536 # target-machine (which you can set by specifying MACHINE_ARCH on
537 # make's command-line, get it?).
538 # The reason is simple: we build these tools not to be run on the
539 # architecture we're cross-building, but on the architecture we're
540 # currently building on (ie the host-machine) and we expect these
541 # tools to produce output for the architecture we're trying to
544 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
545 _elf2exe= usr.sbin/elf2exe
548 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
549 _btxld= usr.sbin/btxld
552 # XXX - MACHINE should actually be TARGET. But we don't set that...
553 .if ${TARGET_ARCH} == "i386" && ${MACHINE} == "pc98"
554 _aout_tools= usr.bin/size usr.bin/strip gnu/usr.bin/as gnu/usr.bin/ld
558 .for _tool in ${_aout_tools} ${_btxld} ${_elf2exe} usr.bin/genassym \
559 usr.bin/gensetdefs gnu/usr.bin/binutils usr.bin/objformat gnu/usr.bin/cc
560 cd ${.CURDIR}/${_tool}; \
568 # hierarchy - ensure that all the needed directories are present
571 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
574 # includes - possibly generate and install the include files.
577 cd ${.CURDIR}/include; ${MAKE} -B all install
578 cd ${.CURDIR}/gnu/include; ${MAKE} install
579 cd ${.CURDIR}/gnu/lib/libmp; ${MAKE} beforeinstall
580 cd ${.CURDIR}/gnu/lib/libobjc; ${MAKE} beforeinstall
581 cd ${.CURDIR}/gnu/lib/libreadline/readline; ${MAKE} beforeinstall
582 cd ${.CURDIR}/gnu/lib/libregex; ${MAKE} beforeinstall
583 cd ${.CURDIR}/gnu/lib/libstdc++; ${MAKE} beforeinstall
584 cd ${.CURDIR}/gnu/lib/libdialog; ${MAKE} beforeinstall
585 cd ${.CURDIR}/gnu/lib/libgmp; ${MAKE} beforeinstall
586 cd ${.CURDIR}/gnu/usr.bin/cc/cc1plus; ${MAKE} beforeinstall
587 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT)
588 .if exists(${.CURDIR}/secure/lib/libcrypto)
589 cd ${.CURDIR}/secure/lib/libcrypto; ${MAKE} beforeinstall
591 .if exists(${.CURDIR}/secure/lib/libssl)
592 cd ${.CURDIR}/secure/lib/libssl; ${MAKE} beforeinstall
595 .if exists(${.CURDIR}/kerberosIV) && !defined(NOCRYPT) && \
596 defined(MAKE_KERBEROS4)
597 cd ${.CURDIR}/kerberosIV/lib/libacl; ${MAKE} beforeinstall
598 cd ${.CURDIR}/kerberosIV/lib/libkadm; ${MAKE} beforeinstall
599 cd ${.CURDIR}/kerberosIV/lib/libkafs; ${MAKE} beforeinstall
600 cd ${.CURDIR}/kerberosIV/lib/libkdb; ${MAKE} beforeinstall
601 cd ${.CURDIR}/kerberosIV/lib/libkrb; ${MAKE} beforeinstall
602 cd ${.CURDIR}/kerberosIV/lib/libtelnet; ${MAKE} beforeinstall
604 cd ${.CURDIR}/lib/libtelnet; ${MAKE} beforeinstall
606 .if exists(${.CURDIR}/kerberos5) && !defined(NOCRYPT) && \
607 defined(MAKE_KERBEROS5)
608 cd ${.CURDIR}/kerberos5/lib/libasn1; ${MAKE} beforeinstall
609 cd ${.CURDIR}/kerberos5/lib/libhdb; ${MAKE} beforeinstall
610 cd ${.CURDIR}/kerberos5/lib/libkadm5clnt; ${MAKE} beforeinstall
611 cd ${.CURDIR}/kerberos5/lib/libkadm5srv; ${MAKE} beforeinstall
612 cd ${.CURDIR}/kerberos5/lib/libkafs5; ${MAKE} beforeinstall
613 cd ${.CURDIR}/kerberos5/lib/libkrb5; ${MAKE} beforeinstall
614 cd ${.CURDIR}/kerberos5/lib/libsl; ${MAKE} beforeinstall
616 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH})
617 cd ${.CURDIR}/lib/csu/${MACHINE_ARCH}; ${MAKE} beforeinstall
619 cd ${.CURDIR}/lib/libalias; ${MAKE} beforeinstall
620 cd ${.CURDIR}/lib/libatm; ${MAKE} beforeinstall
621 cd ${.CURDIR}/lib/libdevstat; ${MAKE} beforeinstall
622 cd ${.CURDIR}/lib/libc; ${MAKE} beforeinstall
623 cd ${.CURDIR}/lib/libcalendar; ${MAKE} beforeinstall
624 cd ${.CURDIR}/lib/libcam; ${MAKE} beforeinstall
625 cd ${.CURDIR}/lib/libdisk; ${MAKE} beforeinstall
626 cd ${.CURDIR}/lib/libedit; ${MAKE} beforeinstall
627 cd ${.CURDIR}/lib/libftpio; ${MAKE} beforeinstall
628 cd ${.CURDIR}/lib/libkvm; ${MAKE} beforeinstall
629 cd ${.CURDIR}/lib/libmd; ${MAKE} beforeinstall
630 .if !defined(WANT_CSRG_LIBM)
631 cd ${.CURDIR}/lib/msun; ${MAKE} beforeinstall
633 cd ${.CURDIR}/lib/libncp; ${MAKE} beforeinstall
634 cd ${.CURDIR}/lib/libncurses; ${MAKE} beforeinstall
635 cd ${.CURDIR}/lib/libnetgraph; ${MAKE} beforeinstall
636 cd ${.CURDIR}/lib/libopie; ${MAKE} beforeinstall
637 cd ${.CURDIR}/lib/libpam/libpam; ${MAKE} beforeinstall
638 cd ${.CURDIR}/lib/libpcap; ${MAKE} beforeinstall
639 cd ${.CURDIR}/lib/libradius; ${MAKE} beforeinstall
640 cd ${.CURDIR}/lib/librpcsvc; ${MAKE} beforeinstall
641 cd ${.CURDIR}/lib/libskey; ${MAKE} beforeinstall
642 cd ${.CURDIR}/lib/libstand; ${MAKE} beforeinstall
643 cd ${.CURDIR}/lib/libtacplus; ${MAKE} beforeinstall
644 cd ${.CURDIR}/lib/libcom_err; ${MAKE} beforeinstall
645 cd ${.CURDIR}/lib/libss; ${MAKE} -B hdrs beforeinstall
646 cd ${.CURDIR}/lib/libutil; ${MAKE} beforeinstall
647 cd ${.CURDIR}/lib/libvgl; ${MAKE} beforeinstall
648 cd ${.CURDIR}/lib/libwrap; ${MAKE} beforeinstall
649 cd ${.CURDIR}/lib/libz; ${MAKE} beforeinstall
650 cd ${.CURDIR}/usr.bin/lex; ${MAKE} beforeinstall
653 # libraries - build all libraries, and install them under ${DESTDIR}.
655 # The following dependencies exist between the libraries:
660 # libdialog: libncurses
661 # libedit: libncurses
665 # libpam: libcom_err libcrypt libcrypto libgcc_pic libkrb libradius libskey \
666 # libtacplus libutil libz libssh
668 # libreadline: libncurses
669 # libskey: libcrypt libmd
674 # Across directories this comes down to (rougly):
676 # gnu/lib: lib/libm lib/libncurses
677 # kerberosIV/lib kerberos5/lib: lib/libcrypt
678 # lib/libpam: secure/lib/libcrypto kerberosIV/lib/libkrb gnu/lib/libgcc \
679 # secure/lib/libssh lib/libz
680 # secure/lib: lib/libmd
682 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}.pcc)
683 _csu= lib/csu/${MACHINE_ARCH}.pcc
684 .elif ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf"
685 _csu= lib/csu/i386-elf
687 _csu= lib/csu/${MACHINE_ARCH}
690 .if !defined(NOSECURE) && !defined(NOCRYPT)
691 _secure_lib= secure/lib
694 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
695 _kerberosIV_lib= kerberosIV/lib
698 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
699 _kerberos5_lib= kerberos5/lib
702 .if defined(WANT_CSRG_LIBM)
709 _libperl= gnu/usr.bin/perl/libperl
712 .if ${MACHINE_ARCH} == "i386"
713 _libkeycap= usr.sbin/pcvt/keycap
717 .for _lib in ${_csu} lib/libmd lib/libcrypt ${_secure_lib} ${_kerberosIV_lib} \
718 ${_kerberos5_lib} gnu/lib/libgcc lib/libcom_err ${_libm} lib/libncurses \
719 lib/libradius lib/libskey lib/libtacplus lib/libutil lib/libz lib gnu/lib \
720 ${_libperl} usr.bin/lex/lib ${_libkeycap}
721 .if exists(${.CURDIR}/${_lib})
722 cd ${.CURDIR}/${_lib}; \
729 .for __target in clean cleandepend cleandir depend obj
730 .for entry in ${SUBDIR}
731 ${entry}.${__target}__D: .PHONY
732 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
733 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
734 edir=${entry}.${MACHINE_ARCH}; \
735 cd ${.CURDIR}/$${edir}; \
737 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
739 cd ${.CURDIR}/$${edir}; \
741 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
743 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
746 .include <bsd.subdir.mk>