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 cp date echo egrep find grep \
309 install ln make makewhatis mv perl rm sed sh sysctl test \
310 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} KERNEL=${_kernel} \
409 cd ${KRNLOBJDIR}/${_kernel}; \
410 ${WMAKEENV} MACHINE=${MACHINE} KERNEL=${_kernel} ${MAKE} all
416 # Install the kernel defined by INSTALLKERNEL
419 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
420 ${IMAKEENV} MACHINE=${MACHINE} KERNEL=${INSTALLKERNEL} \
421 ${MAKE} KERNEL=${INSTALLKERNEL} install
426 # Update the source tree, by running sup and/or running cvs to update to the
430 .if defined(SUP_UPDATE)
431 @echo "--------------------------------------------------------------"
432 @echo ">>> Running ${SUP}"
433 @echo "--------------------------------------------------------------"
435 @${SUP} ${SUPFLAGS} ${SUPFILE}
437 .if defined(SUPFILE1)
438 @${SUP} ${SUPFLAGS} ${SUPFILE1}
440 .if defined(SUPFILE2)
441 @${SUP} ${SUPFLAGS} ${SUPFILE2}
443 .if defined(PORTSSUPFILE)
444 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
447 .if defined(CVS_UPDATE)
448 @echo "--------------------------------------------------------------"
449 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
450 @echo "--------------------------------------------------------------"
451 cd ${.CURDIR}; cvs -q update -A -P -d
457 # Build most of the user binaries on the existing system libs and includes.
460 @echo "--------------------------------------------------------------"
461 @echo ">>> Building programs only"
462 @echo "--------------------------------------------------------------"
463 cd ${.CURDIR}/bin; ${MAKE} all
464 cd ${.CURDIR}/sbin; ${MAKE} all
465 cd ${.CURDIR}/libexec; ${MAKE} all
466 cd ${.CURDIR}/usr.bin; ${MAKE} all
467 cd ${.CURDIR}/usr.sbin; ${MAKE} all
468 cd ${.CURDIR}/gnu/libexec; ${MAKE} all
469 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} all
470 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} all
475 # Install the binaries built by the 'most' target. This does not include
476 # libraries or include files.
479 @echo "--------------------------------------------------------------"
480 @echo ">>> Installing programs only"
481 @echo "--------------------------------------------------------------"
482 cd ${.CURDIR}/bin; ${MAKE} install
483 cd ${.CURDIR}/sbin; ${MAKE} install
484 cd ${.CURDIR}/libexec; ${MAKE} install
485 cd ${.CURDIR}/usr.bin; ${MAKE} install
486 cd ${.CURDIR}/usr.sbin; ${MAKE} install
487 cd ${.CURDIR}/gnu/libexec; ${MAKE} install
488 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} install
489 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} install
492 # ------------------------------------------------------------------------
494 # From here onwards are utility targets used by the 'make world' and
495 # related targets. If your 'world' breaks, you may like to try to fix
496 # the problem and manually run the following targets to attempt to
497 # complete the build. Beware, this is *not* guaranteed to work, you
498 # need to have a pretty good grip on the current state of the system
499 # to attempt to manually finish it. If in doubt, 'make world' again.
503 # bootstrap-tools: Build tools needed for compatibility
505 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
506 _strfile= games/fortune/strfile
510 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef usr.sbin/config \
511 usr.sbin/mtree gnu/usr.bin/gperf gnu/usr.bin/texinfo
512 cd ${.CURDIR}/${_tool}; \
520 # build-tools: Build special purpose build tools
522 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
523 _games= games/adventure games/hack games/phantasia
526 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
527 _share= share/syscons/scrnmaps
530 .if !defined(NO_FORTRAN)
531 _fortran= gnu/usr.bin/cc/f771
534 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
535 !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
536 _libroken4= kerberosIV/lib/libroken
539 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
540 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
541 _libkrb5= kerberos5/lib/libroken kerberos5/lib/libasn1 kerberos5/lib/libhdb \
546 _perl= gnu/usr.bin/perl
550 .for _tool in bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
551 ${_libroken4} ${_libkrb5} lib/libncurses ${_share} ${_perl}
552 cd ${.CURDIR}/${_tool}; ${MAKE} build-tools
556 # cross-tools: Build cross-building tools
558 # WARNING: Because the bootstrap tools are expected to run on the
559 # build-machine, MACHINE_ARCH is *always* set to BUILD_ARCH when this
560 # target is being made. TARGET_ARCH is *always* set to reflect the
561 # target-machine (which you can set by specifying MACHINE_ARCH on
562 # make's command-line, get it?).
563 # The reason is simple: we build these tools not to be run on the
564 # architecture we're cross-building, but on the architecture we're
565 # currently building on (ie the host-machine) and we expect these
566 # tools to produce output for the architecture we're trying to
569 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
570 _elf2exe= usr.sbin/elf2exe
573 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
574 _btxld= usr.sbin/btxld
577 # XXX - MACHINE should actually be TARGET. But we don't set that...
578 .if ${TARGET_ARCH} == "i386" && ${MACHINE} == "pc98"
579 _aout_tools= usr.bin/size usr.bin/strip gnu/usr.bin/as gnu/usr.bin/ld
583 .for _tool in ${_aout_tools} ${_btxld} ${_elf2exe} usr.bin/genassym \
584 usr.bin/gensetdefs gnu/usr.bin/binutils usr.bin/objformat gnu/usr.bin/cc
585 cd ${.CURDIR}/${_tool}; \
593 # hierarchy - ensure that all the needed directories are present
596 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
599 # includes - possibly generate and install the include files.
602 cd ${.CURDIR}/include; ${MAKE} -B all install
603 cd ${.CURDIR}/gnu/include; ${MAKE} install
604 cd ${.CURDIR}/gnu/lib/libmp; ${MAKE} beforeinstall
605 cd ${.CURDIR}/gnu/lib/libobjc; ${MAKE} beforeinstall
606 cd ${.CURDIR}/gnu/lib/libreadline/readline; ${MAKE} beforeinstall
607 cd ${.CURDIR}/gnu/lib/libregex; ${MAKE} beforeinstall
608 cd ${.CURDIR}/gnu/lib/libstdc++; ${MAKE} beforeinstall
609 cd ${.CURDIR}/gnu/lib/libdialog; ${MAKE} beforeinstall
610 cd ${.CURDIR}/gnu/lib/libgmp; ${MAKE} beforeinstall
611 cd ${.CURDIR}/gnu/usr.bin/cc/cc1plus; ${MAKE} beforeinstall
612 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT)
613 .if exists(${.CURDIR}/secure/lib/libcrypto)
614 cd ${.CURDIR}/secure/lib/libcrypto; ${MAKE} beforeinstall
616 .if exists(${.CURDIR}/secure/lib/libssl)
617 cd ${.CURDIR}/secure/lib/libssl; ${MAKE} beforeinstall
620 .if exists(${.CURDIR}/kerberosIV) && !defined(NOCRYPT) && \
621 defined(MAKE_KERBEROS4)
622 cd ${.CURDIR}/kerberosIV/lib/libacl; ${MAKE} beforeinstall
623 cd ${.CURDIR}/kerberosIV/lib/libkadm; ${MAKE} beforeinstall
624 cd ${.CURDIR}/kerberosIV/lib/libkafs; ${MAKE} beforeinstall
625 cd ${.CURDIR}/kerberosIV/lib/libkdb; ${MAKE} beforeinstall
626 cd ${.CURDIR}/kerberosIV/lib/libkrb; ${MAKE} beforeinstall
627 cd ${.CURDIR}/kerberosIV/lib/libtelnet; ${MAKE} beforeinstall
629 cd ${.CURDIR}/lib/libtelnet; ${MAKE} beforeinstall
631 .if exists(${.CURDIR}/kerberos5) && !defined(NOCRYPT) && \
632 defined(MAKE_KERBEROS5)
633 cd ${.CURDIR}/kerberos5/lib/libasn1; ${MAKE} beforeinstall
634 cd ${.CURDIR}/kerberos5/lib/libhdb; ${MAKE} beforeinstall
635 cd ${.CURDIR}/kerberos5/lib/libkadm5clnt; ${MAKE} beforeinstall
636 cd ${.CURDIR}/kerberos5/lib/libkadm5srv; ${MAKE} beforeinstall
637 cd ${.CURDIR}/kerberos5/lib/libkafs5; ${MAKE} beforeinstall
638 cd ${.CURDIR}/kerberos5/lib/libkrb5; ${MAKE} beforeinstall
639 cd ${.CURDIR}/kerberos5/lib/libsl; ${MAKE} beforeinstall
641 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH})
642 cd ${.CURDIR}/lib/csu/${MACHINE_ARCH}; ${MAKE} beforeinstall
644 cd ${.CURDIR}/lib/libalias; ${MAKE} beforeinstall
645 cd ${.CURDIR}/lib/libatm; ${MAKE} beforeinstall
646 cd ${.CURDIR}/lib/libdevstat; ${MAKE} beforeinstall
647 cd ${.CURDIR}/lib/libc; ${MAKE} beforeinstall
648 cd ${.CURDIR}/lib/libcalendar; ${MAKE} beforeinstall
649 cd ${.CURDIR}/lib/libcam; ${MAKE} beforeinstall
650 cd ${.CURDIR}/lib/libdisk; ${MAKE} beforeinstall
651 cd ${.CURDIR}/lib/libedit; ${MAKE} beforeinstall
652 cd ${.CURDIR}/lib/libftpio; ${MAKE} beforeinstall
653 cd ${.CURDIR}/lib/libkvm; ${MAKE} beforeinstall
654 cd ${.CURDIR}/lib/libmd; ${MAKE} beforeinstall
655 .if !defined(WANT_CSRG_LIBM)
656 cd ${.CURDIR}/lib/msun; ${MAKE} beforeinstall
658 cd ${.CURDIR}/lib/libncp; ${MAKE} beforeinstall
659 cd ${.CURDIR}/lib/libncurses; ${MAKE} beforeinstall
660 cd ${.CURDIR}/lib/libnetgraph; ${MAKE} beforeinstall
661 cd ${.CURDIR}/lib/libopie; ${MAKE} beforeinstall
662 cd ${.CURDIR}/lib/libpam/libpam; ${MAKE} beforeinstall
663 cd ${.CURDIR}/lib/libpcap; ${MAKE} beforeinstall
664 cd ${.CURDIR}/lib/libradius; ${MAKE} beforeinstall
665 cd ${.CURDIR}/lib/librpcsvc; ${MAKE} beforeinstall
666 cd ${.CURDIR}/lib/libskey; ${MAKE} beforeinstall
667 cd ${.CURDIR}/lib/libstand; ${MAKE} beforeinstall
668 cd ${.CURDIR}/lib/libtacplus; ${MAKE} beforeinstall
669 cd ${.CURDIR}/lib/libcom_err; ${MAKE} beforeinstall
670 cd ${.CURDIR}/lib/libss; ${MAKE} -B hdrs beforeinstall
671 cd ${.CURDIR}/lib/libutil; ${MAKE} beforeinstall
672 cd ${.CURDIR}/lib/libvgl; ${MAKE} beforeinstall
673 cd ${.CURDIR}/lib/libwrap; ${MAKE} beforeinstall
674 cd ${.CURDIR}/lib/libz; ${MAKE} beforeinstall
675 cd ${.CURDIR}/usr.bin/lex; ${MAKE} beforeinstall
678 # libraries - build all libraries, and install them under ${DESTDIR}.
680 # The following dependencies exist between the libraries:
685 # libdialog: libncurses
686 # libedit: libncurses
690 # libpam: libcom_err libcrypt libcrypto libgcc_pic libkrb libopie libradius \
691 # libskey libtacplus libutil libz libssh
693 # libreadline: libncurses
694 # libskey: libcrypt libmd
699 # Across directories this comes down to (rougly):
701 # gnu/lib: lib/libm lib/libncurses
702 # kerberosIV/lib kerberos5/lib: lib/libcrypt
703 # lib/libpam: secure/lib/libcrypto kerberosIV/lib/libkrb gnu/lib/libgcc \
704 # secure/lib/libssh lib/libz
705 # secure/lib: lib/libmd
707 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}.pcc)
708 _csu= lib/csu/${MACHINE_ARCH}.pcc
709 .elif ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf"
710 _csu= lib/csu/i386-elf
712 _csu= lib/csu/${MACHINE_ARCH}
715 .if !defined(NOSECURE) && !defined(NOCRYPT)
716 _secure_lib= secure/lib
719 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
720 _kerberosIV_lib= kerberosIV/lib
723 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
724 _kerberos5_lib= kerberos5/lib
727 .if defined(WANT_CSRG_LIBM)
733 .if ${MACHINE_ARCH} == "i386"
734 _libkeycap= usr.sbin/pcvt/keycap
738 .for _lib in ${_csu} lib/libmd lib/libcrypt ${_secure_lib} ${_kerberosIV_lib} \
739 ${_kerberos5_lib} gnu/lib/libgcc lib/libcom_err ${_libm} lib/libncurses \
740 lib/libopie lib/libradius lib/libskey lib/libtacplus lib/libutil \
741 lib/libz lib gnu/lib \
742 ${_libperl} usr.bin/lex/lib ${_libkeycap}
743 .if exists(${.CURDIR}/${_lib})
744 cd ${.CURDIR}/${_lib}; \
751 .for __target in clean cleandepend cleandir depend obj
752 .for entry in ${SUBDIR}
753 ${entry}.${__target}__D: .PHONY
754 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
755 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
756 edir=${entry}.${MACHINE_ARCH}; \
757 cd ${.CURDIR}/$${edir}; \
759 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
761 cd ${.CURDIR}/$${edir}; \
763 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
765 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
768 .include <bsd.subdir.mk>