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!= cd ${.CURDIR}; ${MAKE} CPUTYPE=${TARGET_CPUTYPE} -V CPUTYPE
135 .if ${_CPUTYPE} != ${TARGET_CPUTYPE}
136 .error CPUTYPE global should be set with ?=.
139 BUILD_ARCH!= sysctl -n hw.machine_arch
140 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
141 .error To cross-build, set TARGET_ARCH.
144 .if ${MACHINE} == ${TARGET}
145 OBJTREE= ${MAKEOBJDIRPREFIX}
147 OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}
149 WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH}
150 # /usr/games added for fortune which depend on strfile
151 STRICTTMPPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
152 TMPPATH= ${STRICTTMPPATH}:${PATH}
153 OBJFORMAT_PATH?= /usr/libexec
155 INSTALLTMP!= /usr/bin/mktemp -d -u -t install
158 # Building a world goes through the following stages
160 # 1. bootstrap-tool stage [BMAKE]
161 # This stage is responsible for creating programs that
162 # are needed for backward compatibility reasons. They
163 # are not built as cross-tools.
164 # 2. build-tool stage [TMAKE]
165 # This stage is responsible for creating the object
166 # tree and building any tools that are needed during
168 # 3. cross-tool stage [XMAKE]
169 # This stage is responsible for creating any tools that
170 # are needed for cross-builds. A cross-compiler is one
172 # 4. world stage [WMAKE]
173 # This stage actually builds the world.
174 # 5. install stage (optional) [IMAKE]
175 # This stage installs a previously built world.
178 # Common environment for world related stages
179 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
180 MACHINE_ARCH=${TARGET_ARCH} \
182 CPUTYPE=${TARGET_CPUTYPE} \
183 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
184 GROFF_BIN_PATH=${WORLDTMP}/usr/bin \
185 GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \
186 GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac
188 # bootstrap-tool stage
189 BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
191 INSTALL="sh ${.CURDIR}/tools/install.sh"
192 BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
193 -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
194 -DNO_CPU_CFLAGS -DNO_WERROR
197 TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
199 INSTALL="sh ${.CURDIR}/tools/install.sh"
200 TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
204 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB
207 WMAKEENV= ${CROSSENV} \
208 DESTDIR=${WORLDTMP} \
209 INSTALL="sh ${.CURDIR}/tools/install.sh" \
211 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
214 IMAKEENV= ${CROSSENV} \
215 PATH=${STRICTTMPPATH}:${INSTALLTMP}
216 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
219 KMAKEENV= ${WMAKEENV} \
220 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec:${OBJFORMAT_PATH}
222 USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \
223 usr/libexec/${OBJFORMAT} usr/sbin usr/share/misc \
225 usr/share/groff_font/devX100 \
226 usr/share/groff_font/devX100-12 \
227 usr/share/groff_font/devX75 \
228 usr/share/groff_font/devX75-12 \
229 usr/share/groff_font/devascii \
230 usr/share/groff_font/devcp1047 \
231 usr/share/groff_font/devdvi \
232 usr/share/groff_font/devhtml \
233 usr/share/groff_font/devkoi8-r \
234 usr/share/groff_font/devlatin1 \
235 usr/share/groff_font/devlbp \
236 usr/share/groff_font/devlj4 \
237 usr/share/groff_font/devps \
238 usr/share/groff_font/devutf8 \
239 usr/share/tmac/mdoc usr/share/tmac/mm
241 INCDIRS= arpa dev fs g++/backward g++/bits g++/ext isc isofs libmilter \
242 objc openssl protocols readline rpc rpcsvc security ufs
247 # Attempt to rebuild the entire system, with reasonable chance of
248 # success, regardless of how old your existing system is.
252 @echo "--------------------------------------------------------------"
253 @echo ">>> Rebuilding the temporary build tree"
254 @echo "--------------------------------------------------------------"
255 .if !defined(NOCLEAN)
258 # XXX - These two can depend on any header file.
259 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
260 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
262 .for _dir in ${USRDIRS}
263 mkdir -p ${WORLDTMP}/${_dir}
265 .for _dir in ${INCDIRS}
266 mkdir -p ${WORLDTMP}/usr/include/${_dir}
268 ln -sf ${.CURDIR}/sys ${WORLDTMP}
271 @echo "--------------------------------------------------------------"
272 @echo ">>> stage 1: bootstrap tools"
273 @echo "--------------------------------------------------------------"
274 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
276 .if !defined(NOCLEAN)
278 @echo "--------------------------------------------------------------"
279 @echo ">>> stage 2: cleaning up the object tree"
280 @echo "--------------------------------------------------------------"
281 cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
285 @echo "--------------------------------------------------------------"
286 @echo ">>> stage 2: rebuilding the object tree"
287 @echo "--------------------------------------------------------------"
288 cd ${.CURDIR}; ${WMAKE} par-obj
291 @echo "--------------------------------------------------------------"
292 @echo ">>> stage 2: build tools"
293 @echo "--------------------------------------------------------------"
294 cd ${.CURDIR}; ${TMAKE} build-tools
297 @echo "--------------------------------------------------------------"
298 @echo ">>> stage 3: cross tools"
299 @echo "--------------------------------------------------------------"
300 cd ${.CURDIR}; ${XMAKE} cross-tools
303 @echo "--------------------------------------------------------------"
304 @echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
305 @echo "--------------------------------------------------------------"
306 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
309 @echo "--------------------------------------------------------------"
310 @echo ">>> stage 4: building libraries"
311 @echo "--------------------------------------------------------------"
312 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
315 @echo "--------------------------------------------------------------"
316 @echo ">>> stage 4: make dependencies"
317 @echo "--------------------------------------------------------------"
318 cd ${.CURDIR}; ${WMAKE} par-depend
321 @echo "--------------------------------------------------------------"
322 @echo ">>> stage 4: building everything.."
323 @echo "--------------------------------------------------------------"
324 cd ${.CURDIR}; ${WMAKE} all
328 .if !defined(SUBDIR_OVERRIDE)
329 WMAKE_TGTS+= _worldtmp _bootstrap-tools
331 WMAKE_TGTS+= _cleanobj _obj _build-tools
332 .if !defined(SUBDIR_OVERRIDE)
333 WMAKE_TGTS+= _cross-tools
335 WMAKE_TGTS+= _includes _libraries _depend everything
337 buildworld: ${WMAKE_TGTS}
338 .ORDER: ${WMAKE_TGTS}
343 # Checks to be sure system is ready for installworld
346 .if !defined(NO_SENDMAIL)
347 @if ! `grep -q '^smmsp:' /etc/passwd`; then \
348 echo "ERROR: Required smmsp user is missing, see /usr/src/UPDATING."; \
351 @if ! `grep -q '^smmsp:' /etc/group`; then \
352 echo "ERROR: Required smmsp group is missing, see /usr/src/UPDATING."; \
360 # Distributes everything compiled by a `buildworld'.
364 # Installs everything compiled by a 'buildworld'.
366 distributeworld installworld: installcheck
367 mkdir -p ${INSTALLTMP}
368 for prog in [ awk cat chflags chmod chown date echo egrep find grep \
369 ln make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
370 test true uname wc zic; do \
371 cp `which $$prog` ${INSTALLTMP}; \
373 cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
379 # If you have a build server, you can NFS mount the source and obj directories
380 # and do a 'make reinstall' on the *client* to install new binaries from the
381 # most recent server build.
384 @echo "--------------------------------------------------------------"
385 @echo ">>> Making hierarchy"
386 @echo "--------------------------------------------------------------"
387 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
389 @echo "--------------------------------------------------------------"
390 @echo ">>> Installing everything.."
391 @echo "--------------------------------------------------------------"
392 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
393 .if !defined(NOMAN) && !defined(NO_MAKEDB_RUN)
395 @echo "--------------------------------------------------------------"
396 @echo ">>> Rebuilding man page indices"
397 @echo "--------------------------------------------------------------"
398 cd ${.CURDIR}/share/man; ${MAKE} makedb
402 @echo "--------------------------------------------------------------"
403 @echo ">>> Distributing everything.."
404 @echo "--------------------------------------------------------------"
405 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
408 # buildkernel and installkernel
410 # Which kernels to build and/or install is specified by setting
411 # KERNCONF. If not defined a GENERIC kernel is built/installed.
412 # Only the existing (depending TARGET) config files are used
413 # for building kernels and only the first of these is designated
414 # as the one being installed.
416 # Note that we have to use TARGET instead of TARGET_ARCH when
417 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
418 # be set to cross-build, we have to make sure TARGET is set
421 .if !defined(KERNCONF) && defined(KERNEL)
427 INSTKERNNAME?= kernel
429 KRNLSRCDIR= ${.CURDIR}/sys
430 KRNLCONFDIR= ${KRNLSRCDIR}/${TARGET}/conf
431 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
432 KERNCONFDIR?= ${KRNLCONFDIR}
436 .for _kernel in ${KERNCONF}
437 .if exists(${KERNCONFDIR}/${_kernel})
438 BUILDKERNELS+= ${_kernel}
439 .if empty(INSTALLKERNEL)
440 INSTALLKERNEL= ${_kernel}
448 # Builds all kernels defined by BUILDKERNELS.
451 .if empty(BUILDKERNELS)
452 @echo ">>> ERROR: Missing kernel configuration file(s) (${KERNCONF})."
455 .if defined(KERNWARN)
456 @echo "--------------------------------------------------------------"
457 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
458 @echo "--------------------------------------------------------------"
462 .for _kernel in ${BUILDKERNELS}
463 @echo "--------------------------------------------------------------"
464 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
465 @echo "--------------------------------------------------------------"
466 @echo "===> ${_kernel}"
467 mkdir -p ${KRNLOBJDIR}
468 .if !defined(NO_KERNELCONFIG)
471 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
472 ${KERNCONFDIR}/${_kernel}
474 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
475 cd ${KRNLOBJDIR}/${_kernel}; \
476 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} -DNO_MODULES clean
477 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KRNLSRCDIR}/modules)
478 cd ${KRNLOBJDIR}/${_kernel}; \
479 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} cleandir
482 cd ${KRNLOBJDIR}/${_kernel}; \
483 MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx/aicasm \
484 ${MAKE} -DNO_CPU_CFLAGS -f ${KRNLSRCDIR}/dev/aic7xxx/aicasm/Makefile
485 .if !defined(NO_KERNELDEPEND)
486 cd ${KRNLOBJDIR}/${_kernel}; \
487 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
489 cd ${KRNLOBJDIR}/${_kernel}; \
490 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all
491 @echo "--------------------------------------------------------------"
492 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
493 @echo "--------------------------------------------------------------"
499 # Install the kernel defined by INSTALLKERNEL
501 installkernel reinstallkernel:
502 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
503 ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
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 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/usr.bin gnu/usr.sbin
549 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ all
555 # Install the binaries built by the 'most' target. This does not include
556 # libraries or include files.
559 @echo "--------------------------------------------------------------"
560 @echo ">>> Installing programs only"
561 @echo "--------------------------------------------------------------"
562 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/usr.bin gnu/usr.sbin
563 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ install
567 # ------------------------------------------------------------------------
569 # From here onwards are utility targets used by the 'make world' and
570 # related targets. If your 'world' breaks, you may like to try to fix
571 # the problem and manually run the following targets to attempt to
572 # complete the build. Beware, this is *not* guaranteed to work, you
573 # need to have a pretty good grip on the current state of the system
574 # to attempt to manually finish it. If in doubt, 'make world' again.
578 # bootstrap-tools: Build tools needed for compatibility
580 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
581 _strfile= games/fortune/strfile
585 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef \
586 usr.bin/makewhatis usr.bin/rpcgen usr.bin/uudecode \
587 usr.bin/xargs usr.bin/xinstall \
588 usr.sbin/config usr.sbin/kbdcontrol \
589 gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo
590 cd ${.CURDIR}/${_tool}; \
591 ${MAKE} DIRPRFX=${_tool}/ obj; \
592 ${MAKE} DIRPRFX=${_tool}/ depend; \
593 ${MAKE} DIRPRFX=${_tool}/ all; \
594 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
598 # build-tools: Build special purpose build tools
600 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
601 _games= games/adventure games/hack games/phantasia
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 ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
625 ${_libroken4} ${_libkrb5} lib/libncurses ${_share} \
626 usr.bin/awk usr.bin/file usr.sbin/sysinstall
627 cd ${.CURDIR}/${_tool}; ${MAKE} DIRPRFX=${_tool}/ build-tools
631 # cross-tools: Build cross-building tools
633 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
634 _elf2exe= usr.sbin/elf2exe
637 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
638 _btxld= usr.sbin/btxld
641 .if ${TARGET_ARCH} == "sparc64"
642 _elf2aout= usr.sbin/elf2aout
645 _xlint= usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint
648 .for _tool in ${_btxld} ${_elf2aout} ${_elf2exe} \
649 gnu/usr.bin/binutils usr.bin/objformat usr.sbin/crunch/crunchide \
650 gnu/usr.bin/cc ${_xlint}
651 cd ${.CURDIR}/${_tool}; \
652 ${MAKE} DIRPRFX=${_tool}/ obj; \
653 ${MAKE} DIRPRFX=${_tool}/ depend; \
654 ${MAKE} DIRPRFX=${_tool}/ all; \
655 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
659 # hierarchy - ensure that all the needed directories are present
662 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
665 # libraries - build all libraries, and install them under ${DESTDIR}.
667 # The list of libraries with dependents (${_prebuild_libs}) and their
668 # interdependencies (__L) are built automatically by the
669 # ${.CURDIR}/tools/make_libdeps.sh script.
673 ${MAKE} -f Makefile.inc1 _startup_libs; \
674 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
675 ${MAKE} -f Makefile.inc1 _generic_libs;
677 # These dependencies are not automatically generated:
679 # gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all
680 # shared libraries for ELF.
682 _startup_libs= gnu/lib/csu gnu/lib/libgcc
683 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-${OBJFORMAT})
684 _startup_libs+= lib/csu/${MACHINE_ARCH}-${OBJFORMAT}
686 _startup_libs+= lib/csu/${MACHINE_ARCH}
691 _generic_libs= gnu/lib
693 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
694 _prebuild_libs+= kerberos5/lib/libasn1
695 _prebuild_libs+= kerberos5/lib/libgssapi
696 _prebuild_libs+= kerberos5/lib/libkrb5
697 _prebuild_libs+= kerberos5/lib/libroken
698 _generic_libs+= kerberos5/lib
701 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
702 _prebuild_libs+= kerberosIV/lib/libkrb
703 kerberosIV/lib/libkrb__L: lib/libcrypt__L
704 _generic_libs+= kerberosIV/lib
707 _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libkvm lib/libmd \
708 lib/libncurses lib/libopie lib/libradius lib/librpcsvc \
709 lib/libsbuf lib/libtacplus lib/libutil lib/libypclnt \
712 lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
713 lib/libypclnt__L: lib/librpcsvc__L
717 .if !defined(NOCRYPT) && !defined(NOSECURE)
718 .if !defined(NO_OPENSSL)
719 _prebuild_libs+= secure/lib/libcrypto secure/lib/libssl
720 .if !defined(NO_OPENSSH)
721 _prebuild_libs+= secure/lib/libssh
722 secure/lib/libssh__L: secure/lib/libcrypto__L lib/libz__L
725 _generic_libs+= secure/lib
728 _generic_libs+= usr.bin/lex/lib
730 .if ${MACHINE_ARCH} == "i386"
731 _generic_libs+= usr.sbin/pcvt/keycap
734 .for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
736 .if exists(${.CURDIR}/${_lib})
737 cd ${.CURDIR}/${_lib}; \
738 ${MAKE} DIRPRFX=${_lib}/ depend; \
739 ${MAKE} DIRPRFX=${_lib}/ all; \
740 ${MAKE} DIRPRFX=${_lib}/ install
744 _startup_libs: ${_startup_libs:S/$/__L/}
745 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
746 _generic_libs: ${_generic_libs:S/$/__L/}
748 .for __target in clean cleandepend cleandir depend includes obj
749 .for entry in ${SUBDIR}
750 ${entry}.${__target}__D: .PHONY
751 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
752 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
753 edir=${entry}.${MACHINE_ARCH}; \
754 cd ${.CURDIR}/$${edir}; \
756 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
758 cd ${.CURDIR}/$${edir}; \
760 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
762 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
765 .include <bsd.subdir.mk>