2 # $FreeBSD: src/Makefile.inc1,v 1.141.2.62 2003/04/06 19:54:00 dwmalone Exp $
4 # This file defines the user-driven targets.
6 # Standard targets are documented in the makefiles in /usr/share/mk and include:
7 # obj depend all install clean cleandepend cleanobj
9 # Build-time options are documented in make.conf(5).
12 # Put initial settings here.
15 # /libexec/ld-elf.so.2 needs to be installed first
16 # Otherwise, install(1) beeing a dynamically linked binary will fail
17 # during the first upgrade from a static to a dynamic world
18 .if exists(${.CURDIR}/libexec)
22 # We need to do include and lib early.
24 .if exists(${.CURDIR}/include)
27 .if exists(${.CURDIR}/lib)
30 # This exists simply to ensure that the obj dir hierarchy is
31 # intact for nrelease, allowing the nrelease Makefile's to
32 # reference ${.OBJDIR}.
34 .if exists(${.CURDIR}/nrelease)
38 .if exists(${.CURDIR}/bin)
41 .if exists(${.CURDIR}/games) && !defined(NO_GAMES)
44 .if exists(${.CURDIR}/gnu)
47 .if exists(${.CURDIR}/sbin)
50 .if exists(${.CURDIR}/share) && !defined(NO_SHARE)
53 .if exists(${.CURDIR}/sys)
56 .if exists(${.CURDIR}/usr.bin)
59 .if exists(${.CURDIR}/usr.sbin)
62 #.if exists(${.CURDIR}/llvm_clang)
66 .if exists(${.CURDIR}/etc)
70 # These are last, since it is nice to at least get the base system
71 # rebuilt before you do them.
72 .if defined(LOCAL_DIRS)
73 .for _DIR in ${LOCAL_DIRS}
74 .if exists(${.CURDIR}/${_DIR}) & exists(${.CURDIR}/${_DIR}/Makefile)
80 .if defined(SUBDIR_OVERRIDE)
81 SUBDIR= ${SUBDIR_OVERRIDE}
84 .if defined(NOCLEANDIR)
85 CLEANDIR= clean cleandepend
94 # Object directory base in primary make. Note that when we rerun make
95 # from inside this file we change MAKEOBJDIRPREFIX to the appropriate
96 # subdirectory because the rest of the build system needs it that way.
97 # The original object directory base is saved in OBJTREE.
99 MAKEOBJDIRPREFIX?= /usr/obj
100 OBJTREE?= ${MAKEOBJDIRPREFIX}
102 # Used for stage installs and pathing
104 DESTDIRBASE:= ${OBJTREE}${.CURDIR}
106 # Remove DESTDIR from MAKEFLAGS. It is present in the environment
107 # anyhow, and we need to be able to override it for stage installs
108 .MAKEFLAGS:= ${.MAKEFLAGS:NDESTDIR=*}
110 # This section sets the tools used to build the world/kernel
112 WORLD_LDVER?= ld.gold
113 WORLD_BINUTILSVER?= binutils227
115 # Set the backup parameters if they are not already defined
117 WORLD_BACKUP?= /var/backups/world_backup
118 AUTO_BACKUP?= ${OBJTREE}/world_backup/${DESTDIR}
120 TARGET_ARCH?= ${MACHINE_ARCH}
121 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
124 TARGET?= ${TARGET_ARCH}
127 BUILD_ARCH!= sysctl -n hw.machine_arch
129 # temporary until everybody has converted to x86_64
130 .if ${BUILD_ARCH} == "amd64"
134 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
135 .error To cross-build, set TARGET_ARCH.
139 # XXX this is ugly and we need to come up with a nicer solution
140 .if !defined(TARGET_PLATFORM)
141 .if ${TARGET_ARCH} == "x86_64"
142 TARGET_PLATFORM= pc64
144 .error Unknown target architecture.
148 THREAD_LIB?= thread_xu
149 .if ${THREAD_LIB} == "c_r"
150 .if defined(NO_LIBC_R)
151 .error libc_r is chosen as the default thread library, but NO_LIBC_R is defined
155 # BTOOLS (Natively built) All non-cross-development tools that the
156 # main build needs. This includes things like 'mkdir' and 'rm'.
157 # We will not use the native system's exec path once we start
158 # on WORLD. (bootstrap-tools and build-tools or BTOOLS)
160 # CTOOLS (Natively built) Cross development tools which are specific
161 # to the target architecture.
163 # WORLD (Cross built) Our ultimate buildworld, using only BTOOLS and
166 # MACHINE_PLATFORM Platform Architecture we are building on
167 # MACHINE Machine Architecture (usually the same as MACHINE_ARCH)
168 # MACHINE_ARCH CPU Architecture we are building on
170 # TARGET_PLATFORM Platform Architecture we are building for
171 # TARGET Machine Architecture we are building for
172 # TARGET_ARCH CPU Architecture we are building for
174 BTOOLSDEST= ${DESTDIRBASE}/btools_${MACHINE_ARCH}
175 CTOOLSDEST= ${DESTDIRBASE}/ctools_${MACHINE_ARCH}_${TARGET_ARCH}
176 WORLDDEST= ${DESTDIRBASE}/world_${TARGET_ARCH}
178 # The bootstrap-tools path is used by the bootstrap-tools, build-tools, and
179 # cross-tools stages to augment the existing command path to access newer
180 # versions of certain utilities such as 'patch' that the cross-tools stage
183 BTOOLSPATH= ${BTOOLSDEST}/usr/sbin:${BTOOLSDEST}/usr/bin:${BTOOLSDEST}/sbin:${BTOOLSDEST}/bin
185 # The cross-tools path containing the cross-tools to cross build the
188 CTOOLSPATH= ${CTOOLSDEST}/usr/sbin:${CTOOLSDEST}/usr/bin:${CTOOLSDEST}/sbin:${CTOOLSDEST}/bin
190 # The strict temporary command path contains all binaries required
191 # by the buildworld system after the cross-tools stage.
193 # NOTE: Append '/usr/local/bin:/usr/pkg/bin' to support external compilers.
194 # See compilers.conf(5) man page for more info.
196 STRICTTMPPATH= ${CTOOLSPATH}:${BTOOLSPATH}:/usr/local/bin:/usr/pkg/bin
202 # Building a world goes through the following stages
204 # 1. bootstrap-tool stage [BMAKE]
205 # This stage is responsible for creating programs that
206 # are needed for backward compatibility reasons. They
207 # are not built as cross-tools.
208 # 2. build-tool stage [TMAKE]
209 # This stage is responsible for creating the object
210 # tree and building any tools that are needed during
212 # 3. cross-tool stage [XMAKE]
213 # This stage is responsible for creating any tools that
214 # are needed for cross-builds. A cross-compiler is one
216 # 4. world stage [WMAKE]
217 # This stage actually builds the world.
218 # 5. install stage (optional) [IMAKE]
219 # This stage installs a previously built world.
221 # In all cases we must carefully adjust the environment so the proper
222 # tools and header files are used.
224 # NOTE: The M4 environment variable is used by the [f]lex binary to
225 # override the location of the 'm4' binary. The override is
226 # needed for certain buildworld version transitions, specifically
227 # past a certain point in 3.3 because the older /usr/bin/m4 will
228 # generate output that will blow up the newer [f]lex/yacc/bison
232 # bootstrap-tool stage
234 BMAKEENV= MAKEOBJDIRPREFIX=${BTOOLSDEST} \
236 DESTDIR=${BTOOLSDEST} \
238 PATH=${BTOOLSPATH}:${PATH} \
239 M4=${BTOOLSDEST}/usr/bin/m4 \
240 INSTALL="sh ${.CURDIR}/tools/install.sh"
242 BMAKE= ${BMAKEENV} make -f Makefile.inc1 -DBOOTSTRAPPING \
243 -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
244 -DNO_WERROR -DNO_NLS -DSYSBUILD
248 TMAKEENV= MAKEOBJDIRPREFIX=${BTOOLSDEST} \
252 PATH=${BTOOLSPATH}:${PATH} \
253 M4=${BTOOLSDEST}/usr/bin/m4 \
254 INSTALL="sh ${.CURDIR}/tools/install.sh"
256 TMAKE= ${TMAKEENV} make -f Makefile.inc1 -DBOOTSTRAPPING \
257 -DNOSHARED -DSYSBUILD
261 # note: TOOLS_PREFIX points to the obj root holding the cross
262 # compiler binaries, while USRDATA_PREFIX points to the obj root
263 # holding the target environment (and also determines where cross-built
264 # libraries, crt*.o, and include files are installed).
266 XMAKEENV= MAKEOBJDIRPREFIX=${CTOOLSDEST} \
268 DESTDIR=${CTOOLSDEST} \
270 _SHLIBDIRPREFIX=${CTOOLSDEST} \
271 INSTALL="sh ${.CURDIR}/tools/install.sh" \
272 TOOLS_PREFIX=${CTOOLSDEST} \
273 USRDATA_PREFIX=${WORLDDEST} \
274 SELECT_LINKER=${WORLD_LDVER} \
275 M4=${BTOOLSDEST}/usr/bin/m4 \
276 PATH=${BTOOLSPATH}:${PATH}
278 XMAKE= ${XMAKEENV} make -f Makefile.inc1 -DNO_GDB \
279 -DBOOTSTRAPPING -DNOSHARED -DSYSBUILD
281 # world stage, note the strict path and note that TOOLS_PREFIX is left
282 # unset and USRDATA_PREFIX (which defaults to TOOLS_PREFIX) is set to empty,
283 # which is primarily for the compiler so it targets / (e.g. /usr/<blah>)
284 # for both binary and library paths, even though it is being compiled to
285 # WORLDDEST. None of the programs in the world stage are ever actually
286 # executed during the buildworld/installworld.
288 CROSSENV= MAKEOBJDIRPREFIX=${WORLDDEST} \
290 MACHINE_ARCH=${TARGET_ARCH} \
292 MACHINE_PLATFORM=${TARGET_PLATFORM} \
294 OBJFORMAT_PATH=${CTOOLSDEST} \
295 HOST_CCVER=${HOST_CCVER} \
296 CCVER=${WORLD_CCVER} \
297 LDVER=${WORLD_LDVER} \
298 BINUTILSVER=${WORLD_BINUTILSVER}
300 WMAKEENV= ${CROSSENV} \
302 DESTDIR=${WORLDDEST} \
303 _SHLIBDIRPREFIX=${WORLDDEST} \
304 INSTALL="sh ${.CURDIR}/tools/install.sh" \
305 M4=${BTOOLSDEST}/usr/bin/m4 \
306 PATH=${STRICTTMPPATH}
308 WMAKE= ${WMAKEENV} make -f Makefile.inc1 -DSYSBUILD
312 IMAKEENV= ${CROSSENV} \
313 PATH=${STRICTTMPPATH}
314 IMAKE= ${IMAKEENV} make -f Makefile.inc1 -DSYSBUILD
318 KMAKEENV= ${WMAKEENV}
322 # Attempt to rebuild the entire system, with reasonable chance of
323 # success, regardless of how old your existing system is.
325 _worldtmp: _cleantmp _mtreetmp
326 .ORDER: _cleantmp _mtreetmp
330 @echo "--------------------------------------------------------------"
331 @echo ">>> Rebuilding the temporary build tree"
332 @echo "--------------------------------------------------------------"
333 .if !defined(NOCLEAN)
334 rm -rf ${BTOOLSDEST} ${CTOOLSDEST} ${WORLDDEST}
336 # XXX - These two can depend on any header file.
337 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
338 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
342 mkdir -p ${DESTDIRBASE} ${BTOOLSDEST} ${CTOOLSDEST} ${WORLDDEST}
343 .for _dir in ${WORLDDEST} ${BTOOLSDEST} ${CTOOLSDEST}
344 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \
345 -p ${_dir}/ > /dev/null
346 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
347 -p ${_dir}/usr > /dev/null
349 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
350 -p ${WORLDDEST}/usr/include > /dev/null
351 ${LN} -sf ${.CURDIR}/sys ${WORLDDEST}
354 @echo "--------------------------------------------------------------"
355 @echo ">>> starting buildworld target"
356 @echo "--------------------------------------------------------------"
359 @echo "--------------------------------------------------------------"
360 @echo ">>> stage 1: bootstrap tools"
361 @echo "--------------------------------------------------------------"
362 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
365 @echo "--------------------------------------------------------------"
366 @echo ">>> stage 2a: cleaning up the object tree"
367 @echo "--------------------------------------------------------------"
368 cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
371 @echo "--------------------------------------------------------------"
372 @echo ">>> stage 2b: rebuilding the object tree"
373 @echo "--------------------------------------------------------------"
374 cd ${.CURDIR}; ${WMAKE} par-obj
377 @echo "--------------------------------------------------------------"
378 @echo ">>> stage 2c: build tools"
379 @echo "--------------------------------------------------------------"
380 cd ${.CURDIR}; ${TMAKE} build-tools
383 @echo "--------------------------------------------------------------"
384 @echo ">>> stage 3: cross tools"
385 @echo "--------------------------------------------------------------"
386 cd ${.CURDIR}; ${XMAKE} cross-tools
389 @echo "--------------------------------------------------------------"
390 @echo ">>> stage 4a: populating ${WORLDDEST}/usr/include"
391 @echo "--------------------------------------------------------------"
392 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
395 @echo "--------------------------------------------------------------"
396 @echo ">>> stage 4b: building libraries"
397 @echo "--------------------------------------------------------------"
398 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOMAN -DNOFSCHG libraries
401 @echo "--------------------------------------------------------------"
402 @echo ">>> stage 4c: make dependencies"
403 @echo "--------------------------------------------------------------"
404 cd ${.CURDIR}; ${WMAKE} par-depend
407 @echo "--------------------------------------------------------------"
408 @echo ">>> stage 4d: building everything.."
409 @echo "--------------------------------------------------------------"
410 cd ${.CURDIR}; ${WMAKE} all
413 @echo "--------------------------------------------------------------"
414 @echo ">>> stage 5: building rescue and initrd"
415 @echo "--------------------------------------------------------------"
416 cd ${.CURDIR}/initrd; ${WMAKEENV} make all
418 @echo "--------------------------------------------------------------"
419 @echo ">>> buildworld target complete"
420 @echo "--------------------------------------------------------------"
422 @echo "--------------------------------------------------------------"
423 @echo ">>> starting quickworld target"
424 @echo "--------------------------------------------------------------"
426 @echo "--------------------------------------------------------------"
427 @echo ">>> quickworld target complete"
428 @echo "--------------------------------------------------------------"
430 @echo "--------------------------------------------------------------"
431 @echo ">>> starting installworld target"
432 @echo "--------------------------------------------------------------"
434 # note: buildworld no longer depends on _cleanobj because we rm -rf the
435 # entire object tree and built the bootstrap tools in a different location.
437 # buildworld - build everything from scratch
438 # quickworld - skip the bootstrap, build, and cross-build steps
439 # realquickworld - skip the bootstrap, build, crossbuild, and depend step.
441 # note: we include _obj in realquickworld to prevent accidental creation
442 # of files in /usr/src.
445 .if !defined(SUBDIR_OVERRIDE)
446 WMAKE_TGTS+= _worldtmp _bootstrap-tools
448 WMAKE_TGTS+= _obj _build-tools
449 .if !defined(SUBDIR_OVERRIDE)
450 WMAKE_TGTS+= _cross-tools
452 WMAKE_TGTS+= _includes _libraries _depend everything _initrd
454 .if defined(WMAKE_TGTS_OVERRIDE)
456 WMAKE_TGTS= ${WMAKE_TGTS_OVERRIDE}
459 QMAKE_TGTS= _mtreetmp _obj _includes _libraries _depend everything _initrd
461 buildworld: _bwinit ${WMAKE_TGTS} _bwdone
463 quickworld: _qwinit ${QMAKE_TGTS} _qwdone
465 realquickworld: _qwinit _mtreetmp _obj _includes _libraries everything _qwdone
467 crossworld: _worldtmp _bootstrap-tools _obj _build-tools _cross-tools
469 .ORDER: _bwinit ${WMAKE_TGTS} _bwdone
470 .ORDER: _obj _includes
471 .ORDER: _qwinit _mtreetmp _obj
472 .ORDER: installcheck backupworld-auto
473 .ORDER: everything _qwdone
478 # Checks to be sure system is ready for installworld
480 installcheck: _iwinit
481 @pw usershow _pflogd || (echo "You may need to run 'make preupgrade' first"; /usr/bin/false)
482 @pw groupshow authpf || (echo "You may need to run 'make preupgrade' first"; /usr/bin/false)
483 @pw groupshow _pflogd || (echo "You may need to run 'make preupgrade' first"; /usr/bin/false)
484 .if !defined(OVERRIDE_CHECKS)
485 .if !defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/"
486 @case `uname -r` in 1.2*|1.3-*|1.3.*|1.4.*|1.5.0-*|1.5.1-*|1.5.2-*|1.5.3-*) echo "You must upgrade your kernel to at least 1.5.4 and reboot before you can safely installworld, due to libc/system call ABI changes" ; /usr/bin/false ; esac
487 @case `uname -r` in 1.*|2.*|3.0*|3.1*|3.2*|3.3*|3.4*|3.5*|3.6*) echo "Base is too old for a normal installworld, you need to use installworld-force" ; /usr/bin/false ; esac
493 # Backs up the current world if ${AUTO_BACKUP} is writable.
494 # Installs everything compiled by a 'buildworld'.
496 installworld: installcheck
497 -@mkdir -p ${AUTO_BACKUP} > /dev/null 2>&1
499 (touch ${AUTO_BACKUP}/.updating > /dev/null 2>&1 && \
500 ${IMAKE} backupworld-auto) || \
501 echo "Cannot write to ${AUTO_BACKUP} - world not backed up"
503 cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
504 ${INSTALL} -o root -g wheel -m 644 ${.CURDIR}/Makefile_upgrade.inc \
505 ${DESTDIR}/etc/upgrade/
506 cd ${.CURDIR}; ${IMAKE} -DWORLDINSTALL initrd
509 @echo "--------------------------------------------------------------"
510 @echo ">>> installworld target complete"
511 @echo "--------------------------------------------------------------"
514 @echo "Doing a forced installworld. This will install to a temporary directory,"
515 @echo "then copy the main binaries and libraries with a static cpdup to ${DESTDIR}/"
516 @echo "and finally will issue a normal installworld. Starting in 5 seconds.".
519 rm -rf /usr/obj/temp > /dev/null 2>& 1 || chflags -R noschg /usr/obj/temp
521 mkdir -p /usr/obj/temp/cpdup/bin
522 (cd ${.CURDIR}/bin/cpdup; make clean && make obj && make clean && make CFLAGS=-static all install DESTDIR=/usr/obj/temp/cpdup NOMAN=TRUE)
523 @echo "XXXXXXXXX Installing to temporary XXXXXXXXX"
525 (cd ${.CURDIR}; ${MAKE} installworld DESTDIR=/usr/obj/temp > /dev/null 2>&1)
526 @echo "XXXXXXXXX Blasting binaries and libraries XXXXXXXXX"
528 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/bin /bin
529 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/sbin /sbin
530 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/lib /lib
531 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/usr/bin /usr/bin
532 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/usr/sbin /usr/sbin
533 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/usr/lib /usr/lib
534 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/libexec /libexec
535 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/usr/libexec /usr/libexec
536 @echo "XXXXXXXXX Doing final installworld XXXXXXXX"
538 (cd ${.CURDIR}; ${MAKE} installworld OVERRIDE_CHECKS=TRUE)
539 (cd ${.CURDIR}; ${MAKE} upgrade OVERRIDE_CHECKS=TRUE)
540 (cd ${.CURDIR}; ${MAKE} initrd)
545 # If you have a build server, you can NFS mount the source and obj directories
546 # and do a 'make reinstall' on the *client* to install new binaries from the
547 # most recent server build.
550 @echo "--------------------------------------------------------------"
551 @echo ">>> Making hierarchy"
552 @echo "--------------------------------------------------------------"
553 cd ${.CURDIR}; make -f Makefile.inc1 hierarchy
555 @echo "--------------------------------------------------------------"
556 @echo ">>> Installing everything.."
557 @echo "--------------------------------------------------------------"
558 cd ${.CURDIR}; make -f Makefile.inc1 install
562 # Install the rescue tools and the initrd image built by 'buildworld'.
565 (cd ${.CURDIR}/initrd; ${IMAKEENV} make install)
568 # buildkernel, nativekernel, quickkernel, realquickkernel, and installkernel
570 # Which kernels to build and/or install is specified by setting
571 # KERNCONF. If not defined an X86_64_GENERIC kernel is built/installed.
572 # Only the existing (depending TARGET) config files are used
573 # for building kernels and only the first of these is designated
574 # as the one being installed.
576 # You can specify INSTALLSTRIPPED=1 if you wish the installed
577 # kernel and modules to be stripped of its debug info (required
578 # symbols are left intact). You can specify INSTALLSTRIPPEDMODULES
579 # if you only want to strip the modules of their debug info. These
580 # only apply if you have DEBUG=-g in your kernel config or make line.
582 # Note that we have to use TARGET instead of TARGET_ARCH when
583 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
584 # be set to cross-build, we have to make sure TARGET is set
587 .if !defined(KERNCONF) && defined(KERNEL)
591 # XXX makeshift fix to build the right kernel for the (target) architecture
592 # We should configure this in the platform files somehow
593 .if ${TARGET_ARCH} == "x86_64"
594 KERNCONF?= X86_64_GENERIC
597 INSTKERNNAME?= kernel
599 KRNLSRCDIR= ${.CURDIR}/sys
600 KRNLCONFDIR= ${KRNLSRCDIR}/config
601 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
602 KERNCONFDIR?= ${KRNLCONFDIR}
606 .for _kernel in ${KERNCONF}
607 .if exists(${KERNCONFDIR}/${_kernel})
608 BUILDKERNELS+= ${_kernel}
609 .if empty(INSTALLKERNEL)
610 INSTALLKERNEL= ${_kernel}
615 # kernel version numbers survive rm -rf
617 .for _kernel in ${BUILDKERNELS}
618 .if exists(${KRNLOBJDIR}/${_kernel}/version)
619 KERNEL_VERSION_${_kernel} != cat ${KRNLOBJDIR}/${_kernel}/version
626 # Builds all kernels defined by BUILDKERNELS.
629 @if [ ! -f ${WORLDDEST}/.libraries_done ]; then \
630 echo "You must buildworld before buildkernel. If you wish"; \
631 echo "to build a kernel using native tools, config it manually"; \
632 echo "or use the nativekernel target if you are in a rush"; \
637 .for _kernel in ${BUILDKERNELS}
638 @if [ ! -f ${KRNLOBJDIR}/${_kernel}/.nativekernel_run ]; then \
639 if [ ! -f ${WORLDDEST}/.libraries_done ]; then \
640 echo "The kernel was build using buildworld tools which no" ; \
641 echo "longer appear to exist, (real)quickkernel failed!" ; \
648 .if empty(BUILDKERNELS)
649 @echo ">>> ERROR: Missing kernel configuration file(s)."
650 @echo ">>> ${KERNCONF} not found in ${KERNCONFDIR}."
655 .if defined(KERNWARN)
656 @echo "--------------------------------------------------------------"
657 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
658 @echo "--------------------------------------------------------------"
663 # The buildkernel target rebuilds the specified kernels from scratch
664 # using the crossbuild tools generated by the last buildworld. It is
665 # the safest (but also the most time consuming) way to build a new kernel.
667 buildkernel: bk_tools bk_build_list bk_kernwarn
668 .for _kernel in ${BUILDKERNELS}
669 @echo "--------------------------------------------------------------"
670 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
671 @echo "--------------------------------------------------------------"
672 @echo "===> ${_kernel}"
673 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
674 rm -rf ${KRNLOBJDIR}/${_kernel}
676 @if [ -f ${KRNLOBJDIR}/${_kernel}/.nativekernel_run ]; then \
677 echo "YOU ARE REBUILDING WITH BUILDKERNEL, REMOVING OLD NATIVEKERNEL BUILD"; \
678 rm -rf ${KRNLOBJDIR}/${_kernel}; fi
680 mkdir -p ${KRNLOBJDIR}
681 .if !defined(NO_KERNELCONFIG)
683 PATH=${STRICTTMPPATH} \
684 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
685 ${KERNCONFDIR}/${_kernel}
687 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN) && defined(KERNEL_VERSION_${_kernel})
688 echo ${KERNEL_VERSION_${_kernel}} > ${KRNLOBJDIR}/${_kernel}/version
690 touch ${KRNLOBJDIR}/${_kernel}/.buildkernel_run
691 .if !defined(NO_KERNELDEPEND)
692 cd ${KRNLOBJDIR}/${_kernel}; \
693 ${KMAKEENV} make KERNEL=${INSTKERNNAME} depend
695 cd ${KRNLOBJDIR}/${_kernel}; \
696 ${KMAKEENV} make KERNEL=${INSTKERNNAME} all
697 @echo "--------------------------------------------------------------"
698 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
699 @echo "--------------------------------------------------------------"
702 # The nativekernel target rebuilds the specified kernels from scratch
703 # using the system's standard compiler rather than using the crossbuild
704 # tools generated by the last buildworld. This is fairly safe if your
705 # system is reasonable up-to-date.
707 nativekernel: bk_build_list bk_kernwarn
708 .for _kernel in ${BUILDKERNELS}
709 @echo "--------------------------------------------------------------"
710 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
711 @echo "--------------------------------------------------------------"
712 @echo "===> ${_kernel}"
713 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
714 rm -rf ${KRNLOBJDIR}/${_kernel}
716 @if [ -f ${KRNLOBJDIR}/${_kernel}/.buildkernel_run ]; then \
717 echo "YOU ARE REBUILDING WITH NATIVEKERNEL, REMOVING OLD BUILDKERNEL BUILD"; \
718 rm -rf ${KRNLOBJDIR}/${_kernel}; fi
720 mkdir -p ${KRNLOBJDIR}
721 .if !defined(NO_KERNELCONFIG)
723 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
724 ${KERNCONFDIR}/${_kernel}
726 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN) && defined(KERNEL_VERSION_${_kernel})
727 echo ${KERNEL_VERSION_${_kernel}} > ${KRNLOBJDIR}/${_kernel}/version
729 touch ${KRNLOBJDIR}/${_kernel}/.nativekernel_run
730 .if !defined(NO_KERNELDEPEND)
731 cd ${KRNLOBJDIR}/${_kernel}; \
732 make KERNEL=${INSTKERNNAME} depend
734 cd ${KRNLOBJDIR}/${_kernel}; \
735 make KERNEL=${INSTKERNNAME} all
736 @echo "--------------------------------------------------------------"
737 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
738 @echo "--------------------------------------------------------------"
741 # The (real)quickkernel target rebuilds the specified kernels as quickly
742 # as possible. It will use the native tools or the buildworld cross tools
743 # based on whether the kernel was originally generated via buildkernel or
744 # nativekernel. Config is rerun but the object hierarchy is not rebuilt.
745 # realquickkernel skips the depend step (analogous to realquickworld).
747 quickkernel realquickkernel: maybe_bk_tools bk_build_list bk_kernwarn
748 .for _kernel in ${BUILDKERNELS}
749 @echo "--------------------------------------------------------------"
750 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
751 @echo "--------------------------------------------------------------"
752 @echo "===> ${_kernel}"
753 .if exists(${KRNLOBJDIR}/${_kernel}/.buildkernel_run)
754 .if !defined(NO_KERNELCONFIG)
756 PATH=${STRICTTMPPATH} \
757 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
758 ${KERNCONFDIR}/${_kernel}
760 .if !defined(NO_KERNELDEPEND) && !make(realquickkernel)
761 cd ${KRNLOBJDIR}/${_kernel}; \
762 ${KMAKEENV} make KERNEL=${INSTKERNNAME} depend
764 cd ${KRNLOBJDIR}/${_kernel}; \
765 ${KMAKEENV} make KERNEL=${INSTKERNNAME} all
767 .if !defined(NO_KERNELCONFIG)
769 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
770 ${KERNCONFDIR}/${_kernel}
772 .if !defined(NO_KERNELDEPEND) && !make(realquickkernel)
773 cd ${KRNLOBJDIR}/${_kernel}; \
774 make KERNEL=${INSTKERNNAME} depend
776 cd ${KRNLOBJDIR}/${_kernel}; \
777 make KERNEL=${INSTKERNNAME} all
779 @echo "--------------------------------------------------------------"
780 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
781 @echo "--------------------------------------------------------------"
787 # Install the kernel defined by INSTALLKERNEL
789 installkernel reinstallkernel:
790 @echo "--------------------------------------------------------------"
791 @echo ">>> Kernel install for ${INSTALLKERNEL} started on `LC_ALL=C date`"
792 @echo "--------------------------------------------------------------"
793 .if exists(${KRNLOBJDIR}/${INSTALLKERNEL}/.buildkernel_run)
794 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
795 ${IMAKEENV} make KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
797 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
798 make KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
800 @echo "--------------------------------------------------------------"
801 @echo ">>> Kernel install for ${INSTALLKERNEL} completed on `LC_ALL=C date`"
802 @echo "--------------------------------------------------------------"
805 # ------------------------------------------------------------------------
807 # From here onwards are utility targets used by the 'make world' and
808 # related targets. If your 'world' breaks, you may like to try to fix
809 # the problem and manually run the following targets to attempt to
810 # complete the build. Beware, this is *not* guaranteed to work, you
811 # need to have a pretty good grip on the current state of the system
812 # to attempt to manually finish it. If in doubt, 'make world' again.
815 # bootstrap-tools: Build all tools required to build all tools. Note that
816 # order is important in a number of cases and also note that the bootstrap
817 # and build tools stages have access to earlier binaries they themselves
820 # patch: older patch's do not have -i. This program must be built
821 # first so other bootstrap tools that need to apply patches
823 # [x]install: dependancies on various new install features
824 # rpcgen: old rpcgen used a hardwired cpp path, newer OBJFORMAT_PATH
825 # envs are not compatible with older objformat binaries.
828 # BSTRAPDIRS1 - must be built in strict order, no parallelism
830 # order is very important. yacc before m4 before flex. flex exec's m4,
831 # m4's parser file needs the latest byacc (insanity!).
835 bin/chmod bin/cp bin/cpdup bin/dd bin/mkdir bin/rm bin/echo \
836 bin/test bin/cat bin/ln bin/mv bin/expr bin/sh \
837 bin/hostname bin/kill \
838 usr.bin/yacc usr.bin/m4 usr.bin/localedef \
839 usr.bin/uudecode usr.bin/xinstall \
840 usr.bin/rpcgen usr.bin/bmake usr.bin/awk usr.bin/stat \
841 usr.bin/find usr.bin/flex
843 # BSTRAPDIRS2 - may built in parallel
846 usr.bin/sed usr.bin/uname usr.bin/touch \
847 usr.bin/mkdep usr.bin/mktemp usr.bin/lorder usr.bin/file2c \
848 usr.bin/tsort usr.bin/tr usr.bin/join usr.bin/wc usr.bin/basename \
849 usr.bin/gencat usr.bin/chflags usr.bin/expand usr.bin/paste \
850 usr.bin/uuencode usr.bin/cap_mkdb usr.bin/true usr.bin/false \
851 usr.bin/cmp usr.bin/xargs usr.bin/id usr.bin/env usr.bin/dirname \
852 usr.bin/tail usr.bin/unifdef \
853 usr.sbin/chown usr.sbin/mtree usr.sbin/config \
854 usr.sbin/zic usr.sbin/makewhatis usr.sbin/pwd_mkdb \
855 gnu/usr.bin/grep usr.bin/sort usr.bin/gzip \
856 usr.bin/mkcsmapper usr.bin/mkesdb usr.bin/crunch
858 bootstrap-tools: bootstrap-tools-before bootstrap-tools-targets1 bootstrap-tools-targets2
859 touch ${BTOOLSDEST}/.bootstrap_done
861 bootstrap-tools-before:
862 ${LN} -fs /bin/date ${BTOOLSDEST}/bin/date
864 bootstrap-tools-targets1: ${BSTRAPDIRS1:S/^/bstrap-/}
866 bootstrap-tools-targets2: ${BSTRAPDIRS2:S/^/bstrap-/}
868 .ORDER: bootstrap-tools-before bootstrap-tools-targets1 bootstrap-tools-targets2
870 .ORDER: ${BSTRAPDIRS1:S/^/bstrap-/}
872 .for _tool in ${BSTRAPDIRS1} ${BSTRAPDIRS2}
874 ${ECHODIR} "===> ${_tool} (bootstrap-tools)"; \
875 cd ${.CURDIR}/${_tool}; \
876 make DIRPRFX=${_tool}/ obj && \
877 make DIRPRFX=${_tool}/ depend && \
878 make DIRPRFX=${_tool}/ all && \
879 make DIRPRFX=${_tool}/ DESTDIR=${BTOOLSDEST} install
882 # build-tools: Build special purpose build tools.
884 # XXX we may be able to remove or consolidate this into bootstrap-tools
885 # now that we have the native helper (.nx/.no) infrastructure.
887 # XXX we should separate this into new Makefile.inc2.
888 # Just to prepare for reduction of ORDER: that slows down parallel crossworld.
890 # Make sure Makefile.inc1 logic is intact.
891 .if !defined(WORLD_ALTCOMPILER)
892 .warning undefined WORLD_ALTCOMPILER
895 # gcc80 is now the default compiler. See sys.mk for WORLD_ALTCOMPILER default
896 # and this file for WORLD_CCVER.
898 _gcc47_cross= gnu/usr.bin/cc47
899 _gcc47_tools= gnu/usr.bin/cc47/cc_prep gnu/usr.bin/cc47/cc_tools
901 _gcc50_cross= gnu/usr.bin/cc50
902 _gcc50_tools= gnu/usr.bin/cc50/cc_prep gnu/usr.bin/cc50/cc_tools
904 _gcc80_cross= gnu/usr.bin/cc80
905 _gcc80_tools= gnu/usr.bin/cc80/cc_prep gnu/usr.bin/cc80/cc_tools
907 _gcc_common_cross= lib/libz gnu/usr.bin/gmp gnu/usr.bin/mpfr gnu/usr.bin/mpc
909 .if !defined(NO_ALTCOMPILER)
910 . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc47})
911 _altcompiler_cross+= ${_gcc47_cross}
915 .if !defined(NO_ALTCOMPILER)
916 . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc50})
917 _altcompiler_cross+= ${_gcc50_cross}
921 #.if !defined(NO_ALTCOMPILER)
922 #. if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc80})
923 #_altcompiler_cross+= ${_gcc80_cross}
924 _basecompiler_cross+= ${_gcc80_cross}
928 _custom_cross= libexec/customcc
929 _binutils= gnu/usr.bin/${WORLD_BINUTILSVER}
931 build-tools: build-tools-targets
932 touch ${BTOOLSDEST}/.build_done
934 build-tools-targets: ${BTOOLSDIRS:S/^/btools-/}
937 # cross-tools: Build cross-building tools
940 CTOOLSDIRS= usr.bin/objformat
942 CTOOLSDIRS+= ${_binutils} \
943 ${_gcc_common_cross} \
944 ${_altcompiler_cross} \
945 ${_basecompiler_cross} ${_custom_cross}
947 cross-tools: cross-tools-targets
948 touch ${CTOOLSDEST}/.cross_done
950 cross-tools-targets: ${CTOOLSDIRS:S/^/ctools-/}
952 .for _tool in ${CTOOLSDIRS}
954 ${ECHODIR} "===> ${_tool} (cross-tools)"; \
955 cd ${.CURDIR}/${_tool}; \
956 make DIRPRFX=${_tool}/ obj && \
957 make DIRPRFX=${_tool}/ depend && \
958 make DIRPRFX=${_tool}/ all && \
959 make DIRPRFX=${_tool}/ DESTDIR=${CTOOLSDEST} install
963 # hierarchy - ensure that all the needed directories are present
966 cd ${.CURDIR}/etc; make distrib-dirs
969 # libraries - build all libraries, and install them under ${DESTDIR}.
971 # The list of libraries with dependents (${_prebuild_libs}) and their
972 # interdependencies (__L) are built automatically by the
973 # ${.CURDIR}/tools/make_libdeps.sh script.
975 # .makeenv does not work when bootstrapping from 4.x, so we must be sure
976 # to specify the correct CCVER or 'cc' will not exec the correct compiler.
978 # NOTE: Allow duplicate build for WORLD_ALTCOMPILER=all for WORLD_CCVER,
979 # It will already be built so it won't cost any extra time. Please
980 # list all compilers in the ALTCOMPILER sequence, including the base
985 HOST_CCVER=${HOST_CCVER} CCVER=${WORLD_CCVER} \
986 make -f Makefile.inc1 ${_startup_libs_base} -DSYSBUILD -DLIBGCC_ONLY;
987 .if !defined(NO_ALTCOMPILER)
988 . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc47})
990 HOST_CCVER=${HOST_CCVER} CCVER=gcc47 \
991 make -f Makefile.inc1 _startup_libs47 -DSYSBUILD -DLIBGCC_ONLY;
993 . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc50})
995 HOST_CCVER=${HOST_CCVER} CCVER=gcc50 \
996 make -f Makefile.inc1 _startup_libs50 -DSYSBUILD -DLIBGCC_ONLY;
998 . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc80})
1000 HOST_CCVER=${HOST_CCVER} CCVER=gcc80 \
1001 make -f Makefile.inc1 _startup_libs80 -DSYSBUILD -DLIBGCC_ONLY;
1005 make -f Makefile.inc1 _startup_libs -DSYSBUILD && \
1006 make -f Makefile.inc1 _prebuild_libs -DSYSBUILD && \
1007 make -f Makefile.inc1 _generic_libs -DSYSBUILD && \
1008 touch ${WORLDDEST}/.libraries_done
1010 # These dependencies are not automatically generated:
1012 # gnu/lib/${CCVER}/libgcc and gnu/lib/${CCVER}/csu must be built before all
1013 # shared libraries for ELF. The target for _startup_libsXX is
1014 # specifically built using gccXX.
1016 _startup_libs47= gnu/usr.bin/cc47/cc_prep \
1017 gnu/usr.bin/cc47/cc_tools \
1019 gnu/lib/gcc47/libgcc \
1020 gnu/lib/gcc47/libgcc_eh \
1021 gnu/lib/gcc47/libgcc_pic
1023 _startup_libs50= gnu/usr.bin/cc50/cc_prep \
1024 gnu/usr.bin/cc50/cc_tools \
1026 gnu/lib/gcc50/libgcc \
1027 gnu/lib/gcc50/libgcc_eh \
1028 gnu/lib/gcc50/libgcc_pic
1030 _startup_libs80= gnu/usr.bin/cc80/cc_prep \
1031 gnu/usr.bin/cc80/cc_tools \
1033 gnu/lib/gcc80/libgcc \
1034 gnu/lib/gcc80/libgcc_eh \
1035 gnu/lib/gcc80/libgcc_pic
1037 # gcc80 is now the default compiler. See sys.mk for WORLD_ALTCOMPILER default.
1039 .if !defined(NO_ALTCOMPILER)
1040 . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc47})
1041 _startup_libs_alt+= _startup_libs47
1045 .if !defined(NO_ALTCOMPILER)
1046 . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc50})
1047 _startup_libs_alt+= _startup_libs50
1051 #.if !defined(NO_ALTCOMPILER)
1052 #. if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc80})
1053 #_startup_libs_alt+= _startup_libs80
1054 _startup_libs_base+= _startup_libs80
1058 _startup_libs= lib/csu lib/libc lib/libc_rtld
1059 lib/libc__L: lib/csu__L
1061 _prebuild_libs= lib/libbz2 lib/libz
1062 _prebuild_libs+= lib/libutil
1064 _prebuild_libs+= lib/libelf
1065 _prebuild_libs+= lib/libpcap
1067 _generic_libs= gnu/lib
1069 _prebuild_libs+= lib/libcrypt lib/libmd \
1070 lib/libncurses/libncurses
1072 lib/libopie__L lib/libtacplus__L: lib/libmd__L
1076 _prebuild_libs+= lib/librecrypto lib/libressl
1077 lib/libressl__L: lib/librecrypto__L
1079 _prebuild_libs+= lib/libssh
1080 lib/libssh__L: lib/librecrypto__L lib/libz__L
1082 _prebuild_libs+= lib/libradius lib/libopie
1083 lib/libradius__L: lib/librecrypto__L
1084 lib/libopie__L: lib/librecrypto__L
1086 _prebuild_libs+= lib/libsbuf lib/libtacplus lib/libm \
1087 lib/libpam/libpam lib/libypclnt lib/lib${THREAD_LIB} \
1088 lib/libpthread lib/liblzma lib/libprop lib/libdevattr
1089 lib/liblzma__L: lib/libpthread__L
1090 lib/libdevattr__L: lib/libprop__L
1092 _generic_libs+= usr.bin/flex/lib
1094 .for _alib in ${_startup_libs_alt} ${_startup_libs_base}
1095 __startup_alibs+= ${${_alib}}
1098 .for _lib in ${__startup_alibs} \
1099 ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
1101 .if exists(${.CURDIR}/${_lib})
1102 @${ECHODIR} "===> ${_lib}"; \
1103 cd ${.CURDIR}/${_lib}; \
1104 echo "STEP DEP ${_lib}" && \
1105 make DIRPRFX=${_lib}/ depend && \
1106 echo "STEP ALL ${_lib}" && \
1107 make DIRPRFX=${_lib}/ all && \
1108 echo "STEP INSTALL ${_lib}" && \
1109 make DIRPRFX=${_lib}/ install && \
1110 echo "STEP DONE ${_lib}";
1112 .warning missing ${.CURDIR}/${_lib} directory.
1116 _startup_libs: ${_startup_libs:S/$/__L/}
1117 .for _alib in ${_startup_libs_alt} ${_startup_libs_base}
1118 ${_alib}: ${${_alib}:C/$/__L/}
1120 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
1121 _generic_libs: ${_generic_libs:S/$/__L/}
1123 # library targets must be ordered because there are inter-library
1124 # races (e.g. generation of tconfig.h)
1126 .for _alib in ${_startup_libs_base} ${_startup_libs_alt}
1127 .ORDER: ${${_alib}:C/$/__L/}
1130 # uncomment if there are missing dependencies
1132 .ORDER: ${_prebuild_libs:S/$/__L/}
1133 # we can disable this one, no lib/* depend on libstdc++
1134 .ORDER: ${_generic_libs:S/$/__L/}
1137 .for __target in clean cleandepend cleandir obj depend includes
1138 .for entry in ${SUBDIR}
1139 ${entry}.${__target}__D: .PHONY
1140 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
1141 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
1142 edir=${entry}.${MACHINE_ARCH}; \
1143 cd ${.CURDIR}/$${edir}; \
1145 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
1147 cd ${.CURDIR}/$${edir}; \
1149 make ${__target} DIRPRFX=${DIRPRFX}$${edir}/
1151 par-${__target}: ${SUBDIR:C/$/.${__target}__D/}
1152 .ORDER: ${SUBDIR:C/$/.${__target}__D/}
1154 .ORDER: par-clean par-cleandepend par-cleandir par-obj par-depend par-includes
1156 # The wmake target is used by /usr/bin/wmake to run make in a
1157 # world build environment.
1160 @echo '${WMAKEENV} make ${WMAKE_ARGS} -DSYSBUILD'
1163 @echo '${WMAKEENV} /bin/sh'
1166 @echo '${BMAKEENV} make ${BMAKE_ARGS} -DSYSBUILD'
1169 @echo '${BMAKEENV} /bin/sh'
1172 @echo '${TMAKEENV} make ${TMAKE_ARGS} -DSYSBUILD'
1175 @echo '${TMAKEENV} /bin/sh'
1178 @echo '${XMAKEENV} make ${XMAKE_ARGS} -DSYSBUILD'
1181 @echo '${XMAKEENV} /bin/sh'
1183 backupworld: backup-clean
1184 @mkdir -p ${WORLD_BACKUP}
1185 .if (exists(${DESTDIR}/sbin) && exists(${DESTDIR}/bin) && \
1186 exists(${DESTDIR}/usr/sbin) && exists(${DESTDIR}/usr/bin) && \
1187 exists(${DESTDIR}/usr/lib) && exists(${DESTDIR}/usr/libexec))
1188 tar -czf ${WORLD_BACKUP}/binaries.tar.gz -C ${DESTDIR}/ \
1189 --options gzip:compression-level=1 \
1190 sbin bin usr/sbin usr/bin usr/lib usr/libexec
1194 .if !defined(NO_BACKUP)
1195 rm -f ${AUTO_BACKUP}/binaries.tar.gz
1196 @mkdir -p ${AUTO_BACKUP}
1197 .if (exists(${DESTDIR}/sbin) && exists(${DESTDIR}/bin) && \
1198 exists(${DESTDIR}/usr/sbin) && exists(${DESTDIR}/usr/bin) && \
1199 exists(${DESTDIR}/usr/lib) && exists(${DESTDIR}/usr/libexec))
1200 /usr/bin/tar -czf ${AUTO_BACKUP}/binaries.tar.gz -C ${DESTDIR}/ \
1201 --options gzip:compression-level=1 \
1202 sbin bin usr/sbin usr/bin usr/lib usr/libexec
1207 rm -f ${AUTO_BACKUP}/binaries.tar.gz
1210 rm -f ${WORLD_BACKUP}/binaries.tar.gz
1213 .if !exists(${WORLD_BACKUP}/binaries.tar.gz)
1214 @echo "There does not seem to be a valid archive present."
1216 @echo "Restoring system binaries from manual backup archive..."
1217 @chflags -R noschg ${DESTDIR}/sbin ${DESTDIR}/bin \
1218 ${DESTDIR}/usr/sbin ${DESTDIR}/usr/bin \
1219 ${DESTDIR}/usr/lib ${DESTDIR}/usr/libexec
1220 tar -xzf ${WORLD_BACKUP}/binaries.tar.gz -C ${DESTDIR}/
1224 .if !exists(${AUTO_BACKUP}/binaries.tar.gz)
1225 @echo "There does not seem to be a valid archive present."
1227 @echo "Restoring system binaries from auto-backup archive..."
1228 @chflags -R noschg ${DESTDIR}/sbin ${DESTDIR}/bin \
1229 ${DESTDIR}/usr/sbin ${DESTDIR}/usr/bin \
1230 ${DESTDIR}/usr/lib ${DESTDIR}/usr/libexec
1231 tar -xzf ${AUTO_BACKUP}/binaries.tar.gz -C ${DESTDIR}/
1234 # Take advantage of bmake error response
1236 MAKE_PRINT_VAR_ON_ERROR= \
1253 .if ${.MAKE.LEVEL} > 0
1254 MAKE_PRINT_VAR_ON_ERROR+= .MAKE.MAKEFILES .PATH
1257 .include <bsd.subdir.mk>