4 # Make command line options:
5 # -DNO_KERBEROS Do not build Heimdal (Kerberos 5)
6 # -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
7 # -DNOCLEAN do not clean at all
8 # -DNOCRYPT will prevent building of crypt versions
9 # -DNOMAN do not build the manual pages
10 # -DNOPROFILE do not build profiled libraries
11 # -DNOGAMES do not go into games subdir
12 # -DNOSHARE do not go into share subdir
13 # -DNOINFO do not make or install info files
14 # -DNOLIBC_R do not build libc_r.
15 # -DNO_FORTRAN do not build g77 and related libraries.
16 # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
17 # -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
18 # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
19 # -DNO_PORTSUPDATE do not update ports in ${MAKE} update
20 # -DNO_DOCUPDATE do not update doc in ${MAKE} update
21 # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
22 # TARGET_ARCH="arch" to crossbuild world to a different arch
25 # The intended user-driven targets are:
26 # buildworld - rebuild *everything*, including glue to help do upgrades
27 # installworld- install everything built by "buildworld"
28 # update - convenient way to update your source tree (eg: sup/cvs)
29 # most - build user commands, no libraries or include files
30 # installmost - install user commands, no libraries or include files
32 # Standard targets (not defined here) are documented in the makefiles in
33 # /usr/share/mk. These include:
34 # obj depend all install clean cleandepend cleanobj
36 # Put initial settings here.
39 # We must do share/info early so that installation of info `dir'
40 # entries works correctly. Do it first since it is less likely to
41 # grow dependencies on include and lib than vice versa.
42 .if exists(${.CURDIR}/share/info)
46 .if exists(${.CURDIR}/include)
49 .if exists(${.CURDIR}/lib)
53 .if exists(${.CURDIR}/bin)
56 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
59 .if exists(${.CURDIR}/gnu)
62 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
63 !defined(NOCRYPT) && !defined(NO_OPENSSL) && !defined(NO_KERBEROS)
66 .if exists(${.CURDIR}/libexec)
69 .if exists(${.CURDIR}/rescue) && defined(RESCUE)
72 .if exists(${.CURDIR}/sbin)
75 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT)
78 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
81 .if exists(${.CURDIR}/sys)
84 .if exists(${.CURDIR}/usr.bin)
87 .if exists(${.CURDIR}/usr.sbin)
91 # etc must be last for "distribute" to work
92 .if exists(${.CURDIR}/etc)
96 # These are last, since it is nice to at least get the base system
97 # rebuilt before you do them.
98 .if defined(LOCAL_DIRS)
99 .for _DIR in ${LOCAL_DIRS}
100 .if exists(${.CURDIR}/${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile)
106 .if defined(SUBDIR_OVERRIDE)
107 SUBDIR= ${SUBDIR_OVERRIDE}
110 .if defined(NOCLEANDIR)
111 CLEANDIR= clean cleandepend
117 SUP?= /usr/local/bin/cvsup
118 SUPFLAGS?= -g -L 2 -P -
120 SUPFLAGS+= -h ${SUPHOST}
123 MAKEOBJDIRPREFIX?= /usr/obj
124 .if !defined(OSRELDATE)
125 OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
126 /usr/include/osreldate.h
128 TARGET_ARCH?= ${MACHINE_ARCH}
129 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
131 TARGET_CPUTYPE?=${CPUTYPE}
133 TARGET?= ${TARGET_ARCH}
136 .if !empty(TARGET_CPUTYPE)
137 _TARGET_CPUTYPE=${TARGET_CPUTYPE}
139 _TARGET_CPUTYPE=dummy
141 _CPUTYPE!= ${MAKE} -f /dev/null -m ${.CURDIR}/share/mk \
142 CPUTYPE=${_TARGET_CPUTYPE} -V CPUTYPE
143 .if ${_CPUTYPE} != ${_TARGET_CPUTYPE}
144 .error CPUTYPE global should be set with ?=.
147 BUILD_ARCH!= sysctl -n hw.machine_arch
148 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
149 .error To cross-build, set TARGET_ARCH.
152 .if ${MACHINE} == ${TARGET}
153 OBJTREE= ${MAKEOBJDIRPREFIX}
155 OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}
157 WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH}
158 # /usr/games added for fortune which depend on strfile
159 BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games
160 XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
161 STRICTTMPPATH= ${BPATH}:${XPATH}
162 TMPPATH= ${STRICTTMPPATH}:${PATH}
164 INSTALLTMP!= /usr/bin/mktemp -d -u -t install
167 # Building a world goes through the following stages
169 # 1. legacy stage [BMAKE]
170 # This stage is responsible for creating compatibility
171 # shims that are needed by the bootstrap-tools,
172 # build-tools and cross-tools stages.
173 # 1. bootstrap-tools stage [BMAKE]
174 # This stage is responsible for creating programs that
175 # are needed for backward compatibility reasons. They
176 # are not built as cross-tools.
177 # 2. build-tools stage [TMAKE]
178 # This stage is responsible for creating the object
179 # tree and building any tools that are needed during
181 # 3. cross-tools stage [XMAKE]
182 # This stage is responsible for creating any tools that
183 # are needed for cross-builds. A cross-compiler is one
185 # 4. world stage [WMAKE]
186 # This stage actually builds the world.
187 # 5. install stage (optional) [IMAKE]
188 # This stage installs a previously built world.
193 # Common environment for world related stages
194 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
195 MACHINE_ARCH=${TARGET_ARCH} \
197 CPUTYPE=${TARGET_CPUTYPE} \
198 GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \
199 GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \
200 GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac
202 # bootstrap-tools stage
204 INSTALL="sh ${.CURDIR}/tools/install.sh" \
205 PATH=${BPATH}:${PATH} \
206 WORLDTMP=${WORLDTMP} \
207 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
208 BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \
209 ${BMAKEENV} ${MAKE} -f Makefile.inc1 \
210 BOOTSTRAPPING=${OSRELDATE} \
211 -DNOHTML -DNOINFO -DNOLINT -DNOMAN -DNOPIC -DNOPROFILE \
212 -DNOSHARED -DNO_CPU_CFLAGS -DNO_WARNS
215 TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
216 ${BMAKEENV} ${MAKE} -f Makefile.inc1 \
217 BOOTSTRAPPING=${OSRELDATE} -DNOLINT -DNO_CPU_CFLAGS -DNO_WARNS
220 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB
223 WMAKEENV= ${CROSSENV} \
224 DESTDIR=${WORLDTMP} \
225 INSTALL="sh ${.CURDIR}/tools/install.sh" \
227 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
230 IMAKEENV= ${CROSSENV} \
231 PATH=${STRICTTMPPATH}:${INSTALLTMP}
232 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
235 KMAKEENV= ${WMAKEENV}
240 # Attempt to rebuild the entire system, with reasonable chance of
241 # success, regardless of how old your existing system is.
244 .if ${.CURDIR:C/[^,]//g} != ""
245 # The m4 build of sendmail files doesn't like it if ',' is used
246 # anywhere in the path of it's files.
248 @echo "*** Error: path to source tree contains a comma ','"
253 @echo "--------------------------------------------------------------"
254 @echo ">>> Rebuilding the temporary build tree"
255 @echo "--------------------------------------------------------------"
256 .if !defined(NOCLEAN)
259 rm -rf ${WORLDTMP}/legacy/usr/include
260 # XXX - These two can depend on any header file.
261 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
262 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
265 usr/bin usr/games usr/include/sys usr/lib \
266 usr/libexec usr/sbin usr/share/dict \
267 usr/share/groff_font/devX100 \
268 usr/share/groff_font/devX100-12 \
269 usr/share/groff_font/devX75 \
270 usr/share/groff_font/devX75-12 \
271 usr/share/groff_font/devascii \
272 usr/share/groff_font/devcp1047 \
273 usr/share/groff_font/devdvi \
274 usr/share/groff_font/devhtml \
275 usr/share/groff_font/devkoi8-r \
276 usr/share/groff_font/devlatin1 \
277 usr/share/groff_font/devlbp \
278 usr/share/groff_font/devlj4 \
279 usr/share/groff_font/devps \
280 usr/share/groff_font/devutf8 \
281 usr/share/tmac/mdoc usr/share/tmac/mm
282 mkdir -p ${WORLDTMP}/legacy/${_dir}
285 usr/bin usr/include usr/lib/compat/aout usr/libdata/ldscripts \
286 usr/libexec usr/share/misc
287 mkdir -p ${WORLDTMP}/${_dir}
289 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
290 -p ${WORLDTMP}/usr/include
291 ln -sf ${.CURDIR}/sys ${WORLDTMP}
294 @echo "--------------------------------------------------------------"
295 @echo ">>> stage 1: legacy release compatibility shims"
296 @echo "--------------------------------------------------------------"
297 cd ${.CURDIR}; ${BMAKE} legacy
300 @echo "--------------------------------------------------------------"
301 @echo ">>> stage 1: bootstrap tools"
302 @echo "--------------------------------------------------------------"
303 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
305 .if !defined(NOCLEAN)
307 @echo "--------------------------------------------------------------"
308 @echo ">>> stage 2: cleaning up the object tree"
309 @echo "--------------------------------------------------------------"
310 cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
314 @echo "--------------------------------------------------------------"
315 @echo ">>> stage 2: rebuilding the object tree"
316 @echo "--------------------------------------------------------------"
317 cd ${.CURDIR}; ${WMAKE} par-obj
320 @echo "--------------------------------------------------------------"
321 @echo ">>> stage 2: build tools"
322 @echo "--------------------------------------------------------------"
323 cd ${.CURDIR}; ${TMAKE} build-tools
326 @echo "--------------------------------------------------------------"
327 @echo ">>> stage 3: cross tools"
328 @echo "--------------------------------------------------------------"
329 cd ${.CURDIR}; ${XMAKE} cross-tools
332 @echo "--------------------------------------------------------------"
333 @echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
334 @echo "--------------------------------------------------------------"
335 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
338 @echo "--------------------------------------------------------------"
339 @echo ">>> stage 4: building libraries"
340 @echo "--------------------------------------------------------------"
341 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
344 @echo "--------------------------------------------------------------"
345 @echo ">>> stage 4: make dependencies"
346 @echo "--------------------------------------------------------------"
347 cd ${.CURDIR}; ${WMAKE} par-depend
350 @echo "--------------------------------------------------------------"
351 @echo ">>> stage 4: building everything.."
352 @echo "--------------------------------------------------------------"
353 cd ${.CURDIR}; ${WMAKE} par-all
357 .if !defined(SUBDIR_OVERRIDE)
358 WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools
360 WMAKE_TGTS+= _cleanobj _obj _build-tools
361 .if !defined(SUBDIR_OVERRIDE)
362 WMAKE_TGTS+= _cross-tools
364 WMAKE_TGTS+= _includes _libraries _depend everything
366 buildworld: ${WMAKE_TGTS}
367 .ORDER: ${WMAKE_TGTS}
372 # Checks to be sure system is ready for installworld
375 .if !defined(NO_SENDMAIL)
376 @if ! `id -u smmsp > /dev/null`; then \
377 echo "ERROR: Required smmsp user is missing, see /usr/src/UPDATING."; \
380 @if ! `id -g smmsp > /dev/null`; then \
381 echo "ERROR: Required smmsp group is missing, see /usr/src/UPDATING."; \
385 .if ${TARGET_ARCH} == ${MACHINE_ARCH} && !defined(DISTDIR) && \
386 (!defined(DESTDIR) || empty(DESTDIR) || ${DESTDIR} == "/")
387 @echo "Checking to see if your booted kernel is fresh enough.."
388 ${.OBJDIR}/bin/sh/sh -c \
389 'echo "Testing installed kernel for new sigaction(2) syscall"'
396 # Distributes everything compiled by a `buildworld'.
400 # Installs everything compiled by a 'buildworld'.
402 distributeworld installworld: installcheck
403 mkdir -p ${INSTALLTMP}
404 for prog in [ awk cap_mkdb cat chflags chmod chown \
405 date echo egrep find grep \
406 ln make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
407 test true uname wc zic; do \
408 cp `which $$prog` ${INSTALLTMP}; \
410 cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
416 # If you have a build server, you can NFS mount the source and obj directories
417 # and do a 'make reinstall' on the *client* to install new binaries from the
418 # most recent server build.
421 @echo "--------------------------------------------------------------"
422 @echo ">>> Making hierarchy"
423 @echo "--------------------------------------------------------------"
424 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
426 @echo "--------------------------------------------------------------"
427 @echo ">>> Installing everything.."
428 @echo "--------------------------------------------------------------"
429 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
430 .if !defined(NOMAN) && !defined(NO_MAKEDB_RUN)
432 @echo "--------------------------------------------------------------"
433 @echo ">>> Rebuilding man page indices"
434 @echo "--------------------------------------------------------------"
435 cd ${.CURDIR}/share/man; ${MAKE} makedb
439 @echo "--------------------------------------------------------------"
440 @echo ">>> Distributing everything.."
441 @echo "--------------------------------------------------------------"
442 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
445 # buildkernel and installkernel
447 # Which kernels to build and/or install is specified by setting
448 # KERNCONF. If not defined a GENERIC kernel is built/installed.
449 # Only the existing (depending TARGET) config files are used
450 # for building kernels and only the first of these is designated
451 # as the one being installed.
453 # Note that we have to use TARGET instead of TARGET_ARCH when
454 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
455 # be set to cross-build, we have to make sure TARGET is set
458 .if !defined(KERNCONF) && defined(KERNEL)
464 INSTKERNNAME?= kernel
466 KERNSRCDIR?= ${.CURDIR}/sys
467 KRNLCONFDIR= ${KERNSRCDIR}/${TARGET}/conf
468 KRNLOBJDIR= ${OBJTREE}${KERNSRCDIR}
469 KERNCONFDIR?= ${KRNLCONFDIR}
473 .for _kernel in ${KERNCONF}
474 .if exists(${KERNCONFDIR}/${_kernel})
475 BUILDKERNELS+= ${_kernel}
476 .if empty(INSTALLKERNEL)
477 INSTALLKERNEL= ${_kernel}
485 # Builds all kernels defined by BUILDKERNELS.
488 .if empty(BUILDKERNELS)
489 @echo "ERROR: Missing kernel configuration file(s) (${KERNCONF}).";
492 .if defined(KERNWARN)
493 @echo "--------------------------------------------------------------"
494 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
495 @echo "--------------------------------------------------------------"
499 .for _kernel in ${BUILDKERNELS}
500 @echo "--------------------------------------------------------------"
501 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
502 @echo "--------------------------------------------------------------"
503 @echo "===> ${_kernel}"
504 mkdir -p ${KRNLOBJDIR}
505 .if !defined(NO_KERNELCONFIG)
508 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
509 ${KERNCONFDIR}/${_kernel}
511 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
512 cd ${KRNLOBJDIR}/${_kernel}; \
513 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} ${CLEANDIR}
515 cd ${KRNLOBJDIR}/${_kernel}; \
516 MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \
517 ${MAKE} -DNO_CPU_CFLAGS -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
518 cd ${KRNLOBJDIR}/${_kernel}; \
519 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} obj
520 # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case.
521 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules)
522 .for target in obj depend all
523 cd ${.CURDIR}/sys/modules/aic7xxx/aicasm; \
524 MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \
525 ${MAKE} -DNO_CPU_CFLAGS ${target}
528 .if !defined(NO_KERNELDEPEND)
529 cd ${KRNLOBJDIR}/${_kernel}; \
530 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend -DNO_MODULES_OBJ
532 cd ${KRNLOBJDIR}/${_kernel}; \
533 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all -DNO_MODULES_OBJ
534 @echo "--------------------------------------------------------------"
535 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
536 @echo "--------------------------------------------------------------"
542 # Install the kernel defined by INSTALLKERNEL
544 installkernel reinstallkernel installkernel.debug reinstallkernel.debug:
545 .if empty(INSTALLKERNEL)
546 @echo "ERROR: No kernel \"${KERNCONF}\" to install."
549 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
550 ${CROSSENV} PATH=${TMPPATH} \
551 ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
556 # Update the source tree, by running sup and/or running cvs to update to the
560 .if defined(SUP_UPDATE)
561 @echo "--------------------------------------------------------------"
562 @echo ">>> Running ${SUP}"
563 @echo "--------------------------------------------------------------"
565 @${SUP} ${SUPFLAGS} ${SUPFILE}
567 .if defined(SUPFILE1)
568 @${SUP} ${SUPFLAGS} ${SUPFILE1}
570 .if defined(SUPFILE2)
571 @${SUP} ${SUPFLAGS} ${SUPFILE2}
573 .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
574 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
576 .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
577 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
580 .if defined(CVS_UPDATE)
581 @echo "--------------------------------------------------------------"
582 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
583 @echo "--------------------------------------------------------------"
584 cd ${.CURDIR}; ${CVS} -R -q update -A -P -d
590 # Build most of the user binaries on the existing system libs and includes.
593 @echo "--------------------------------------------------------------"
594 @echo ">>> Building programs only"
595 @echo "--------------------------------------------------------------"
596 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/usr.bin gnu/usr.sbin
597 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ all
603 # Install the binaries built by the 'most' target. This does not include
604 # libraries or include files.
607 @echo "--------------------------------------------------------------"
608 @echo ">>> Installing programs only"
609 @echo "--------------------------------------------------------------"
610 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/usr.bin gnu/usr.sbin
611 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ install
615 # ------------------------------------------------------------------------
617 # From here onwards are utility targets used by the 'make world' and
618 # related targets. If your 'world' breaks, you may like to try to fix
619 # the problem and manually run the following targets to attempt to
620 # complete the build. Beware, this is *not* guaranteed to work, you
621 # need to have a pretty good grip on the current state of the system
622 # to attempt to manually finish it. If in doubt, 'make world' again.
626 # legacy: Build compatibility shims for the next three targets
629 .for _tool in tools/build
630 @${ECHODIR} "===> ${_tool}"; \
631 cd ${.CURDIR}/${_tool}; \
632 ${MAKE} DIRPRFX=${_tool}/ obj; \
633 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \
634 ${MAKE} DIRPRFX=${_tool}/ depend; \
635 ${MAKE} DIRPRFX=${_tool}/ all; \
636 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
640 # bootstrap-tools: Build tools needed for compatibility
642 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
643 _strfile= games/fortune/strfile
647 _gperf= gnu/usr.bin/gperf
648 .if ${BOOTSTRAPPING} < 500113
649 _groff= gnu/usr.bin/groff
651 _groff= gnu/usr.bin/groff/tmac
655 .if ${BOOTSTRAPPING} < 450005 || \
656 ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500034
657 _uudecode= usr.bin/uudecode
660 .if ${BOOTSTRAPPING} < 430002 || \
661 ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500019
662 _xargs= usr.bin/xargs
665 .if ${BOOTSTRAPPING} < 430002 || \
666 ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500018
670 .if defined(RESCUE) && \
671 ${BOOTSTRAPPING} < 501100
672 _crunchgen= usr.sbin/crunch/crunchgen
675 .if ${BOOTSTRAPPING} < 500019
676 _kbdcontrol= usr.sbin/kbdcontrol
684 gnu/usr.bin/texinfo \
695 @${ECHODIR} "===> ${_tool}"; \
696 cd ${.CURDIR}/${_tool}; \
697 ${MAKE} DIRPRFX=${_tool}/ obj; \
698 ${MAKE} DIRPRFX=${_tool}/ depend; \
699 ${MAKE} DIRPRFX=${_tool}/ all; \
700 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
704 # build-tools: Build special purpose build tools
706 .if defined(MODULES_WITH_WORLD) && exists(${KERNSRCDIR}/modules)
707 _aicasm= sys/modules/aic7xxx/aicasm
710 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
711 _share= share/syscons/scrnmaps
714 .if !defined(NO_FORTRAN)
715 _fortran= gnu/usr.bin/cc/f771
718 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
719 !defined(NOCRYPT) && !defined(NO_OPENSSL) && !defined(NO_KERBEROS)
720 _libkrb5= kerberos5/lib/libroken kerberos5/lib/libvers \
721 kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
728 gnu/usr.bin/cc/cc_tools \
737 @${ECHODIR} "===> ${_tool}"; \
738 cd ${.CURDIR}/${_tool}; \
739 ${MAKE} DIRPRFX=${_tool}/ obj; \
740 ${MAKE} DIRPRFX=${_tool}/ build-tools
744 # cross-tools: Build cross-building tools
746 .if ${TARGET_ARCH} == "sparc64" && ${TARGET_ARCH} != ${MACHINE_ARCH} && \
747 ${BOOTSTRAPPING} < 500037
748 _elf2aout= usr.bin/elf2aout
751 .if ${TARGET_ARCH} == "i386" && ${TARGET_ARCH} != ${MACHINE_ARCH}
752 _btxld= usr.sbin/btxld
755 .if (defined(RESCUE) || \
756 defined(RELEASEDIR)) && \
757 (${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 501101)
758 _crunchide= usr.sbin/crunch/crunchide
761 .if ${TARGET_ARCH} == "alpha" && ${TARGET_ARCH} != ${MACHINE_ARCH}
762 _elf2exe= usr.sbin/elf2exe
765 .if ${TARGET_ARCH} == "i386" && ${TARGET_ARCH} != ${MACHINE_ARCH} && \
767 _kgzip= usr.sbin/kgzip
772 gnu/usr.bin/binutils \
775 usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \
780 @${ECHODIR} "===> ${_tool}"; \
781 cd ${.CURDIR}/${_tool}; \
782 ${MAKE} DIRPRFX=${_tool}/ obj; \
783 ${MAKE} DIRPRFX=${_tool}/ depend; \
784 ${MAKE} DIRPRFX=${_tool}/ all; \
785 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
789 # hierarchy - ensure that all the needed directories are present
792 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
795 # libraries - build all libraries, and install them under ${DESTDIR}.
797 # The list of libraries with dependents (${_prebuild_libs}) and their
798 # interdependencies (__L) are built automatically by the
799 # ${.CURDIR}/tools/make_libdeps.sh script.
803 ${MAKE} -f Makefile.inc1 _startup_libs; \
804 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
805 ${MAKE} -f Makefile.inc1 _generic_libs;
807 # These dependencies are not automatically generated:
809 # gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all
810 # shared libraries for ELF.
812 # lib/libc (libc_pic.a) must be built before lib/libpthread.
814 _startup_libs= gnu/lib/csu gnu/lib/libgcc
815 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
816 _startup_libs+= lib/csu/${MACHINE_ARCH}-elf
818 _startup_libs+= lib/csu/${MACHINE_ARCH}
822 _generic_libs= gnu/lib
824 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
825 !defined(NOCRYPT) && !defined(NO_OPENSSL) && !defined(NO_KERBEROS)
826 _prebuild_libs+= kerberos5/lib/libasn1
827 _prebuild_libs+= kerberos5/lib/libgssapi
828 _prebuild_libs+= kerberos5/lib/libkrb5
829 _prebuild_libs+= kerberos5/lib/libroken
830 _generic_libs+= kerberos5/lib
833 .if !defined(NOLIBPTHREAD)
834 _prebuild_libs+= lib/libc
836 _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libexpat \
837 lib/libkvm lib/libmd \
838 lib/libncurses lib/libopie lib/libpam lib/libradius \
840 lib/libsbuf lib/libtacplus lib/libutil lib/libypclnt \
843 lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
844 lib/libypclnt__L: lib/librpcsvc__L
848 .if !defined(NOCRYPT)
849 .if !defined(NO_OPENSSL)
850 _prebuild_libs+= secure/lib/libcrypto secure/lib/libssl
851 .if !defined(NO_OPENSSH)
852 _prebuild_libs+= secure/lib/libssh
853 secure/lib/libssh__L: secure/lib/libcrypto__L lib/libz__L
856 _generic_libs+= secure/lib
859 _generic_libs+= usr.bin/lex/lib
861 .if ${MACHINE_ARCH} == "i386"
862 _generic_libs+= usr.sbin/pcvt/keycap
865 .for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
867 .if exists(${.CURDIR}/${_lib})
868 @${ECHODIR} "===> ${_lib}"; \
869 cd ${.CURDIR}/${_lib}; \
870 ${MAKE} DIRPRFX=${_lib}/ depend; \
871 ${MAKE} DIRPRFX=${_lib}/ all; \
872 ${MAKE} DIRPRFX=${_lib}/ install
876 # libpam is special: we need to build static PAM modules before
877 # static PAM library, and dynamic PAM library before dynamic PAM
879 lib/libpam__L: .PHONY
880 @${ECHODIR} "===> lib/libpam"; \
881 cd ${.CURDIR}/lib/libpam; \
882 ${MAKE} DIRPRFX=lib/libpam/ depend; \
883 ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \
884 ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install
886 _startup_libs: ${_startup_libs:S/$/__L/}
887 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
888 _generic_libs: ${_generic_libs:S/$/__L/}
890 .for __target in all clean cleandepend cleandir depend includes obj
891 .for entry in ${SUBDIR}
892 ${entry}.${__target}__D: .PHONY
893 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
894 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
895 edir=${entry}.${MACHINE_ARCH}; \
896 cd ${.CURDIR}/$${edir}; \
898 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
900 cd ${.CURDIR}/$${edir}; \
902 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
904 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
907 .include <bsd.subdir.mk>