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_PORTSUPDATE do not update ports in ${MAKE} update
21 # -DNO_DOCUPDATE do not update doc in ${MAKE} update
22 # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
23 # TARGET_ARCH="arch" to crossbuild world to a different arch
26 # The intended user-driven targets are:
27 # buildworld - rebuild *everything*, including glue to help do upgrades
28 # installworld- install everything built by "buildworld"
29 # update - convenient way to update your source tree (eg: sup/cvs)
30 # most - build user commands, no libraries or include files
31 # installmost - install user commands, no libraries or include files
33 # Standard targets (not defined here) are documented in the makefiles in
34 # /usr/share/mk. These include:
35 # obj depend all install clean cleandepend cleanobj
37 # Put initial settings here.
40 # We must do share/info early so that installation of info `dir'
41 # entries works correctly. Do it first since it is less likely to
42 # grow dependencies on include and lib than vice versa.
43 .if exists(${.CURDIR}/share/info)
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}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
80 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
83 .if exists(${.CURDIR}/sys)
86 .if exists(${.CURDIR}/usr.bin)
89 .if exists(${.CURDIR}/usr.sbin)
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(SUBDIR_OVERRIDE)
109 SUBDIR= ${SUBDIR_OVERRIDE}
112 .if defined(NOCLEANDIR)
113 CLEANDIR= clean cleandepend
119 SUP?= /usr/local/bin/cvsup
120 SUPFLAGS?= -g -L 2 -P -
122 SUPFLAGS+= -h ${SUPHOST}
125 MAKEOBJDIRPREFIX?= /usr/obj
126 TARGET_ARCH?= ${MACHINE_ARCH}
127 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
129 TARGET_CPUTYPE?=${CPUTYPE}
131 TARGET?= ${TARGET_ARCH}
134 .if !empty(TARGET_CPUTYPE)
135 _TARGET_CPUTYPE=${TARGET_CPUTYPE}
137 _TARGET_CPUTYPE=dummy
139 _CPUTYPE!= ${MAKE} -f /dev/null -m ${.CURDIR}/share/mk \
140 CPUTYPE=${_TARGET_CPUTYPE} -V CPUTYPE
141 .if ${_CPUTYPE} != ${_TARGET_CPUTYPE}
142 .error CPUTYPE global should be set with ?=.
145 BUILD_ARCH!= sysctl -n hw.machine_arch
146 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
147 .error To cross-build, set TARGET_ARCH.
150 .if ${MACHINE} == ${TARGET}
151 OBJTREE= ${MAKEOBJDIRPREFIX}
153 OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}
155 WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH}
156 # /usr/games added for fortune which depend on strfile
157 STRICTTMPPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
158 TMPPATH= ${STRICTTMPPATH}:${PATH}
160 INSTALLTMP!= /usr/bin/mktemp -d -u -t install
163 # Building a world goes through the following stages
165 # 1. bootstrap-tool stage [BMAKE]
166 # This stage is responsible for creating programs that
167 # are needed for backward compatibility reasons. They
168 # are not built as cross-tools.
169 # 2. build-tool stage [TMAKE]
170 # This stage is responsible for creating the object
171 # tree and building any tools that are needed during
173 # 3. cross-tool stage [XMAKE]
174 # This stage is responsible for creating any tools that
175 # are needed for cross-builds. A cross-compiler is one
177 # 4. world stage [WMAKE]
178 # This stage actually builds the world.
179 # 5. install stage (optional) [IMAKE]
180 # This stage installs a previously built world.
183 # Common environment for world related stages
184 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
185 MACHINE_ARCH=${TARGET_ARCH} \
187 CPUTYPE=${TARGET_CPUTYPE} \
188 GROFF_BIN_PATH=${WORLDTMP}/usr/bin \
189 GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \
190 GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac
192 # bootstrap-tool stage
193 BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
195 INSTALL="sh ${.CURDIR}/tools/install.sh"
196 BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
197 -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
198 -DNO_CPU_CFLAGS -DNO_WERROR
201 TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
203 INSTALL="sh ${.CURDIR}/tools/install.sh"
204 TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
208 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB
211 WMAKEENV= ${CROSSENV} \
212 DESTDIR=${WORLDTMP} \
213 INSTALL="sh ${.CURDIR}/tools/install.sh" \
215 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
218 IMAKEENV= ${CROSSENV} \
219 PATH=${STRICTTMPPATH}:${INSTALLTMP}
220 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
223 KMAKEENV= ${WMAKEENV}
225 USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \
226 usr/libexec usr/sbin usr/share/misc \
228 usr/share/groff_font/devX100 \
229 usr/share/groff_font/devX100-12 \
230 usr/share/groff_font/devX75 \
231 usr/share/groff_font/devX75-12 \
232 usr/share/groff_font/devascii \
233 usr/share/groff_font/devcp1047 \
234 usr/share/groff_font/devdvi \
235 usr/share/groff_font/devhtml \
236 usr/share/groff_font/devkoi8-r \
237 usr/share/groff_font/devlatin1 \
238 usr/share/groff_font/devlbp \
239 usr/share/groff_font/devlj4 \
240 usr/share/groff_font/devps \
241 usr/share/groff_font/devutf8 \
242 usr/share/tmac/mdoc usr/share/tmac/mm
244 INCDIRS= arpa dev fs g++/backward g++/bits g++/ext isc isofs libmilter \
245 objc openssl protocols readline rpc rpcsvc security ufs
250 # Attempt to rebuild the entire system, with reasonable chance of
251 # success, regardless of how old your existing system is.
255 @echo "--------------------------------------------------------------"
256 @echo ">>> Rebuilding the temporary build tree"
257 @echo "--------------------------------------------------------------"
258 .if !defined(NOCLEAN)
261 # XXX - These two can depend on any header file.
262 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
263 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
265 .for _dir in ${USRDIRS}
266 mkdir -p ${WORLDTMP}/${_dir}
268 .for _dir in ${INCDIRS}
269 mkdir -p ${WORLDTMP}/usr/include/${_dir}
271 ln -sf ${.CURDIR}/sys ${WORLDTMP}
274 @echo "--------------------------------------------------------------"
275 @echo ">>> stage 1: bootstrap tools"
276 @echo "--------------------------------------------------------------"
277 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
279 .if !defined(NOCLEAN)
281 @echo "--------------------------------------------------------------"
282 @echo ">>> stage 2: cleaning up the object tree"
283 @echo "--------------------------------------------------------------"
284 cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
288 @echo "--------------------------------------------------------------"
289 @echo ">>> stage 2: rebuilding the object tree"
290 @echo "--------------------------------------------------------------"
291 cd ${.CURDIR}; ${WMAKE} par-obj
294 @echo "--------------------------------------------------------------"
295 @echo ">>> stage 2: build tools"
296 @echo "--------------------------------------------------------------"
297 cd ${.CURDIR}; ${TMAKE} build-tools
300 @echo "--------------------------------------------------------------"
301 @echo ">>> stage 3: cross tools"
302 @echo "--------------------------------------------------------------"
303 cd ${.CURDIR}; ${XMAKE} cross-tools
306 @echo "--------------------------------------------------------------"
307 @echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
308 @echo "--------------------------------------------------------------"
309 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
312 @echo "--------------------------------------------------------------"
313 @echo ">>> stage 4: building libraries"
314 @echo "--------------------------------------------------------------"
315 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
318 @echo "--------------------------------------------------------------"
319 @echo ">>> stage 4: make dependencies"
320 @echo "--------------------------------------------------------------"
321 cd ${.CURDIR}; ${WMAKE} par-depend
324 @echo "--------------------------------------------------------------"
325 @echo ">>> stage 4: building everything.."
326 @echo "--------------------------------------------------------------"
327 cd ${.CURDIR}; ${WMAKE} all
331 .if !defined(SUBDIR_OVERRIDE)
332 WMAKE_TGTS+= _worldtmp _bootstrap-tools
334 WMAKE_TGTS+= _cleanobj _obj _build-tools
335 .if !defined(SUBDIR_OVERRIDE)
336 WMAKE_TGTS+= _cross-tools
338 WMAKE_TGTS+= _includes _libraries _depend everything
340 buildworld: ${WMAKE_TGTS}
341 .ORDER: ${WMAKE_TGTS}
346 # Checks to be sure system is ready for installworld
349 .if !defined(NO_SENDMAIL)
350 @if ! `grep -q '^smmsp:' /etc/passwd`; then \
351 echo "ERROR: Required smmsp user is missing, see /usr/src/UPDATING."; \
354 @if ! `grep -q '^smmsp:' /etc/group`; then \
355 echo "ERROR: Required smmsp group is missing, see /usr/src/UPDATING."; \
363 # Distributes everything compiled by a `buildworld'.
367 # Installs everything compiled by a 'buildworld'.
369 distributeworld installworld: installcheck
370 mkdir -p ${INSTALLTMP}
371 for prog in [ awk cat chflags chmod chown date echo egrep find grep \
372 ln make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
373 test true uname wc zic; do \
374 cp `which $$prog` ${INSTALLTMP}; \
376 cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
382 # If you have a build server, you can NFS mount the source and obj directories
383 # and do a 'make reinstall' on the *client* to install new binaries from the
384 # most recent server build.
387 @echo "--------------------------------------------------------------"
388 @echo ">>> Making hierarchy"
389 @echo "--------------------------------------------------------------"
390 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
392 @echo "--------------------------------------------------------------"
393 @echo ">>> Installing everything.."
394 @echo "--------------------------------------------------------------"
395 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
396 .if !defined(NOMAN) && !defined(NO_MAKEDB_RUN)
398 @echo "--------------------------------------------------------------"
399 @echo ">>> Rebuilding man page indices"
400 @echo "--------------------------------------------------------------"
401 cd ${.CURDIR}/share/man; ${MAKE} makedb
405 @echo "--------------------------------------------------------------"
406 @echo ">>> Distributing everything.."
407 @echo "--------------------------------------------------------------"
408 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
411 # buildkernel and installkernel
413 # Which kernels to build and/or install is specified by setting
414 # KERNCONF. If not defined a GENERIC kernel is built/installed.
415 # Only the existing (depending TARGET) config files are used
416 # for building kernels and only the first of these is designated
417 # as the one being installed.
419 # Note that we have to use TARGET instead of TARGET_ARCH when
420 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
421 # be set to cross-build, we have to make sure TARGET is set
424 .if !defined(KERNCONF) && defined(KERNEL)
430 INSTKERNNAME?= kernel
432 KRNLSRCDIR= ${.CURDIR}/sys
433 KRNLCONFDIR= ${KRNLSRCDIR}/${TARGET}/conf
434 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
435 KERNCONFDIR?= ${KRNLCONFDIR}
439 .for _kernel in ${KERNCONF}
440 .if exists(${KERNCONFDIR}/${_kernel})
441 BUILDKERNELS+= ${_kernel}
442 .if empty(INSTALLKERNEL)
443 INSTALLKERNEL= ${_kernel}
451 # Builds all kernels defined by BUILDKERNELS.
454 .if empty(BUILDKERNELS)
455 @echo ">>> ERROR: Missing kernel configuration file(s) (${KERNCONF})."
458 .if defined(KERNWARN)
459 @echo "--------------------------------------------------------------"
460 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
461 @echo "--------------------------------------------------------------"
465 .for _kernel in ${BUILDKERNELS}
466 @echo "--------------------------------------------------------------"
467 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
468 @echo "--------------------------------------------------------------"
469 @echo "===> ${_kernel}"
470 mkdir -p ${KRNLOBJDIR}
471 .if !defined(NO_KERNELCONFIG)
474 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
475 ${KERNCONFDIR}/${_kernel}
477 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
478 cd ${KRNLOBJDIR}/${_kernel}; \
479 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} -DNO_MODULES clean
480 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KRNLSRCDIR}/modules)
481 cd ${KRNLOBJDIR}/${_kernel}; \
482 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} cleandir
485 cd ${KRNLOBJDIR}/${_kernel}; \
486 MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx/aicasm \
487 ${MAKE} -DNO_CPU_CFLAGS -f ${KRNLSRCDIR}/dev/aic7xxx/aicasm/Makefile
488 .if !defined(NO_KERNELDEPEND)
489 cd ${KRNLOBJDIR}/${_kernel}; \
490 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
492 cd ${KRNLOBJDIR}/${_kernel}; \
493 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all
494 @echo "--------------------------------------------------------------"
495 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
496 @echo "--------------------------------------------------------------"
502 # Install the kernel defined by INSTALLKERNEL
504 installkernel reinstallkernel:
505 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
506 ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
511 # Update the source tree, by running sup and/or running cvs to update to the
515 .if defined(SUP_UPDATE)
516 @echo "--------------------------------------------------------------"
517 @echo ">>> Running ${SUP}"
518 @echo "--------------------------------------------------------------"
520 @${SUP} ${SUPFLAGS} ${SUPFILE}
522 .if defined(SUPFILE1)
523 @${SUP} ${SUPFLAGS} ${SUPFILE1}
525 .if defined(SUPFILE2)
526 @${SUP} ${SUPFLAGS} ${SUPFILE2}
528 .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
529 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
531 .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
532 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
535 .if defined(CVS_UPDATE)
536 @echo "--------------------------------------------------------------"
537 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
538 @echo "--------------------------------------------------------------"
539 cd ${.CURDIR}; ${CVS} -q update -A -P -d
545 # Build most of the user binaries on the existing system libs and includes.
548 @echo "--------------------------------------------------------------"
549 @echo ">>> Building programs only"
550 @echo "--------------------------------------------------------------"
551 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/usr.bin gnu/usr.sbin
552 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ all
558 # Install the binaries built by the 'most' target. This does not include
559 # libraries or include files.
562 @echo "--------------------------------------------------------------"
563 @echo ">>> Installing programs only"
564 @echo "--------------------------------------------------------------"
565 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/usr.bin gnu/usr.sbin
566 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ install
570 # ------------------------------------------------------------------------
572 # From here onwards are utility targets used by the 'make world' and
573 # related targets. If your 'world' breaks, you may like to try to fix
574 # the problem and manually run the following targets to attempt to
575 # complete the build. Beware, this is *not* guaranteed to work, you
576 # need to have a pretty good grip on the current state of the system
577 # to attempt to manually finish it. If in doubt, 'make world' again.
581 # bootstrap-tools: Build tools needed for compatibility
583 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
584 _strfile= games/fortune/strfile
588 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef \
589 usr.bin/makewhatis usr.bin/rpcgen usr.bin/uudecode \
590 usr.bin/xargs usr.bin/xinstall \
591 usr.sbin/config usr.sbin/kbdcontrol \
592 gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo
593 ${ECHODIR} "===> ${_tool}"; \
594 cd ${.CURDIR}/${_tool}; \
595 ${MAKE} DIRPRFX=${_tool}/ obj; \
596 ${MAKE} DIRPRFX=${_tool}/ depend; \
597 ${MAKE} DIRPRFX=${_tool}/ all; \
598 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
602 # build-tools: Build special purpose build tools
604 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
605 _share= share/syscons/scrnmaps
608 .if !defined(NO_FORTRAN)
609 _fortran= gnu/usr.bin/cc/f771
612 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
613 !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
614 _libroken4= kerberosIV/lib/libroken
617 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
618 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
619 _libkrb5= kerberos5/lib/libroken kerberos5/lib/libvers \
620 kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
624 .for _tool in bin/csh bin/sh gnu/usr.bin/cc/cc_tools ${_fortran} \
625 ${_libroken4} ${_libkrb5} lib/libncurses ${_share} \
626 usr.bin/awk usr.bin/file usr.sbin/sysinstall
627 ${ECHODIR} "===> ${_tool}"; \
628 cd ${.CURDIR}/${_tool}; ${MAKE} DIRPRFX=${_tool}/ build-tools
632 # cross-tools: Build cross-building tools
634 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
635 _elf2exe= usr.sbin/elf2exe
638 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
639 _btxld= usr.sbin/btxld
642 .if ${TARGET_ARCH} == "sparc64"
643 _elf2aout= usr.sbin/elf2aout
646 _xlint= usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint
649 .for _tool in ${_btxld} ${_elf2aout} ${_elf2exe} \
650 gnu/usr.bin/binutils usr.sbin/crunch/crunchide \
651 gnu/usr.bin/cc ${_xlint}
652 ${ECHODIR} "===> ${_tool}"; \
653 cd ${.CURDIR}/${_tool}; \
654 ${MAKE} DIRPRFX=${_tool}/ obj; \
655 ${MAKE} DIRPRFX=${_tool}/ depend; \
656 ${MAKE} DIRPRFX=${_tool}/ all; \
657 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
661 # hierarchy - ensure that all the needed directories are present
664 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
667 # libraries - build all libraries, and install them under ${DESTDIR}.
669 # The list of libraries with dependents (${_prebuild_libs}) and their
670 # interdependencies (__L) are built automatically by the
671 # ${.CURDIR}/tools/make_libdeps.sh script.
675 ${MAKE} -f Makefile.inc1 _startup_libs; \
676 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
677 ${MAKE} -f Makefile.inc1 _generic_libs;
679 # These dependencies are not automatically generated:
681 # gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all
682 # shared libraries for ELF.
684 _startup_libs= gnu/lib/csu gnu/lib/libgcc
685 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
686 _startup_libs+= lib/csu/${MACHINE_ARCH}-elf
688 _startup_libs+= lib/csu/${MACHINE_ARCH}
693 _generic_libs= gnu/lib
695 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
696 _prebuild_libs+= kerberos5/lib/libasn1
697 _prebuild_libs+= kerberos5/lib/libgssapi
698 _prebuild_libs+= kerberos5/lib/libkrb5
699 _prebuild_libs+= kerberos5/lib/libroken
700 _generic_libs+= kerberos5/lib
703 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
704 _prebuild_libs+= kerberosIV/lib/libkrb
705 kerberosIV/lib/libkrb__L: lib/libcrypt__L
706 _generic_libs+= kerberosIV/lib
709 _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libkvm lib/libmd \
710 lib/libncurses lib/libopie lib/libradius lib/librpcsvc \
711 lib/libsbuf lib/libtacplus lib/libutil lib/libypclnt \
714 lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
715 lib/libypclnt__L: lib/librpcsvc__L
719 .if !defined(NOCRYPT) && !defined(NOSECURE)
720 .if !defined(NO_OPENSSL)
721 _prebuild_libs+= secure/lib/libcrypto secure/lib/libssl
722 .if !defined(NO_OPENSSH)
723 _prebuild_libs+= secure/lib/libssh
724 secure/lib/libssh__L: secure/lib/libcrypto__L lib/libz__L
727 _generic_libs+= secure/lib
730 _generic_libs+= usr.bin/lex/lib
732 .if ${MACHINE_ARCH} == "i386"
733 _generic_libs+= usr.sbin/pcvt/keycap
736 .for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
738 .if exists(${.CURDIR}/${_lib})
739 ${ECHODIR} "===> ${_lib}"; \
740 cd ${.CURDIR}/${_lib}; \
741 ${MAKE} DIRPRFX=${_lib}/ depend; \
742 ${MAKE} DIRPRFX=${_lib}/ all; \
743 ${MAKE} DIRPRFX=${_lib}/ install
747 _startup_libs: ${_startup_libs:S/$/__L/}
748 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
749 _generic_libs: ${_generic_libs:S/$/__L/}
751 .for __target in clean cleandepend cleandir depend includes 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>