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.2 2003/06/17 04:21:10 dillon Exp $
5 # Make command line options:
6 # -DMAKE_KERBEROS4 to build KerberosIV
7 # -DMAKE_KERBEROS5 to build Kerberos5
8 # -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
9 # -DNOCLEAN do not clean at all
10 # -DNOCRYPT will prevent building of crypt versions
11 # -DNOMAN do not build the manual pages
12 # -DNOPROFILE do not build profiled libraries
13 # -DNOSECURE do not go into secure subdir
14 # -DNOGAMES do not go into games subdir
15 # -DNOSHARE do not go into share subdir
16 # -DNOINFO do not make or install info files
17 # -DNOLIBC_R do not build libc_r.
18 # -DNO_FORTRAN do not build g77 and related libraries.
19 # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
20 # -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
21 # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
22 # -DNO_PORTSUPDATE do not update ports in ${MAKE} update
23 # -DNO_DOCUPDATE do not update doc in ${MAKE} update
24 # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
25 # TARGET_ARCH="arch" to crossbuild world to a different arch
28 # The intended user-driven targets are:
29 # buildworld - rebuild *everything*, including glue to help do upgrades
30 # installworld- install everything built by "buildworld"
31 # update - convenient way to update your source tree (eg: sup/cvs)
32 # most - build user commands, no libraries or include files
33 # installmost - install user commands, no libraries or include files
35 # Standard targets (not defined here) are documented in the makefiles in
36 # /usr/share/mk. These include:
37 # obj depend all install clean cleandepend cleanobj
39 # Put initial settings here.
42 # We must do share/info early so that installation of info `dir'
43 # entries works correctly. Do it first since it is less likely to
44 # grow dependencies on include and lib than vice versa.
45 .if exists(${.CURDIR}/share/info)
49 # We must do include and lib early so that the perl *.ph generation
50 # works correctly as it uses the header files installed by this.
51 .if exists(${.CURDIR}/include)
54 .if exists(${.CURDIR}/lib)
58 .if exists(${.CURDIR}/bin)
61 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
64 .if exists(${.CURDIR}/gnu)
67 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
68 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS4)
71 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
72 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS5)
75 .if exists(${.CURDIR}/libexec)
78 .if exists(${.CURDIR}/sbin)
81 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
84 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
87 .if exists(${.CURDIR}/sys)
90 .if exists(${.CURDIR}/usr.bin)
93 .if exists(${.CURDIR}/usr.sbin)
97 # etc must be last for "distribute" to work
98 .if exists(${.CURDIR}/etc)
102 # These are last, since it is nice to at least get the base system
103 # rebuilt before you do them.
104 .if defined(LOCAL_DIRS)
105 .for _DIR in ${LOCAL_DIRS}
106 .if exists(${.CURDIR}/${_DIR}) & exists(${.CURDIR}/${_DIR}/Makefile)
112 .if defined(SUBDIR_OVERRIDE)
113 SUBDIR= ${SUBDIR_OVERRIDE}
116 .if defined(NOCLEANDIR)
117 CLEANDIR= clean cleandepend
122 SUP?= /usr/local/bin/cvsup
123 SUPFLAGS?= -g -L 2 -P -
125 SUPFLAGS+= -h ${SUPHOST}
128 MAKEOBJDIRPREFIX?= /usr/obj
129 TARGET_ARCH?= ${MACHINE_ARCH}
130 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
133 TARGET?= ${TARGET_ARCH}
136 BUILD_ARCH!= sysctl -n hw.machine_arch
137 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
138 .error To cross-build, set TARGET_ARCH.
141 .if ${MACHINE} == ${TARGET}
142 OBJTREE= ${MAKEOBJDIRPREFIX}
144 OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}
146 WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH}
147 # /usr/games added for fortune which depend on strfile
148 STRICTTMPPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
149 TMPPATH= ${STRICTTMPPATH}:${PATH}
150 OBJFORMAT_PATH?= /usr/libexec
154 INSTALLTMP= ${TMPDIR}/install.${TMPPID}
157 # Building a world goes through the following stages
159 # 1. bootstrap-tool stage [BMAKE]
160 # This stage is responsible for creating programs that
161 # are needed for backward compatibility reasons. They
162 # are not built as cross-tools.
163 # 2. build-tool stage [TMAKE]
164 # This stage is responsible for creating the object
165 # tree and building any tools that are needed during
167 # 3. cross-tool stage [XMAKE]
168 # This stage is responsible for creating any tools that
169 # are needed for cross-builds. A cross-compiler is one
171 # 4. world stage [WMAKE]
172 # This stage actually builds the world.
173 # 5. install stage (optional) [IMAKE]
174 # This stage installs a previously built world.
177 # Common environment for world related stages
178 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
179 MACHINE_ARCH=${TARGET_ARCH} \
181 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
182 PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.00503 \
183 GROFF_BIN_PATH=${WORLDTMP}/usr/bin \
184 GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \
185 GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac
187 # bootstrap-tool stage
188 BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
190 INSTALL="sh ${.CURDIR}/tools/install.sh"
191 BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
192 -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
196 TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
198 INSTALL="sh ${.CURDIR}/tools/install.sh"
199 TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING
202 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB
205 WMAKEENV= ${CROSSENV} \
206 DESTDIR=${WORLDTMP} \
207 INSTALL="sh ${.CURDIR}/tools/install.sh" \
209 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
212 IMAKEENV= ${CROSSENV} \
213 PATH=${STRICTTMPPATH}:${INSTALLTMP}
214 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
217 KMAKEENV= ${WMAKEENV} \
218 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec:${OBJFORMAT_PATH}
220 USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \
221 usr/libexec/${OBJFORMAT} usr/sbin usr/share/misc \
223 usr/share/groff_font/devX100 \
224 usr/share/groff_font/devX100-12 \
225 usr/share/groff_font/devX75 \
226 usr/share/groff_font/devX75-12 \
227 usr/share/groff_font/devascii \
228 usr/share/groff_font/devcp1047 \
229 usr/share/groff_font/devdvi \
230 usr/share/groff_font/devhtml \
231 usr/share/groff_font/devkoi8-r \
232 usr/share/groff_font/devlatin1 \
233 usr/share/groff_font/devlbp \
234 usr/share/groff_font/devlj4 \
235 usr/share/groff_font/devps \
236 usr/share/groff_font/devutf8 \
237 usr/share/tmac/mdoc usr/share/tmac/mm
239 INCDIRS= arpa dev fs g++/std isc isofs libmilter objc openssl \
240 protocols readline rpc rpcsvc security ufs
245 # Attempt to rebuild the entire system, with reasonable chance of
246 # success, regardless of how old your existing system is.
250 @echo "--------------------------------------------------------------"
251 @echo ">>> Rebuilding the temporary build tree"
252 @echo "--------------------------------------------------------------"
253 .if !defined(NOCLEAN)
256 # XXX - These two can depend on any header file.
257 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
258 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
260 .for _dir in ${USRDIRS}
261 mkdir -p ${WORLDTMP}/${_dir}
263 .for _dir in ${INCDIRS}
264 mkdir -p ${WORLDTMP}/usr/include/${_dir}
266 ln -sf ${.CURDIR}/sys ${WORLDTMP}
269 @echo "--------------------------------------------------------------"
270 @echo ">>> stage 1: bootstrap tools"
271 @echo "--------------------------------------------------------------"
272 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
274 .if !defined(NOCLEAN)
276 @echo "--------------------------------------------------------------"
277 @echo ">>> stage 2: cleaning up the object tree"
278 @echo "--------------------------------------------------------------"
279 cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
283 @echo "--------------------------------------------------------------"
284 @echo ">>> stage 2: rebuilding the object tree"
285 @echo "--------------------------------------------------------------"
286 cd ${.CURDIR}; ${WMAKE} par-obj
289 @echo "--------------------------------------------------------------"
290 @echo ">>> stage 2: build tools"
291 @echo "--------------------------------------------------------------"
292 cd ${.CURDIR}; ${TMAKE} build-tools
295 @echo "--------------------------------------------------------------"
296 @echo ">>> stage 3: cross tools"
297 @echo "--------------------------------------------------------------"
298 cd ${.CURDIR}; ${XMAKE} cross-tools
301 @echo "--------------------------------------------------------------"
302 @echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
303 @echo "--------------------------------------------------------------"
304 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
307 @echo "--------------------------------------------------------------"
308 @echo ">>> stage 4: building libraries"
309 @echo "--------------------------------------------------------------"
310 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
313 @echo "--------------------------------------------------------------"
314 @echo ">>> stage 4: make dependencies"
315 @echo "--------------------------------------------------------------"
316 cd ${.CURDIR}; ${WMAKE} par-depend
319 @echo "--------------------------------------------------------------"
320 @echo ">>> stage 4: building everything.."
321 @echo "--------------------------------------------------------------"
322 cd ${.CURDIR}; ${WMAKE} all
326 .if !defined(SUBDIR_OVERRIDE)
327 WMAKE_TGTS+= _worldtmp _bootstrap-tools
329 WMAKE_TGTS+= _cleanobj _obj _build-tools
330 .if !defined(SUBDIR_OVERRIDE)
331 WMAKE_TGTS+= _cross-tools
333 WMAKE_TGTS+= _includes _libraries _depend everything
335 buildworld: ${WMAKE_TGTS}
336 .ORDER: ${WMAKE_TGTS}
341 # Checks to be sure system is ready for installworld
344 .if !defined(NO_SENDMAIL)
345 @if ! `grep -q '^smmsp:' /etc/passwd`; then \
346 echo "ERROR: Required smmsp user is missing, see /usr/src/UPDATING."; \
349 @if ! `grep -q '^smmsp:' /etc/group`; then \
350 echo "ERROR: Required smmsp group is missing, see /usr/src/UPDATING."; \
358 # Distributes everything compiled by a `buildworld'.
362 # Installs everything compiled by a 'buildworld'.
364 distributeworld installworld: installcheck
365 mkdir -p ${INSTALLTMP}
366 for prog in [ awk cap_mkdb cat chflags chmod chown \
367 date echo egrep find grep \
368 ln make makewhatis mkdir mtree mv perl pwd_mkdb rm sed sh sysctl \
369 test true uname wc zic; do \
370 cp `which $$prog` ${INSTALLTMP}; \
372 cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
378 # If you have a build server, you can NFS mount the source and obj directories
379 # and do a 'make reinstall' on the *client* to install new binaries from the
380 # most recent server build.
383 @echo "--------------------------------------------------------------"
384 @echo ">>> Making hierarchy"
385 @echo "--------------------------------------------------------------"
386 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
388 @echo "--------------------------------------------------------------"
389 @echo ">>> Installing everything.."
390 @echo "--------------------------------------------------------------"
391 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
392 .if !defined(NOMAN) && !defined(NO_MAKEDB_RUN)
394 @echo "--------------------------------------------------------------"
395 @echo ">>> Rebuilding man page indices"
396 @echo "--------------------------------------------------------------"
397 cd ${.CURDIR}/share/man; ${MAKE} makedb
401 @echo "--------------------------------------------------------------"
402 @echo ">>> Distributing everything.."
403 @echo "--------------------------------------------------------------"
404 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
407 # buildkernel and installkernel
409 # Which kernels to build and/or install is specified by setting
410 # KERNCONF. If not defined a GENERIC kernel is built/installed.
411 # Only the existing (depending TARGET) config files are used
412 # for building kernels and only the first of these is designated
413 # as the one being installed.
415 # Note that we have to use TARGET instead of TARGET_ARCH when
416 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
417 # be set to cross-build, we have to make sure TARGET is set
420 .if !defined(KERNCONF) && defined(KERNEL)
426 INSTKERNNAME?= kernel
428 KRNLSRCDIR= ${.CURDIR}/sys
429 KRNLCONFDIR= ${KRNLSRCDIR}/${TARGET}/conf
430 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
431 KERNCONFDIR?= ${KRNLCONFDIR}
435 .for _kernel in ${KERNCONF}
436 .if exists(${KERNCONFDIR}/${_kernel})
437 BUILDKERNELS+= ${_kernel}
438 .if empty(INSTALLKERNEL)
439 INSTALLKERNEL= ${_kernel}
447 # Builds all kernels defined by BUILDKERNELS.
450 .if empty(BUILDKERNELS)
451 @echo ">>> ERROR: Missing kernel configuration file(s) (${KERNCONF})."
454 .if defined(KERNWARN)
455 @echo "--------------------------------------------------------------"
456 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
457 @echo "--------------------------------------------------------------"
461 .for _kernel in ${BUILDKERNELS}
462 @echo "--------------------------------------------------------------"
463 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
464 @echo "--------------------------------------------------------------"
465 @echo "===> ${_kernel}"
466 mkdir -p ${KRNLOBJDIR}
467 .if !defined(NO_KERNELCONFIG)
470 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
471 ${KERNCONFDIR}/${_kernel}
473 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
474 cd ${KRNLOBJDIR}/${_kernel}; \
475 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} -DNO_MODULES clean
476 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KRNLSRCDIR}/modules)
477 cd ${KRNLOBJDIR}/${_kernel}; \
478 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} cleandir
481 cd ${KRNLOBJDIR}/${_kernel}; \
482 MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx/aicasm \
483 ${MAKE} -DBOOTSTRAPPING -f ${KRNLSRCDIR}/dev/aic7xxx/aicasm/Makefile
484 .if !defined(NO_KERNELDEPEND)
485 cd ${KRNLOBJDIR}/${_kernel}; \
486 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
488 cd ${KRNLOBJDIR}/${_kernel}; \
489 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all
490 @echo "--------------------------------------------------------------"
491 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
492 @echo "--------------------------------------------------------------"
498 # Install the kernel defined by INSTALLKERNEL
500 installkernel reinstallkernel:
501 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
502 ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
507 # Update the source tree, by running sup and/or running cvs to update to the
511 .if defined(SUP_UPDATE)
512 @echo "--------------------------------------------------------------"
513 @echo ">>> Running ${SUP}"
514 @echo "--------------------------------------------------------------"
516 @${SUP} ${SUPFLAGS} ${SUPFILE}
518 .if defined(SUPFILE1)
519 @${SUP} ${SUPFLAGS} ${SUPFILE1}
521 .if defined(SUPFILE2)
522 @${SUP} ${SUPFLAGS} ${SUPFILE2}
524 .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
525 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
527 .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
528 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
531 .if defined(CVS_UPDATE)
532 @echo "--------------------------------------------------------------"
533 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
534 @echo "--------------------------------------------------------------"
535 cd ${.CURDIR}; cvs -q update -rRELENG_4 -P -d
541 # Build most of the user binaries on the existing system libs and includes.
544 @echo "--------------------------------------------------------------"
545 @echo ">>> Building programs only"
546 @echo "--------------------------------------------------------------"
547 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
548 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ all
554 # Install the binaries built by the 'most' target. This does not include
555 # libraries or include files.
558 @echo "--------------------------------------------------------------"
559 @echo ">>> Installing programs only"
560 @echo "--------------------------------------------------------------"
561 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
562 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ install
566 # ------------------------------------------------------------------------
568 # From here onwards are utility targets used by the 'make world' and
569 # related targets. If your 'world' breaks, you may like to try to fix
570 # the problem and manually run the following targets to attempt to
571 # complete the build. Beware, this is *not* guaranteed to work, you
572 # need to have a pretty good grip on the current state of the system
573 # to attempt to manually finish it. If in doubt, 'make world' again.
577 # bootstrap-tools: Build tools needed for compatibility
579 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
580 _strfile= games/fortune/strfile
584 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef \
585 usr.bin/uudecode usr.bin/xinstall \
587 gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo
588 ${ECHODIR} "===> ${_tool}"; \
589 cd ${.CURDIR}/${_tool}; \
590 ${MAKE} DIRPRFX=${_tool}/ obj; \
591 ${MAKE} DIRPRFX=${_tool}/ depend; \
592 ${MAKE} DIRPRFX=${_tool}/ all; \
593 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
597 # build-tools: Build special purpose build tools
599 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
600 _games= games/adventure games/hack games/phantasia
603 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
604 _share= share/syscons/scrnmaps
607 .if !defined(NO_FORTRAN)
608 _fortran= gnu/usr.bin/cc/f771
612 _perl= gnu/usr.bin/perl/miniperl
615 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
616 !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
617 _libroken4= kerberosIV/lib/libroken
620 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
621 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
622 _libkrb5= kerberos5/lib/libroken kerberos5/lib/libvers \
623 kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
626 .if defined(RELEASEDIR)
627 _sysinstall= release/sysinstall
631 .for _tool in bin/csh bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
632 ${_perl} ${_libroken4} ${_libkrb5} lib/libncurses ${_share} \
633 usr.bin/awk usr.bin/file ${_sysinstall}
634 ${ECHODIR} "===> ${_tool}"; \
635 cd ${.CURDIR}/${_tool}; \
636 ${MAKE} DIRPRFX=${_tool}/ obj; \
637 ${MAKE} DIRPRFX=${_tool}/ build-tools
641 # cross-tools: Build cross-building tools
643 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
644 _elf2exe= usr.sbin/elf2exe
647 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
648 _btxld= usr.sbin/btxld
652 .for _tool in ${_btxld} ${_elf2exe} usr.bin/genassym usr.bin/gensetdefs \
653 gnu/usr.bin/binutils usr.bin/objformat usr.sbin/crunch/crunchide \
655 ${ECHODIR} "===> ${_tool}"; \
656 cd ${.CURDIR}/${_tool}; \
657 ${MAKE} DIRPRFX=${_tool}/ obj; \
658 ${MAKE} DIRPRFX=${_tool}/ depend; \
659 ${MAKE} DIRPRFX=${_tool}/ all; \
660 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
664 # hierarchy - ensure that all the needed directories are present
667 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
670 # libraries - build all libraries, and install them under ${DESTDIR}.
672 # The list of libraries with dependents (${_prebuild_libs}) and their
673 # interdependencies (__L) are built automatically by the
674 # ${.CURDIR}/tools/make_libdeps.sh script.
678 ${MAKE} -f Makefile.inc1 _startup_libs; \
679 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
680 ${MAKE} -f Makefile.inc1 _generic_libs;
682 # These dependencies are not automatically generated:
684 # gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all
685 # shared libraries for ELF.
687 _startup_libs= gnu/lib/csu gnu/lib/libgcc
688 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-${OBJFORMAT})
689 _startup_libs+= lib/csu/${MACHINE_ARCH}-${OBJFORMAT}
691 _startup_libs+= lib/csu/${MACHINE_ARCH}
696 _generic_libs= gnu/lib
699 _generic_libs+= gnu/usr.bin/perl/libperl
702 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
703 _prebuild_libs+= kerberos5/lib/libasn1
704 _prebuild_libs+= kerberos5/lib/libgssapi
705 _prebuild_libs+= kerberos5/lib/libkrb5
706 _prebuild_libs+= kerberos5/lib/libroken
707 _generic_libs+= kerberos5/lib
710 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
711 _prebuild_libs+= kerberosIV/lib/libkrb
712 kerberosIV/lib/libkrb__L: lib/libcrypt__L
713 _generic_libs+= kerberosIV/lib
716 _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libmd \
717 lib/libncurses lib/libopie lib/libradius lib/libskey \
718 lib/libtacplus lib/libutil \
721 lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
722 lib/libskey__L: lib/libcrypt__L lib/libmd__L
726 .if !defined(NOCRYPT) && !defined(NOSECURE)
727 .if !defined(NO_OPENSSL)
728 _prebuild_libs+= secure/lib/libcrypto secure/lib/libssl
729 .if !defined(NO_OPENSSH)
730 _prebuild_libs+= secure/lib/libssh
731 secure/lib/libssh__L: secure/lib/libcrypto__L lib/libz__L
734 _generic_libs+= secure/lib
737 _generic_libs+= usr.bin/lex/lib
739 .if ${MACHINE_ARCH} == "i386"
740 _generic_libs+= usr.sbin/pcvt/keycap
743 .for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
745 .if exists(${.CURDIR}/${_lib})
746 ${ECHODIR} "===> ${_lib}"; \
747 cd ${.CURDIR}/${_lib}; \
748 ${MAKE} DIRPRFX=${_lib}/ depend; \
749 ${MAKE} DIRPRFX=${_lib}/ all; \
750 ${MAKE} DIRPRFX=${_lib}/ install
754 _startup_libs: ${_startup_libs:S/$/__L/}
755 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
756 _generic_libs: ${_generic_libs:S/$/__L/}
758 .for __target in clean cleandepend cleandir depend includes obj
759 .for entry in ${SUBDIR}
760 ${entry}.${__target}__D: .PHONY
761 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
762 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
763 edir=${entry}.${MACHINE_ARCH}; \
764 cd ${.CURDIR}/$${edir}; \
766 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
768 cd ${.CURDIR}/$${edir}; \
770 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
772 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
775 .include <bsd.subdir.mk>