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 # -DNO_PORTSUPDATE do not update ports in ${MAKE} update
20 # -DNO_DOCUPDATE do not update doc in ${MAKE} update
21 # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
24 # The intended user-driven targets are:
25 # buildworld - rebuild *everything*, including glue to help do upgrades
26 # installworld- install everything built by "buildworld"
27 # update - convenient way to update your source tree (eg: sup/cvs)
28 # most - build user commands, no libraries or include files
29 # installmost - install user commands, no libraries or include files
31 # Standard targets (not defined here) are documented in the makefiles in
32 # /usr/share/mk. These include:
33 # obj depend all install clean cleandepend cleanobj
35 # Put initial settings here.
38 # We must do share/info early so that installation of info `dir'
39 # entries works correctly. Do it first since it is less likely to
40 # grow dependencies on include and lib than vice versa.
41 .if exists(${.CURDIR}/share/info)
45 # We must do include and lib early so that the perl *.ph generation
46 # works correctly as it uses the header files installed by this.
47 .if exists(${.CURDIR}/include)
50 .if exists(${.CURDIR}/lib)
54 .if exists(${.CURDIR}/bin)
57 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
60 .if exists(${.CURDIR}/gnu)
63 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
64 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS4)
67 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
68 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS5)
71 .if exists(${.CURDIR}/libexec)
74 .if exists(${.CURDIR}/sbin)
77 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
80 .if exists(${.CURDIR}/sys)
83 .if exists(${.CURDIR}/usr.bin)
86 .if exists(${.CURDIR}/usr.sbin)
89 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
93 # etc must be last for "distribute" to work
94 .if exists(${.CURDIR}/etc)
98 # These are last, since it is nice to at least get the base system
99 # rebuilt before you do them.
100 .if defined(LOCAL_DIRS)
101 .for _DIR in ${LOCAL_DIRS}
102 .if exists(${.CURDIR}/${_DIR}) & exists(${.CURDIR}/${_DIR}/Makefile)
108 .if defined(NOCLEANDIR)
109 CLEANDIR= clean cleandepend
115 SUPFLAGS?= -g -L 2 -P -
117 SUPFLAGS+= -h ${SUPHOST}
120 MAKEOBJDIRPREFIX?= /usr/obj
121 TARGET_ARCH?= ${MACHINE_ARCH}
122 BUILD_ARCH!= sysctl -n hw.machine_arch
123 .if ${BUILD_ARCH} == ${MACHINE_ARCH}
124 OBJTREE= ${MAKEOBJDIRPREFIX}
126 OBJTREE= ${MAKEOBJDIRPREFIX}/${MACHINE_ARCH}
128 WORLDTMP= ${OBJTREE}${.CURDIR}/${BUILD_ARCH}
129 # /usr/games added for fortune which depend on strfile
130 STRICTTMPPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
131 TMPPATH= ${STRICTTMPPATH}:${PATH}
135 INSTALLTMP= ${TMPDIR}/install.${TMPPID}
138 # Building a world goes through the following stages
140 # 1. bootstrap-tool stage [BMAKE]
141 # This stage is responsible for creating programs that
142 # are needed for backward compatibility reasons. They
143 # are not built as cross-tools.
144 # 2. build-tool stage [TMAKE]
145 # This stage is responsible for creating the object
146 # tree and building any tools that are needed during
148 # 3. cross-tool stage [XMAKE]
149 # This stage is responsible for creating any tools that
150 # are needed for cross-builds. A cross-compiler is one
152 # 4. world stage [WMAKE]
153 # This stage actually builds the world.
154 # 5. install stage (optional) [IMAKE]
155 # This stage installs a previously built world.
158 # Common environment for bootstrap related stages
159 BOOTSTRAPENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
160 DESTDIR=${WORLDTMP} \
161 INSTALL="sh ${.CURDIR}/tools/install.sh" \
162 MACHINE_ARCH=${BUILD_ARCH} \
163 TOOLS_PREFIX=${WORLDTMP} \
166 # Common environment for world related stages
167 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
168 COMPILER_PATH=${WORLDTMP}/usr/libexec:${WORLDTMP}/usr/bin \
169 LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib \
170 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
171 PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.6.0
173 # bootstrap-tool stage
174 BMAKEENV= ${BOOTSTRAPENV}
175 BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DNOMAN -DNOINFO -DNOHTML
178 TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
179 INSTALL="sh ${.CURDIR}/tools/install.sh" \
181 TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1
184 XMAKEENV= ${BOOTSTRAPENV} \
185 TARGET_ARCH=${MACHINE_ARCH}
186 XMAKE= ${XMAKEENV} ${MAKE} -f Makefile.inc1 -DNOMAN -DNOINFO -DNOHTML \
187 -DNO_FORTRAN -DNO_GDB
190 WMAKEENV= ${CROSSENV} \
191 DESTDIR=${WORLDTMP} \
192 INSTALL="sh ${.CURDIR}/tools/install.sh" \
194 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
197 IMAKEENV= ${CROSSENV} \
198 PATH=${STRICTTMPPATH}:${INSTALLTMP}
199 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
201 USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \
202 usr/libexec/${OBJFORMAT} usr/sbin usr/share/misc
204 .if ${MACHINE_ARCH} == "i386" && ${MACHINE} == "pc98"
205 USRDIRS+= usr/libexec/aout
208 INCDIRS= arpa g++/std objc protocols readline rpc rpcsvc openssl \
214 # Attempt to rebuild the entire system, with reasonable chance of
215 # success, regardless of how old your existing system is.
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 mkdir -p ${INSTALLTMP}
301 for prog in [ awk cat chflags chown date echo egrep find grep \
302 install ln make makewhatis mtree mv perl rm sed sh sysctl \
303 test true uname wc zic; do \
304 cp `which $$prog` ${INSTALLTMP}; \
306 cd ${.CURDIR}; ${IMAKE} reinstall
312 # If you have a build server, you can NFS mount the source and obj directories
313 # and do a 'make reinstall' on the *client* to install new binaries from the
314 # most recent server build.
317 @echo "--------------------------------------------------------------"
318 @echo ">>> Making hierarchy"
319 @echo "--------------------------------------------------------------"
320 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
322 @echo "--------------------------------------------------------------"
323 @echo ">>> Installing everything.."
324 @echo "--------------------------------------------------------------"
325 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
328 @echo "--------------------------------------------------------------"
329 @echo ">>> Rebuilding man page indices"
330 @echo "--------------------------------------------------------------"
331 cd ${.CURDIR}/share/man; ${MAKE} makedb
335 # buildkernel and installkernel
337 # Which kernels to build and/or install is specified by setting
338 # KERNEL. If not defined a GENERIC kernel is built/installed.
339 # Only the existing (depending MACHINE) config files are used
340 # for building kernels and only the first of these is designated
341 # as the one being installed.
343 # Note that we have to use MACHINE instead of MACHINE_ARCH when
344 # we're in kernel-land. Since only MACHINE_ARCH is (expected) to
345 # be set to cross-build, we have to make sure MACHINE is set
349 INSTKERNNAME?= kernel
351 # The only exotic MACHINE_ARCH/MACHINE combination valid at this
352 # time is i386/pc98. In all other cases set MACHINE equal to
354 .if ${MACHINE_ARCH} != "i386" || ${MACHINE} != "pc98"
355 MACHINE= ${MACHINE_ARCH}
358 KRNLSRCDIR= ${.CURDIR}/sys
359 KRNLCONFDIR= ${KRNLSRCDIR}/${MACHINE}/conf
360 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
362 .if !defined(NOCLEAN)
368 .for _kernel in ${KERNEL}
369 .if exists(${KRNLCONFDIR}/${_kernel})
370 BUILDKERNELS+= ${_kernel}
371 .if empty(INSTALLKERNEL)
372 INSTALLKERNEL= ${_kernel}
380 # Builds all kernels defined by BUILDKERNELS.
383 .if empty(BUILDKERNELS)
384 @echo ">>> ERROR: Missing kernel configuration file(s) (${KERNEL})."
388 @echo "--------------------------------------------------------------"
389 @echo ">>> Rebuilding kernel(s)"
390 @echo "--------------------------------------------------------------"
391 .for _kernel in ${BUILDKERNELS}
392 @echo "===> ${_kernel}"
393 mkdir -p ${KRNLOBJDIR}
394 .if !defined(NO_KERNELCONFIG)
397 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} ${_kernel}
399 cd ${KRNLOBJDIR}/${_kernel}; \
400 MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx/aicasm \
401 ${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/aicasm/Makefile
402 .if !defined(NO_KERNELDEPEND)
403 cd ${KRNLOBJDIR}/${_kernel}; \
404 ${WMAKEENV} MACHINE=${MACHINE} ${MAKE} KERNEL=${INSTKERNNAME} depend
406 cd ${KRNLOBJDIR}/${_kernel}; \
407 ${WMAKEENV} MACHINE=${MACHINE} ${MAKE} KERNEL=${INSTKERNNAME} all
413 # Install the kernel defined by INSTALLKERNEL
416 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
417 ${CROSSENV} MACHINE=${MACHINE} ${MAKE} KERNEL=${INSTKERNNAME} install
419 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
420 ${CROSSENV} MACHINE=${MACHINE} ${MAKE} KERNEL=${INSTKERNNAME} reinstall
425 # Short hand for `make buildkernel installkernel'
427 kernel: buildkernel installkernel
432 # Update the source tree, by running sup and/or running cvs to update to the
436 .if defined(SUP_UPDATE)
437 @echo "--------------------------------------------------------------"
438 @echo ">>> Running ${SUP}"
439 @echo "--------------------------------------------------------------"
441 @${SUP} ${SUPFLAGS} ${SUPFILE}
443 .if defined(SUPFILE1)
444 @${SUP} ${SUPFLAGS} ${SUPFILE1}
446 .if defined(SUPFILE2)
447 @${SUP} ${SUPFLAGS} ${SUPFILE2}
449 .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
450 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
452 .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
453 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
456 .if defined(CVS_UPDATE)
457 @echo "--------------------------------------------------------------"
458 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
459 @echo "--------------------------------------------------------------"
460 cd ${.CURDIR}; cvs -q update -A -P -d
466 # Build most of the user binaries on the existing system libs and includes.
469 @echo "--------------------------------------------------------------"
470 @echo ">>> Building programs only"
471 @echo "--------------------------------------------------------------"
472 cd ${.CURDIR}/bin; ${MAKE} all
473 cd ${.CURDIR}/sbin; ${MAKE} all
474 cd ${.CURDIR}/libexec; ${MAKE} all
475 cd ${.CURDIR}/usr.bin; ${MAKE} all
476 cd ${.CURDIR}/usr.sbin; ${MAKE} all
477 cd ${.CURDIR}/gnu/libexec; ${MAKE} all
478 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} all
479 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} all
484 # Install the binaries built by the 'most' target. This does not include
485 # libraries or include files.
488 @echo "--------------------------------------------------------------"
489 @echo ">>> Installing programs only"
490 @echo "--------------------------------------------------------------"
491 cd ${.CURDIR}/bin; ${MAKE} install
492 cd ${.CURDIR}/sbin; ${MAKE} install
493 cd ${.CURDIR}/libexec; ${MAKE} install
494 cd ${.CURDIR}/usr.bin; ${MAKE} install
495 cd ${.CURDIR}/usr.sbin; ${MAKE} install
496 cd ${.CURDIR}/gnu/libexec; ${MAKE} install
497 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} install
498 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} install
501 # ------------------------------------------------------------------------
503 # From here onwards are utility targets used by the 'make world' and
504 # related targets. If your 'world' breaks, you may like to try to fix
505 # the problem and manually run the following targets to attempt to
506 # complete the build. Beware, this is *not* guaranteed to work, you
507 # need to have a pretty good grip on the current state of the system
508 # to attempt to manually finish it. If in doubt, 'make world' again.
512 # bootstrap-tools: Build tools needed for compatibility
514 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
515 _strfile= games/fortune/strfile
519 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef usr.sbin/config \
520 gnu/usr.bin/gperf gnu/usr.bin/texinfo
521 cd ${.CURDIR}/${_tool}; \
529 # build-tools: Build special purpose build tools
531 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
532 _games= games/adventure games/hack games/phantasia
535 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
536 _share= share/syscons/scrnmaps
539 .if !defined(NO_FORTRAN)
540 _fortran= gnu/usr.bin/cc/f771
543 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
544 !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
545 _libroken4= kerberosIV/lib/libroken
548 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
549 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
550 _libkrb5= kerberos5/lib/libroken kerberos5/lib/libasn1 kerberos5/lib/libhdb \
555 _perl= gnu/usr.bin/perl
559 .for _tool in bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
560 ${_libroken4} ${_libkrb5} lib/libncurses ${_share} ${_perl}
561 cd ${.CURDIR}/${_tool}; ${MAKE} build-tools
565 # cross-tools: Build cross-building tools
567 # WARNING: Because the bootstrap tools are expected to run on the
568 # build-machine, MACHINE_ARCH is *always* set to BUILD_ARCH when this
569 # target is being made. TARGET_ARCH is *always* set to reflect the
570 # target-machine (which you can set by specifying MACHINE_ARCH on
571 # make's command-line, get it?).
572 # The reason is simple: we build these tools not to be run on the
573 # architecture we're cross-building, but on the architecture we're
574 # currently building on (ie the host-machine) and we expect these
575 # tools to produce output for the architecture we're trying to
578 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
579 _elf2exe= usr.sbin/elf2exe
582 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
583 _btxld= usr.sbin/btxld
586 # XXX - MACHINE should actually be TARGET. But we don't set that...
587 .if ${TARGET_ARCH} == "i386" && ${MACHINE} == "pc98"
588 _aout_tools= usr.bin/size usr.bin/strip gnu/usr.bin/as gnu/usr.bin/ld
592 .for _tool in ${_aout_tools} ${_btxld} ${_elf2exe} usr.bin/genassym \
593 usr.bin/gensetdefs gnu/usr.bin/binutils usr.bin/objformat gnu/usr.bin/cc
594 cd ${.CURDIR}/${_tool}; \
602 # hierarchy - ensure that all the needed directories are present
605 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
608 # includes - possibly generate and install the include files.
611 cd ${.CURDIR}/include; ${MAKE} -B all install
612 cd ${.CURDIR}/gnu/include; ${MAKE} install
613 cd ${.CURDIR}/gnu/lib/libmp; ${MAKE} beforeinstall
614 cd ${.CURDIR}/gnu/lib/libobjc; ${MAKE} beforeinstall
615 cd ${.CURDIR}/gnu/lib/libreadline/readline; ${MAKE} beforeinstall
616 cd ${.CURDIR}/gnu/lib/libregex; ${MAKE} beforeinstall
617 cd ${.CURDIR}/gnu/lib/libstdc++; ${MAKE} beforeinstall
618 cd ${.CURDIR}/gnu/lib/libdialog; ${MAKE} beforeinstall
619 cd ${.CURDIR}/gnu/lib/libgmp; ${MAKE} beforeinstall
620 cd ${.CURDIR}/gnu/usr.bin/cc/cc1plus; ${MAKE} beforeinstall
621 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT)
622 .if exists(${.CURDIR}/secure/lib/libcrypto)
623 cd ${.CURDIR}/secure/lib/libcrypto; ${MAKE} beforeinstall
625 .if exists(${.CURDIR}/secure/lib/libssl)
626 cd ${.CURDIR}/secure/lib/libssl; ${MAKE} beforeinstall
629 .if exists(${.CURDIR}/kerberosIV) && !defined(NOCRYPT) && \
630 defined(MAKE_KERBEROS4)
631 cd ${.CURDIR}/kerberosIV/lib/libacl; ${MAKE} beforeinstall
632 cd ${.CURDIR}/kerberosIV/lib/libkadm; ${MAKE} beforeinstall
633 cd ${.CURDIR}/kerberosIV/lib/libkafs; ${MAKE} beforeinstall
634 cd ${.CURDIR}/kerberosIV/lib/libkdb; ${MAKE} beforeinstall
635 cd ${.CURDIR}/kerberosIV/lib/libkrb; ${MAKE} beforeinstall
636 cd ${.CURDIR}/kerberosIV/lib/libtelnet; ${MAKE} beforeinstall
638 cd ${.CURDIR}/lib/libtelnet; ${MAKE} beforeinstall
640 .if exists(${.CURDIR}/kerberos5) && !defined(NOCRYPT) && \
641 defined(MAKE_KERBEROS5)
642 cd ${.CURDIR}/kerberos5/lib/libasn1; ${MAKE} beforeinstall
643 cd ${.CURDIR}/kerberos5/lib/libhdb; ${MAKE} beforeinstall
644 cd ${.CURDIR}/kerberos5/lib/libkadm5clnt; ${MAKE} beforeinstall
645 cd ${.CURDIR}/kerberos5/lib/libkadm5srv; ${MAKE} beforeinstall
646 cd ${.CURDIR}/kerberos5/lib/libkafs5; ${MAKE} beforeinstall
647 cd ${.CURDIR}/kerberos5/lib/libkrb5; ${MAKE} beforeinstall
648 cd ${.CURDIR}/kerberos5/lib/libsl; ${MAKE} beforeinstall
650 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH})
651 cd ${.CURDIR}/lib/csu/${MACHINE_ARCH}; ${MAKE} beforeinstall
653 cd ${.CURDIR}/gnu/lib/csu; ${MAKE} beforeinstall
654 cd ${.CURDIR}/lib/libalias; ${MAKE} beforeinstall
655 cd ${.CURDIR}/lib/libatm; ${MAKE} beforeinstall
656 cd ${.CURDIR}/lib/libdevstat; ${MAKE} beforeinstall
657 cd ${.CURDIR}/lib/libc; ${MAKE} beforeinstall
658 cd ${.CURDIR}/lib/libcalendar; ${MAKE} beforeinstall
659 cd ${.CURDIR}/lib/libcam; ${MAKE} beforeinstall
660 cd ${.CURDIR}/lib/libdisk; ${MAKE} beforeinstall
661 cd ${.CURDIR}/lib/libedit; ${MAKE} beforeinstall
662 cd ${.CURDIR}/lib/libfetch; ${MAKE} beforeinstall
663 cd ${.CURDIR}/lib/libftpio; ${MAKE} beforeinstall
664 cd ${.CURDIR}/lib/libkvm; ${MAKE} beforeinstall
665 cd ${.CURDIR}/lib/libmd; ${MAKE} beforeinstall
666 .if !defined(WANT_CSRG_LIBM)
667 cd ${.CURDIR}/lib/msun; ${MAKE} beforeinstall
669 cd ${.CURDIR}/lib/libncp; ${MAKE} beforeinstall
670 cd ${.CURDIR}/lib/libncurses; ${MAKE} beforeinstall
671 cd ${.CURDIR}/lib/libnetgraph; ${MAKE} beforeinstall
672 cd ${.CURDIR}/lib/libopie; ${MAKE} beforeinstall
673 cd ${.CURDIR}/lib/libpam/libpam; ${MAKE} beforeinstall
674 cd ${.CURDIR}/lib/libpcap; ${MAKE} beforeinstall
675 cd ${.CURDIR}/lib/libradius; ${MAKE} beforeinstall
676 cd ${.CURDIR}/lib/librpcsvc; ${MAKE} beforeinstall
677 cd ${.CURDIR}/lib/libskey; ${MAKE} beforeinstall
678 cd ${.CURDIR}/lib/libstand; ${MAKE} beforeinstall
679 cd ${.CURDIR}/lib/libtacplus; ${MAKE} beforeinstall
680 cd ${.CURDIR}/lib/libcom_err; ${MAKE} beforeinstall
681 cd ${.CURDIR}/lib/libss; ${MAKE} -B hdrs beforeinstall
682 cd ${.CURDIR}/lib/libutil; ${MAKE} beforeinstall
683 cd ${.CURDIR}/lib/libvgl; ${MAKE} beforeinstall
684 cd ${.CURDIR}/lib/libwrap; ${MAKE} beforeinstall
685 cd ${.CURDIR}/lib/libz; ${MAKE} beforeinstall
686 cd ${.CURDIR}/usr.bin/lex; ${MAKE} beforeinstall
689 # libraries - build all libraries, and install them under ${DESTDIR}.
691 # The following dependencies exist between the libraries:
696 # libdialog: libncurses
697 # libedit: libncurses
701 # libpam: libcom_err libcrypt libcrypto libgcc_pic libkrb libopie libradius \
702 # libskey libtacplus libutil libz libssh
704 # libreadline: libncurses
705 # libskey: libcrypt libmd
710 # Across directories this comes down to (rougly):
712 # gnu/lib: lib/libm lib/libncurses
713 # kerberosIV/lib kerberos5/lib: lib/libcrypt
714 # lib/libpam: secure/lib/libcrypto kerberosIV/lib/libkrb gnu/lib/libgcc \
715 # secure/lib/libssh lib/libz
716 # secure/lib: lib/libmd
718 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}.pcc)
719 _csu= lib/csu/${MACHINE_ARCH}.pcc
720 .elif ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf"
721 _csu= lib/csu/i386-elf
723 _csu= lib/csu/${MACHINE_ARCH}
726 .if !defined(NOSECURE) && !defined(NOCRYPT)
727 _secure_lib= secure/lib
730 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
731 _kerberosIV_lib= kerberosIV/lib
734 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
735 _kerberos5_lib= kerberos5/lib
738 .if defined(WANT_CSRG_LIBM)
744 .if ${MACHINE_ARCH} == "i386"
745 _libkeycap= usr.sbin/pcvt/keycap
749 .for _lib in ${_csu} gnu/lib/csu lib/libmd lib/libcrypt ${_secure_lib} ${_kerberosIV_lib} \
750 ${_kerberos5_lib} gnu/lib/libgcc lib/libcom_err ${_libm} lib/libncurses \
751 lib/libopie lib/libradius lib/libskey lib/libtacplus lib/libutil \
752 lib/libz lib gnu/lib \
753 ${_libperl} usr.bin/lex/lib ${_libkeycap}
754 .if exists(${.CURDIR}/${_lib})
755 cd ${.CURDIR}/${_lib}; \
762 .for __target in clean cleandepend cleandir depend obj
763 .for entry in ${SUBDIR}
764 ${entry}.${__target}__D: .PHONY
765 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
766 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
767 edir=${entry}.${MACHINE_ARCH}; \
768 cd ${.CURDIR}/$${edir}; \
770 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
772 cd ${.CURDIR}/$${edir}; \
774 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
776 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
779 .include <bsd.subdir.mk>