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.25 2004/03/23 17:21:09 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
25 # The intended user-driven targets are:
27 # buildworld - rebuild *everything*, including glue to help do upgrades
28 # quickworld - skip the glue and do a depend+build on the meat
29 # realquickworld - skip the glue and depend stages and just build the meat
30 # crossworld - only build the glue (particularly the cross-build environment)
31 # installworld- install everything built by "buildworld"
32 # update - convenient way to update your source tree (eg: sup/cvs)
33 # most - build user commands, no libraries or include files
34 # installmost - install user commands, no libraries or include files
36 # Standard targets (not defined here) are documented in the makefiles in
37 # /usr/share/mk. These include:
38 # obj depend all install clean cleandepend cleanobj
40 # Put initial settings here.
43 # We must do share/info early so that installation of info `dir'
44 # entries works correctly. Do it first since it is less likely to
45 # grow dependencies on include and lib than vice versa.
46 .if exists(${.CURDIR}/share/info)
50 # We must do include and lib early so that the perl *.ph generation
51 # works correctly as it uses the header files installed by this.
52 .if exists(${.CURDIR}/include)
55 .if exists(${.CURDIR}/lib)
58 # This exists simply to ensure that the obj dir hierarchy is
59 # intact for nrelease, allowing the nrelease Makefile's to
60 # reference ${.OBJDIR}.
62 .if exists(${.CURDIR}/nrelease)
66 .if exists(${.CURDIR}/bin)
69 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
72 .if exists(${.CURDIR}/gnu)
75 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
76 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS5)
79 .if exists(${.CURDIR}/libexec)
82 .if exists(${.CURDIR}/sbin)
85 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT)
88 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
91 .if exists(${.CURDIR}/sys)
94 .if exists(${.CURDIR}/usr.bin)
97 .if exists(${.CURDIR}/usr.sbin)
101 # etc must be last for "distribute" to work
102 .if exists(${.CURDIR}/etc)
106 # These are last, since it is nice to at least get the base system
107 # rebuilt before you do them.
108 .if defined(LOCAL_DIRS)
109 .for _DIR in ${LOCAL_DIRS}
110 .if exists(${.CURDIR}/${_DIR}) & exists(${.CURDIR}/${_DIR}/Makefile)
116 .if defined(SUBDIR_OVERRIDE)
117 SUBDIR= ${SUBDIR_OVERRIDE}
120 .if defined(NOCLEANDIR)
121 CLEANDIR= clean cleandepend
126 SUP?= /usr/local/bin/cvsup
127 SUPFLAGS?= -g -L 2 -P -
129 SUPFLAGS+= -h ${SUPHOST}
132 # Object directory base in primary make. Note that when we rerun make
133 # from inside this file we change MAKEOBJDIRPREFIX to the appropriate
134 # subdirectory because the rest of the build system needs it that way.
135 # The original object directory base is saved in OBJTREE.
137 MAKEOBJDIRPREFIX?= /usr/obj
138 OBJTREE?= ${MAKEOBJDIRPREFIX}
140 # Used for stage installs and pathing
142 DESTDIRBASE?= ${OBJTREE}${.CURDIR}
144 TARGET_ARCH?= ${MACHINE_ARCH}
145 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
148 TARGET?= ${TARGET_ARCH}
151 BUILD_ARCH!= sysctl -n hw.machine_arch
152 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
153 .error To cross-build, set TARGET_ARCH.
157 # BTOOLS (Natively built) All non-cross-development tools that the
158 # main build needs. This includes things like 'mkdir' and 'rm'.
159 # We will not use the native system's exec path once we start
160 # on WORLD. (bootstrap-tools and build-tools or BTOOLS)
162 # CTOOLS (Natively built) Cross development tools which are specific
163 # to the target architecture.
165 # WORLD (Cross built) Our ultimate buildworld, using only BTOOLS and
168 # MACHINE_ARCH Architecture we are building on
169 # TARGET_ARCH Architecture we are building for
171 BTOOLSDEST= ${DESTDIRBASE}/btools_${MACHINE_ARCH}
172 CTOOLSDEST= ${DESTDIRBASE}/ctools_${MACHINE_ARCH}_${TARGET_ARCH}
173 WORLDDEST= ${DESTDIRBASE}/world_${TARGET_ARCH}
175 # The strict temporary command path contains all binaries required
176 # by the buildworld system after the cross-tools stage.
178 STRICTTMPPATH= ${CTOOLSDEST}/usr/sbin:${CTOOLSDEST}/usr/bin:${CTOOLSDEST}/bin:${CTOOLSDEST}/usr/games:${BTOOLSDEST}/usr/sbin:${BTOOLSDEST}/usr/bin:${BTOOLSDEST}/bin:${BTOOLSDEST}/usr/games
184 # Building a world goes through the following stages
186 # 1. bootstrap-tool stage [BMAKE]
187 # This stage is responsible for creating programs that
188 # are needed for backward compatibility reasons. They
189 # are not built as cross-tools.
190 # 2. build-tool stage [TMAKE]
191 # This stage is responsible for creating the object
192 # tree and building any tools that are needed during
194 # 3. cross-tool stage [XMAKE]
195 # This stage is responsible for creating any tools that
196 # are needed for cross-builds. A cross-compiler is one
198 # 4. world stage [WMAKE]
199 # This stage actually builds the world.
200 # 5. install stage (optional) [IMAKE]
201 # This stage installs a previously built world.
204 # bootstrap-tool stage
206 BMAKEENV= MAKEOBJDIRPREFIX=${BTOOLSDEST} \
209 INSTALL="sh ${.CURDIR}/tools/install.sh"
211 BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
212 -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
217 TMAKEENV= MAKEOBJDIRPREFIX=${BTOOLSDEST} \
220 INSTALL="sh ${.CURDIR}/tools/install.sh"
222 TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
227 # note: TOOLS_PREFIX points to the obj root holding the cross
228 # compiler binaries, while INCS_PREFIX points to the obj root holding
229 # the target environment (and also determines where cross-built
230 # libraries and crt*.o are installed).
232 XMAKEENV= MAKEOBJDIRPREFIX=${CTOOLSDEST} \
234 DESTDIR=${CTOOLSDEST} \
235 INSTALL="sh ${.CURDIR}/tools/install.sh" \
236 TOOLS_PREFIX=${CTOOLSDEST} \
237 USRDATA_PREFIX=${WORLDDEST}
239 XMAKE= ${XMAKEENV} ${MAKE} -f Makefile.inc1 -DNO_FORTRAN -DNO_GDB
241 # world stage, note the strict path and note that TOOLS_PREFIX is left
242 # unset and USRDATA_PREFIX (which defaults to TOOLS_PREFIX) is set to empty,
243 # which is primarily for the compiler so it targets / (e.g. /usr/<blah>)
244 # for both binary and library paths, even though it is being compiled to
245 # WORLDDEST. None of the programs in the world stage are ever actually
246 # executed during the buildworld/installworld.
248 CROSSENV= MAKEOBJDIRPREFIX=${WORLDDEST} \
250 MACHINE_ARCH=${TARGET_ARCH} \
252 OBJFORMAT_PATH=${CTOOLSDEST} \
253 PERL5LIB=${WORLDDEST}/usr/libdata/perl/5.00503 \
254 GROFF_BIN_PATH=${BTOOLSDEST}/usr/bin \
255 GROFF_FONT_PATH=${BTOOLSDEST}/usr/share/groff_font \
256 GROFF_TMAC_PATH=${BTOOLSDEST}/usr/share/tmac
258 WMAKEENV= ${CROSSENV} \
259 DESTDIR=${WORLDDEST} \
260 INSTALL="sh ${.CURDIR}/tools/install.sh" \
261 PATH=${STRICTTMPPATH}
263 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
267 IMAKEENV= ${CROSSENV} \
268 PATH=${STRICTTMPPATH}
269 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
273 KMAKEENV= ${WMAKEENV}
277 # Attempt to rebuild the entire system, with reasonable chance of
278 # success, regardless of how old your existing system is.
282 @echo "--------------------------------------------------------------"
283 @echo ">>> Rebuilding the temporary build tree"
284 @echo "--------------------------------------------------------------"
285 .if !defined(NOCLEAN)
286 rm -rf ${BTOOLSDEST} ${CTOOLSDEST} ${WORLDDEST}
288 # XXX - These two can depend on any header file.
289 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
290 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
292 mkdir -p ${DESTDIRBASE} ${BTOOLSDEST} ${CTOOLSDEST} ${WORLDDEST}
293 .for _dir in ${WORLDDEST} ${BTOOLSDEST} ${CTOOLSDEST}
294 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \
295 -p ${_dir}/ > /dev/null
296 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
297 -p ${_dir}/usr > /dev/null
299 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
300 -p ${WORLDDEST}/usr/include > /dev/null
301 ln -sf ${.CURDIR}/sys ${WORLDDEST}
305 @echo "--------------------------------------------------------------"
306 @echo ">>> stage 1: bootstrap tools"
307 @echo "--------------------------------------------------------------"
308 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
311 @echo "--------------------------------------------------------------"
312 @echo ">>> stage 2a: cleaning up the object tree"
313 @echo "--------------------------------------------------------------"
314 cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
317 @echo "--------------------------------------------------------------"
318 @echo ">>> stage 2b: rebuilding the object tree"
319 @echo "--------------------------------------------------------------"
320 cd ${.CURDIR}; ${WMAKE} par-obj
323 @echo "--------------------------------------------------------------"
324 @echo ">>> stage 2c: build tools"
325 @echo "--------------------------------------------------------------"
326 cd ${.CURDIR}; ${TMAKE} build-tools
329 @echo "--------------------------------------------------------------"
330 @echo ">>> stage 3: cross tools"
331 @echo "--------------------------------------------------------------"
332 cd ${.CURDIR}; ${XMAKE} cross-tools
335 @echo "--------------------------------------------------------------"
336 @echo ">>> stage 4a: populating ${WORLDDEST}/usr/include"
337 @echo "--------------------------------------------------------------"
338 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
341 @echo "--------------------------------------------------------------"
342 @echo ">>> stage 4b: building libraries"
343 @echo "--------------------------------------------------------------"
344 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
347 @echo "--------------------------------------------------------------"
348 @echo ">>> stage 4c: make dependencies"
349 @echo "--------------------------------------------------------------"
350 cd ${.CURDIR}; ${WMAKE} par-depend
353 @echo "--------------------------------------------------------------"
354 @echo ">>> stage 4d: building everything.."
355 @echo "--------------------------------------------------------------"
356 cd ${.CURDIR}; ${WMAKE} all
358 # note: buildworld no longer depends on _cleanobj because we rm -rf the
359 # entire object tree and built the bootstrap tools in a different location.
361 # buildworld - build everything from scratch
362 # quickworld - skip the bootstrap, build, and cross-build steps
363 # realquickworld - skip the bootstrap, build, crossbuild, and depend step.
365 # note: we include _obj in realquickworld to prevent accidental creation
366 # of files in /usr/src.
369 .if !defined(SUBDIR_OVERRIDE)
370 WMAKE_TGTS+= _worldtmp _bootstrap-tools
372 WMAKE_TGTS+= _obj _build-tools
373 .if !defined(SUBDIR_OVERRIDE)
374 WMAKE_TGTS+= _cross-tools
376 WMAKE_TGTS+= _includes _libraries _depend everything
378 buildworld: ${WMAKE_TGTS}
380 quickworld: _obj _includes _libraries _depend everything
382 realquickworld: _obj _includes _libraries everything
384 crossworld: _worldtmp _bootstrap-tools _obj _build-tools _cross-tools
386 .ORDER: ${WMAKE_TGTS}
391 # Checks to be sure system is ready for installworld
394 .if !defined(NO_SENDMAIL)
395 @if ! `id -u smmsp > /dev/null`; then \
396 echo "ERROR: Required smmsp user is missing, see /usr/src/UPDATING."; \
399 @if ! `id -g smmsp > /dev/null`; then \
400 echo "ERROR: Required smmsp group is missing, see /usr/src/UPDATING."; \
408 # Distributes everything compiled by a `buildworld'.
412 # Installs everything compiled by a 'buildworld'.
414 distributeworld installworld: installcheck
415 cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
420 # If you have a build server, you can NFS mount the source and obj directories
421 # and do a 'make reinstall' on the *client* to install new binaries from the
422 # most recent server build.
425 @echo "--------------------------------------------------------------"
426 @echo ">>> Making hierarchy"
427 @echo "--------------------------------------------------------------"
428 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
430 @echo "--------------------------------------------------------------"
431 @echo ">>> Installing everything.."
432 @echo "--------------------------------------------------------------"
433 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
434 .if !defined(NOMAN) && !defined(NO_MAKEDB_RUN)
436 @echo "--------------------------------------------------------------"
437 @echo ">>> Rebuilding man page indices"
438 @echo "--------------------------------------------------------------"
439 cd ${.CURDIR}/share/man; ${MAKE} makedb
443 @echo "--------------------------------------------------------------"
444 @echo ">>> Distributing everything.."
445 @echo "--------------------------------------------------------------"
446 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
449 # buildkernel and installkernel
451 # Which kernels to build and/or install is specified by setting
452 # KERNCONF. If not defined a GENERIC kernel is built/installed.
453 # Only the existing (depending TARGET) config files are used
454 # for building kernels and only the first of these is designated
455 # as the one being installed.
457 # Note that we have to use TARGET instead of TARGET_ARCH when
458 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
459 # be set to cross-build, we have to make sure TARGET is set
462 .if !defined(KERNCONF) && defined(KERNEL)
468 INSTKERNNAME?= kernel
470 KRNLSRCDIR= ${.CURDIR}/sys
471 KRNLCONFDIR= ${KRNLSRCDIR}/${TARGET}/conf
472 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
473 KERNCONFDIR?= ${KRNLCONFDIR}
477 .for _kernel in ${KERNCONF}
478 .if exists(${KERNCONFDIR}/${_kernel})
479 BUILDKERNELS+= ${_kernel}
480 .if empty(INSTALLKERNEL)
481 INSTALLKERNEL= ${_kernel}
489 # Builds all kernels defined by BUILDKERNELS.
492 .if empty(BUILDKERNELS)
493 @echo ">>> ERROR: Missing kernel configuration file(s) (${KERNCONF})."
496 .if defined(KERNWARN)
497 @echo "--------------------------------------------------------------"
498 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
499 @echo "--------------------------------------------------------------"
503 .for _kernel in ${BUILDKERNELS}
504 @echo "--------------------------------------------------------------"
505 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
506 @echo "--------------------------------------------------------------"
507 @echo "===> ${_kernel}"
508 mkdir -p ${KRNLOBJDIR}
509 .if !defined(NO_KERNELCONFIG)
511 PATH=${STRICTTMPPATH} \
512 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
513 ${KERNCONFDIR}/${_kernel}
515 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
516 cd ${KRNLOBJDIR}/${_kernel}; \
517 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} -DNO_MODULES clean
518 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KRNLSRCDIR}/modules)
519 cd ${KRNLOBJDIR}/${_kernel}; \
520 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} cleandir
523 cd ${KRNLOBJDIR}/${_kernel}; \
524 MAKESRCPATH=${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm \
525 ${MAKE} -DBOOTSTRAPPING -f ${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm/Makefile
526 .if !defined(NO_KERNELDEPEND)
527 cd ${KRNLOBJDIR}/${_kernel}; \
528 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
530 cd ${KRNLOBJDIR}/${_kernel}; \
531 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all
532 @echo "--------------------------------------------------------------"
533 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
534 @echo "--------------------------------------------------------------"
540 # Install the kernel defined by INSTALLKERNEL
542 installkernel reinstallkernel:
543 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
544 ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
549 # Update the source tree, by running sup and/or running cvs to update to the
553 .if defined(SUP_UPDATE)
554 @echo "--------------------------------------------------------------"
555 @echo ">>> Running ${SUP}"
556 @echo "--------------------------------------------------------------"
558 @${SUP} ${SUPFLAGS} ${SUPFILE}
560 .if defined(SUPFILE1)
561 @${SUP} ${SUPFLAGS} ${SUPFILE1}
563 .if defined(SUPFILE2)
564 @${SUP} ${SUPFLAGS} ${SUPFILE2}
566 .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
567 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
569 .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
570 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
573 .if defined(CVS_UPDATE)
574 @echo "--------------------------------------------------------------"
575 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
576 @echo "--------------------------------------------------------------"
577 cd ${.CURDIR}; cvs -q update -rRELENG_4 -P -d
583 # Build most of the user binaries on the existing system libs and includes.
586 @echo "--------------------------------------------------------------"
587 @echo ">>> Building programs only"
588 @echo "--------------------------------------------------------------"
589 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
590 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ all
596 # Install the binaries built by the 'most' target. This does not include
597 # libraries or include files.
600 @echo "--------------------------------------------------------------"
601 @echo ">>> Installing programs only"
602 @echo "--------------------------------------------------------------"
603 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
604 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ install
608 # ------------------------------------------------------------------------
610 # From here onwards are utility targets used by the 'make world' and
611 # related targets. If your 'world' breaks, you may like to try to fix
612 # the problem and manually run the following targets to attempt to
613 # complete the build. Beware, this is *not* guaranteed to work, you
614 # need to have a pretty good grip on the current state of the system
615 # to attempt to manually finish it. If in doubt, 'make world' again.
618 # bootstrap-tools: Build all tools required to build all tools.
620 # [x]install: dependancies on various new install features
621 # rpcgen: old rpcgen used a hardwired cpp path, newer OBJFORMAT_PATH
622 # envs are not compatible with older objformat binaries.
624 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
625 _strfile= games/fortune/strfile
629 .for _tool in ${_strfile} \
630 bin/chmod bin/cp bin/dd bin/mkdir bin/rm bin/echo bin/test \
631 bin/cat bin/date bin/ln bin/mv bin/csh bin/expr bin/sh bin/ls \
632 bin/hostname bin/kill \
634 usr.bin/yacc usr.bin/colldef usr.bin/uudecode usr.bin/xinstall \
635 usr.bin/m4 usr.bin/rpcgen usr.bin/make gnu/usr.bin/awk usr.bin/file \
636 usr.bin/find usr.bin/lex usr.bin/sed usr.bin/uname usr.bin/touch \
637 usr.bin/mkdep usr.bin/mktemp usr.bin/lorder usr.bin/file2c \
638 usr.bin/tsort usr.bin/tr usr.bin/join usr.bin/wc usr.bin/basename \
639 usr.bin/gencat usr.bin/chflags usr.bin/expand usr.bin/paste \
640 usr.bin/mklocale usr.bin/uuencode usr.bin/compile_et usr.bin/hexdump \
641 usr.bin/vi usr.bin/cap_mkdb usr.bin/vgrind usr.bin/true usr.bin/false \
642 usr.bin/cmp usr.bin/xargs usr.bin/id usr.bin/env usr.bin/dirname \
643 usr.sbin/chown usr.sbin/mtree usr.sbin/config \
644 usr.sbin/btxld usr.sbin/pwd_mkdb usr.sbin/zic \
645 gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo \
646 gnu/usr.bin/grep gnu/usr.bin/sort gnu/usr.bin/patch \
647 gnu/usr.bin/gzip gnu/usr.bin/perl gnu/usr.bin/man/makewhatis
648 ${ECHODIR} "===> ${_tool} (bootstrap-tools)"; \
649 cd ${.CURDIR}/${_tool}; \
650 ${MAKE} DIRPRFX=${_tool}/ obj; \
651 ${MAKE} DIRPRFX=${_tool}/ depend; \
652 ${MAKE} DIRPRFX=${_tool}/ all; \
653 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${BTOOLSDEST} install
656 # build-tools: Build special purpose build tools. gcc2 related tools are
657 # only built under the i386 architecture. Other architectures are
660 # XXX we may be able to remove or consolidate this into bootstrap-tools
661 # now that we have the native helper (.nx/.no) infrastructure.
663 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
664 _games= games/adventure games/hack games/phantasia
667 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
668 _share= share/syscons/scrnmaps
671 _gcc3_cross= gnu/usr.bin/cc3
672 _gcc3_tools= gnu/usr.bin/cc3/cc_tools
673 .if ${MACHINE_ARCH} == "i386" && ${TARGET_ARCH} == "i386"
674 _gcc2_cross= gnu/usr.bin/cc
675 _gcc2_tools= gnu/usr.bin/cc/cc_tools
676 _binutils= gnu/usr.bin/binutils gnu/usr.bin/binutils214
678 _binutils= gnu/usr.bin/binutils214
681 .if !defined(NO_FORTRAN)
682 .if ${TARGET_ARCH} == "i386"
683 _fortran= gnu/usr.bin/cc/f771
685 _fortran= gnu/usr.bin/cc3/f771
690 _perl= gnu/usr.bin/perl/miniperl
693 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
694 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
695 _libkrb5= kerberos5/lib/libroken kerberos5/lib/libvers \
696 kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
699 .if defined(RELEASEDIR)
700 _sysinstall= release/sysinstall
704 .for _tool in ${_gcc2_tools} ${_gcc3_tools} \
705 ${_fortran} ${_perl} ${_libroken4} ${_libkrb5} \
706 ${_share} ${_sysinstall}
707 ${ECHODIR} "===> ${_tool} (build-tools)"; \
708 cd ${.CURDIR}/${_tool}; \
709 ${MAKE} DIRPRFX=${_tool}/ obj; \
710 ${MAKE} DIRPRFX=${_tool}/ depend; \
711 ${MAKE} DIRPRFX=${_tool}/ all; \
712 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${BTOOLSDEST} install
716 # cross-tools: Build cross-building tools
718 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
719 _elf2exe= usr.sbin/elf2exe
722 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
723 _btxld= usr.sbin/btxld
727 .for _tool in ${_btxld} ${_elf2exe} ${_binutils} \
728 usr.bin/objformat usr.sbin/crunch/crunchide \
729 ${_gcc2_cross} ${_gcc3_cross}
730 ${ECHODIR} "===> ${_tool} (cross-tools)"; \
731 cd ${.CURDIR}/${_tool}; \
732 ${MAKE} DIRPRFX=${_tool}/ obj; \
733 ${MAKE} DIRPRFX=${_tool}/ depend; \
734 ${MAKE} DIRPRFX=${_tool}/ all; \
735 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${CTOOLSDEST} install
739 # hierarchy - ensure that all the needed directories are present
742 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
745 # libraries - build all libraries, and install them under ${DESTDIR}.
747 # The list of libraries with dependents (${_prebuild_libs}) and their
748 # interdependencies (__L) are built automatically by the
749 # ${.CURDIR}/tools/make_libdeps.sh script.
751 # .makeenv does not work when bootstrapping from 4.x, so we must be sure
752 # to specify the correct CCVER or 'cc' will not exec the correct compiler.
756 CCVER=gcc2 ${MAKE} -f Makefile.inc1 _startup_libs2; \
757 CCVER=gcc3 ${MAKE} -f Makefile.inc1 _startup_libs3; \
758 ${MAKE} -f Makefile.inc1 _startup_libs; \
759 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
760 ${MAKE} -f Makefile.inc1 _generic_libs;
762 # These dependencies are not automatically generated:
764 # gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all
765 # shared libraries for ELF. The targets for _startup_libs{2,3} are
766 # specifically built using gcc{2,3}.
768 _startup_libs2= gnu/lib/gcc2/csu gnu/lib/gcc2/libgcc
769 _startup_libs3= gnu/lib/gcc3/csu gnu/lib/gcc3/libgcc
770 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
771 _startup_libs= lib/csu/${MACHINE_ARCH}-elf
773 _startup_libs= lib/csu/${MACHINE_ARCH}
775 _startup_libs+= lib/libc
779 _generic_libs= gnu/lib
782 _generic_libs+= gnu/usr.bin/perl/libperl
785 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
786 _prebuild_libs+= kerberos5/lib/libasn1
787 _prebuild_libs+= kerberos5/lib/libgssapi
788 _prebuild_libs+= kerberos5/lib/libkrb5
789 _prebuild_libs+= kerberos5/lib/libroken
790 _generic_libs+= kerberos5/lib
793 _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libmd \
794 lib/libncurses lib/libopie lib/libradius lib/libskey \
795 lib/libtacplus lib/libutil \
798 lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
799 lib/libskey__L: lib/libcrypt__L lib/libmd__L
803 .if !defined(NOCRYPT)
804 .if !defined(NO_OPENSSL)
805 _prebuild_libs+= secure/lib/libcrypto secure/lib/libssl
806 .if !defined(NO_OPENSSH)
807 _prebuild_libs+= secure/lib/libssh
808 secure/lib/libssh__L: secure/lib/libcrypto__L lib/libz__L
811 _generic_libs+= secure/lib
814 _generic_libs+= usr.bin/lex/lib
816 .if ${MACHINE_ARCH} == "i386"
817 _generic_libs+= usr.sbin/pcvt/keycap
820 .for _lib in ${_startup_libs2} ${_startup_libs3} ${_startup_libs} \
821 ${_prebuild_libs} ${_generic_libs}
823 .if exists(${.CURDIR}/${_lib})
824 ${ECHODIR} "===> ${_lib}"; \
825 cd ${.CURDIR}/${_lib}; \
826 ${MAKE} DIRPRFX=${_lib}/ depend; \
827 ${MAKE} DIRPRFX=${_lib}/ all; \
828 ${MAKE} DIRPRFX=${_lib}/ install
832 # only mess with gcc2 for i386 architectures.
834 _startup_libs: ${_startup_libs:S/$/__L/}
835 .if ${TARGET_ARCH} == "i386"
836 _startup_libs2: ${_startup_libs2:S/$/__L/}
840 _startup_libs3: ${_startup_libs3:S/$/__L/}
841 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
842 _generic_libs: ${_generic_libs:S/$/__L/}
844 # library targets must be ordered because there are inter-library
845 # races (e.g. generation of tconfig.h)
847 .ORDER: ${_startup_libs2:S/$/__L/}
848 .ORDER: ${_startup_libs3:S/$/__L/}
849 .ORDER: ${_startup_libs:S/$/__L/}
850 .ORDER: ${_prebuild_libs:S/$/__L/}
851 .ORDER: ${_generic_libs:S/$/__L/}
853 .for __target in clean cleandepend cleandir obj depend includes
854 .for entry in ${SUBDIR}
855 ${entry}.${__target}__D: .PHONY
856 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
857 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
858 edir=${entry}.${MACHINE_ARCH}; \
859 cd ${.CURDIR}/$${edir}; \
861 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
863 cd ${.CURDIR}/$${edir}; \
865 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
867 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
868 .ORDER: ${SUBDIR:S/$/.${__target}__D/}
870 .ORDER: par-clean par-cleandepend par-cleandir par-obj par-depend par-includes
872 # The wmake target is used by /usr/bin/wmake to run make in a
873 # world build environment.
876 @echo '${WMAKEENV} ${MAKE} -m ${.CURDIR}/share/mk ${WMAKE_ARGS}'
879 @echo '${WMAKEENV} /bin/sh'
882 @echo '${BMAKEENV} ${MAKE} -m ${.CURDIR}/share/mk ${BMAKE_ARGS}'
885 @echo '${BMAKEENV} /bin/sh'
888 @echo '${TMAKEENV} ${MAKE} -m ${.CURDIR}/share/mk ${TMAKE_ARGS}'
891 @echo '${TMAKEENV} /bin/sh'
893 .include <bsd.subdir.mk>