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.11 2003/12/01 19:32:53 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 # This exists simply to ensure that the obj dir hierarchy is
56 # intact for nrelease, allowing the nrelease Makefile's to
57 # reference ${.OBJDIR}.
59 .if exists(${.CURDIR}/nrelease)
63 .if exists(${.CURDIR}/bin)
66 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
69 .if exists(${.CURDIR}/gnu)
72 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
73 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS5)
76 .if exists(${.CURDIR}/libexec)
79 .if exists(${.CURDIR}/sbin)
82 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT)
85 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
88 .if exists(${.CURDIR}/sys)
91 .if exists(${.CURDIR}/usr.bin)
94 .if exists(${.CURDIR}/usr.sbin)
98 # etc must be last for "distribute" to work
99 .if exists(${.CURDIR}/etc)
103 # These are last, since it is nice to at least get the base system
104 # rebuilt before you do them.
105 .if defined(LOCAL_DIRS)
106 .for _DIR in ${LOCAL_DIRS}
107 .if exists(${.CURDIR}/${_DIR}) & exists(${.CURDIR}/${_DIR}/Makefile)
113 .if defined(SUBDIR_OVERRIDE)
114 SUBDIR= ${SUBDIR_OVERRIDE}
117 .if defined(NOCLEANDIR)
118 CLEANDIR= clean cleandepend
123 SUP?= /usr/local/bin/cvsup
124 SUPFLAGS?= -g -L 2 -P -
126 SUPFLAGS+= -h ${SUPHOST}
129 MAKEOBJDIRPREFIX?= /usr/obj
130 TARGET_ARCH?= ${MACHINE_ARCH}
131 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
134 TARGET?= ${TARGET_ARCH}
137 BUILD_ARCH!= sysctl -n hw.machine_arch
138 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
139 .error To cross-build, set TARGET_ARCH.
142 .if ${MACHINE} == ${TARGET}
143 OBJTREE= ${MAKEOBJDIRPREFIX}
145 OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}
147 WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH}
148 # /usr/games added for fortune which depend on strfile
149 STRICTTMPPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
150 TMPPATH= ${STRICTTMPPATH}:${PATH}
151 OBJFORMAT_PATH?= /usr/libexec
155 INSTALLTMP= ${TMPDIR}/install.${TMPPID}
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 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
183 PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.00503 \
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 \
197 TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
199 INSTALL="sh ${.CURDIR}/tools/install.sh"
200 TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING
203 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB
206 WMAKEENV= ${CROSSENV} \
207 DESTDIR=${WORLDTMP} \
208 INSTALL="sh ${.CURDIR}/tools/install.sh" \
210 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
213 IMAKEENV= ${CROSSENV} \
214 PATH=${STRICTTMPPATH}:${INSTALLTMP}
215 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
218 KMAKEENV= ${WMAKEENV} \
219 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec:${OBJFORMAT_PATH}
221 USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \
222 usr/libexec/${OBJFORMAT} usr/sbin usr/share/misc \
224 usr/share/groff_font/devX100 \
225 usr/share/groff_font/devX100-12 \
226 usr/share/groff_font/devX75 \
227 usr/share/groff_font/devX75-12 \
228 usr/share/groff_font/devascii \
229 usr/share/groff_font/devcp1047 \
230 usr/share/groff_font/devdvi \
231 usr/share/groff_font/devhtml \
232 usr/share/groff_font/devkoi8-r \
233 usr/share/groff_font/devlatin1 \
234 usr/share/groff_font/devlbp \
235 usr/share/groff_font/devlj4 \
236 usr/share/groff_font/devps \
237 usr/share/groff_font/devutf8 \
238 usr/share/tmac/mdoc usr/share/tmac/mm
240 # XXX remove in favor of the BSD.include.dist mtree that we already have.
242 INCDIRS= arpa dev g++/std isc libmilter objc openssl \
243 protocols readline rpc rpcsvc security
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 cap_mkdb cat chflags chmod chown \
370 date echo egrep find grep \
371 ln make makewhatis mkdir mtree mv perl pwd_mkdb rm sed sh sysctl \
372 test true uname wc zic; do \
373 cp `which $$prog` ${INSTALLTMP}; \
375 cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
381 # If you have a build server, you can NFS mount the source and obj directories
382 # and do a 'make reinstall' on the *client* to install new binaries from the
383 # most recent server build.
386 @echo "--------------------------------------------------------------"
387 @echo ">>> Making hierarchy"
388 @echo "--------------------------------------------------------------"
389 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
391 @echo "--------------------------------------------------------------"
392 @echo ">>> Installing everything.."
393 @echo "--------------------------------------------------------------"
394 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
395 .if !defined(NOMAN) && !defined(NO_MAKEDB_RUN)
397 @echo "--------------------------------------------------------------"
398 @echo ">>> Rebuilding man page indices"
399 @echo "--------------------------------------------------------------"
400 cd ${.CURDIR}/share/man; ${MAKE} makedb
404 @echo "--------------------------------------------------------------"
405 @echo ">>> Distributing everything.."
406 @echo "--------------------------------------------------------------"
407 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
410 # buildkernel and installkernel
412 # Which kernels to build and/or install is specified by setting
413 # KERNCONF. If not defined a GENERIC kernel is built/installed.
414 # Only the existing (depending TARGET) config files are used
415 # for building kernels and only the first of these is designated
416 # as the one being installed.
418 # Note that we have to use TARGET instead of TARGET_ARCH when
419 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
420 # be set to cross-build, we have to make sure TARGET is set
423 .if !defined(KERNCONF) && defined(KERNEL)
429 INSTKERNNAME?= kernel
431 KRNLSRCDIR= ${.CURDIR}/sys
432 KRNLCONFDIR= ${KRNLSRCDIR}/${TARGET}/conf
433 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
434 KERNCONFDIR?= ${KRNLCONFDIR}
438 .for _kernel in ${KERNCONF}
439 .if exists(${KERNCONFDIR}/${_kernel})
440 BUILDKERNELS+= ${_kernel}
441 .if empty(INSTALLKERNEL)
442 INSTALLKERNEL= ${_kernel}
450 # Builds all kernels defined by BUILDKERNELS.
453 .if empty(BUILDKERNELS)
454 @echo ">>> ERROR: Missing kernel configuration file(s) (${KERNCONF})."
457 .if defined(KERNWARN)
458 @echo "--------------------------------------------------------------"
459 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
460 @echo "--------------------------------------------------------------"
464 .for _kernel in ${BUILDKERNELS}
465 @echo "--------------------------------------------------------------"
466 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
467 @echo "--------------------------------------------------------------"
468 @echo "===> ${_kernel}"
469 mkdir -p ${KRNLOBJDIR}
470 .if !defined(NO_KERNELCONFIG)
473 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
474 ${KERNCONFDIR}/${_kernel}
476 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
477 cd ${KRNLOBJDIR}/${_kernel}; \
478 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} -DNO_MODULES clean
479 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KRNLSRCDIR}/modules)
480 cd ${KRNLOBJDIR}/${_kernel}; \
481 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} cleandir
484 cd ${KRNLOBJDIR}/${_kernel}; \
485 MAKESRCPATH=${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm \
486 ${MAKE} -DBOOTSTRAPPING -f ${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm/Makefile
487 .if !defined(NO_KERNELDEPEND)
488 cd ${KRNLOBJDIR}/${_kernel}; \
489 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
491 cd ${KRNLOBJDIR}/${_kernel}; \
492 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all
493 @echo "--------------------------------------------------------------"
494 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
495 @echo "--------------------------------------------------------------"
501 # Install the kernel defined by INSTALLKERNEL
503 installkernel reinstallkernel:
504 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
505 ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
510 # Update the source tree, by running sup and/or running cvs to update to the
514 .if defined(SUP_UPDATE)
515 @echo "--------------------------------------------------------------"
516 @echo ">>> Running ${SUP}"
517 @echo "--------------------------------------------------------------"
519 @${SUP} ${SUPFLAGS} ${SUPFILE}
521 .if defined(SUPFILE1)
522 @${SUP} ${SUPFLAGS} ${SUPFILE1}
524 .if defined(SUPFILE2)
525 @${SUP} ${SUPFLAGS} ${SUPFILE2}
527 .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
528 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
530 .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
531 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
534 .if defined(CVS_UPDATE)
535 @echo "--------------------------------------------------------------"
536 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
537 @echo "--------------------------------------------------------------"
538 cd ${.CURDIR}; cvs -q update -rRELENG_4 -P -d
544 # Build most of the user binaries on the existing system libs and includes.
547 @echo "--------------------------------------------------------------"
548 @echo ">>> Building programs only"
549 @echo "--------------------------------------------------------------"
550 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
551 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ all
557 # Install the binaries built by the 'most' target. This does not include
558 # libraries or include files.
561 @echo "--------------------------------------------------------------"
562 @echo ">>> Installing programs only"
563 @echo "--------------------------------------------------------------"
564 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
565 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ install
569 # ------------------------------------------------------------------------
571 # From here onwards are utility targets used by the 'make world' and
572 # related targets. If your 'world' breaks, you may like to try to fix
573 # the problem and manually run the following targets to attempt to
574 # complete the build. Beware, this is *not* guaranteed to work, you
575 # need to have a pretty good grip on the current state of the system
576 # to attempt to manually finish it. If in doubt, 'make world' again.
580 # bootstrap-tools: Build tools needed for compatibility
582 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
583 _strfile= games/fortune/strfile
587 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef \
588 usr.bin/uudecode usr.bin/xinstall \
590 gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo
591 ${ECHODIR} "===> ${_tool}"; \
592 cd ${.CURDIR}/${_tool}; \
593 ${MAKE} DIRPRFX=${_tool}/ obj; \
594 ${MAKE} DIRPRFX=${_tool}/ depend; \
595 ${MAKE} DIRPRFX=${_tool}/ all; \
596 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
600 # build-tools: Build special purpose build tools
602 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
603 _games= games/adventure games/hack games/phantasia
606 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
607 _share= share/syscons/scrnmaps
610 .if !defined(NO_FORTRAN)
611 _fortran= gnu/usr.bin/cc/f771
615 _perl= gnu/usr.bin/perl/miniperl
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
624 .if defined(RELEASEDIR)
625 _sysinstall= release/sysinstall
629 .for _tool in bin/csh bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
630 ${_perl} ${_libroken4} ${_libkrb5} lib/libncurses ${_share} \
631 usr.bin/awk usr.bin/file ${_sysinstall}
632 ${ECHODIR} "===> ${_tool}"; \
633 cd ${.CURDIR}/${_tool}; \
634 ${MAKE} DIRPRFX=${_tool}/ obj; \
635 ${MAKE} DIRPRFX=${_tool}/ build-tools
639 # cross-tools: Build cross-building tools
641 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
642 _elf2exe= usr.sbin/elf2exe
645 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
646 _btxld= usr.sbin/btxld
650 .for _tool in ${_btxld} ${_elf2exe} usr.bin/genassym usr.bin/gensetdefs \
651 gnu/usr.bin/binutils usr.bin/objformat usr.sbin/crunch/crunchide \
653 ${ECHODIR} "===> ${_tool}"; \
654 cd ${.CURDIR}/${_tool}; \
655 ${MAKE} DIRPRFX=${_tool}/ obj; \
656 ${MAKE} DIRPRFX=${_tool}/ depend; \
657 ${MAKE} DIRPRFX=${_tool}/ all; \
658 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
662 # hierarchy - ensure that all the needed directories are present
665 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
668 # libraries - build all libraries, and install them under ${DESTDIR}.
670 # The list of libraries with dependents (${_prebuild_libs}) and their
671 # interdependencies (__L) are built automatically by the
672 # ${.CURDIR}/tools/make_libdeps.sh script.
676 ${MAKE} -f Makefile.inc1 _startup_libs; \
677 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
678 ${MAKE} -f Makefile.inc1 _generic_libs;
680 # These dependencies are not automatically generated:
682 # gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all
683 # shared libraries for ELF.
685 _startup_libs= gnu/lib/csu gnu/lib/libgcc
686 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-${OBJFORMAT})
687 _startup_libs+= lib/csu/${MACHINE_ARCH}-${OBJFORMAT}
689 _startup_libs+= lib/csu/${MACHINE_ARCH}
694 _generic_libs= gnu/lib
697 _generic_libs+= gnu/usr.bin/perl/libperl
700 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
701 _prebuild_libs+= kerberos5/lib/libasn1
702 _prebuild_libs+= kerberos5/lib/libgssapi
703 _prebuild_libs+= kerberos5/lib/libkrb5
704 _prebuild_libs+= kerberos5/lib/libroken
705 _generic_libs+= kerberos5/lib
708 _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libmd \
709 lib/libncurses lib/libopie lib/libradius lib/libskey \
710 lib/libtacplus lib/libutil \
713 lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
714 lib/libskey__L: lib/libcrypt__L lib/libmd__L
718 .if !defined(NOCRYPT)
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 ${ECHODIR} "===> ${_lib}"; \
739 cd ${.CURDIR}/${_lib}; \
740 ${MAKE} DIRPRFX=${_lib}/ depend; \
741 ${MAKE} DIRPRFX=${_lib}/ all; \
742 ${MAKE} DIRPRFX=${_lib}/ install
746 _startup_libs: ${_startup_libs:S/$/__L/}
747 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
748 _generic_libs: ${_generic_libs:S/$/__L/}
750 .for __target in clean cleandepend cleandir depend includes obj
751 .for entry in ${SUBDIR}
752 ${entry}.${__target}__D: .PHONY
753 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
754 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
755 edir=${entry}.${MACHINE_ARCH}; \
756 cd ${.CURDIR}/$${edir}; \
758 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
760 cd ${.CURDIR}/$${edir}; \
762 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
764 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
767 # The wmake target is used by /usr/bin/wmake to run make in a
768 # world build environment.
771 @echo '${WMAKEENV} ${MAKE} ${WMAKE_ARGS}'
774 @echo '${WMAKEENV} /bin/sh'
776 .include <bsd.subdir.mk>