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_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
19 # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
20 # -DNO_PERL do not build perl5 and related libraries
21 # -DNO_PORTSUPDATE do not update ports in ${MAKE} update
22 # -DNO_DOCUPDATE do not update doc in ${MAKE} update
23 # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
24 # TARGET_ARCH="arch" to crossbuild world to a different arch
27 # The intended user-driven targets are:
28 # buildworld - rebuild *everything*, including glue to help do upgrades
29 # installworld- install everything built by "buildworld"
30 # update - convenient way to update your source tree (eg: sup/cvs)
31 # most - build user commands, no libraries or include files
32 # installmost - install user commands, no libraries or include files
34 # Standard targets (not defined here) are documented in the makefiles in
35 # /usr/share/mk. These include:
36 # obj depend all install clean cleandepend cleanobj
38 # Put initial settings here.
41 # We must do share/info early so that installation of info `dir'
42 # entries works correctly. Do it first since it is less likely to
43 # grow dependencies on include and lib than vice versa.
44 .if exists(${.CURDIR}/share/info)
48 # We must do include and lib early so that the perl *.ph generation
49 # works correctly as it uses the header files installed by this.
50 .if exists(${.CURDIR}/include)
53 .if exists(${.CURDIR}/lib)
57 .if exists(${.CURDIR}/bin)
60 .if exists(${.CURDIR}/etc)
63 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
66 .if exists(${.CURDIR}/gnu)
69 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
70 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS4)
73 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
74 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS5)
77 .if exists(${.CURDIR}/libexec)
80 .if exists(${.CURDIR}/sbin)
83 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
86 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
89 .if exists(${.CURDIR}/sys)
92 .if exists(${.CURDIR}/usr.bin)
95 .if exists(${.CURDIR}/usr.sbin)
99 # These are last, since it is nice to at least get the base system
100 # rebuilt before you do them.
101 .if defined(LOCAL_DIRS)
102 .for _DIR in ${LOCAL_DIRS}
103 .if exists(${.CURDIR}/${_DIR}) & exists(${.CURDIR}/${_DIR}/Makefile)
109 .if defined(SUBDIR_OVERRIDE)
110 SUBDIR= ${SUBDIR_OVERRIDE}
113 .if defined(NOCLEANDIR)
114 CLEANDIR= clean cleandepend
120 SUP?= /usr/local/bin/cvsup
121 SUPFLAGS?= -g -L 2 -P -
123 SUPFLAGS+= -h ${SUPHOST}
126 MAKEOBJDIRPREFIX?= /usr/obj
127 TARGET_ARCH?= ${MACHINE_ARCH}
128 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
131 TARGET?= ${TARGET_ARCH}
134 BUILD_ARCH!= sysctl -n hw.machine_arch
135 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
136 .error To cross-build, set TARGET_ARCH.
139 .if ${MACHINE} == ${TARGET}
140 OBJTREE= ${MAKEOBJDIRPREFIX}
142 OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}
144 WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH}
145 # /usr/games added for fortune which depend on strfile
146 STRICTTMPPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
147 TMPPATH= ${STRICTTMPPATH}:${PATH}
148 OBJFORMAT_PATH?= /usr/libexec
150 INSTALLTMP!= /usr/bin/mktemp -d -u -t install
153 # Building a world goes through the following stages
155 # 1. bootstrap-tool stage [BMAKE]
156 # This stage is responsible for creating programs that
157 # are needed for backward compatibility reasons. They
158 # are not built as cross-tools.
159 # 2. build-tool stage [TMAKE]
160 # This stage is responsible for creating the object
161 # tree and building any tools that are needed during
163 # 3. cross-tool stage [XMAKE]
164 # This stage is responsible for creating any tools that
165 # are needed for cross-builds. A cross-compiler is one
167 # 4. world stage [WMAKE]
168 # This stage actually builds the world.
169 # 5. install stage (optional) [IMAKE]
170 # This stage installs a previously built world.
173 # Common environment for world related stages
174 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
175 MACHINE_ARCH=${TARGET_ARCH} \
177 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
178 PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.6.1 \
179 GROFF_BIN_PATH=${WORLDTMP}/usr/bin \
180 GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \
181 GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac
183 # bootstrap-tool stage
184 BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
186 INSTALL="sh ${.CURDIR}/tools/install.sh"
187 BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
188 -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
192 TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
194 INSTALL="sh ${.CURDIR}/tools/install.sh"
195 TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING
198 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB
201 WMAKEENV= ${CROSSENV} \
202 DESTDIR=${WORLDTMP} \
203 INSTALL="sh ${.CURDIR}/tools/install.sh" \
205 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
208 IMAKEENV= ${CROSSENV} \
209 PATH=${STRICTTMPPATH}:${INSTALLTMP}
210 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
213 KMAKEENV= ${WMAKEENV} \
214 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec:${OBJFORMAT_PATH}
216 USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \
217 usr/libexec/${OBJFORMAT} usr/sbin usr/share/misc \
219 usr/share/groff_font/devX100 \
220 usr/share/groff_font/devX100-12 \
221 usr/share/groff_font/devX75 \
222 usr/share/groff_font/devX75-12 \
223 usr/share/groff_font/devascii \
224 usr/share/groff_font/devcp1047 \
225 usr/share/groff_font/devdvi \
226 usr/share/groff_font/devhtml \
227 usr/share/groff_font/devkoi8-r \
228 usr/share/groff_font/devlatin1 \
229 usr/share/groff_font/devlbp \
230 usr/share/groff_font/devlj4 \
231 usr/share/groff_font/devps \
232 usr/share/groff_font/devutf8 \
233 usr/share/tmac/mdoc usr/share/tmac/mm
235 INCDIRS= arpa dev fs g++/std isc isofs objc protocols \
236 readline rpc rpcsvc openssl security ufs
241 # Attempt to rebuild the entire system, with reasonable chance of
242 # success, regardless of how old your existing system is.
246 @echo "--------------------------------------------------------------"
247 @echo ">>> Rebuilding the temporary build tree"
248 @echo "--------------------------------------------------------------"
249 .if !defined(NOCLEAN)
252 # XXX - These two can depend on any header file.
253 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
254 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
256 .for _dir in ${USRDIRS}
257 mkdir -p ${WORLDTMP}/${_dir}
259 .for _dir in ${INCDIRS}
260 mkdir -p ${WORLDTMP}/usr/include/${_dir}
262 ln -sf ${.CURDIR}/sys ${WORLDTMP}
265 @echo "--------------------------------------------------------------"
266 @echo ">>> stage 1: bootstrap tools"
267 @echo "--------------------------------------------------------------"
268 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
270 .if !defined(NOCLEAN)
272 @echo "--------------------------------------------------------------"
273 @echo ">>> stage 2: cleaning up the object tree"
274 @echo "--------------------------------------------------------------"
275 cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
279 @echo "--------------------------------------------------------------"
280 @echo ">>> stage 2: rebuilding the object tree"
281 @echo "--------------------------------------------------------------"
282 cd ${.CURDIR}; ${WMAKE} par-obj
285 @echo "--------------------------------------------------------------"
286 @echo ">>> stage 2: build tools"
287 @echo "--------------------------------------------------------------"
288 cd ${.CURDIR}; ${TMAKE} build-tools
291 @echo "--------------------------------------------------------------"
292 @echo ">>> stage 3: cross tools"
293 @echo "--------------------------------------------------------------"
294 cd ${.CURDIR}; ${XMAKE} cross-tools
297 @echo "--------------------------------------------------------------"
298 @echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
299 @echo "--------------------------------------------------------------"
300 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks includes
303 @echo "--------------------------------------------------------------"
304 @echo ">>> stage 4: building libraries"
305 @echo "--------------------------------------------------------------"
306 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
309 @echo "--------------------------------------------------------------"
310 @echo ">>> stage 4: make dependencies"
311 @echo "--------------------------------------------------------------"
312 cd ${.CURDIR}; ${WMAKE} par-depend
315 @echo "--------------------------------------------------------------"
316 @echo ">>> stage 4: building everything.."
317 @echo "--------------------------------------------------------------"
318 cd ${.CURDIR}; ${WMAKE} all
322 .if !defined(SUBDIR_OVERRIDE)
323 WMAKE_TGTS+= _worldtmp _bootstrap-tools
325 WMAKE_TGTS+= _cleanobj _obj _build-tools
326 .if !defined(SUBDIR_OVERRIDE)
327 WMAKE_TGTS+= _cross-tools
329 WMAKE_TGTS+= _includes _libraries _depend everything
331 buildworld: ${WMAKE_TGTS}
332 .ORDER: ${WMAKE_TGTS}
337 # Checks to be sure system is ready for installworld
340 .if !defined(NO_SENDMAIL)
341 @if ! `grep -q '^smmsp:' /etc/passwd`; then \
342 echo "ERROR: Required smmsp user is missing, see /usr/src/UPDATING."; \
345 @if ! `grep -q '^smmsp:' /etc/group`; then \
346 echo "ERROR: Required smmsp group is missing, see /usr/src/UPDATING."; \
354 # Installs everything compiled by a 'buildworld'.
356 installworld: installcheck
357 mkdir -p ${INSTALLTMP}
358 for prog in [ awk cat chflags chmod chown date echo egrep find grep \
359 ln make makewhatis mkdir mtree mv perl rm sed sh sysctl \
360 test true uname wc zic; do \
361 cp `which $$prog` ${INSTALLTMP}; \
363 cd ${.CURDIR}; ${IMAKE} reinstall
369 # If you have a build server, you can NFS mount the source and obj directories
370 # and do a 'make reinstall' on the *client* to install new binaries from the
371 # most recent server build.
374 @echo "--------------------------------------------------------------"
375 @echo ">>> Making hierarchy"
376 @echo "--------------------------------------------------------------"
377 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
379 @echo "--------------------------------------------------------------"
380 @echo ">>> Installing everything.."
381 @echo "--------------------------------------------------------------"
382 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
383 .if !defined(NOMAN) && !defined(NO_MAKEDB_RUN)
385 @echo "--------------------------------------------------------------"
386 @echo ">>> Rebuilding man page indices"
387 @echo "--------------------------------------------------------------"
388 cd ${.CURDIR}/share/man; ${MAKE} makedb
394 # Front-end to distribute to make sure the search path contains
395 # the object directory. Needed for miniperl.
398 cd ${.CURDIR}; PATH=${TMPPATH} ${MAKE} -f Makefile.inc1 distribute
401 # buildkernel and installkernel
403 # Which kernels to build and/or install is specified by setting
404 # KERNCONF. If not defined a GENERIC kernel is built/installed.
405 # Only the existing (depending TARGET) config files are used
406 # for building kernels and only the first of these is designated
407 # as the one being installed.
409 # Note that we have to use TARGET instead of TARGET_ARCH when
410 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
411 # be set to cross-build, we have to make sure TARGET is set
414 .if !defined(KERNCONF) && defined(KERNEL)
420 INSTKERNNAME?= kernel
422 KRNLSRCDIR= ${.CURDIR}/sys
423 KRNLCONFDIR= ${KRNLSRCDIR}/${TARGET}/conf
424 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
425 KERNCONFDIR?= ${KRNLCONFDIR}
429 .for _kernel in ${KERNCONF}
430 .if exists(${KERNCONFDIR}/${_kernel})
431 BUILDKERNELS+= ${_kernel}
432 .if empty(INSTALLKERNEL)
433 INSTALLKERNEL= ${_kernel}
441 # Builds all kernels defined by BUILDKERNELS.
444 .if empty(BUILDKERNELS)
445 @echo ">>> ERROR: Missing kernel configuration file(s) (${KERNCONF})."
448 .if defined(KERNWARN)
449 @echo "--------------------------------------------------------------"
450 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
451 @echo "--------------------------------------------------------------"
455 .for _kernel in ${BUILDKERNELS}
456 @echo "--------------------------------------------------------------"
457 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
458 @echo "--------------------------------------------------------------"
459 @echo "===> ${_kernel}"
460 mkdir -p ${KRNLOBJDIR}
461 .if !defined(NO_KERNELCONFIG)
464 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
465 ${KERNCONFDIR}/${_kernel}
467 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
468 cd ${KRNLOBJDIR}/${_kernel}; \
469 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} -DNO_MODULES clean
470 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KRNLSRCDIR}/modules)
471 cd ${KRNLOBJDIR}/${_kernel}; \
472 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} cleandir
475 cd ${KRNLOBJDIR}/${_kernel}; \
476 MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx/aicasm \
477 ${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/aicasm/Makefile
478 .if !defined(NO_KERNELDEPEND)
479 cd ${KRNLOBJDIR}/${_kernel}; \
480 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
482 cd ${KRNLOBJDIR}/${_kernel}; \
483 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all
484 @echo "--------------------------------------------------------------"
485 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
486 @echo "--------------------------------------------------------------"
492 # Install the kernel defined by INSTALLKERNEL
494 installkernel reinstallkernel:
495 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
496 ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
501 # Short hand for `make buildkernel installkernel'
503 kernel: buildkernel installkernel
508 # Update the source tree, by running sup and/or running cvs to update to the
512 .if defined(SUP_UPDATE)
513 @echo "--------------------------------------------------------------"
514 @echo ">>> Running ${SUP}"
515 @echo "--------------------------------------------------------------"
517 @${SUP} ${SUPFLAGS} ${SUPFILE}
519 .if defined(SUPFILE1)
520 @${SUP} ${SUPFLAGS} ${SUPFILE1}
522 .if defined(SUPFILE2)
523 @${SUP} ${SUPFLAGS} ${SUPFILE2}
525 .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
526 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
528 .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
529 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
532 .if defined(CVS_UPDATE)
533 @echo "--------------------------------------------------------------"
534 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
535 @echo "--------------------------------------------------------------"
536 cd ${.CURDIR}; ${CVS} -q update -A -P -d
542 # Build most of the user binaries on the existing system libs and includes.
545 @echo "--------------------------------------------------------------"
546 @echo ">>> Building programs only"
547 @echo "--------------------------------------------------------------"
548 cd ${.CURDIR}/bin; ${MAKE} all
549 cd ${.CURDIR}/sbin; ${MAKE} all
550 cd ${.CURDIR}/libexec; ${MAKE} all
551 cd ${.CURDIR}/usr.bin; ${MAKE} all
552 cd ${.CURDIR}/usr.sbin; ${MAKE} all
553 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} all
554 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} all
559 # Install the binaries built by the 'most' target. This does not include
560 # libraries or include files.
563 @echo "--------------------------------------------------------------"
564 @echo ">>> Installing programs only"
565 @echo "--------------------------------------------------------------"
566 cd ${.CURDIR}/bin; ${MAKE} install
567 cd ${.CURDIR}/sbin; ${MAKE} install
568 cd ${.CURDIR}/libexec; ${MAKE} install
569 cd ${.CURDIR}/usr.bin; ${MAKE} install
570 cd ${.CURDIR}/usr.sbin; ${MAKE} install
571 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} install
572 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} install
575 # ------------------------------------------------------------------------
577 # From here onwards are utility targets used by the 'make world' and
578 # related targets. If your 'world' breaks, you may like to try to fix
579 # the problem and manually run the following targets to attempt to
580 # complete the build. Beware, this is *not* guaranteed to work, you
581 # need to have a pretty good grip on the current state of the system
582 # to attempt to manually finish it. If in doubt, 'make world' again.
586 # bootstrap-tools: Build tools needed for compatibility
588 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
589 _strfile= games/fortune/strfile
593 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef \
594 usr.bin/xargs usr.bin/xinstall \
595 usr.sbin/config usr.sbin/kbdcontrol \
596 gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo
597 cd ${.CURDIR}/${_tool}; \
601 ${MAKE} DESTDIR=${MAKEOBJDIRPREFIX} install
605 # build-tools: Build special purpose build tools
607 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
608 _games= games/adventure games/hack games/phantasia
611 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
612 _share= share/syscons/scrnmaps
615 .if !defined(NO_FORTRAN)
616 _fortran= gnu/usr.bin/cc/f771
619 .if !defined(NOPERL) && !defined(NO_PERL)
620 _perl= gnu/usr.bin/perl/miniperl
623 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
624 !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
625 _libroken4= kerberosIV/lib/libroken
628 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
629 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
630 _libkrb5= kerberos5/lib/libroken kerberos5/lib/libvers \
631 kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
635 .for _tool in bin/csh bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
636 ${_perl} ${_libroken4} ${_libkrb5} lib/libncurses ${_share} \
637 usr.bin/awk usr.bin/file usr.sbin/sysinstall
638 cd ${.CURDIR}/${_tool}; ${MAKE} build-tools
642 # cross-tools: Build cross-building tools
644 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
645 _elf2exe= usr.sbin/elf2exe
648 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
649 _btxld= usr.sbin/btxld
652 _xlint= usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint
655 .for _tool in ${_btxld} ${_elf2exe} \
656 gnu/usr.bin/binutils usr.bin/objformat gnu/usr.bin/cc ${_xlint}
657 cd ${.CURDIR}/${_tool}; \
661 ${MAKE} DESTDIR=${MAKEOBJDIRPREFIX} install
665 # hierarchy - ensure that all the needed directories are present
668 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
671 # includes - possibly generate and install the include files.
674 cd ${.CURDIR}/include; ${MAKE} -B all install
675 cd ${.CURDIR}/gnu/include; ${MAKE} install
676 cd ${.CURDIR}/gnu/lib/libobjc; ${MAKE} beforeinstall
677 cd ${.CURDIR}/gnu/lib/libreadline/readline; ${MAKE} beforeinstall
678 cd ${.CURDIR}/gnu/lib/libregex; ${MAKE} beforeinstall
679 cd ${.CURDIR}/gnu/lib/libstdc++; ${MAKE} beforeinstall
680 cd ${.CURDIR}/gnu/lib/libdialog; ${MAKE} beforeinstall
681 cd ${.CURDIR}/gnu/usr.bin/cc/cc1plus; ${MAKE} beforeinstall
682 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
683 .if exists(${.CURDIR}/secure/lib/libcrypto)
684 cd ${.CURDIR}/secure/lib/libcrypto; ${MAKE} beforeinstall
686 .if exists(${.CURDIR}/secure/lib/libssl)
687 cd ${.CURDIR}/secure/lib/libssl; ${MAKE} beforeinstall
690 .if exists(${.CURDIR}/kerberosIV) && !defined(NOCRYPT) && \
691 defined(MAKE_KERBEROS4)
692 cd ${.CURDIR}/kerberosIV/lib/libacl; ${MAKE} beforeinstall
693 cd ${.CURDIR}/kerberosIV/lib/libkadm; ${MAKE} beforeinstall
694 cd ${.CURDIR}/kerberosIV/lib/libkafs; ${MAKE} beforeinstall
695 cd ${.CURDIR}/kerberosIV/lib/libkdb; ${MAKE} beforeinstall
696 cd ${.CURDIR}/kerberosIV/lib/libkrb; ${MAKE} beforeinstall
697 cd ${.CURDIR}/kerberosIV/lib/libtelnet; ${MAKE} beforeinstall
698 .elif exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
699 cd ${.CURDIR}/secure/lib/libtelnet; ${MAKE} beforeinstall
701 cd ${.CURDIR}/lib/libtelnet; ${MAKE} beforeinstall
703 .if exists(${.CURDIR}/kerberos5) && !defined(NOCRYPT) && \
704 defined(MAKE_KERBEROS5)
705 cd ${.CURDIR}/kerberos5/lib/libasn1; ${MAKE} beforeinstall
706 cd ${.CURDIR}/kerberos5/lib/libhdb; ${MAKE} beforeinstall
707 cd ${.CURDIR}/kerberos5/lib/libkadm5clnt; ${MAKE} beforeinstall
708 cd ${.CURDIR}/kerberos5/lib/libkadm5srv; ${MAKE} beforeinstall
709 cd ${.CURDIR}/kerberos5/lib/libkafs5; ${MAKE} beforeinstall
710 cd ${.CURDIR}/kerberos5/lib/libkrb5; ${MAKE} beforeinstall
711 cd ${.CURDIR}/kerberos5/lib/libsl; ${MAKE} beforeinstall
713 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH})
714 cd ${.CURDIR}/lib/csu/${MACHINE_ARCH}; ${MAKE} beforeinstall
716 cd ${.CURDIR}/gnu/lib/csu; ${MAKE} beforeinstall
717 cd ${.CURDIR}/lib/libalias; ${MAKE} beforeinstall
718 cd ${.CURDIR}/lib/libatm; ${MAKE} beforeinstall
719 cd ${.CURDIR}/lib/libdevstat; ${MAKE} beforeinstall
720 cd ${.CURDIR}/lib/libc; ${MAKE} beforeinstall
721 cd ${.CURDIR}/lib/libcalendar; ${MAKE} beforeinstall
722 cd ${.CURDIR}/lib/libcam; ${MAKE} beforeinstall
723 cd ${.CURDIR}/lib/libdisk; ${MAKE} beforeinstall
724 cd ${.CURDIR}/lib/libedit; ${MAKE} beforeinstall
725 cd ${.CURDIR}/lib/libfetch; ${MAKE} beforeinstall
726 cd ${.CURDIR}/lib/libftpio; ${MAKE} beforeinstall
727 cd ${.CURDIR}/lib/libkvm; ${MAKE} beforeinstall
728 cd ${.CURDIR}/lib/libmd; ${MAKE} beforeinstall
729 cd ${.CURDIR}/lib/libmp; ${MAKE} beforeinstall
730 cd ${.CURDIR}/lib/msun; ${MAKE} beforeinstall
731 cd ${.CURDIR}/lib/libncp; ${MAKE} beforeinstall
732 cd ${.CURDIR}/lib/libncurses; ${MAKE} beforeinstall
733 cd ${.CURDIR}/lib/libnetgraph; ${MAKE} beforeinstall
734 cd ${.CURDIR}/lib/libopie; ${MAKE} beforeinstall
735 cd ${.CURDIR}/lib/libpcap; ${MAKE} beforeinstall
736 cd ${.CURDIR}/lib/libradius; ${MAKE} beforeinstall
737 cd ${.CURDIR}/lib/librpcsvc; ${MAKE} beforeinstall
738 cd ${.CURDIR}/lib/libpam/libpam; ${MAKE} beforeinstall
739 cd ${.CURDIR}/lib/libsbuf; ${MAKE} beforeinstall
740 cd ${.CURDIR}/lib/libstand; ${MAKE} beforeinstall
741 cd ${.CURDIR}/lib/libtacplus; ${MAKE} beforeinstall
742 cd ${.CURDIR}/lib/libcom_err; ${MAKE} beforeinstall
743 cd ${.CURDIR}/lib/libusbhid; ${MAKE} beforeinstall
744 cd ${.CURDIR}/lib/libutil; ${MAKE} beforeinstall
745 cd ${.CURDIR}/lib/libvgl; ${MAKE} beforeinstall
746 cd ${.CURDIR}/lib/libwrap; ${MAKE} beforeinstall
747 cd ${.CURDIR}/lib/libypclnt; ${MAKE} beforeinstall
748 cd ${.CURDIR}/lib/libz; ${MAKE} beforeinstall
749 cd ${.CURDIR}/usr.bin/lex; ${MAKE} beforeinstall
752 # libraries - build all libraries, and install them under ${DESTDIR}.
754 # The list of libraries with dependents (${_prebuild_libs}) and their
755 # interdependencies (__L) are built automatically by the
756 # ${.CURDIR}/tools/make_libdeps.sh script.
760 ${MAKE} -f Makefile.inc1 _startup_libs; \
761 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
762 ${MAKE} -f Makefile.inc1 _generic_libs;
764 # These dependencies are not automatically generated:
766 # gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all
767 # shared libraries for ELF.
769 _startup_libs= gnu/lib/csu gnu/lib/libgcc
770 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-${OBJFORMAT})
771 _startup_libs+= lib/csu/${MACHINE_ARCH}-${OBJFORMAT}
773 _startup_libs+= lib/csu/${MACHINE_ARCH}
778 _generic_libs= gnu/lib
780 .if !defined(NOPERL) && !defined(NO_PERL)
781 _generic_libs+= gnu/usr.bin/perl/libperl
784 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
785 _prebuild_libs+= kerberos5/lib/libasn1
786 _prebuild_libs+= kerberos5/lib/libgssapi
787 _prebuild_libs+= kerberos5/lib/libkrb5
788 _prebuild_libs+= kerberos5/lib/libroken
789 _generic_libs+= kerberos5/lib
792 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
793 _prebuild_libs+= kerberosIV/lib/libkrb
794 kerberosIV/lib/libkrb__L: lib/libcrypt__L
795 _generic_libs+= kerberosIV/lib
798 _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libkvm lib/libmd \
799 lib/libncurses lib/libopie lib/libradius lib/librpcsvc \
800 lib/libsbuf lib/libtacplus lib/libutil lib/libypclnt \
803 lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
804 lib/libypclnt__L: lib/librpcsvc__L
808 .if !defined(NOCRYPT) && !defined(NOSECURE)
809 _prebuild_libs+= secure/lib/libcrypto
810 .if !defined(NO_OPENSSH)
811 _prebuild_libs+= secure/lib/libssh
812 secure/lib/libssh__L: secure/lib/libcrypto__L lib/libz__L
814 _generic_libs+= secure/lib
817 _generic_libs+= usr.bin/lex/lib
819 .if ${MACHINE_ARCH} == "i386"
820 _generic_libs+= usr.sbin/pcvt/keycap
823 .for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
825 .if exists(${.CURDIR}/${_lib})
826 cd ${.CURDIR}/${_lib}; \
833 _startup_libs: ${_startup_libs:S/$/__L/}
834 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
835 _generic_libs: ${_generic_libs:S/$/__L/}
837 .for __target in clean cleandepend cleandir depend obj
838 .for entry in ${SUBDIR}
839 ${entry}.${__target}__D: .PHONY
840 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
841 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
842 edir=${entry}.${MACHINE_ARCH}; \
843 cd ${.CURDIR}/$${edir}; \
845 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
847 cd ${.CURDIR}/$${edir}; \
849 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
851 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
854 .include <bsd.subdir.mk>