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 DFLYVERSION!= awk '/^\#define[[:blank:]]__DragonFly_version/ {print $$3}' \
13 < ${.CURDIR}/sys/sys/param.h
15 OSREL!= echo ${DFLYVERSION} | \
16 awk '{a=int($$1/100000); b=int(($$1-(a*100000))/100); \
19 # Put initial settings here.
22 # /libexec/ld-elf.so.2 needs to be installed first
23 # Otherwise, install(1) beeing a dynamically linked binary will fail
24 # during the first upgrade from a static to a dynamic world
25 .if exists(${.CURDIR}/libexec)
29 # We need to do include and lib early.
31 .if exists(${.CURDIR}/include)
34 .if exists(${.CURDIR}/lib)
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)
63 .if exists(${.CURDIR}/etc)
67 # These are last, since it is nice to at least get the base system
68 # rebuilt before you do them.
69 .if defined(LOCAL_DIRS)
70 .for _DIR in ${LOCAL_DIRS}
71 .if exists(${.CURDIR}/${_DIR}) & exists(${.CURDIR}/${_DIR}/Makefile)
77 .if defined(SUBDIR_OVERRIDE)
78 SUBDIR= ${SUBDIR_OVERRIDE}
81 .if defined(NOCLEANDIR)
82 CLEANDIR= clean cleandepend
91 # Object directory base in primary make. Note that when we rerun make
92 # from inside this file we change MAKEOBJDIRPREFIX to the appropriate
93 # subdirectory because the rest of the build system needs it that way.
94 # The original object directory base is saved in OBJTREE.
96 MAKEOBJDIRPREFIX?= /usr/obj
97 OBJTREE?= ${MAKEOBJDIRPREFIX}
99 # Used for stage installs and pathing
101 DESTDIRBASE:= ${OBJTREE}${.CURDIR}
103 # Remove DESTDIR from MAKEFLAGS. It is present in the environment
104 # anyhow, and we need to be able to override it for stage installs
105 .MAKEFLAGS:= ${.MAKEFLAGS:NDESTDIR=*}
107 # This section sets the tools used to build the world/kernel
109 WORLD_LDVER?= ld.gold
110 WORLD_BINUTILSVER?= binutils227
112 # Set the backup parameters if they are not already defined
114 WORLD_BACKUP?= /var/backups/world_backup
115 AUTO_BACKUP?= ${OBJTREE}/world_backup/${DESTDIR}
117 TARGET_ARCH?= ${MACHINE_ARCH}
118 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
121 TARGET?= ${TARGET_ARCH}
124 BUILD_ARCH!= sysctl -n hw.machine_arch
126 # temporary until everybody has converted to x86_64
127 .if ${BUILD_ARCH} == "amd64"
131 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
132 .error To cross-build, set TARGET_ARCH.
136 # XXX this is ugly and we need to come up with a nicer solution
137 .if !defined(TARGET_PLATFORM)
138 .if ${TARGET_ARCH} == "x86_64"
139 TARGET_PLATFORM= pc64
141 .error Unknown target architecture.
145 THREAD_LIB?= thread_xu
147 # BTOOLS (Natively built) All non-cross-development tools that the
148 # main build needs. This includes things like 'mkdir' and 'rm'.
149 # We will not use the native system's exec path once we start
150 # on WORLD. (bootstrap-tools and build-tools or BTOOLS)
152 # CTOOLS (Natively built) Cross development tools which are specific
153 # to the target architecture.
155 # WORLD (Cross built) Our ultimate buildworld, using only BTOOLS and
158 # MACHINE_PLATFORM Platform Architecture we are building on
159 # MACHINE Machine Architecture (usually the same as MACHINE_ARCH)
160 # MACHINE_ARCH CPU Architecture we are building on
162 # TARGET_PLATFORM Platform Architecture we are building for
163 # TARGET Machine Architecture we are building for
164 # TARGET_ARCH CPU Architecture we are building for
166 BTOOLSDEST= ${DESTDIRBASE}/btools_${MACHINE_ARCH}
167 CTOOLSDEST= ${DESTDIRBASE}/ctools_${MACHINE_ARCH}_${TARGET_ARCH}
168 WORLDDEST= ${DESTDIRBASE}/world_${TARGET_ARCH}
170 # The bootstrap-tools path is used by the bootstrap-tools, build-tools, and
171 # cross-tools stages to augment the existing command path to access newer
172 # versions of certain utilities such as 'patch' that the cross-tools stage
175 BTOOLSPATH= ${BTOOLSDEST}/usr/sbin:${BTOOLSDEST}/usr/bin:${BTOOLSDEST}/sbin:${BTOOLSDEST}/bin
177 # The cross-tools path containing the cross-tools to cross build the
180 CTOOLSPATH= ${CTOOLSDEST}/usr/sbin:${CTOOLSDEST}/usr/bin:${CTOOLSDEST}/sbin:${CTOOLSDEST}/bin
182 # The strict temporary command path contains all binaries required
183 # by the buildworld system after the cross-tools stage.
185 # NOTE: Append '/usr/local/bin:/usr/pkg/bin' to support external compilers.
186 # See compilers.conf(5) man page for more info.
188 STRICTTMPPATH= ${CTOOLSPATH}:${BTOOLSPATH}:/usr/local/bin:/usr/pkg/bin
194 # Building a world goes through the following stages
196 # 1. bootstrap-tool stage [BMAKE]
197 # This stage is responsible for creating programs that
198 # are needed for backward compatibility reasons. They
199 # are not built as cross-tools.
200 # 2. build-tool stage [TMAKE]
201 # This stage is responsible for creating the object
202 # tree and building any tools that are needed during
204 # 3. cross-tool stage [XMAKE]
205 # This stage is responsible for creating any tools that
206 # are needed for cross-builds. A cross-compiler is one
208 # 4. world stage [WMAKE]
209 # This stage actually builds the world.
210 # 5. install stage (optional) [IMAKE]
211 # This stage installs a previously built world.
213 # In all cases we must carefully adjust the environment so the proper
214 # tools and header files are used.
216 # NOTE: The M4 environment variable is used by the [f]lex binary to
217 # override the location of the 'm4' binary. The override is
218 # needed for certain buildworld version transitions, specifically
219 # past a certain point in 3.3 because the older /usr/bin/m4 will
220 # generate output that will blow up the newer [f]lex/yacc/bison
224 # bootstrap-tool stage
226 BMAKEENV= MAKEOBJDIRPREFIX=${BTOOLSDEST} \
228 DESTDIR=${BTOOLSDEST} \
230 PATH=${BTOOLSPATH}:${PATH} \
231 M4=${BTOOLSDEST}/usr/bin/m4 \
232 INSTALL="sh ${.CURDIR}/tools/install.sh"
234 BMAKE= ${BMAKEENV} make -f Makefile.inc1 -DBOOTSTRAPPING \
235 -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
236 -DNO_WERROR -DNO_NLS -DSYSBUILD
240 TMAKEENV= MAKEOBJDIRPREFIX=${BTOOLSDEST} \
244 PATH=${BTOOLSPATH}:${PATH} \
245 M4=${BTOOLSDEST}/usr/bin/m4 \
246 INSTALL="sh ${.CURDIR}/tools/install.sh"
248 TMAKE= ${TMAKEENV} make -f Makefile.inc1 -DBOOTSTRAPPING \
249 -DNOSHARED -DSYSBUILD
253 # note: TOOLS_PREFIX points to the obj root holding the cross
254 # compiler binaries, while USRDATA_PREFIX points to the obj root
255 # holding the target environment (and also determines where cross-built
256 # libraries, crt*.o, and include files are installed).
258 XMAKEENV= MAKEOBJDIRPREFIX=${CTOOLSDEST} \
260 DESTDIR=${CTOOLSDEST} \
262 _SHLIBDIRPREFIX=${CTOOLSDEST} \
263 INSTALL="sh ${.CURDIR}/tools/install.sh" \
264 TOOLS_PREFIX=${CTOOLSDEST} \
265 USRDATA_PREFIX=${WORLDDEST} \
266 SELECT_LINKER=${WORLD_LDVER} \
267 M4=${BTOOLSDEST}/usr/bin/m4 \
268 PATH=${BTOOLSPATH}:${PATH}
270 XMAKE= ${XMAKEENV} make -f Makefile.inc1 -DNO_GDB \
271 -DBOOTSTRAPPING -DNOMAN -DNOSHARED -DSYSBUILD
273 # world stage, note the strict path and note that TOOLS_PREFIX is left
274 # unset and USRDATA_PREFIX (which defaults to TOOLS_PREFIX) is set to empty,
275 # which is primarily for the compiler so it targets / (e.g. /usr/<blah>)
276 # for both binary and library paths, even though it is being compiled to
277 # WORLDDEST. None of the programs in the world stage are ever actually
278 # executed during the buildworld/installworld.
280 CROSSENV= MAKEOBJDIRPREFIX=${WORLDDEST} \
282 MACHINE_ARCH=${TARGET_ARCH} \
284 MACHINE_PLATFORM=${TARGET_PLATFORM} \
286 OBJFORMAT_PATH=${CTOOLSDEST} \
287 HOST_CCVER=${HOST_CCVER} \
288 CCVER=${WORLD_CCVER} \
289 LDVER=${WORLD_LDVER} \
290 BINUTILSVER=${WORLD_BINUTILSVER}
292 WMAKEENV= ${CROSSENV} \
294 DESTDIR=${WORLDDEST} \
295 _SHLIBDIRPREFIX=${WORLDDEST} \
296 INSTALL="sh ${.CURDIR}/tools/install.sh" \
297 M4=${BTOOLSDEST}/usr/bin/m4 \
298 PATH=${STRICTTMPPATH}
300 WMAKE= ${WMAKEENV} make -f Makefile.inc1 -DSYSBUILD
304 IMAKEENV= ${CROSSENV} \
305 PATH=${STRICTTMPPATH}
306 IMAKE= ${IMAKEENV} make -f Makefile.inc1 -DSYSBUILD
310 KMAKEENV= ${WMAKEENV}
314 # Attempt to rebuild the entire system, with reasonable chance of
315 # success, regardless of how old your existing system is.
317 _worldtmp: _cleantmp _mtreetmp
318 .ORDER: _cleantmp _mtreetmp
321 .if !defined(NOCLEAN)
322 rm -rf ${BTOOLSDEST} ${CTOOLSDEST} ${WORLDDEST}
324 # XXX - These two can depend on any header file.
325 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
326 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
331 @echo "--------------------------------------------------------------"
332 @echo ">>> Rebuilding the temporary build tree"
333 @echo "--------------------------------------------------------------"
334 mkdir -p ${DESTDIRBASE} ${BTOOLSDEST} ${CTOOLSDEST} ${WORLDDEST}
335 .for _dir in ${WORLDDEST} ${BTOOLSDEST} ${CTOOLSDEST}
336 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \
337 -p ${_dir}/ > /dev/null
338 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
339 -p ${_dir}/usr > /dev/null
341 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
342 -p ${WORLDDEST}/usr/include > /dev/null
343 ${LN} -sf ${.CURDIR}/sys ${WORLDDEST}
346 @echo "--------------------------------------------------------------"
347 @echo ">>> starting buildworld target"
348 @echo "--------------------------------------------------------------"
351 @echo "--------------------------------------------------------------"
352 @echo ">>> stage 1: bootstrap tools"
353 @echo "--------------------------------------------------------------"
354 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
357 @echo "--------------------------------------------------------------"
358 @echo ">>> stage 2a: cleaning up the object tree"
359 @echo "--------------------------------------------------------------"
360 cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
363 @echo "--------------------------------------------------------------"
364 @echo ">>> stage 2b: rebuilding the object tree"
365 @echo "--------------------------------------------------------------"
366 cd ${.CURDIR}; ${WMAKE} par-obj
369 @echo "--------------------------------------------------------------"
370 @echo ">>> stage 2c: build tools"
371 @echo "--------------------------------------------------------------"
372 cd ${.CURDIR}; ${TMAKE} build-tools
375 @echo "--------------------------------------------------------------"
376 @echo ">>> stage 3: cross tools"
377 @echo "--------------------------------------------------------------"
378 cd ${.CURDIR}; ${XMAKE} cross-tools
381 @echo "--------------------------------------------------------------"
382 @echo ">>> stage 4a: populating ${WORLDDEST}/usr/include"
383 @echo "--------------------------------------------------------------"
384 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
387 @echo "--------------------------------------------------------------"
388 @echo ">>> stage 4b: building libraries"
389 @echo "--------------------------------------------------------------"
390 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOMAN -DNOFSCHG libraries
393 @echo "--------------------------------------------------------------"
394 @echo ">>> stage 4c: make dependencies"
395 @echo "--------------------------------------------------------------"
396 cd ${.CURDIR}; ${WMAKE} par-depend
399 @echo "--------------------------------------------------------------"
400 @echo ">>> stage 4d: building everything"
401 @echo "--------------------------------------------------------------"
402 cd ${.CURDIR}; ${WMAKE} all
405 @echo "--------------------------------------------------------------"
406 @echo ">>> stage 5: building rescue and initrd"
407 @echo "--------------------------------------------------------------"
408 cd ${.CURDIR}/initrd; ${WMAKEENV} make all
410 @echo "--------------------------------------------------------------"
411 @echo ">>> buildworld target complete"
412 @echo "--------------------------------------------------------------"
414 @echo "--------------------------------------------------------------"
415 @echo ">>> starting quickworld target"
416 @echo "--------------------------------------------------------------"
418 @echo "--------------------------------------------------------------"
419 @echo ">>> quickworld target complete"
420 @echo "--------------------------------------------------------------"
422 @echo "--------------------------------------------------------------"
423 @echo ">>> starting installworld target"
424 @echo "--------------------------------------------------------------"
426 # note: buildworld no longer depends on _cleanobj because we rm -rf the
427 # entire object tree and built the bootstrap tools in a different location.
429 # buildworld - build everything from scratch
430 # quickworld - skip the bootstrap, build, and cross-build steps
431 # realquickworld - skip the bootstrap, build, crossbuild, and depend step.
433 # note: we include _obj in realquickworld to prevent accidental creation
434 # of files in /usr/src.
437 .if !defined(SUBDIR_OVERRIDE)
438 WMAKE_TGTS+= _worldtmp _bootstrap-tools
440 WMAKE_TGTS+= _obj _build-tools
441 .if !defined(SUBDIR_OVERRIDE)
442 WMAKE_TGTS+= _cross-tools
444 WMAKE_TGTS+= _includes _libraries _depend everything _initrd
446 .if defined(WMAKE_TGTS_OVERRIDE)
448 WMAKE_TGTS= ${WMAKE_TGTS_OVERRIDE}
451 QMAKE_TGTS= _mtreetmp _obj _includes _libraries _depend everything _initrd
453 buildworld: _bwinit ${WMAKE_TGTS} _bwdone
455 quickworld: _qwinit ${QMAKE_TGTS} _qwdone
457 realquickworld: _qwinit _mtreetmp _obj _includes _libraries everything _qwdone
459 crossworld: _worldtmp _bootstrap-tools _obj _build-tools _cross-tools
461 GENLOGDIR= /usr/obj/${.CURDIR}
462 .ORDER: build-all install-all
468 @echo "Building world, log file in ${GENLOGDIR}/bw.out"
469 @mkdir -p ${GENLOGDIR}
470 @(cd ${.CURDIR}; ${MAKE} -j `sysctl -n hw.ncpu` buildworld > ${GENLOGDIR}/bw.out 2>&1)
472 @echo "Building kernel, log file in ${GENLOGDIR}/bk.out"
473 @(cd ${.CURDIR}; ${MAKE} -j `sysctl -n hw.ncpu` buildkernel > ${GENLOGDIR}/bk.out 2>&1)
474 @echo "build-all completed ok"
478 @echo "Installing kernel, log file in ${GENLOGDIR}/bk.out"
479 @mkdir -p ${GENLOGDIR}
480 @(cd ${.CURDIR}; ${MAKE} -j 1 installkernel >> ${GENLOGDIR}/bk.out 2>&1)
482 @echo "Installing world, log file in ${GENLOGDIR}/bw.out"
483 @(cd ${.CURDIR}; ${MAKE} -j 1 installworld >> ${GENLOGDIR}/bw.out 2>&1)
485 echo "Upgrading world"
486 @(cd ${.CURDIR}; ${MAKE} -j 1 upgrade >> ${GENLOGDIR}/bw.out 2>&1)
488 @echo "install-all completed ok. reboot recommended and after that, "
489 @echo "if doing a major upgrade, pkg upgrade -f"
491 .ORDER: _bwinit ${WMAKE_TGTS} _bwdone
492 .ORDER: _obj _includes
493 .ORDER: _qwinit _mtreetmp _obj
494 .ORDER: installcheck backupworld-auto
495 .ORDER: everything _qwdone
500 # Checks to be sure system is ready for installworld
502 installcheck: _iwinit
503 .for _user in _pflogd
504 @pw usershow ${_user} >/dev/null || { \
505 echo "You need to run 'make preupgrade' first."; \
509 .for _group in _pflogd authpf
510 @pw groupshow ${_group} >/dev/null || { \
511 echo "You need to run 'make preupgrade' first."; \
515 .if !defined(OVERRIDE_CHECKS)
516 .if !defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/"
517 @case `uname -r` in \
518 1.2*|1.3-*|1.3.*|1.4.*|1.5.0-*|1.5.1-*|1.5.2-*|1.5.3-*) \
519 echo "You must upgrade your kernel to at least 1.5.4" \
520 "and reboot before you can safely installworld," \
521 "due to libc/system call ABI changes."; \
524 @case `uname -r` in \
525 1.*|2.*|3.0*|3.1*|3.2*|3.3*|3.4*|3.5*|3.6*) \
526 echo "The system is too old for a normal installworld," \
527 "you need to use 'installworld-force'."; \
535 # Backs up the current world if ${AUTO_BACKUP} is writable.
536 # Installs everything compiled by a 'buildworld'.
538 installworld: installcheck
539 -@mkdir -p ${AUTO_BACKUP} > /dev/null 2>&1
541 (touch ${AUTO_BACKUP}/.updating > /dev/null 2>&1 && \
542 ${IMAKE} backupworld-auto) || \
543 echo "Cannot write to ${AUTO_BACKUP} - world not backed up"
545 cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
546 ${INSTALL} -o root -g wheel -m 644 ${.CURDIR}/Makefile_upgrade.inc \
547 ${DESTDIR}/etc/upgrade/
548 cd ${.CURDIR}; ${IMAKE} -DWORLDINSTALL os-release
549 cd ${.CURDIR}; ${IMAKE} -DWORLDINSTALL initrd
551 @echo "--------------------------------------------------------------"
552 @echo ">>> installworld target complete"
553 @echo "--------------------------------------------------------------"
556 @echo "NAME=DragonFly" > ${DESTDIR}/etc/os-release
557 @echo "VERSION=${OSREL}-SYNTH" >> ${DESTDIR}/etc/os-release
558 @echo "VERSION_ID=${OSREL}" >> ${DESTDIR}/etc/os-release
559 @echo "ID=dragonfly" >> ${DESTDIR}/etc/os-release
560 @echo "ANSI_COLOR=\"0;32\"" >> ${DESTDIR}/etc/os-release
561 @echo "PRETTY_NAME=\"DragonFlyBSD ${OSREL}-SYNTH\"" >> ${DESTDIR}/etc/os-release
562 @echo "CPE_NAME=\"cpe:/o:dragonflybsd:dragonfly:${OSREL}\"" >> ${DESTDIR}/etc/os-release
563 @echo "SUPPORT_URL=\"http://chat.efnet.org:9090/?nick=dflynick&channels=%23dragonflybsd&Login=Login\"" >> ${DESTDIR}/etc/os-release
564 @echo "HOME_URL=\"https://www.dragonflybsd.org/\"" >> ${DESTDIR}/etc/os-release
565 @echo "BUG_REPORT_URL=\"https://bugs.dragonflybsd.org/\"" >> ${DESTDIR}/etc/os-release
566 @echo "MACHINE_ARCH=${MACHINE_ARCH}" >> ${DESTDIR}/etc/os-release
567 @echo "MACHINE=${MACHINE}" >> ${DESTDIR}/etc/os-release
568 @echo "DFLYVERSION=${DFLYVERSION}" >> ${DESTDIR}/etc/os-release
571 @echo "Doing a forced installworld. This will install to a temporary directory,"
572 @echo "then copy the main binaries and libraries with a static cpdup to ${DESTDIR}/"
573 @echo "and finally will issue a normal installworld."
575 @echo "Starting in 5 seconds. ^C to abort."
578 rm -rf /usr/obj/temp > /dev/null 2>&1 || chflags -R noschg /usr/obj/temp
580 mkdir -p /usr/obj/temp/cpdup/bin
581 (cd ${.CURDIR}/bin/cpdup; \
585 make CFLAGS=-static all install DESTDIR=/usr/obj/temp/cpdup NOMAN=TRUE)
586 @echo "XXXXXXXXX Installing to temporary XXXXXXXXX"
588 (cd ${.CURDIR}; ${MAKE} installworld DESTDIR=/usr/obj/temp > /dev/null 2>&1)
589 @echo "XXXXXXXXX Blasting binaries and libraries XXXXXXXXX"
591 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/bin /bin
592 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/sbin /sbin
593 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/lib /lib
594 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/usr/bin /usr/bin
595 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/usr/sbin /usr/sbin
596 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/usr/lib /usr/lib
597 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/libexec /libexec
598 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/usr/libexec /usr/libexec
599 @echo "XXXXXXXXX Doing final installworld XXXXXXXX"
601 (cd ${.CURDIR}; ${MAKE} installworld OVERRIDE_CHECKS=TRUE)
602 (cd ${.CURDIR}; ${MAKE} upgrade OVERRIDE_CHECKS=TRUE)
603 (cd ${.CURDIR}; ${MAKE} initrd)
607 # If you have a build server, you can NFS mount the source and obj directories
608 # and do a 'make reinstall' on the *client* to install new binaries from the
609 # most recent server build.
612 @echo "--------------------------------------------------------------"
613 @echo ">>> Making hierarchy"
614 @echo "--------------------------------------------------------------"
615 cd ${.CURDIR}; make -f Makefile.inc1 hierarchy
617 @echo "--------------------------------------------------------------"
618 @echo ">>> Installing everything"
619 @echo "--------------------------------------------------------------"
620 cd ${.CURDIR}; make -f Makefile.inc1 install
624 # Install the rescue tools and the initrd image built by 'buildworld'.
627 (cd ${.CURDIR}/initrd; ${IMAKEENV} make install)
630 # buildkernel, nativekernel, quickkernel, realquickkernel, and installkernel
632 # Which kernels to build and/or install is specified by setting
633 # KERNCONF. If not defined an X86_64_GENERIC kernel is built/installed.
634 # Only the existing (depending TARGET) config files are used
635 # for building kernels and only the first of these is designated
636 # as the one being installed.
638 # You can specify INSTALLSTRIPPED=1 if you wish the installed
639 # kernel and modules to be stripped of its debug info (required
640 # symbols are left intact). You can specify INSTALLSTRIPPEDMODULES
641 # if you only want to strip the modules of their debug info. These
642 # only apply if you have DEBUG=-g in your kernel config or make line.
644 # Note that we have to use TARGET instead of TARGET_ARCH when
645 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
646 # be set to cross-build, we have to make sure TARGET is set
649 .if !defined(KERNCONF) && defined(KERNEL)
653 # XXX makeshift fix to build the right kernel for the (target) architecture
654 # We should configure this in the platform files somehow
655 .if ${TARGET_ARCH} == "x86_64"
656 KERNCONF?= X86_64_GENERIC
659 INSTKERNNAME?= kernel
661 KRNLSRCDIR= ${.CURDIR}/sys
662 KRNLCONFDIR= ${KRNLSRCDIR}/config
663 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
664 KERNCONFDIR?= ${KRNLCONFDIR}
668 .for _kernel in ${KERNCONF}
669 .if exists(${KERNCONFDIR}/${_kernel})
670 BUILDKERNELS+= ${_kernel}
671 .if empty(INSTALLKERNEL)
672 INSTALLKERNEL= ${_kernel}
677 # kernel version numbers survive rm -rf
679 .for _kernel in ${BUILDKERNELS}
680 .if exists(${KRNLOBJDIR}/${_kernel}/version)
681 KERNEL_VERSION_${_kernel} != cat ${KRNLOBJDIR}/${_kernel}/version
687 # Builds all kernels defined by BUILDKERNELS.
690 @if [ ! -f ${WORLDDEST}/.libraries_done ]; then \
691 echo "You must buildworld before buildkernel. If you wish"; \
692 echo "to build a kernel using native tools, config it manually"; \
693 echo "or use the nativekernel target if you are in a rush"; \
698 .for _kernel in ${BUILDKERNELS}
699 @if [ ! -f ${KRNLOBJDIR}/${_kernel}/.nativekernel_run ]; then \
700 if [ ! -f ${WORLDDEST}/.libraries_done ]; then \
701 echo "The kernel was build using buildworld tools which no" ; \
702 echo "longer appear to exist, (real)quickkernel failed!" ; \
709 .if empty(BUILDKERNELS)
710 @echo ">>> ERROR: Missing kernel configuration file(s)."
711 @echo ">>> ${KERNCONF} not found in ${KERNCONFDIR}."
716 .if defined(KERNWARN)
717 @echo "--------------------------------------------------------------"
718 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
719 @echo "--------------------------------------------------------------"
724 # The buildkernel target rebuilds the specified kernels from scratch
725 # using the crossbuild tools generated by the last buildworld. It is
726 # the safest (but also the most time consuming) way to build a new kernel.
728 buildkernel: bk_tools bk_build_list bk_kernwarn
729 .for _kernel in ${BUILDKERNELS}
730 @echo "--------------------------------------------------------------"
731 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
732 @echo "--------------------------------------------------------------"
733 @echo "===> ${_kernel}"
734 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
735 rm -rf ${KRNLOBJDIR}/${_kernel}
737 @if [ -f ${KRNLOBJDIR}/${_kernel}/.nativekernel_run ]; then \
738 echo "YOU ARE REBUILDING WITH BUILDKERNEL, REMOVING OLD NATIVEKERNEL BUILD"; \
739 rm -rf ${KRNLOBJDIR}/${_kernel}; fi
741 mkdir -p ${KRNLOBJDIR}
742 .if !defined(NO_KERNELCONFIG)
744 PATH=${STRICTTMPPATH} \
745 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
746 ${KERNCONFDIR}/${_kernel}
748 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN) && defined(KERNEL_VERSION_${_kernel})
749 echo ${KERNEL_VERSION_${_kernel}} > ${KRNLOBJDIR}/${_kernel}/version
751 touch ${KRNLOBJDIR}/${_kernel}/.buildkernel_run
752 .if !defined(NO_KERNELDEPEND)
753 cd ${KRNLOBJDIR}/${_kernel}; \
754 ${KMAKEENV} make KERNEL=${INSTKERNNAME} depend
756 cd ${KRNLOBJDIR}/${_kernel}; \
757 ${KMAKEENV} make KERNEL=${INSTKERNNAME} all
758 @echo "--------------------------------------------------------------"
759 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
760 @echo "--------------------------------------------------------------"
763 # The nativekernel target rebuilds the specified kernels from scratch
764 # using the system's standard compiler rather than using the crossbuild
765 # tools generated by the last buildworld. This is fairly safe if your
766 # system is reasonable up-to-date.
768 nativekernel: bk_build_list bk_kernwarn
769 .for _kernel in ${BUILDKERNELS}
770 @echo "--------------------------------------------------------------"
771 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
772 @echo "--------------------------------------------------------------"
773 @echo "===> ${_kernel}"
774 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
775 rm -rf ${KRNLOBJDIR}/${_kernel}
777 @if [ -f ${KRNLOBJDIR}/${_kernel}/.buildkernel_run ]; then \
778 echo "YOU ARE REBUILDING WITH NATIVEKERNEL, REMOVING OLD BUILDKERNEL BUILD"; \
779 rm -rf ${KRNLOBJDIR}/${_kernel}; fi
781 mkdir -p ${KRNLOBJDIR}
782 .if !defined(NO_KERNELCONFIG)
784 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
785 ${KERNCONFDIR}/${_kernel}
787 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN) && defined(KERNEL_VERSION_${_kernel})
788 echo ${KERNEL_VERSION_${_kernel}} > ${KRNLOBJDIR}/${_kernel}/version
790 touch ${KRNLOBJDIR}/${_kernel}/.nativekernel_run
791 .if !defined(NO_KERNELDEPEND)
792 cd ${KRNLOBJDIR}/${_kernel}; \
793 make KERNEL=${INSTKERNNAME} depend
795 cd ${KRNLOBJDIR}/${_kernel}; \
796 make KERNEL=${INSTKERNNAME} all
797 @echo "--------------------------------------------------------------"
798 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
799 @echo "--------------------------------------------------------------"
802 # The (real)quickkernel target rebuilds the specified kernels as quickly
803 # as possible. It will use the native tools or the buildworld cross tools
804 # based on whether the kernel was originally generated via buildkernel or
805 # nativekernel. Config is rerun but the object hierarchy is not rebuilt.
806 # realquickkernel skips the depend step (analogous to realquickworld).
808 quickkernel realquickkernel: maybe_bk_tools bk_build_list bk_kernwarn
809 .for _kernel in ${BUILDKERNELS}
810 @echo "--------------------------------------------------------------"
811 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
812 @echo "--------------------------------------------------------------"
813 @echo "===> ${_kernel}"
814 .if exists(${KRNLOBJDIR}/${_kernel}/.buildkernel_run)
815 .if !defined(NO_KERNELCONFIG)
817 PATH=${STRICTTMPPATH} \
818 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
819 ${KERNCONFDIR}/${_kernel}
821 .if !defined(NO_KERNELDEPEND) && !make(realquickkernel)
822 cd ${KRNLOBJDIR}/${_kernel}; \
823 ${KMAKEENV} make KERNEL=${INSTKERNNAME} depend
825 cd ${KRNLOBJDIR}/${_kernel}; \
826 ${KMAKEENV} make KERNEL=${INSTKERNNAME} all
828 .if !defined(NO_KERNELCONFIG)
830 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
831 ${KERNCONFDIR}/${_kernel}
833 .if !defined(NO_KERNELDEPEND) && !make(realquickkernel)
834 cd ${KRNLOBJDIR}/${_kernel}; \
835 make KERNEL=${INSTKERNNAME} depend
837 cd ${KRNLOBJDIR}/${_kernel}; \
838 make KERNEL=${INSTKERNNAME} all
840 @echo "--------------------------------------------------------------"
841 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
842 @echo "--------------------------------------------------------------"
848 # Install the kernel defined by INSTALLKERNEL
850 installkernel reinstallkernel:
851 @echo "--------------------------------------------------------------"
852 @echo ">>> Kernel install for ${INSTALLKERNEL} started on `LC_ALL=C date`"
853 @echo "--------------------------------------------------------------"
854 .if exists(${KRNLOBJDIR}/${INSTALLKERNEL}/.buildkernel_run)
855 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
856 ${IMAKEENV} make KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
858 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
859 make KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
861 @echo "--------------------------------------------------------------"
862 @echo ">>> Kernel install for ${INSTALLKERNEL} completed on `LC_ALL=C date`"
863 @echo "--------------------------------------------------------------"
866 # ------------------------------------------------------------------------
868 # From here onwards are utility targets used by the 'make world' and
869 # related targets. If your 'world' breaks, you may like to try to fix
870 # the problem and manually run the following targets to attempt to
871 # complete the build. Beware, this is *not* guaranteed to work, you
872 # need to have a pretty good grip on the current state of the system
873 # to attempt to manually finish it. If in doubt, 'make world' again.
876 # bootstrap-tools: Build all tools required to build all tools. Note that
877 # order is important in a number of cases and also note that the bootstrap
878 # and build tools stages have access to earlier binaries they themselves
881 # patch: older patch's do not have -i. This program must be built
882 # first so other bootstrap tools that need to apply patches
884 # [x]install: dependancies on various new install features
885 # rpcgen: old rpcgen used a hardwired cpp path, newer OBJFORMAT_PATH
886 # envs are not compatible with older objformat binaries.
889 # BSTRAPDIRS1 - must be built in strict order, no parallelism
891 # order is very important. yacc before m4 before flex. flex exec's m4,
892 # m4's parser file needs the latest byacc (insanity!).
896 bin/chmod bin/cp bin/cpdup bin/dd bin/mkdir bin/rm bin/echo \
897 bin/test bin/cat bin/ln bin/mv bin/expr bin/sh \
898 bin/hostname bin/kill \
899 usr.bin/yacc usr.bin/m4 usr.bin/localedef \
900 usr.bin/uudecode usr.bin/xinstall \
901 usr.bin/rpcgen usr.bin/bmake usr.bin/awk usr.bin/stat \
902 usr.bin/find usr.bin/flex
904 # BSTRAPDIRS2 - may built in parallel
907 usr.bin/sed usr.bin/uname usr.bin/touch \
908 usr.bin/mkdep usr.bin/mktemp usr.bin/lorder usr.bin/file2c \
909 usr.bin/tsort usr.bin/tr usr.bin/join usr.bin/wc usr.bin/basename \
910 usr.bin/gencat usr.bin/chflags \
911 usr.bin/uuencode usr.bin/cap_mkdb usr.bin/true usr.bin/false \
912 usr.bin/cmp usr.bin/xargs usr.bin/id usr.bin/env usr.bin/dirname \
913 usr.bin/tail usr.bin/unifdef \
914 usr.sbin/chown usr.sbin/mtree usr.sbin/config \
915 usr.sbin/zic usr.sbin/pwd_mkdb \
916 gnu/usr.bin/grep usr.bin/sort usr.bin/gzip \
917 usr.bin/mkcsmapper usr.bin/mkesdb usr.bin/crunch
919 bootstrap-tools: bootstrap-tools-before bootstrap-tools-targets1 bootstrap-tools-targets2
920 touch ${BTOOLSDEST}/.bootstrap_done
922 bootstrap-tools-before:
923 ${LN} -fs /bin/date ${BTOOLSDEST}/bin/date
925 bootstrap-tools-targets1: ${BSTRAPDIRS1:S/^/bstrap-/}
927 bootstrap-tools-targets2: ${BSTRAPDIRS2:S/^/bstrap-/}
929 .ORDER: bootstrap-tools-before bootstrap-tools-targets1 bootstrap-tools-targets2
931 .ORDER: ${BSTRAPDIRS1:S/^/bstrap-/}
933 .for _tool in ${BSTRAPDIRS1} ${BSTRAPDIRS2}
935 ${ECHODIR} "===> ${_tool} (bootstrap-tools)"; \
936 cd ${.CURDIR}/${_tool}; \
937 make DIRPRFX=${_tool}/ obj && \
938 make DIRPRFX=${_tool}/ depend && \
939 make DIRPRFX=${_tool}/ all && \
940 make DIRPRFX=${_tool}/ DESTDIR=${BTOOLSDEST} install
943 # build-tools: Build special purpose build tools.
945 # XXX we may be able to remove or consolidate this into bootstrap-tools
946 # now that we have the native helper (.nx/.no) infrastructure.
948 # XXX we should separate this into new Makefile.inc2.
949 # Just to prepare for reduction of ORDER: that slows down parallel crossworld.
951 # Make sure Makefile.inc1 logic is intact.
952 .if !defined(WORLD_ALTCOMPILER)
953 .warning undefined WORLD_ALTCOMPILER
956 # gcc80 is now the default compiler. See sys.mk for WORLD_ALTCOMPILER default
957 # and this file for WORLD_CCVER.
959 _gcc47_cross= gnu/usr.bin/cc47
960 _gcc80_cross= gnu/usr.bin/cc80
961 _gcc_common_cross= lib/libz gnu/usr.bin/gmp gnu/usr.bin/mpfr gnu/usr.bin/mpc
963 .if !defined(NO_ALTCOMPILER)
964 . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc47})
965 _altcompiler_cross+= ${_gcc47_cross}
969 _basecompiler_cross= ${_gcc80_cross}
971 _custom_cross= libexec/customcc
972 _binutils= gnu/usr.bin/${WORLD_BINUTILSVER}
974 build-tools: build-tools-targets
975 touch ${BTOOLSDEST}/.build_done
977 build-tools-targets: ${BTOOLSDIRS:S/^/btools-/}
980 # cross-tools: Build cross-building tools
983 CTOOLSDIRS= usr.bin/objformat
985 CTOOLSDIRS+= ${_binutils} \
986 ${_gcc_common_cross} \
987 ${_altcompiler_cross} \
988 ${_basecompiler_cross} ${_custom_cross}
990 cross-tools: cross-tools-targets
991 touch ${CTOOLSDEST}/.cross_done
993 cross-tools-targets: ${CTOOLSDIRS:S/^/ctools-/}
995 .for _tool in ${CTOOLSDIRS}
997 ${ECHODIR} "===> ${_tool} (cross-tools)"; \
998 cd ${.CURDIR}/${_tool}; \
999 make DIRPRFX=${_tool}/ obj && \
1000 make DIRPRFX=${_tool}/ depend && \
1001 make DIRPRFX=${_tool}/ all && \
1002 make DIRPRFX=${_tool}/ DESTDIR=${CTOOLSDEST} install
1006 # hierarchy - ensure that all the needed directories are present
1009 cd ${.CURDIR}/etc; make distrib-dirs
1012 # libraries - build all libraries, and install them under ${DESTDIR}.
1014 # The list of libraries with dependents (${_prebuild_libs}) and their
1015 # interdependencies (__L) are built automatically by the
1016 # ${.CURDIR}/tools/make_libdeps.sh script.
1018 # .makeenv does not work when bootstrapping from 4.x, so we must be sure
1019 # to specify the correct CCVER or 'cc' will not exec the correct compiler.
1023 HOST_CCVER=${HOST_CCVER} CCVER=gcc80 \
1024 make -f Makefile.inc1 _startup_libs80 -DSYSBUILD -DLIBGCC_ONLY;
1025 .if !defined(NO_ALTCOMPILER)
1026 . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc47})
1028 HOST_CCVER=${HOST_CCVER} CCVER=gcc47 \
1029 make -f Makefile.inc1 _startup_libs47 -DSYSBUILD -DLIBGCC_ONLY;
1033 make -f Makefile.inc1 _startup_libs -DSYSBUILD && \
1034 make -f Makefile.inc1 _prebuild_libs -DSYSBUILD && \
1035 make -f Makefile.inc1 _generic_libs -DSYSBUILD && \
1036 touch ${WORLDDEST}/.libraries_done
1038 # These dependencies are not automatically generated:
1040 # gnu/lib/${CCVER}/libgcc and gnu/lib/${CCVER}/csu must be built before all
1041 # shared libraries for ELF. The target for _startup_libsXX is
1042 # specifically built using gccXX.
1044 _startup_libs47= gnu/usr.bin/cc47/cc_prep \
1045 gnu/usr.bin/cc47/cc_tools \
1047 gnu/lib/gcc47/libgcc \
1048 gnu/lib/gcc47/libgcc_eh \
1049 gnu/lib/gcc47/libgcc_pic
1051 _startup_libs80= gnu/usr.bin/cc80/cc_prep \
1052 gnu/usr.bin/cc80/cc_tools \
1054 gnu/lib/gcc80/libgcc \
1055 gnu/lib/gcc80/libgcc_eh \
1056 gnu/lib/gcc80/libgcc_pic
1058 .if !defined(NO_ALTCOMPILER)
1059 . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc47})
1060 _startup_libs_alt+= _startup_libs47
1064 _startup_libs_base= _startup_libs80
1066 _startup_libs= lib/csu lib/libc lib/libc_rtld
1067 lib/libc__L: lib/csu__L
1069 _prebuild_libs= lib/libbz2 lib/liblzma lib/libz
1070 _prebuild_libs+= lib/libutil
1072 _prebuild_libs+= lib/libelf
1073 _prebuild_libs+= lib/libpcap
1075 _generic_libs= gnu/lib
1077 _prebuild_libs+= lib/libcrypt lib/libncurses/libncurses
1081 _prebuild_libs+= lib/librecrypto lib/libressl
1082 lib/libressl__L: lib/librecrypto__L
1084 _prebuild_libs+= lib/libsbuf lib/libm \
1085 lib/libpam/libpam lib/libypclnt lib/lib${THREAD_LIB} \
1086 lib/libpthread lib/libprop
1088 _generic_libs+= usr.bin/flex/lib
1090 .for _alib in ${_startup_libs_alt} ${_startup_libs_base}
1091 __startup_alibs+= ${${_alib}}
1094 .for _lib in ${__startup_alibs} \
1095 ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
1097 .if exists(${.CURDIR}/${_lib})
1098 @${ECHODIR} "===> ${_lib}"; \
1099 cd ${.CURDIR}/${_lib}; \
1100 echo "STEP DEP ${_lib}" && \
1101 make DIRPRFX=${_lib}/ depend && \
1102 echo "STEP ALL ${_lib}" && \
1103 make DIRPRFX=${_lib}/ all && \
1104 echo "STEP INSTALL ${_lib}" && \
1105 make DIRPRFX=${_lib}/ install && \
1106 echo "STEP DONE ${_lib}";
1108 .warning missing ${.CURDIR}/${_lib} directory.
1112 _startup_libs: ${_startup_libs:S/$/__L/}
1113 .for _alib in ${_startup_libs_alt} ${_startup_libs_base}
1114 ${_alib}: ${${_alib}:C/$/__L/}
1116 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
1117 _generic_libs: ${_generic_libs:S/$/__L/}
1119 # library targets must be ordered because there are inter-library
1120 # races (e.g. generation of tconfig.h)
1122 .for _alib in ${_startup_libs_base} ${_startup_libs_alt}
1123 .ORDER: ${${_alib}:C/$/__L/}
1126 # uncomment if there are missing dependencies
1128 .ORDER: ${_prebuild_libs:S/$/__L/}
1129 # we can disable this one, no lib/* depend on libstdc++
1130 .ORDER: ${_generic_libs:S/$/__L/}
1133 .for __target in clean cleandepend cleandir obj depend includes
1134 .for entry in ${SUBDIR}
1135 ${entry}.${__target}__D: .PHONY
1136 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
1137 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
1138 edir=${entry}.${MACHINE_ARCH}; \
1139 cd ${.CURDIR}/$${edir}; \
1141 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
1143 cd ${.CURDIR}/$${edir}; \
1145 make ${__target} DIRPRFX=${DIRPRFX}$${edir}/
1147 par-${__target}: ${SUBDIR:C/$/.${__target}__D/}
1148 .ORDER: ${SUBDIR:C/$/.${__target}__D/}
1150 .ORDER: par-clean par-cleandepend par-cleandir par-obj par-depend par-includes
1152 # The wmake target is used by /usr/bin/wmake to run make in a
1153 # world build environment.
1156 @echo '${WMAKEENV} make ${WMAKE_ARGS} -DSYSBUILD'
1159 @echo '${WMAKEENV} /bin/sh'
1162 @echo '${BMAKEENV} make ${BMAKE_ARGS} -DSYSBUILD'
1165 @echo '${BMAKEENV} /bin/sh'
1168 @echo '${TMAKEENV} make ${TMAKE_ARGS} -DSYSBUILD'
1171 @echo '${TMAKEENV} /bin/sh'
1174 @echo '${XMAKEENV} make ${XMAKE_ARGS} -DSYSBUILD'
1177 @echo '${XMAKEENV} /bin/sh'
1179 backupworld: backup-clean
1180 @mkdir -p ${WORLD_BACKUP}
1181 .if (exists(${DESTDIR}/sbin) && exists(${DESTDIR}/bin) && \
1182 exists(${DESTDIR}/usr/sbin) && exists(${DESTDIR}/usr/bin) && \
1183 exists(${DESTDIR}/usr/lib) && exists(${DESTDIR}/usr/libexec))
1184 tar -czf ${WORLD_BACKUP}/binaries.tar.gz -C ${DESTDIR}/ \
1185 --options gzip:compression-level=1 \
1186 sbin bin usr/sbin usr/bin usr/lib usr/libexec
1190 .if !defined(NO_BACKUP)
1191 rm -f ${AUTO_BACKUP}/binaries.tar.gz
1192 @mkdir -p ${AUTO_BACKUP}
1193 .if (exists(${DESTDIR}/sbin) && exists(${DESTDIR}/bin) && \
1194 exists(${DESTDIR}/usr/sbin) && exists(${DESTDIR}/usr/bin) && \
1195 exists(${DESTDIR}/usr/lib) && exists(${DESTDIR}/usr/libexec))
1196 /usr/bin/tar -czf ${AUTO_BACKUP}/binaries.tar.gz -C ${DESTDIR}/ \
1197 --options gzip:compression-level=1 \
1198 sbin bin usr/sbin usr/bin usr/lib usr/libexec
1203 rm -f ${AUTO_BACKUP}/binaries.tar.gz
1206 rm -f ${WORLD_BACKUP}/binaries.tar.gz
1209 .if !exists(${WORLD_BACKUP}/binaries.tar.gz)
1210 @echo "There does not seem to be a valid archive present."
1212 @echo "Restoring system binaries from manual backup archive..."
1213 @chflags -R noschg ${DESTDIR}/sbin ${DESTDIR}/bin \
1214 ${DESTDIR}/usr/sbin ${DESTDIR}/usr/bin \
1215 ${DESTDIR}/usr/lib ${DESTDIR}/usr/libexec
1216 tar -xzf ${WORLD_BACKUP}/binaries.tar.gz -C ${DESTDIR}/
1220 .if !exists(${AUTO_BACKUP}/binaries.tar.gz)
1221 @echo "There does not seem to be a valid archive present."
1223 @echo "Restoring system binaries from auto-backup archive..."
1224 @chflags -R noschg ${DESTDIR}/sbin ${DESTDIR}/bin \
1225 ${DESTDIR}/usr/sbin ${DESTDIR}/usr/bin \
1226 ${DESTDIR}/usr/lib ${DESTDIR}/usr/libexec
1227 tar -xzf ${AUTO_BACKUP}/binaries.tar.gz -C ${DESTDIR}/
1230 # Take advantage of bmake error response
1232 MAKE_PRINT_VAR_ON_ERROR= \
1249 .if ${.MAKE.LEVEL} > 0
1250 MAKE_PRINT_VAR_ON_ERROR+= .MAKE.MAKEFILES .PATH
1253 .include <bsd.subdir.mk>