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}
130 TARGET?= ${TARGET_ARCH}
133 BUILD_ARCH!= sysctl -n hw.machine_arch
134 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
135 .error To cross-build, set TARGET_ARCH.
138 .if ${MACHINE} == ${TARGET}
139 OBJTREE= ${MAKEOBJDIRPREFIX}
141 OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}
143 WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH}
144 # /usr/games added for fortune which depend on strfile
145 STRICTTMPPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
146 TMPPATH= ${STRICTTMPPATH}:${PATH}
147 OBJFORMAT_PATH?= /usr/libexec
149 INSTALLTMP!= /usr/bin/mktemp -d -u -t install
152 # Building a world goes through the following stages
154 # 1. bootstrap-tool stage [BMAKE]
155 # This stage is responsible for creating programs that
156 # are needed for backward compatibility reasons. They
157 # are not built as cross-tools.
158 # 2. build-tool stage [TMAKE]
159 # This stage is responsible for creating the object
160 # tree and building any tools that are needed during
162 # 3. cross-tool stage [XMAKE]
163 # This stage is responsible for creating any tools that
164 # are needed for cross-builds. A cross-compiler is one
166 # 4. world stage [WMAKE]
167 # This stage actually builds the world.
168 # 5. install stage (optional) [IMAKE]
169 # This stage installs a previously built world.
172 # Common environment for world related stages
173 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
174 MACHINE_ARCH=${TARGET_ARCH} \
176 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
177 GROFF_BIN_PATH=${WORLDTMP}/usr/bin \
178 GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \
179 GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac
181 # bootstrap-tool stage
182 BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
184 INSTALL="sh ${.CURDIR}/tools/install.sh"
185 BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
186 -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
190 TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
192 INSTALL="sh ${.CURDIR}/tools/install.sh"
193 TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING
196 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB
199 WMAKEENV= ${CROSSENV} \
200 DESTDIR=${WORLDTMP} \
201 INSTALL="sh ${.CURDIR}/tools/install.sh" \
203 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
206 IMAKEENV= ${CROSSENV} \
207 PATH=${STRICTTMPPATH}:${INSTALLTMP}
208 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
211 KMAKEENV= ${WMAKEENV} \
212 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec:${OBJFORMAT_PATH}
214 USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \
215 usr/libexec/${OBJFORMAT} usr/sbin usr/share/misc \
217 usr/share/groff_font/devX100 \
218 usr/share/groff_font/devX100-12 \
219 usr/share/groff_font/devX75 \
220 usr/share/groff_font/devX75-12 \
221 usr/share/groff_font/devascii \
222 usr/share/groff_font/devcp1047 \
223 usr/share/groff_font/devdvi \
224 usr/share/groff_font/devhtml \
225 usr/share/groff_font/devkoi8-r \
226 usr/share/groff_font/devlatin1 \
227 usr/share/groff_font/devlbp \
228 usr/share/groff_font/devlj4 \
229 usr/share/groff_font/devps \
230 usr/share/groff_font/devutf8 \
231 usr/share/tmac/mdoc usr/share/tmac/mm
233 INCDIRS= arpa dev fs g++/std isc isofs libmilter objc openssl \
234 protocols readline rpc rpcsvc security ufs
239 # Attempt to rebuild the entire system, with reasonable chance of
240 # success, regardless of how old your existing system is.
244 @echo "--------------------------------------------------------------"
245 @echo ">>> Rebuilding the temporary build tree"
246 @echo "--------------------------------------------------------------"
247 .if !defined(NOCLEAN)
250 # XXX - These two can depend on any header file.
251 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
252 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
254 .for _dir in ${USRDIRS}
255 mkdir -p ${WORLDTMP}/${_dir}
257 .for _dir in ${INCDIRS}
258 mkdir -p ${WORLDTMP}/usr/include/${_dir}
260 ln -sf ${.CURDIR}/sys ${WORLDTMP}
263 @echo "--------------------------------------------------------------"
264 @echo ">>> stage 1: bootstrap tools"
265 @echo "--------------------------------------------------------------"
266 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
268 .if !defined(NOCLEAN)
270 @echo "--------------------------------------------------------------"
271 @echo ">>> stage 2: cleaning up the object tree"
272 @echo "--------------------------------------------------------------"
273 cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
277 @echo "--------------------------------------------------------------"
278 @echo ">>> stage 2: rebuilding the object tree"
279 @echo "--------------------------------------------------------------"
280 cd ${.CURDIR}; ${WMAKE} par-obj
283 @echo "--------------------------------------------------------------"
284 @echo ">>> stage 2: build tools"
285 @echo "--------------------------------------------------------------"
286 cd ${.CURDIR}; ${TMAKE} build-tools
289 @echo "--------------------------------------------------------------"
290 @echo ">>> stage 3: cross tools"
291 @echo "--------------------------------------------------------------"
292 cd ${.CURDIR}; ${XMAKE} cross-tools
295 @echo "--------------------------------------------------------------"
296 @echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
297 @echo "--------------------------------------------------------------"
298 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
301 @echo "--------------------------------------------------------------"
302 @echo ">>> stage 4: building libraries"
303 @echo "--------------------------------------------------------------"
304 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
307 @echo "--------------------------------------------------------------"
308 @echo ">>> stage 4: make dependencies"
309 @echo "--------------------------------------------------------------"
310 cd ${.CURDIR}; ${WMAKE} par-depend
313 @echo "--------------------------------------------------------------"
314 @echo ">>> stage 4: building everything.."
315 @echo "--------------------------------------------------------------"
316 cd ${.CURDIR}; ${WMAKE} all
320 .if !defined(SUBDIR_OVERRIDE)
321 WMAKE_TGTS+= _worldtmp _bootstrap-tools
323 WMAKE_TGTS+= _cleanobj _obj _build-tools
324 .if !defined(SUBDIR_OVERRIDE)
325 WMAKE_TGTS+= _cross-tools
327 WMAKE_TGTS+= _includes _libraries _depend everything
329 buildworld: ${WMAKE_TGTS}
330 .ORDER: ${WMAKE_TGTS}
335 # Checks to be sure system is ready for installworld
338 .if !defined(NO_SENDMAIL)
339 @if ! `grep -q '^smmsp:' /etc/passwd`; then \
340 echo "ERROR: Required smmsp user is missing, see /usr/src/UPDATING."; \
343 @if ! `grep -q '^smmsp:' /etc/group`; then \
344 echo "ERROR: Required smmsp group is missing, see /usr/src/UPDATING."; \
352 # Distributes everything compiled by a `buildworld'.
356 # Installs everything compiled by a 'buildworld'.
358 distributeworld installworld: installcheck
359 mkdir -p ${INSTALLTMP}
360 for prog in [ awk cat chflags chmod chown date echo egrep find grep \
361 ln make makewhatis mkdir mtree mv pwd_mkdb rm sed sh sysctl \
362 test true uname wc zic; do \
363 cp `which $$prog` ${INSTALLTMP}; \
365 cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
371 # If you have a build server, you can NFS mount the source and obj directories
372 # and do a 'make reinstall' on the *client* to install new binaries from the
373 # most recent server build.
376 @echo "--------------------------------------------------------------"
377 @echo ">>> Making hierarchy"
378 @echo "--------------------------------------------------------------"
379 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
381 @echo "--------------------------------------------------------------"
382 @echo ">>> Installing everything.."
383 @echo "--------------------------------------------------------------"
384 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
385 .if !defined(NOMAN) && !defined(NO_MAKEDB_RUN)
387 @echo "--------------------------------------------------------------"
388 @echo ">>> Rebuilding man page indices"
389 @echo "--------------------------------------------------------------"
390 cd ${.CURDIR}/share/man; ${MAKE} makedb
394 @echo "--------------------------------------------------------------"
395 @echo ">>> Distributing everything.."
396 @echo "--------------------------------------------------------------"
397 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
400 # buildkernel and installkernel
402 # Which kernels to build and/or install is specified by setting
403 # KERNCONF. If not defined a GENERIC kernel is built/installed.
404 # Only the existing (depending TARGET) config files are used
405 # for building kernels and only the first of these is designated
406 # as the one being installed.
408 # Note that we have to use TARGET instead of TARGET_ARCH when
409 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
410 # be set to cross-build, we have to make sure TARGET is set
413 .if !defined(KERNCONF) && defined(KERNEL)
419 INSTKERNNAME?= kernel
421 KRNLSRCDIR= ${.CURDIR}/sys
422 KRNLCONFDIR= ${KRNLSRCDIR}/${TARGET}/conf
423 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
424 KERNCONFDIR?= ${KRNLCONFDIR}
428 .for _kernel in ${KERNCONF}
429 .if exists(${KERNCONFDIR}/${_kernel})
430 BUILDKERNELS+= ${_kernel}
431 .if empty(INSTALLKERNEL)
432 INSTALLKERNEL= ${_kernel}
440 # Builds all kernels defined by BUILDKERNELS.
443 .if empty(BUILDKERNELS)
444 @echo ">>> ERROR: Missing kernel configuration file(s) (${KERNCONF})."
447 .if defined(KERNWARN)
448 @echo "--------------------------------------------------------------"
449 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
450 @echo "--------------------------------------------------------------"
454 .for _kernel in ${BUILDKERNELS}
455 @echo "--------------------------------------------------------------"
456 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
457 @echo "--------------------------------------------------------------"
458 @echo "===> ${_kernel}"
459 mkdir -p ${KRNLOBJDIR}
460 .if !defined(NO_KERNELCONFIG)
463 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
464 ${KERNCONFDIR}/${_kernel}
466 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
467 cd ${KRNLOBJDIR}/${_kernel}; \
468 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} -DNO_MODULES clean
469 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KRNLSRCDIR}/modules)
470 cd ${KRNLOBJDIR}/${_kernel}; \
471 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} cleandir
474 cd ${KRNLOBJDIR}/${_kernel}; \
475 MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx/aicasm \
476 ${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/aicasm/Makefile
477 .if !defined(NO_KERNELDEPEND)
478 cd ${KRNLOBJDIR}/${_kernel}; \
479 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
481 cd ${KRNLOBJDIR}/${_kernel}; \
482 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all
483 @echo "--------------------------------------------------------------"
484 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
485 @echo "--------------------------------------------------------------"
491 # Install the kernel defined by INSTALLKERNEL
493 installkernel reinstallkernel:
494 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
495 ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
500 # Update the source tree, by running sup and/or running cvs to update to the
504 .if defined(SUP_UPDATE)
505 @echo "--------------------------------------------------------------"
506 @echo ">>> Running ${SUP}"
507 @echo "--------------------------------------------------------------"
509 @${SUP} ${SUPFLAGS} ${SUPFILE}
511 .if defined(SUPFILE1)
512 @${SUP} ${SUPFLAGS} ${SUPFILE1}
514 .if defined(SUPFILE2)
515 @${SUP} ${SUPFLAGS} ${SUPFILE2}
517 .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
518 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
520 .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
521 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
524 .if defined(CVS_UPDATE)
525 @echo "--------------------------------------------------------------"
526 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
527 @echo "--------------------------------------------------------------"
528 cd ${.CURDIR}; ${CVS} -q update -A -P -d
534 # Build most of the user binaries on the existing system libs and includes.
537 @echo "--------------------------------------------------------------"
538 @echo ">>> Building programs only"
539 @echo "--------------------------------------------------------------"
540 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/usr.bin gnu/usr.sbin
541 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ all
547 # Install the binaries built by the 'most' target. This does not include
548 # libraries or include files.
551 @echo "--------------------------------------------------------------"
552 @echo ">>> Installing programs only"
553 @echo "--------------------------------------------------------------"
554 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/usr.bin gnu/usr.sbin
555 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ install
559 # ------------------------------------------------------------------------
561 # From here onwards are utility targets used by the 'make world' and
562 # related targets. If your 'world' breaks, you may like to try to fix
563 # the problem and manually run the following targets to attempt to
564 # complete the build. Beware, this is *not* guaranteed to work, you
565 # need to have a pretty good grip on the current state of the system
566 # to attempt to manually finish it. If in doubt, 'make world' again.
570 # bootstrap-tools: Build tools needed for compatibility
572 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
573 _strfile= games/fortune/strfile
575 .if ${CXX:T} != "c++"
576 _cxx_consumers= gnu/usr.bin/gperf gnu/usr.bin/groff
580 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef \
581 usr.bin/rpcgen usr.bin/xargs usr.bin/xinstall \
582 usr.sbin/config usr.sbin/kbdcontrol \
583 ${_cxx_consumers} gnu/usr.bin/texinfo
584 cd ${.CURDIR}/${_tool}; \
585 ${MAKE} DIRPRFX=${_tool}/ obj; \
586 ${MAKE} DIRPRFX=${_tool}/ depend; \
587 ${MAKE} DIRPRFX=${_tool}/ all; \
588 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
592 # build-tools: Build special purpose build tools
594 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
595 _games= games/adventure games/hack games/phantasia
598 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
599 _share= share/syscons/scrnmaps
602 .if !defined(NO_FORTRAN)
603 _fortran= gnu/usr.bin/cc/f771
606 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
607 !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
608 _libroken4= kerberosIV/lib/libroken
611 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
612 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
613 _libkrb5= kerberos5/lib/libroken kerberos5/lib/libvers \
614 kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
618 .for _tool in bin/csh bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
619 ${_libroken4} ${_libkrb5} lib/libncurses ${_share} \
620 usr.bin/awk usr.bin/file usr.sbin/sysinstall
621 cd ${.CURDIR}/${_tool}; ${MAKE} DIRPRFX=${_tool}/ build-tools
625 # cross-tools: Build cross-building tools
627 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
628 _elf2exe= usr.sbin/elf2exe
631 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
632 _btxld= usr.sbin/btxld
635 .if ${TARGET_ARCH} == "sparc64"
636 _elf2aout= usr.bin/elf2aout
639 _xlint= usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint
642 .for _tool in ${_btxld} ${_elf2aout} ${_elf2exe} \
643 gnu/usr.bin/binutils usr.bin/objformat usr.sbin/crunch/crunchide \
644 gnu/usr.bin/cc ${_xlint}
645 cd ${.CURDIR}/${_tool}; \
646 ${MAKE} DIRPRFX=${_tool}/ obj; \
647 ${MAKE} DIRPRFX=${_tool}/ depend; \
648 ${MAKE} DIRPRFX=${_tool}/ all; \
649 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
653 # hierarchy - ensure that all the needed directories are present
656 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
659 # libraries - build all libraries, and install them under ${DESTDIR}.
661 # The list of libraries with dependents (${_prebuild_libs}) and their
662 # interdependencies (__L) are built automatically by the
663 # ${.CURDIR}/tools/make_libdeps.sh script.
667 ${MAKE} -f Makefile.inc1 _startup_libs; \
668 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
669 ${MAKE} -f Makefile.inc1 _generic_libs;
671 # These dependencies are not automatically generated:
673 # gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all
674 # shared libraries for ELF.
676 _startup_libs= gnu/lib/csu gnu/lib/libgcc
677 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-${OBJFORMAT})
678 _startup_libs+= lib/csu/${MACHINE_ARCH}-${OBJFORMAT}
680 _startup_libs+= lib/csu/${MACHINE_ARCH}
685 _generic_libs= gnu/lib
687 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
688 _prebuild_libs+= kerberos5/lib/libasn1
689 _prebuild_libs+= kerberos5/lib/libgssapi
690 _prebuild_libs+= kerberos5/lib/libkrb5
691 _prebuild_libs+= kerberos5/lib/libroken
692 _generic_libs+= kerberos5/lib
695 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
696 _prebuild_libs+= kerberosIV/lib/libkrb
697 kerberosIV/lib/libkrb__L: lib/libcrypt__L
698 _generic_libs+= kerberosIV/lib
701 _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libkvm lib/libmd \
702 lib/libncurses lib/libopie lib/libradius lib/librpcsvc \
703 lib/libsbuf lib/libtacplus lib/libutil lib/libypclnt \
706 lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
707 lib/libypclnt__L: lib/librpcsvc__L
711 .if !defined(NOCRYPT) && !defined(NOSECURE)
712 _prebuild_libs+= secure/lib/libcrypto
713 .if !defined(NO_OPENSSH)
714 _prebuild_libs+= secure/lib/libssh
715 secure/lib/libssh__L: secure/lib/libcrypto__L lib/libz__L
717 _generic_libs+= secure/lib
720 _generic_libs+= usr.bin/lex/lib
722 .if ${MACHINE_ARCH} == "i386"
723 _generic_libs+= usr.sbin/pcvt/keycap
726 .for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
728 .if exists(${.CURDIR}/${_lib})
729 cd ${.CURDIR}/${_lib}; \
730 ${MAKE} DIRPRFX=${_lib}/ depend; \
731 ${MAKE} DIRPRFX=${_lib}/ all; \
732 ${MAKE} DIRPRFX=${_lib}/ install
736 _startup_libs: ${_startup_libs:S/$/__L/}
737 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
738 _generic_libs: ${_generic_libs:S/$/__L/}
740 .for __target in clean cleandepend cleandir depend includes obj
741 .for entry in ${SUBDIR}
742 ${entry}.${__target}__D: .PHONY
743 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
744 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
745 edir=${entry}.${MACHINE_ARCH}; \
746 cd ${.CURDIR}/$${edir}; \
748 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
750 cd ${.CURDIR}/$${edir}; \
752 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
754 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
757 .include <bsd.subdir.mk>