2 # $FreeBSD: src/Makefile.inc1,v 1.141.2.62 2003/04/06 19:54:00 dwmalone Exp $
3 # $DragonFly: src/Makefile.inc1,v 1.9 2003/12/01 09:59:42 dillon Exp $
5 # Make command line options:
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 # -DNOMAN do not build the manual pages
11 # -DNOPROFILE do not build profiled libraries
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 # We must do include and lib early so that the perl *.ph generation
48 # works correctly as it uses the header files installed by this.
49 .if exists(${.CURDIR}/include)
52 .if exists(${.CURDIR}/lib)
55 .if exists(${.CURDIR}/nrelease)
59 .if exists(${.CURDIR}/bin)
62 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
65 .if exists(${.CURDIR}/gnu)
68 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
69 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS5)
72 .if exists(${.CURDIR}/libexec)
75 .if exists(${.CURDIR}/sbin)
78 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT)
81 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
84 .if exists(${.CURDIR}/sys)
87 .if exists(${.CURDIR}/usr.bin)
90 .if exists(${.CURDIR}/usr.sbin)
94 # etc must be last for "distribute" to work
95 .if exists(${.CURDIR}/etc)
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
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
151 INSTALLTMP= ${TMPDIR}/install.${TMPPID}
154 # Building a world goes through the following stages
156 # 1. bootstrap-tool stage [BMAKE]
157 # This stage is responsible for creating programs that
158 # are needed for backward compatibility reasons. They
159 # are not built as cross-tools.
160 # 2. build-tool stage [TMAKE]
161 # This stage is responsible for creating the object
162 # tree and building any tools that are needed during
164 # 3. cross-tool stage [XMAKE]
165 # This stage is responsible for creating any tools that
166 # are needed for cross-builds. A cross-compiler is one
168 # 4. world stage [WMAKE]
169 # This stage actually builds the world.
170 # 5. install stage (optional) [IMAKE]
171 # This stage installs a previously built world.
174 # Common environment for world related stages
175 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
176 MACHINE_ARCH=${TARGET_ARCH} \
178 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
179 PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.00503 \
180 GROFF_BIN_PATH=${WORLDTMP}/usr/bin \
181 GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \
182 GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac
184 # bootstrap-tool stage
185 BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
187 INSTALL="sh ${.CURDIR}/tools/install.sh"
188 BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
189 -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
193 TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
195 INSTALL="sh ${.CURDIR}/tools/install.sh"
196 TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING
199 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB
202 WMAKEENV= ${CROSSENV} \
203 DESTDIR=${WORLDTMP} \
204 INSTALL="sh ${.CURDIR}/tools/install.sh" \
206 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
209 IMAKEENV= ${CROSSENV} \
210 PATH=${STRICTTMPPATH}:${INSTALLTMP}
211 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
214 KMAKEENV= ${WMAKEENV} \
215 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec:${OBJFORMAT_PATH}
217 USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \
218 usr/libexec/${OBJFORMAT} usr/sbin usr/share/misc \
220 usr/share/groff_font/devX100 \
221 usr/share/groff_font/devX100-12 \
222 usr/share/groff_font/devX75 \
223 usr/share/groff_font/devX75-12 \
224 usr/share/groff_font/devascii \
225 usr/share/groff_font/devcp1047 \
226 usr/share/groff_font/devdvi \
227 usr/share/groff_font/devhtml \
228 usr/share/groff_font/devkoi8-r \
229 usr/share/groff_font/devlatin1 \
230 usr/share/groff_font/devlbp \
231 usr/share/groff_font/devlj4 \
232 usr/share/groff_font/devps \
233 usr/share/groff_font/devutf8 \
234 usr/share/tmac/mdoc usr/share/tmac/mm
236 # XXX remove in favor of the BSD.include.dist mtree that we already have.
238 INCDIRS= arpa dev g++/std isc libmilter objc openssl \
239 protocols readline rpc rpcsvc security
244 # Attempt to rebuild the entire system, with reasonable chance of
245 # success, regardless of how old your existing system is.
249 @echo "--------------------------------------------------------------"
250 @echo ">>> Rebuilding the temporary build tree"
251 @echo "--------------------------------------------------------------"
252 .if !defined(NOCLEAN)
255 # XXX - These two can depend on any header file.
256 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
257 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
259 .for _dir in ${USRDIRS}
260 mkdir -p ${WORLDTMP}/${_dir}
262 .for _dir in ${INCDIRS}
263 mkdir -p ${WORLDTMP}/usr/include/${_dir}
265 ln -sf ${.CURDIR}/sys ${WORLDTMP}
268 @echo "--------------------------------------------------------------"
269 @echo ">>> stage 1: bootstrap tools"
270 @echo "--------------------------------------------------------------"
271 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
273 .if !defined(NOCLEAN)
275 @echo "--------------------------------------------------------------"
276 @echo ">>> stage 2: cleaning up the object tree"
277 @echo "--------------------------------------------------------------"
278 cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
282 @echo "--------------------------------------------------------------"
283 @echo ">>> stage 2: rebuilding the object tree"
284 @echo "--------------------------------------------------------------"
285 cd ${.CURDIR}; ${WMAKE} par-obj
288 @echo "--------------------------------------------------------------"
289 @echo ">>> stage 2: build tools"
290 @echo "--------------------------------------------------------------"
291 cd ${.CURDIR}; ${TMAKE} build-tools
294 @echo "--------------------------------------------------------------"
295 @echo ">>> stage 3: cross tools"
296 @echo "--------------------------------------------------------------"
297 cd ${.CURDIR}; ${XMAKE} cross-tools
300 @echo "--------------------------------------------------------------"
301 @echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
302 @echo "--------------------------------------------------------------"
303 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
306 @echo "--------------------------------------------------------------"
307 @echo ">>> stage 4: building libraries"
308 @echo "--------------------------------------------------------------"
309 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
312 @echo "--------------------------------------------------------------"
313 @echo ">>> stage 4: make dependencies"
314 @echo "--------------------------------------------------------------"
315 cd ${.CURDIR}; ${WMAKE} par-depend
318 @echo "--------------------------------------------------------------"
319 @echo ">>> stage 4: building everything.."
320 @echo "--------------------------------------------------------------"
321 cd ${.CURDIR}; ${WMAKE} all
325 .if !defined(SUBDIR_OVERRIDE)
326 WMAKE_TGTS+= _worldtmp _bootstrap-tools
328 WMAKE_TGTS+= _cleanobj _obj _build-tools
329 .if !defined(SUBDIR_OVERRIDE)
330 WMAKE_TGTS+= _cross-tools
332 WMAKE_TGTS+= _includes _libraries _depend everything
334 buildworld: ${WMAKE_TGTS}
335 .ORDER: ${WMAKE_TGTS}
340 # Checks to be sure system is ready for installworld
343 .if !defined(NO_SENDMAIL)
344 @if ! `grep -q '^smmsp:' /etc/passwd`; then \
345 echo "ERROR: Required smmsp user is missing, see /usr/src/UPDATING."; \
348 @if ! `grep -q '^smmsp:' /etc/group`; then \
349 echo "ERROR: Required smmsp group is missing, see /usr/src/UPDATING."; \
357 # Distributes everything compiled by a `buildworld'.
361 # Installs everything compiled by a 'buildworld'.
363 distributeworld installworld: installcheck
364 mkdir -p ${INSTALLTMP}
365 for prog in [ awk cap_mkdb cat chflags chmod chown \
366 date echo egrep find grep \
367 ln make makewhatis mkdir mtree mv perl pwd_mkdb rm sed sh sysctl \
368 test true uname wc zic; do \
369 cp `which $$prog` ${INSTALLTMP}; \
371 cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
377 # If you have a build server, you can NFS mount the source and obj directories
378 # and do a 'make reinstall' on the *client* to install new binaries from the
379 # most recent server build.
382 @echo "--------------------------------------------------------------"
383 @echo ">>> Making hierarchy"
384 @echo "--------------------------------------------------------------"
385 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
387 @echo "--------------------------------------------------------------"
388 @echo ">>> Installing everything.."
389 @echo "--------------------------------------------------------------"
390 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
391 .if !defined(NOMAN) && !defined(NO_MAKEDB_RUN)
393 @echo "--------------------------------------------------------------"
394 @echo ">>> Rebuilding man page indices"
395 @echo "--------------------------------------------------------------"
396 cd ${.CURDIR}/share/man; ${MAKE} makedb
400 @echo "--------------------------------------------------------------"
401 @echo ">>> Distributing everything.."
402 @echo "--------------------------------------------------------------"
403 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
406 # buildkernel and installkernel
408 # Which kernels to build and/or install is specified by setting
409 # KERNCONF. If not defined a GENERIC kernel is built/installed.
410 # Only the existing (depending TARGET) config files are used
411 # for building kernels and only the first of these is designated
412 # as the one being installed.
414 # Note that we have to use TARGET instead of TARGET_ARCH when
415 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
416 # be set to cross-build, we have to make sure TARGET is set
419 .if !defined(KERNCONF) && defined(KERNEL)
425 INSTKERNNAME?= kernel
427 KRNLSRCDIR= ${.CURDIR}/sys
428 KRNLCONFDIR= ${KRNLSRCDIR}/${TARGET}/conf
429 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
430 KERNCONFDIR?= ${KRNLCONFDIR}
434 .for _kernel in ${KERNCONF}
435 .if exists(${KERNCONFDIR}/${_kernel})
436 BUILDKERNELS+= ${_kernel}
437 .if empty(INSTALLKERNEL)
438 INSTALLKERNEL= ${_kernel}
446 # Builds all kernels defined by BUILDKERNELS.
449 .if empty(BUILDKERNELS)
450 @echo ">>> ERROR: Missing kernel configuration file(s) (${KERNCONF})."
453 .if defined(KERNWARN)
454 @echo "--------------------------------------------------------------"
455 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
456 @echo "--------------------------------------------------------------"
460 .for _kernel in ${BUILDKERNELS}
461 @echo "--------------------------------------------------------------"
462 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
463 @echo "--------------------------------------------------------------"
464 @echo "===> ${_kernel}"
465 mkdir -p ${KRNLOBJDIR}
466 .if !defined(NO_KERNELCONFIG)
469 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
470 ${KERNCONFDIR}/${_kernel}
472 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
473 cd ${KRNLOBJDIR}/${_kernel}; \
474 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} -DNO_MODULES clean
475 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KRNLSRCDIR}/modules)
476 cd ${KRNLOBJDIR}/${_kernel}; \
477 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} cleandir
480 cd ${KRNLOBJDIR}/${_kernel}; \
481 MAKESRCPATH=${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm \
482 ${MAKE} -DBOOTSTRAPPING -f ${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm/Makefile
483 .if !defined(NO_KERNELDEPEND)
484 cd ${KRNLOBJDIR}/${_kernel}; \
485 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
487 cd ${KRNLOBJDIR}/${_kernel}; \
488 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all
489 @echo "--------------------------------------------------------------"
490 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
491 @echo "--------------------------------------------------------------"
497 # Install the kernel defined by INSTALLKERNEL
499 installkernel reinstallkernel:
500 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
501 ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
506 # Update the source tree, by running sup and/or running cvs to update to the
510 .if defined(SUP_UPDATE)
511 @echo "--------------------------------------------------------------"
512 @echo ">>> Running ${SUP}"
513 @echo "--------------------------------------------------------------"
515 @${SUP} ${SUPFLAGS} ${SUPFILE}
517 .if defined(SUPFILE1)
518 @${SUP} ${SUPFLAGS} ${SUPFILE1}
520 .if defined(SUPFILE2)
521 @${SUP} ${SUPFLAGS} ${SUPFILE2}
523 .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
524 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
526 .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
527 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
530 .if defined(CVS_UPDATE)
531 @echo "--------------------------------------------------------------"
532 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
533 @echo "--------------------------------------------------------------"
534 cd ${.CURDIR}; cvs -q update -rRELENG_4 -P -d
540 # Build most of the user binaries on the existing system libs and includes.
543 @echo "--------------------------------------------------------------"
544 @echo ">>> Building programs only"
545 @echo "--------------------------------------------------------------"
546 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
547 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ all
553 # Install the binaries built by the 'most' target. This does not include
554 # libraries or include files.
557 @echo "--------------------------------------------------------------"
558 @echo ">>> Installing programs only"
559 @echo "--------------------------------------------------------------"
560 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
561 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ install
565 # ------------------------------------------------------------------------
567 # From here onwards are utility targets used by the 'make world' and
568 # related targets. If your 'world' breaks, you may like to try to fix
569 # the problem and manually run the following targets to attempt to
570 # complete the build. Beware, this is *not* guaranteed to work, you
571 # need to have a pretty good grip on the current state of the system
572 # to attempt to manually finish it. If in doubt, 'make world' again.
576 # bootstrap-tools: Build tools needed for compatibility
578 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
579 _strfile= games/fortune/strfile
583 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef \
584 usr.bin/uudecode usr.bin/xinstall \
586 gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo
587 ${ECHODIR} "===> ${_tool}"; \
588 cd ${.CURDIR}/${_tool}; \
589 ${MAKE} DIRPRFX=${_tool}/ obj; \
590 ${MAKE} DIRPRFX=${_tool}/ depend; \
591 ${MAKE} DIRPRFX=${_tool}/ all; \
592 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
596 # build-tools: Build special purpose build tools
598 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
599 _games= games/adventure games/hack games/phantasia
602 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
603 _share= share/syscons/scrnmaps
606 .if !defined(NO_FORTRAN)
607 _fortran= gnu/usr.bin/cc/f771
611 _perl= gnu/usr.bin/perl/miniperl
614 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
615 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
616 _libkrb5= kerberos5/lib/libroken kerberos5/lib/libvers \
617 kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
620 .if defined(RELEASEDIR)
621 _sysinstall= release/sysinstall
625 .for _tool in bin/csh bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
626 ${_perl} ${_libroken4} ${_libkrb5} lib/libncurses ${_share} \
627 usr.bin/awk usr.bin/file ${_sysinstall}
628 ${ECHODIR} "===> ${_tool}"; \
629 cd ${.CURDIR}/${_tool}; \
630 ${MAKE} DIRPRFX=${_tool}/ obj; \
631 ${MAKE} DIRPRFX=${_tool}/ build-tools
635 # cross-tools: Build cross-building tools
637 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
638 _elf2exe= usr.sbin/elf2exe
641 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
642 _btxld= usr.sbin/btxld
646 .for _tool in ${_btxld} ${_elf2exe} usr.bin/genassym usr.bin/gensetdefs \
647 gnu/usr.bin/binutils usr.bin/objformat usr.sbin/crunch/crunchide \
649 ${ECHODIR} "===> ${_tool}"; \
650 cd ${.CURDIR}/${_tool}; \
651 ${MAKE} DIRPRFX=${_tool}/ obj; \
652 ${MAKE} DIRPRFX=${_tool}/ depend; \
653 ${MAKE} DIRPRFX=${_tool}/ all; \
654 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
658 # hierarchy - ensure that all the needed directories are present
661 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
664 # libraries - build all libraries, and install them under ${DESTDIR}.
666 # The list of libraries with dependents (${_prebuild_libs}) and their
667 # interdependencies (__L) are built automatically by the
668 # ${.CURDIR}/tools/make_libdeps.sh script.
672 ${MAKE} -f Makefile.inc1 _startup_libs; \
673 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
674 ${MAKE} -f Makefile.inc1 _generic_libs;
676 # These dependencies are not automatically generated:
678 # gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all
679 # shared libraries for ELF.
681 _startup_libs= gnu/lib/csu gnu/lib/libgcc
682 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-${OBJFORMAT})
683 _startup_libs+= lib/csu/${MACHINE_ARCH}-${OBJFORMAT}
685 _startup_libs+= lib/csu/${MACHINE_ARCH}
690 _generic_libs= gnu/lib
693 _generic_libs+= gnu/usr.bin/perl/libperl
696 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
697 _prebuild_libs+= kerberos5/lib/libasn1
698 _prebuild_libs+= kerberos5/lib/libgssapi
699 _prebuild_libs+= kerberos5/lib/libkrb5
700 _prebuild_libs+= kerberos5/lib/libroken
701 _generic_libs+= kerberos5/lib
704 _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libmd \
705 lib/libncurses lib/libopie lib/libradius lib/libskey \
706 lib/libtacplus lib/libutil \
709 lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
710 lib/libskey__L: lib/libcrypt__L lib/libmd__L
714 .if !defined(NOCRYPT)
715 .if !defined(NO_OPENSSL)
716 _prebuild_libs+= secure/lib/libcrypto secure/lib/libssl
717 .if !defined(NO_OPENSSH)
718 _prebuild_libs+= secure/lib/libssh
719 secure/lib/libssh__L: secure/lib/libcrypto__L lib/libz__L
722 _generic_libs+= secure/lib
725 _generic_libs+= usr.bin/lex/lib
727 .if ${MACHINE_ARCH} == "i386"
728 _generic_libs+= usr.sbin/pcvt/keycap
731 .for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
733 .if exists(${.CURDIR}/${_lib})
734 ${ECHODIR} "===> ${_lib}"; \
735 cd ${.CURDIR}/${_lib}; \
736 ${MAKE} DIRPRFX=${_lib}/ depend; \
737 ${MAKE} DIRPRFX=${_lib}/ all; \
738 ${MAKE} DIRPRFX=${_lib}/ install
742 _startup_libs: ${_startup_libs:S/$/__L/}
743 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
744 _generic_libs: ${_generic_libs:S/$/__L/}
746 .for __target in clean cleandepend cleandir depend includes obj
747 .for entry in ${SUBDIR}
748 ${entry}.${__target}__D: .PHONY
749 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
750 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
751 edir=${entry}.${MACHINE_ARCH}; \
752 cd ${.CURDIR}/$${edir}; \
754 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
756 cd ${.CURDIR}/$${edir}; \
758 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
760 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
763 # The wmake target is used by /usr/bin/wmake to run make in a
764 # world build environment.
767 @echo '${WMAKEENV} ${MAKE} ${WMAKE_ARGS}'
770 @echo '${WMAKEENV} /bin/sh'
772 .include <bsd.subdir.mk>