2 # $FreeBSD: src/Makefile.inc1,v 1.141.2.62 2003/04/06 19:54:00 dwmalone Exp $
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 # -DNOMAN do not build the manual pages
11 # -DNOPROFILE do not build profiled libraries
12 # -DNOSECURE do not go into secure subdir
13 # -DNOGAMES do not go into games subdir
14 # -DNOSHARE do not go into share subdir
15 # -DNOINFO do not make or install info files
16 # -DNOLIBC_R do not build libc_r.
17 # -DNO_FORTRAN do not build g77 and related libraries.
18 # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
19 # -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
20 # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
21 # -DNO_PORTSUPDATE do not update ports in ${MAKE} update
22 # -DNO_DOCUPDATE do not update doc in ${MAKE} update
23 # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
24 # TARGET_ARCH="arch" to crossbuild world to a different arch
27 # The intended user-driven targets are:
28 # buildworld - rebuild *everything*, including glue to help do upgrades
29 # installworld- install everything built by "buildworld"
30 # update - convenient way to update your source tree (eg: sup/cvs)
31 # most - build user commands, no libraries or include files
32 # installmost - install user commands, no libraries or include files
34 # Standard targets (not defined here) are documented in the makefiles in
35 # /usr/share/mk. These include:
36 # obj depend all install clean cleandepend cleanobj
38 # Put initial settings here.
41 # We must do share/info early so that installation of info `dir'
42 # entries works correctly. Do it first since it is less likely to
43 # grow dependencies on include and lib than vice versa.
44 .if exists(${.CURDIR}/share/info)
48 # We must do include and lib early so that the perl *.ph generation
49 # works correctly as it uses the header files installed by this.
50 .if exists(${.CURDIR}/include)
53 .if exists(${.CURDIR}/lib)
57 .if exists(${.CURDIR}/bin)
60 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
63 .if exists(${.CURDIR}/gnu)
66 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
67 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS4)
70 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
71 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS5)
74 .if exists(${.CURDIR}/libexec)
77 .if exists(${.CURDIR}/sbin)
80 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
83 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
86 .if exists(${.CURDIR}/sys)
89 .if exists(${.CURDIR}/usr.bin)
92 .if exists(${.CURDIR}/usr.sbin)
96 # etc must be last for "distribute" to work
97 .if exists(${.CURDIR}/etc)
101 # These are last, since it is nice to at least get the base system
102 # rebuilt before you do them.
103 .if defined(LOCAL_DIRS)
104 .for _DIR in ${LOCAL_DIRS}
105 .if exists(${.CURDIR}/${_DIR}) & exists(${.CURDIR}/${_DIR}/Makefile)
111 .if defined(SUBDIR_OVERRIDE)
112 SUBDIR= ${SUBDIR_OVERRIDE}
115 .if defined(NOCLEANDIR)
116 CLEANDIR= clean cleandepend
121 SUP?= /usr/local/bin/cvsup
122 SUPFLAGS?= -g -L 2 -P -
124 SUPFLAGS+= -h ${SUPHOST}
127 MAKEOBJDIRPREFIX?= /usr/obj
128 TARGET_ARCH?= ${MACHINE_ARCH}
129 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
132 TARGET?= ${TARGET_ARCH}
135 BUILD_ARCH!= sysctl -n hw.machine_arch
136 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
137 .error To cross-build, set TARGET_ARCH.
140 .if ${MACHINE} == ${TARGET}
141 OBJTREE= ${MAKEOBJDIRPREFIX}
143 OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}
145 WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH}
146 # /usr/games added for fortune which depend on strfile
147 STRICTTMPPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
148 TMPPATH= ${STRICTTMPPATH}:${PATH}
149 OBJFORMAT_PATH?= /usr/libexec
153 INSTALLTMP= ${TMPDIR}/install.${TMPPID}
156 # Building a world goes through the following stages
158 # 1. bootstrap-tool stage [BMAKE]
159 # This stage is responsible for creating programs that
160 # are needed for backward compatibility reasons. They
161 # are not built as cross-tools.
162 # 2. build-tool stage [TMAKE]
163 # This stage is responsible for creating the object
164 # tree and building any tools that are needed during
166 # 3. cross-tool stage [XMAKE]
167 # This stage is responsible for creating any tools that
168 # are needed for cross-builds. A cross-compiler is one
170 # 4. world stage [WMAKE]
171 # This stage actually builds the world.
172 # 5. install stage (optional) [IMAKE]
173 # This stage installs a previously built world.
176 # Common environment for world related stages
177 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
178 MACHINE_ARCH=${TARGET_ARCH} \
180 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
181 PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.00503 \
182 GROFF_BIN_PATH=${WORLDTMP}/usr/bin \
183 GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \
184 GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac
186 # bootstrap-tool stage
187 BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
189 INSTALL="sh ${.CURDIR}/tools/install.sh"
190 BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
191 -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
195 TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
197 INSTALL="sh ${.CURDIR}/tools/install.sh"
198 TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING
201 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB
204 WMAKEENV= ${CROSSENV} \
205 DESTDIR=${WORLDTMP} \
206 INSTALL="sh ${.CURDIR}/tools/install.sh" \
208 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
211 IMAKEENV= ${CROSSENV} \
212 PATH=${STRICTTMPPATH}:${INSTALLTMP}
213 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
216 KMAKEENV= ${WMAKEENV} \
217 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec:${OBJFORMAT_PATH}
219 USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \
220 usr/libexec/${OBJFORMAT} usr/sbin usr/share/misc \
222 usr/share/groff_font/devX100 \
223 usr/share/groff_font/devX100-12 \
224 usr/share/groff_font/devX75 \
225 usr/share/groff_font/devX75-12 \
226 usr/share/groff_font/devascii \
227 usr/share/groff_font/devcp1047 \
228 usr/share/groff_font/devdvi \
229 usr/share/groff_font/devhtml \
230 usr/share/groff_font/devkoi8-r \
231 usr/share/groff_font/devlatin1 \
232 usr/share/groff_font/devlbp \
233 usr/share/groff_font/devlj4 \
234 usr/share/groff_font/devps \
235 usr/share/groff_font/devutf8 \
236 usr/share/tmac/mdoc usr/share/tmac/mm
238 INCDIRS= arpa dev fs g++/std isc isofs libmilter objc openssl \
239 protocols readline rpc rpcsvc security ufs
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/aic7xxx/aicasm \
482 ${MAKE} -DBOOTSTRAPPING -f ${KRNLSRCDIR}/dev/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}/kerberosIV) && exists(${.CURDIR}/crypto) && \
615 !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
616 _libroken4= kerberosIV/lib/libroken
619 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
620 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
621 _libkrb5= kerberos5/lib/libroken kerberos5/lib/libvers \
622 kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
625 .if defined(RELEASEDIR)
626 _sysinstall= release/sysinstall
630 .for _tool in bin/csh bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
631 ${_perl} ${_libroken4} ${_libkrb5} lib/libncurses ${_share} \
632 usr.bin/awk usr.bin/file ${_sysinstall}
633 ${ECHODIR} "===> ${_tool}"; \
634 cd ${.CURDIR}/${_tool}; \
635 ${MAKE} DIRPRFX=${_tool}/ obj; \
636 ${MAKE} DIRPRFX=${_tool}/ build-tools
640 # cross-tools: Build cross-building tools
642 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
643 _elf2exe= usr.sbin/elf2exe
646 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
647 _btxld= usr.sbin/btxld
651 .for _tool in ${_btxld} ${_elf2exe} usr.bin/genassym usr.bin/gensetdefs \
652 gnu/usr.bin/binutils usr.bin/objformat usr.sbin/crunch/crunchide \
654 ${ECHODIR} "===> ${_tool}"; \
655 cd ${.CURDIR}/${_tool}; \
656 ${MAKE} DIRPRFX=${_tool}/ obj; \
657 ${MAKE} DIRPRFX=${_tool}/ depend; \
658 ${MAKE} DIRPRFX=${_tool}/ all; \
659 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
663 # hierarchy - ensure that all the needed directories are present
666 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
669 # libraries - build all libraries, and install them under ${DESTDIR}.
671 # The list of libraries with dependents (${_prebuild_libs}) and their
672 # interdependencies (__L) are built automatically by the
673 # ${.CURDIR}/tools/make_libdeps.sh script.
677 ${MAKE} -f Makefile.inc1 _startup_libs; \
678 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
679 ${MAKE} -f Makefile.inc1 _generic_libs;
681 # These dependencies are not automatically generated:
683 # gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all
684 # shared libraries for ELF.
686 _startup_libs= gnu/lib/csu gnu/lib/libgcc
687 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-${OBJFORMAT})
688 _startup_libs+= lib/csu/${MACHINE_ARCH}-${OBJFORMAT}
690 _startup_libs+= lib/csu/${MACHINE_ARCH}
695 _generic_libs= gnu/lib
698 _generic_libs+= gnu/usr.bin/perl/libperl
701 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
702 _prebuild_libs+= kerberos5/lib/libasn1
703 _prebuild_libs+= kerberos5/lib/libgssapi
704 _prebuild_libs+= kerberos5/lib/libkrb5
705 _prebuild_libs+= kerberos5/lib/libroken
706 _generic_libs+= kerberos5/lib
709 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
710 _prebuild_libs+= kerberosIV/lib/libkrb
711 kerberosIV/lib/libkrb__L: lib/libcrypt__L
712 _generic_libs+= kerberosIV/lib
715 _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libmd \
716 lib/libncurses lib/libopie lib/libradius lib/libskey \
717 lib/libtacplus lib/libutil \
720 lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
721 lib/libskey__L: lib/libcrypt__L lib/libmd__L
725 .if !defined(NOCRYPT) && !defined(NOSECURE)
726 .if !defined(NO_OPENSSL)
727 _prebuild_libs+= secure/lib/libcrypto secure/lib/libssl
728 .if !defined(NO_OPENSSH)
729 _prebuild_libs+= secure/lib/libssh
730 secure/lib/libssh__L: secure/lib/libcrypto__L lib/libz__L
733 _generic_libs+= secure/lib
736 _generic_libs+= usr.bin/lex/lib
738 .if ${MACHINE_ARCH} == "i386"
739 _generic_libs+= usr.sbin/pcvt/keycap
742 .for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
744 .if exists(${.CURDIR}/${_lib})
745 ${ECHODIR} "===> ${_lib}"; \
746 cd ${.CURDIR}/${_lib}; \
747 ${MAKE} DIRPRFX=${_lib}/ depend; \
748 ${MAKE} DIRPRFX=${_lib}/ all; \
749 ${MAKE} DIRPRFX=${_lib}/ install
753 _startup_libs: ${_startup_libs:S/$/__L/}
754 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
755 _generic_libs: ${_generic_libs:S/$/__L/}
757 .for __target in clean cleandepend cleandir depend includes obj
758 .for entry in ${SUBDIR}
759 ${entry}.${__target}__D: .PHONY
760 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
761 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
762 edir=${entry}.${MACHINE_ARCH}; \
763 cd ${.CURDIR}/$${edir}; \
765 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
767 cd ${.CURDIR}/$${edir}; \
769 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
771 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
774 .include <bsd.subdir.mk>