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 _CPUTYPE!= ${MAKE} -f /dev/null -m ${.CURDIR}/share/mk \
135 CPUTYPE=X${TARGET_CPUTYPE} -V CPUTYPE
136 .if ${_CPUTYPE} != X${TARGET_CPUTYPE}
137 .error CPUTYPE global should be set with ?=.
140 BUILD_ARCH!= sysctl -n hw.machine_arch
141 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
142 .error To cross-build, set TARGET_ARCH.
145 .if ${MACHINE} == ${TARGET}
146 OBJTREE= ${MAKEOBJDIRPREFIX}
148 OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}
150 WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH}
151 # /usr/games added for fortune which depend on strfile
152 STRICTTMPPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
153 TMPPATH= ${STRICTTMPPATH}:${PATH}
154 OBJFORMAT_PATH?= /usr/libexec
156 INSTALLTMP!= /usr/bin/mktemp -d -u -t install
159 # Building a world goes through the following stages
161 # 1. bootstrap-tool stage [BMAKE]
162 # This stage is responsible for creating programs that
163 # are needed for backward compatibility reasons. They
164 # are not built as cross-tools.
165 # 2. build-tool stage [TMAKE]
166 # This stage is responsible for creating the object
167 # tree and building any tools that are needed during
169 # 3. cross-tool stage [XMAKE]
170 # This stage is responsible for creating any tools that
171 # are needed for cross-builds. A cross-compiler is one
173 # 4. world stage [WMAKE]
174 # This stage actually builds the world.
175 # 5. install stage (optional) [IMAKE]
176 # This stage installs a previously built world.
179 # Common environment for world related stages
180 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
181 MACHINE_ARCH=${TARGET_ARCH} \
183 CPUTYPE=${TARGET_CPUTYPE} \
184 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
185 GROFF_BIN_PATH=${WORLDTMP}/usr/bin \
186 GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \
187 GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac
189 # bootstrap-tool stage
190 BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
192 INSTALL="sh ${.CURDIR}/tools/install.sh"
193 BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
194 -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
195 -DNO_CPU_CFLAGS -DNO_WERROR
198 TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
200 INSTALL="sh ${.CURDIR}/tools/install.sh"
201 TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
205 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB
208 WMAKEENV= ${CROSSENV} \
209 DESTDIR=${WORLDTMP} \
210 INSTALL="sh ${.CURDIR}/tools/install.sh" \
212 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
215 IMAKEENV= ${CROSSENV} \
216 PATH=${STRICTTMPPATH}:${INSTALLTMP}
217 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
220 KMAKEENV= ${WMAKEENV} \
221 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec:${OBJFORMAT_PATH}
223 USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \
224 usr/libexec/${OBJFORMAT} usr/sbin usr/share/misc \
226 usr/share/groff_font/devX100 \
227 usr/share/groff_font/devX100-12 \
228 usr/share/groff_font/devX75 \
229 usr/share/groff_font/devX75-12 \
230 usr/share/groff_font/devascii \
231 usr/share/groff_font/devcp1047 \
232 usr/share/groff_font/devdvi \
233 usr/share/groff_font/devhtml \
234 usr/share/groff_font/devkoi8-r \
235 usr/share/groff_font/devlatin1 \
236 usr/share/groff_font/devlbp \
237 usr/share/groff_font/devlj4 \
238 usr/share/groff_font/devps \
239 usr/share/groff_font/devutf8 \
240 usr/share/tmac/mdoc usr/share/tmac/mm
242 INCDIRS= arpa dev fs g++/backward g++/bits g++/ext isc isofs libmilter \
243 objc openssl protocols readline rpc rpcsvc security ufs
248 # Attempt to rebuild the entire system, with reasonable chance of
249 # success, regardless of how old your existing system is.
253 @echo "--------------------------------------------------------------"
254 @echo ">>> Rebuilding the temporary build tree"
255 @echo "--------------------------------------------------------------"
256 .if !defined(NOCLEAN)
259 # XXX - These two can depend on any header file.
260 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
261 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
263 .for _dir in ${USRDIRS}
264 mkdir -p ${WORLDTMP}/${_dir}
266 .for _dir in ${INCDIRS}
267 mkdir -p ${WORLDTMP}/usr/include/${_dir}
269 ln -sf ${.CURDIR}/sys ${WORLDTMP}
272 @echo "--------------------------------------------------------------"
273 @echo ">>> stage 1: bootstrap tools"
274 @echo "--------------------------------------------------------------"
275 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
277 .if !defined(NOCLEAN)
279 @echo "--------------------------------------------------------------"
280 @echo ">>> stage 2: cleaning up the object tree"
281 @echo "--------------------------------------------------------------"
282 cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
286 @echo "--------------------------------------------------------------"
287 @echo ">>> stage 2: rebuilding the object tree"
288 @echo "--------------------------------------------------------------"
289 cd ${.CURDIR}; ${WMAKE} par-obj
292 @echo "--------------------------------------------------------------"
293 @echo ">>> stage 2: build tools"
294 @echo "--------------------------------------------------------------"
295 cd ${.CURDIR}; ${TMAKE} build-tools
298 @echo "--------------------------------------------------------------"
299 @echo ">>> stage 3: cross tools"
300 @echo "--------------------------------------------------------------"
301 cd ${.CURDIR}; ${XMAKE} cross-tools
304 @echo "--------------------------------------------------------------"
305 @echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
306 @echo "--------------------------------------------------------------"
307 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
310 @echo "--------------------------------------------------------------"
311 @echo ">>> stage 4: building libraries"
312 @echo "--------------------------------------------------------------"
313 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
316 @echo "--------------------------------------------------------------"
317 @echo ">>> stage 4: make dependencies"
318 @echo "--------------------------------------------------------------"
319 cd ${.CURDIR}; ${WMAKE} par-depend
322 @echo "--------------------------------------------------------------"
323 @echo ">>> stage 4: building everything.."
324 @echo "--------------------------------------------------------------"
325 cd ${.CURDIR}; ${WMAKE} all
329 .if !defined(SUBDIR_OVERRIDE)
330 WMAKE_TGTS+= _worldtmp _bootstrap-tools
332 WMAKE_TGTS+= _cleanobj _obj _build-tools
333 .if !defined(SUBDIR_OVERRIDE)
334 WMAKE_TGTS+= _cross-tools
336 WMAKE_TGTS+= _includes _libraries _depend everything
338 buildworld: ${WMAKE_TGTS}
339 .ORDER: ${WMAKE_TGTS}
344 # Checks to be sure system is ready for installworld
347 .if !defined(NO_SENDMAIL)
348 @if ! `grep -q '^smmsp:' /etc/passwd`; then \
349 echo "ERROR: Required smmsp user is missing, see /usr/src/UPDATING."; \
352 @if ! `grep -q '^smmsp:' /etc/group`; then \
353 echo "ERROR: Required smmsp group is missing, see /usr/src/UPDATING."; \
361 # Distributes everything compiled by a `buildworld'.
365 # Installs everything compiled by a 'buildworld'.
367 distributeworld installworld: installcheck
368 mkdir -p ${INSTALLTMP}
369 for prog in [ awk cat chflags chmod chown date echo egrep find grep \
370 ln make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
371 test true uname wc zic; do \
372 cp `which $$prog` ${INSTALLTMP}; \
374 cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
380 # If you have a build server, you can NFS mount the source and obj directories
381 # and do a 'make reinstall' on the *client* to install new binaries from the
382 # most recent server build.
385 @echo "--------------------------------------------------------------"
386 @echo ">>> Making hierarchy"
387 @echo "--------------------------------------------------------------"
388 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
390 @echo "--------------------------------------------------------------"
391 @echo ">>> Installing everything.."
392 @echo "--------------------------------------------------------------"
393 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
394 .if !defined(NOMAN) && !defined(NO_MAKEDB_RUN)
396 @echo "--------------------------------------------------------------"
397 @echo ">>> Rebuilding man page indices"
398 @echo "--------------------------------------------------------------"
399 cd ${.CURDIR}/share/man; ${MAKE} makedb
403 @echo "--------------------------------------------------------------"
404 @echo ">>> Distributing everything.."
405 @echo "--------------------------------------------------------------"
406 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
409 # buildkernel and installkernel
411 # Which kernels to build and/or install is specified by setting
412 # KERNCONF. If not defined a GENERIC kernel is built/installed.
413 # Only the existing (depending TARGET) config files are used
414 # for building kernels and only the first of these is designated
415 # as the one being installed.
417 # Note that we have to use TARGET instead of TARGET_ARCH when
418 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
419 # be set to cross-build, we have to make sure TARGET is set
422 .if !defined(KERNCONF) && defined(KERNEL)
428 INSTKERNNAME?= kernel
430 KRNLSRCDIR= ${.CURDIR}/sys
431 KRNLCONFDIR= ${KRNLSRCDIR}/${TARGET}/conf
432 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
433 KERNCONFDIR?= ${KRNLCONFDIR}
437 .for _kernel in ${KERNCONF}
438 .if exists(${KERNCONFDIR}/${_kernel})
439 BUILDKERNELS+= ${_kernel}
440 .if empty(INSTALLKERNEL)
441 INSTALLKERNEL= ${_kernel}
449 # Builds all kernels defined by BUILDKERNELS.
452 .if empty(BUILDKERNELS)
453 @echo ">>> ERROR: Missing kernel configuration file(s) (${KERNCONF})."
456 .if defined(KERNWARN)
457 @echo "--------------------------------------------------------------"
458 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
459 @echo "--------------------------------------------------------------"
463 .for _kernel in ${BUILDKERNELS}
464 @echo "--------------------------------------------------------------"
465 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
466 @echo "--------------------------------------------------------------"
467 @echo "===> ${_kernel}"
468 mkdir -p ${KRNLOBJDIR}
469 .if !defined(NO_KERNELCONFIG)
472 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
473 ${KERNCONFDIR}/${_kernel}
475 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
476 cd ${KRNLOBJDIR}/${_kernel}; \
477 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} -DNO_MODULES clean
478 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KRNLSRCDIR}/modules)
479 cd ${KRNLOBJDIR}/${_kernel}; \
480 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} cleandir
483 cd ${KRNLOBJDIR}/${_kernel}; \
484 MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx/aicasm \
485 ${MAKE} -DNO_CPU_CFLAGS -f ${KRNLSRCDIR}/dev/aic7xxx/aicasm/Makefile
486 .if !defined(NO_KERNELDEPEND)
487 cd ${KRNLOBJDIR}/${_kernel}; \
488 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
490 cd ${KRNLOBJDIR}/${_kernel}; \
491 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all
492 @echo "--------------------------------------------------------------"
493 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
494 @echo "--------------------------------------------------------------"
500 # Install the kernel defined by INSTALLKERNEL
502 installkernel reinstallkernel:
503 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
504 ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
509 # Update the source tree, by running sup and/or running cvs to update to the
513 .if defined(SUP_UPDATE)
514 @echo "--------------------------------------------------------------"
515 @echo ">>> Running ${SUP}"
516 @echo "--------------------------------------------------------------"
518 @${SUP} ${SUPFLAGS} ${SUPFILE}
520 .if defined(SUPFILE1)
521 @${SUP} ${SUPFLAGS} ${SUPFILE1}
523 .if defined(SUPFILE2)
524 @${SUP} ${SUPFLAGS} ${SUPFILE2}
526 .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
527 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
529 .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
530 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
533 .if defined(CVS_UPDATE)
534 @echo "--------------------------------------------------------------"
535 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
536 @echo "--------------------------------------------------------------"
537 cd ${.CURDIR}; ${CVS} -q update -A -P -d
543 # Build most of the user binaries on the existing system libs and includes.
546 @echo "--------------------------------------------------------------"
547 @echo ">>> Building programs only"
548 @echo "--------------------------------------------------------------"
549 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/usr.bin gnu/usr.sbin
550 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ all
556 # Install the binaries built by the 'most' target. This does not include
557 # libraries or include files.
560 @echo "--------------------------------------------------------------"
561 @echo ">>> Installing programs only"
562 @echo "--------------------------------------------------------------"
563 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/usr.bin gnu/usr.sbin
564 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ install
568 # ------------------------------------------------------------------------
570 # From here onwards are utility targets used by the 'make world' and
571 # related targets. If your 'world' breaks, you may like to try to fix
572 # the problem and manually run the following targets to attempt to
573 # complete the build. Beware, this is *not* guaranteed to work, you
574 # need to have a pretty good grip on the current state of the system
575 # to attempt to manually finish it. If in doubt, 'make world' again.
579 # bootstrap-tools: Build tools needed for compatibility
581 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
582 _strfile= games/fortune/strfile
586 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef \
587 usr.bin/makewhatis usr.bin/rpcgen usr.bin/uudecode \
588 usr.bin/xargs usr.bin/xinstall \
589 usr.sbin/config usr.sbin/kbdcontrol \
590 gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo
591 cd ${.CURDIR}/${_tool}; \
592 ${MAKE} DIRPRFX=${_tool}/ obj; \
593 ${MAKE} DIRPRFX=${_tool}/ depend; \
594 ${MAKE} DIRPRFX=${_tool}/ all; \
595 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
599 # build-tools: Build special purpose build tools
601 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
602 _games= games/adventure games/hack games/phantasia
605 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
606 _share= share/syscons/scrnmaps
609 .if !defined(NO_FORTRAN)
610 _fortran= gnu/usr.bin/cc/f771
613 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
614 !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
615 _libroken4= kerberosIV/lib/libroken
618 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
619 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
620 _libkrb5= kerberos5/lib/libroken kerberos5/lib/libvers \
621 kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
625 .for _tool in bin/csh bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
626 ${_libroken4} ${_libkrb5} lib/libncurses ${_share} \
627 usr.bin/awk usr.bin/file usr.sbin/sysinstall
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.bin/objformat usr.sbin/crunch/crunchide \
651 gnu/usr.bin/cc ${_xlint}
652 cd ${.CURDIR}/${_tool}; \
653 ${MAKE} DIRPRFX=${_tool}/ obj; \
654 ${MAKE} DIRPRFX=${_tool}/ depend; \
655 ${MAKE} DIRPRFX=${_tool}/ all; \
656 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
660 # hierarchy - ensure that all the needed directories are present
663 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
666 # libraries - build all libraries, and install them under ${DESTDIR}.
668 # The list of libraries with dependents (${_prebuild_libs}) and their
669 # interdependencies (__L) are built automatically by the
670 # ${.CURDIR}/tools/make_libdeps.sh script.
674 ${MAKE} -f Makefile.inc1 _startup_libs; \
675 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
676 ${MAKE} -f Makefile.inc1 _generic_libs;
678 # These dependencies are not automatically generated:
680 # gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all
681 # shared libraries for ELF.
683 _startup_libs= gnu/lib/csu gnu/lib/libgcc
684 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-${OBJFORMAT})
685 _startup_libs+= lib/csu/${MACHINE_ARCH}-${OBJFORMAT}
687 _startup_libs+= lib/csu/${MACHINE_ARCH}
692 _generic_libs= gnu/lib
694 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
695 _prebuild_libs+= kerberos5/lib/libasn1
696 _prebuild_libs+= kerberos5/lib/libgssapi
697 _prebuild_libs+= kerberos5/lib/libkrb5
698 _prebuild_libs+= kerberos5/lib/libroken
699 _generic_libs+= kerberos5/lib
702 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
703 _prebuild_libs+= kerberosIV/lib/libkrb
704 kerberosIV/lib/libkrb__L: lib/libcrypt__L
705 _generic_libs+= kerberosIV/lib
708 _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libkvm lib/libmd \
709 lib/libncurses lib/libopie lib/libradius lib/librpcsvc \
710 lib/libsbuf lib/libtacplus lib/libutil lib/libypclnt \
713 lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
714 lib/libypclnt__L: lib/librpcsvc__L
718 .if !defined(NOCRYPT) && !defined(NOSECURE)
719 .if !defined(NO_OPENSSL)
720 _prebuild_libs+= secure/lib/libcrypto secure/lib/libssl
721 .if !defined(NO_OPENSSH)
722 _prebuild_libs+= secure/lib/libssh
723 secure/lib/libssh__L: secure/lib/libcrypto__L lib/libz__L
726 _generic_libs+= secure/lib
729 _generic_libs+= usr.bin/lex/lib
731 .if ${MACHINE_ARCH} == "i386"
732 _generic_libs+= usr.sbin/pcvt/keycap
735 .for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
737 .if exists(${.CURDIR}/${_lib})
738 cd ${.CURDIR}/${_lib}; \
739 ${MAKE} DIRPRFX=${_lib}/ depend; \
740 ${MAKE} DIRPRFX=${_lib}/ all; \
741 ${MAKE} DIRPRFX=${_lib}/ install
745 _startup_libs: ${_startup_libs:S/$/__L/}
746 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
747 _generic_libs: ${_generic_libs:S/$/__L/}
749 .for __target in clean cleandepend cleandir depend includes obj
750 .for entry in ${SUBDIR}
751 ${entry}.${__target}__D: .PHONY
752 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
753 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
754 edir=${entry}.${MACHINE_ARCH}; \
755 cd ${.CURDIR}/$${edir}; \
757 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
759 cd ${.CURDIR}/$${edir}; \
761 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
763 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
766 .include <bsd.subdir.mk>