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.21 2004/03/20 16:27:39 drhodus 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}
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 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}
218 # /usr/bin/gccX version-specific gcc binaries
219 # /usr/lib/gccX version-specific gcc libraries
220 # /usr/libexec/gccX version-specific gcc helper binaries
221 # /usr/libexec/binutilsXXX version-specific binutils
224 usr/lib/gcc2 usr/lib/gcc3 \
225 usr/libexec/gcc2 usr/libexec/gcc3 \
226 usr/lib/compat/aout usr/games \
228 usr/libexec/binutils212 \
229 usr/libexec/binutils212/elf \
230 usr/libexec/binutils212/aout \
231 usr/libexec/binutils212/ldscripts \
232 usr/libexec/binutils214 \
233 usr/libexec/binutils214/elf \
234 usr/libexec/binutils214/ldscripts \
235 usr/sbin usr/share/misc \
237 usr/share/groff_font/devX100 \
238 usr/share/groff_font/devX100-12 \
239 usr/share/groff_font/devX75 \
240 usr/share/groff_font/devX75-12 \
241 usr/share/groff_font/devascii \
242 usr/share/groff_font/devcp1047 \
243 usr/share/groff_font/devdvi \
244 usr/share/groff_font/devhtml \
245 usr/share/groff_font/devkoi8-r \
246 usr/share/groff_font/devlatin1 \
247 usr/share/groff_font/devlbp \
248 usr/share/groff_font/devlj4 \
249 usr/share/groff_font/devps \
250 usr/share/groff_font/devutf8 \
251 usr/share/tmac/mdoc usr/share/tmac/mm
253 # XXX remove in favor of the BSD.include.dist mtree that we already have.
255 INCDIRS= arpa dev c++/2.95 isc libmilter objc openssl \
256 protocols readline rpc rpcsvc security
261 # Attempt to rebuild the entire system, with reasonable chance of
262 # success, regardless of how old your existing system is.
266 @echo "--------------------------------------------------------------"
267 @echo ">>> Rebuilding the temporary build tree"
268 @echo "--------------------------------------------------------------"
269 .if !defined(NOCLEAN)
272 # XXX - These two can depend on any header file.
273 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
274 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
276 .for _dir in ${USRDIRS}
277 mkdir -p ${WORLDTMP}/${_dir}
279 .for _dir in ${INCDIRS}
280 mkdir -p ${WORLDTMP}/usr/include/${_dir}
282 ln -sf ${.CURDIR}/sys ${WORLDTMP}
285 @echo "--------------------------------------------------------------"
286 @echo ">>> stage 1: bootstrap tools"
287 @echo "--------------------------------------------------------------"
288 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
290 .if !defined(NOCLEAN)
292 @echo "--------------------------------------------------------------"
293 @echo ">>> stage 2: cleaning up the object tree"
294 @echo "--------------------------------------------------------------"
295 cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
299 @echo "--------------------------------------------------------------"
300 @echo ">>> stage 2: rebuilding the object tree"
301 @echo "--------------------------------------------------------------"
302 cd ${.CURDIR}; ${WMAKE} par-obj
305 @echo "--------------------------------------------------------------"
306 @echo ">>> stage 2: build tools"
307 @echo "--------------------------------------------------------------"
308 cd ${.CURDIR}; ${TMAKE} build-tools
311 @echo "--------------------------------------------------------------"
312 @echo ">>> stage 3: cross tools"
313 @echo "--------------------------------------------------------------"
314 cd ${.CURDIR}; ${XMAKE} cross-tools
317 @echo "--------------------------------------------------------------"
318 @echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
319 @echo "--------------------------------------------------------------"
320 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
323 @echo "--------------------------------------------------------------"
324 @echo ">>> stage 4: building libraries"
325 @echo "--------------------------------------------------------------"
326 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
329 @echo "--------------------------------------------------------------"
330 @echo ">>> stage 4: make dependencies"
331 @echo "--------------------------------------------------------------"
332 cd ${.CURDIR}; ${WMAKE} par-depend
335 @echo "--------------------------------------------------------------"
336 @echo ">>> stage 4: building everything.."
337 @echo "--------------------------------------------------------------"
338 cd ${.CURDIR}; ${WMAKE} all
342 .if !defined(SUBDIR_OVERRIDE)
343 WMAKE_TGTS+= _worldtmp _bootstrap-tools
345 WMAKE_TGTS+= _cleanobj _obj _build-tools
346 .if !defined(SUBDIR_OVERRIDE)
347 WMAKE_TGTS+= _cross-tools
349 WMAKE_TGTS+= _includes _libraries _depend everything
351 buildworld: ${WMAKE_TGTS}
352 .ORDER: ${WMAKE_TGTS}
357 # Checks to be sure system is ready for installworld
360 .if !defined(NO_SENDMAIL)
361 @if ! `id -u smmsp > /dev/null`; then \
362 echo "ERROR: Required smmsp user is missing, see /usr/src/UPDATING."; \
365 @if ! `id -g smmsp > /dev/null`; then \
366 echo "ERROR: Required smmsp group is missing, see /usr/src/UPDATING."; \
374 # Distributes everything compiled by a `buildworld'.
378 # Installs everything compiled by a 'buildworld'.
380 distributeworld installworld: installcheck
381 mkdir -p ${INSTALLTMP}
382 for prog in [ awk cap_mkdb cat chflags chmod chown \
383 date echo egrep find grep \
384 ln make makewhatis mkdir mtree mv perl pwd_mkdb rm sed sh sysctl \
385 test true uname wc zic; do \
386 cp `which $$prog` ${INSTALLTMP}; \
388 cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
394 # If you have a build server, you can NFS mount the source and obj directories
395 # and do a 'make reinstall' on the *client* to install new binaries from the
396 # most recent server build.
399 @echo "--------------------------------------------------------------"
400 @echo ">>> Making hierarchy"
401 @echo "--------------------------------------------------------------"
402 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
404 @echo "--------------------------------------------------------------"
405 @echo ">>> Installing everything.."
406 @echo "--------------------------------------------------------------"
407 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
408 .if !defined(NOMAN) && !defined(NO_MAKEDB_RUN)
410 @echo "--------------------------------------------------------------"
411 @echo ">>> Rebuilding man page indices"
412 @echo "--------------------------------------------------------------"
413 cd ${.CURDIR}/share/man; ${MAKE} makedb
417 @echo "--------------------------------------------------------------"
418 @echo ">>> Distributing everything.."
419 @echo "--------------------------------------------------------------"
420 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
423 # buildkernel and installkernel
425 # Which kernels to build and/or install is specified by setting
426 # KERNCONF. If not defined a GENERIC kernel is built/installed.
427 # Only the existing (depending TARGET) config files are used
428 # for building kernels and only the first of these is designated
429 # as the one being installed.
431 # Note that we have to use TARGET instead of TARGET_ARCH when
432 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
433 # be set to cross-build, we have to make sure TARGET is set
436 .if !defined(KERNCONF) && defined(KERNEL)
442 INSTKERNNAME?= kernel
444 KRNLSRCDIR= ${.CURDIR}/sys
445 KRNLCONFDIR= ${KRNLSRCDIR}/${TARGET}/conf
446 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
447 KERNCONFDIR?= ${KRNLCONFDIR}
451 .for _kernel in ${KERNCONF}
452 .if exists(${KERNCONFDIR}/${_kernel})
453 BUILDKERNELS+= ${_kernel}
454 .if empty(INSTALLKERNEL)
455 INSTALLKERNEL= ${_kernel}
463 # Builds all kernels defined by BUILDKERNELS.
466 .if empty(BUILDKERNELS)
467 @echo ">>> ERROR: Missing kernel configuration file(s) (${KERNCONF})."
470 .if defined(KERNWARN)
471 @echo "--------------------------------------------------------------"
472 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
473 @echo "--------------------------------------------------------------"
477 .for _kernel in ${BUILDKERNELS}
478 @echo "--------------------------------------------------------------"
479 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
480 @echo "--------------------------------------------------------------"
481 @echo "===> ${_kernel}"
482 mkdir -p ${KRNLOBJDIR}
483 .if !defined(NO_KERNELCONFIG)
486 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
487 ${KERNCONFDIR}/${_kernel}
489 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
490 cd ${KRNLOBJDIR}/${_kernel}; \
491 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} -DNO_MODULES clean
492 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KRNLSRCDIR}/modules)
493 cd ${KRNLOBJDIR}/${_kernel}; \
494 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} cleandir
497 cd ${KRNLOBJDIR}/${_kernel}; \
498 MAKESRCPATH=${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm \
499 ${MAKE} -DBOOTSTRAPPING -f ${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm/Makefile
500 .if !defined(NO_KERNELDEPEND)
501 cd ${KRNLOBJDIR}/${_kernel}; \
502 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
504 cd ${KRNLOBJDIR}/${_kernel}; \
505 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all
506 @echo "--------------------------------------------------------------"
507 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
508 @echo "--------------------------------------------------------------"
514 # Install the kernel defined by INSTALLKERNEL
516 installkernel reinstallkernel:
517 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
518 ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
523 # Update the source tree, by running sup and/or running cvs to update to the
527 .if defined(SUP_UPDATE)
528 @echo "--------------------------------------------------------------"
529 @echo ">>> Running ${SUP}"
530 @echo "--------------------------------------------------------------"
532 @${SUP} ${SUPFLAGS} ${SUPFILE}
534 .if defined(SUPFILE1)
535 @${SUP} ${SUPFLAGS} ${SUPFILE1}
537 .if defined(SUPFILE2)
538 @${SUP} ${SUPFLAGS} ${SUPFILE2}
540 .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
541 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
543 .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
544 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
547 .if defined(CVS_UPDATE)
548 @echo "--------------------------------------------------------------"
549 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
550 @echo "--------------------------------------------------------------"
551 cd ${.CURDIR}; cvs -q update -rRELENG_4 -P -d
557 # Build most of the user binaries on the existing system libs and includes.
560 @echo "--------------------------------------------------------------"
561 @echo ">>> Building programs only"
562 @echo "--------------------------------------------------------------"
563 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
564 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ all
570 # Install the binaries built by the 'most' target. This does not include
571 # libraries or include files.
574 @echo "--------------------------------------------------------------"
575 @echo ">>> Installing programs only"
576 @echo "--------------------------------------------------------------"
577 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
578 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ install
582 # ------------------------------------------------------------------------
584 # From here onwards are utility targets used by the 'make world' and
585 # related targets. If your 'world' breaks, you may like to try to fix
586 # the problem and manually run the following targets to attempt to
587 # complete the build. Beware, this is *not* guaranteed to work, you
588 # need to have a pretty good grip on the current state of the system
589 # to attempt to manually finish it. If in doubt, 'make world' again.
592 # bootstrap-tools: Build tools needed for compatibility
594 # [x]install: dependancies on various new install features
595 # rpcgen: old rpcgen used a hardwired cpp path, newer OBJFORMAT_PATH
596 # envs are not compatible with older objformat binaries.
598 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
599 _strfile= games/fortune/strfile
603 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef \
604 usr.bin/uudecode usr.bin/xinstall usr.bin/rpcgen \
606 gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo
607 ${ECHODIR} "===> ${_tool}"; \
608 cd ${.CURDIR}/${_tool}; \
609 ${MAKE} DIRPRFX=${_tool}/ obj; \
610 ${MAKE} DIRPRFX=${_tool}/ depend; \
611 ${MAKE} DIRPRFX=${_tool}/ all; \
612 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
615 # build-tools: Build special purpose build tools. gcc2 related tools are
616 # only built under the i386 architecture. Other architectures are
619 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
620 _games= games/adventure games/hack games/phantasia
623 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
624 _share= share/syscons/scrnmaps
627 _gcc3_cross= gnu/usr.bin/cc3
628 _gcc3_tools= gnu/usr.bin/cc3/cc_tools
629 .if ${MACHINE_ARCH} == "i386" && ${TARGET_ARCH} == "i386"
630 _gcc2_cross= gnu/usr.bin/cc
631 _gcc2_tools= gnu/usr.bin/cc/cc_tools
632 _binutils= gnu/usr.bin/binutils gnu/usr.bin/binutils214
634 _binutils= gnu/usr.bin/binutils214
637 .if !defined(NO_FORTRAN)
638 .if ${TARGET_ARCH} == "i386"
639 _fortran= gnu/usr.bin/cc/f771
641 _fortran= gnu/usr.bin/cc3/f771
646 _perl= gnu/usr.bin/perl/miniperl
649 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
650 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
651 _libkrb5= kerberos5/lib/libroken kerberos5/lib/libvers \
652 kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
655 .if defined(RELEASEDIR)
656 _sysinstall= release/sysinstall
659 # build-tools: tools we need
662 .for _tool in bin/csh bin/sh ${_games} ${_gcc2_tools} ${_gcc3_tools} \
663 ${_fortran} ${_perl} ${_libroken4} ${_libkrb5} \
664 lib/libncurses ${_share} usr.bin/awk usr.bin/file \
666 ${ECHODIR} "===> ${_tool}"; \
667 cd ${.CURDIR}/${_tool}; \
668 ${MAKE} DIRPRFX=${_tool}/ obj; \
669 ${MAKE} DIRPRFX=${_tool}/ build-tools
673 # cross-tools: Build cross-building tools
675 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
676 _elf2exe= usr.sbin/elf2exe
679 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
680 _btxld= usr.sbin/btxld
684 .for _tool in ${_btxld} ${_elf2exe} ${_binutils} \
685 usr.bin/objformat usr.sbin/crunch/crunchide \
686 ${_gcc2_cross} ${_gcc3_cross}
687 ${ECHODIR} "===> ${_tool}"; \
688 cd ${.CURDIR}/${_tool}; \
689 ${MAKE} DIRPRFX=${_tool}/ obj; \
690 ${MAKE} DIRPRFX=${_tool}/ depend; \
691 ${MAKE} DIRPRFX=${_tool}/ all; \
692 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
696 # hierarchy - ensure that all the needed directories are present
699 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
702 # libraries - build all libraries, and install them under ${DESTDIR}.
704 # The list of libraries with dependents (${_prebuild_libs}) and their
705 # interdependencies (__L) are built automatically by the
706 # ${.CURDIR}/tools/make_libdeps.sh script.
708 # .makeenv does not work when bootstrapping from 4.x, so we must be sure
709 # to specify the correct CCVER or 'cc' will not exec the correct compiler.
713 CCVER=gcc2 ${MAKE} -f Makefile.inc1 _startup_libs2; \
714 CCVER=gcc3 ${MAKE} -f Makefile.inc1 _startup_libs3; \
715 ${MAKE} -f Makefile.inc1 _startup_libs; \
716 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
717 ${MAKE} -f Makefile.inc1 _generic_libs;
719 # These dependencies are not automatically generated:
721 # gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all
722 # shared libraries for ELF. The targets for _startup_libs{2,3} are
723 # specifically built using gcc{2,3}.
725 _startup_libs2= gnu/lib/gcc2/csu gnu/lib/gcc2/libgcc
726 _startup_libs3= gnu/lib/gcc3/csu gnu/lib/gcc3/libgcc
727 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
728 _startup_libs= lib/csu/${MACHINE_ARCH}-elf
730 _startup_libs= lib/csu/${MACHINE_ARCH}
735 _generic_libs= gnu/lib
738 _generic_libs+= gnu/usr.bin/perl/libperl
741 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
742 _prebuild_libs+= kerberos5/lib/libasn1
743 _prebuild_libs+= kerberos5/lib/libgssapi
744 _prebuild_libs+= kerberos5/lib/libkrb5
745 _prebuild_libs+= kerberos5/lib/libroken
746 _generic_libs+= kerberos5/lib
749 _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libmd \
750 lib/libncurses lib/libopie lib/libradius lib/libskey \
751 lib/libtacplus lib/libutil \
754 lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
755 lib/libskey__L: lib/libcrypt__L lib/libmd__L
759 .if !defined(NOCRYPT)
760 .if !defined(NO_OPENSSL)
761 _prebuild_libs+= secure/lib/libcrypto secure/lib/libssl
762 .if !defined(NO_OPENSSH)
763 _prebuild_libs+= secure/lib/libssh
764 secure/lib/libssh__L: secure/lib/libcrypto__L lib/libz__L
767 _generic_libs+= secure/lib
770 _generic_libs+= usr.bin/lex/lib
772 .if ${MACHINE_ARCH} == "i386"
773 _generic_libs+= usr.sbin/pcvt/keycap
776 .for _lib in ${_startup_libs2} ${_startup_libs3} ${_startup_libs} \
777 ${_prebuild_libs} ${_generic_libs}
779 .if exists(${.CURDIR}/${_lib})
780 ${ECHODIR} "===> ${_lib}"; \
781 cd ${.CURDIR}/${_lib}; \
782 ${MAKE} DIRPRFX=${_lib}/ depend; \
783 ${MAKE} DIRPRFX=${_lib}/ all; \
784 ${MAKE} DIRPRFX=${_lib}/ install
788 # only mess with gcc2 for i386 architectures.
790 _startup_libs: ${_startup_libs:S/$/__L/}
791 .if ${TARGET_ARCH} == "i386"
792 _startup_libs2: ${_startup_libs2:S/$/__L/}
796 _startup_libs3: ${_startup_libs3:S/$/__L/}
797 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
798 _generic_libs: ${_generic_libs:S/$/__L/}
800 .for __target in clean cleandepend cleandir depend includes obj
801 .for entry in ${SUBDIR}
802 ${entry}.${__target}__D: .PHONY
803 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
804 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
805 edir=${entry}.${MACHINE_ARCH}; \
806 cd ${.CURDIR}/$${edir}; \
808 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
810 cd ${.CURDIR}/$${edir}; \
812 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
814 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
817 # The wmake target is used by /usr/bin/wmake to run make in a
818 # world build environment.
821 @echo '${WMAKEENV} ${MAKE} ${WMAKE_ARGS}'
824 @echo '${WMAKEENV} /bin/sh'
827 @echo '${BMAKEENV} /bin/sh'
830 @echo '${TMAKEENV} /bin/sh'
832 .include <bsd.subdir.mk>