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
27 # We need to do include and lib early.
33 .if !defined(NO_GAMES)
38 .if !defined(NO_SHARE)
48 # These are last, since it is nice to at least get the base system
49 # rebuilt before you do them.
50 .if defined(LOCAL_DIRS)
51 .for _DIR in ${LOCAL_DIRS}
52 .if exists(${.CURDIR}/${_DIR}) & exists(${.CURDIR}/${_DIR}/Makefile)
58 .if defined(SUBDIR_OVERRIDE)
59 SUBDIR= ${SUBDIR_OVERRIDE}
62 .if defined(NOCLEANDIR)
63 CLEANDIR= clean cleandepend
72 # Object directory base in primary make. Note that when we rerun make
73 # from inside this file we change MAKEOBJDIRPREFIX to the appropriate
74 # subdirectory because the rest of the build system needs it that way.
75 # The original object directory base is saved in OBJTREE.
77 MAKEOBJDIRPREFIX?= /usr/obj
78 OBJTREE?= ${MAKEOBJDIRPREFIX}
80 # Used for stage installs and pathing
82 DESTDIRBASE:= ${OBJTREE}${.CURDIR}
84 # Remove DESTDIR from MAKEFLAGS. It is present in the environment
85 # anyhow, and we need to be able to override it for stage installs
86 .MAKEFLAGS:= ${.MAKEFLAGS:NDESTDIR=*}
88 # This section sets the tools used to build the world/kernel
91 WORLD_BINUTILSVER?= binutils234
93 .if !defined(NO_BACKUP)
94 # Set the backup parameters if they are not already defined
96 WORLD_BACKUP?= /var/backups/world_backup
97 AUTO_BACKUP?= ${OBJTREE}/world_backup/${DESTDIR}
100 TARGET_ARCH?= ${MACHINE_ARCH}
101 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
104 TARGET?= ${TARGET_ARCH}
107 BUILD_ARCH!= sysctl -n hw.machine_arch
109 # temporary until everybody has converted to x86_64
110 .if ${BUILD_ARCH} == "amd64"
114 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
115 .error To cross-build, set TARGET_ARCH.
119 # XXX this is ugly and we need to come up with a nicer solution
120 .if !defined(TARGET_PLATFORM)
121 .if ${TARGET_ARCH} == "x86_64"
122 TARGET_PLATFORM= pc64
124 .error Unknown target architecture.
128 THREAD_LIB?= thread_xu
130 # BTOOLS (Natively built) All non-cross-development tools that the
131 # main build needs. This includes things like 'mkdir' and 'rm'.
132 # We will not use the native system's exec path once we start
133 # on WORLD. (bootstrap-tools and build-tools or BTOOLS)
135 # CTOOLS (Natively built) Cross development tools which are specific
136 # to the target architecture.
138 # WORLD (Cross built) Our ultimate buildworld, using only BTOOLS and
141 # MACHINE_PLATFORM Platform Architecture we are building on
142 # MACHINE Machine Architecture (usually the same as MACHINE_ARCH)
143 # MACHINE_ARCH CPU Architecture we are building on
145 # TARGET_PLATFORM Platform Architecture we are building for
146 # TARGET Machine Architecture we are building for
147 # TARGET_ARCH CPU Architecture we are building for
149 BTOOLSDEST= ${DESTDIRBASE}/btools_${MACHINE_ARCH}
150 CTOOLSDEST= ${DESTDIRBASE}/ctools_${MACHINE_ARCH}_${TARGET_ARCH}
151 WORLDDEST= ${DESTDIRBASE}/world_${TARGET_ARCH}
153 # The bootstrap-tools path is used by the bootstrap-tools, build-tools, and
154 # cross-tools stages to augment the existing command path to access newer
155 # versions of certain utilities that the cross-tools stage might expect.
157 BTOOLSPATH= ${BTOOLSDEST}/usr/sbin:${BTOOLSDEST}/usr/bin:${BTOOLSDEST}/sbin:${BTOOLSDEST}/bin
159 # The cross-tools path containing the cross-tools to cross build the
162 CTOOLSPATH= ${CTOOLSDEST}/usr/sbin:${CTOOLSDEST}/usr/bin:${CTOOLSDEST}/sbin:${CTOOLSDEST}/bin
164 # The strict temporary command path contains all binaries required
165 # by the buildworld system after the cross-tools stage.
167 # NOTE: Append '/usr/local/bin:/usr/pkg/bin' to support external compilers.
168 # See compilers.conf(5) man page for more info.
170 STRICTTMPPATH= ${CTOOLSPATH}:${BTOOLSPATH}:/usr/local/bin:/usr/pkg/bin
176 # Building a world goes through the following stages
178 # 1. bootstrap-tool stage [BMAKE]
179 # This stage is responsible for creating programs that
180 # are needed for backward compatibility reasons. They
181 # are not built as cross-tools.
182 # 2. build-tool stage [TMAKE]
183 # This stage is responsible for creating the object
184 # tree and building any tools that are needed during
186 # 3. cross-tool stage [XMAKE]
187 # This stage is responsible for creating any tools that
188 # are needed for cross-builds. A cross-compiler is one
190 # 4. world stage [WMAKE]
191 # This stage actually builds the world.
192 # 5. install stage (optional) [IMAKE]
193 # This stage installs a previously built world.
195 # In all cases we must carefully adjust the environment so the proper
196 # tools and header files are used.
198 # NOTE: The M4 environment variable is used by the [f]lex binary to
199 # override the location of the 'm4' binary. The override is
200 # needed for certain buildworld version transitions, specifically
201 # past a certain point in 3.3 because the older /usr/bin/m4 will
202 # generate output that will blow up the newer [f]lex/yacc/bison
206 # bootstrap-tool stage
208 BMAKEENV= MAKEOBJDIRPREFIX=${BTOOLSDEST} \
210 DESTDIR=${BTOOLSDEST} \
212 _SHLIBDIRPREFIX=${BTOOLSDEST} \
213 PATH=${BTOOLSPATH}:${PATH} \
214 M4=${BTOOLSDEST}/usr/bin/m4 \
215 INSTALL="sh ${.CURDIR}/tools/install.sh"
217 BMAKE= ${BMAKEENV} make -f Makefile.inc1 -DBOOTSTRAPPING \
218 -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
219 -DNO_WERROR -DNO_NLS -DSYSBUILD
223 TMAKEENV= MAKEOBJDIRPREFIX=${BTOOLSDEST} \
227 PATH=${BTOOLSPATH}:${PATH} \
228 M4=${BTOOLSDEST}/usr/bin/m4 \
229 INSTALL="sh ${.CURDIR}/tools/install.sh"
231 TMAKE= ${TMAKEENV} make -f Makefile.inc1 -DBOOTSTRAPPING \
232 -DNOSHARED -DSYSBUILD
236 # note: TOOLS_PREFIX points to the obj root holding the cross
237 # compiler binaries, while USRDATA_PREFIX points to the obj root
238 # holding the target environment (and also determines where cross-built
239 # libraries, crt*.o, and include files are installed).
241 XMAKEENV= MAKEOBJDIRPREFIX=${CTOOLSDEST} \
243 DESTDIR=${CTOOLSDEST} \
245 _SHLIBDIRPREFIX=${CTOOLSDEST} \
246 INSTALL="sh ${.CURDIR}/tools/install.sh" \
247 TOOLS_PREFIX=${CTOOLSDEST} \
248 USRDATA_PREFIX=${WORLDDEST} \
249 SELECT_LINKER=${WORLD_LDVER} \
250 M4=${BTOOLSDEST}/usr/bin/m4 \
251 PATH=${BTOOLSPATH}:${PATH}
253 XMAKE= ${XMAKEENV} make -f Makefile.inc1 -DNO_GDB \
254 -DBOOTSTRAPPING -DNOMAN -DNOSHARED -DSYSBUILD
256 # world stage, note the strict path and note that TOOLS_PREFIX is left
257 # unset and USRDATA_PREFIX (which defaults to TOOLS_PREFIX) is set to empty,
258 # which is primarily for the compiler so it targets / (e.g. /usr/<blah>)
259 # for both binary and library paths, even though it is being compiled to
260 # WORLDDEST. None of the programs in the world stage are ever actually
261 # executed during the buildworld/installworld.
263 CROSSENV= MAKEOBJDIRPREFIX=${WORLDDEST} \
265 MACHINE_ARCH=${TARGET_ARCH} \
267 MACHINE_PLATFORM=${TARGET_PLATFORM} \
269 OBJFORMAT_PATH=${CTOOLSDEST} \
270 HOST_CCVER=${HOST_CCVER} \
271 CCVER=${WORLD_CCVER} \
272 LDVER=${WORLD_LDVER} \
273 BINUTILSVER=${WORLD_BINUTILSVER}
275 WMAKEENV= ${CROSSENV} \
277 DESTDIR=${WORLDDEST} \
278 _SHLIBDIRPREFIX=${WORLDDEST} \
279 INSTALL="sh ${.CURDIR}/tools/install.sh" \
280 M4=${BTOOLSDEST}/usr/bin/m4 \
281 PATH=${STRICTTMPPATH}
283 WMAKE= ${WMAKEENV} make -f Makefile.inc1 -DSYSBUILD
287 IMAKEENV= ${CROSSENV} \
288 PATH=${STRICTTMPPATH}
289 IMAKE= ${IMAKEENV} make -f Makefile.inc1 -DSYSBUILD
293 KMAKEENV= ${WMAKEENV}
297 # Attempt to rebuild the entire system, with reasonable chance of
298 # success, regardless of how old your existing system is.
300 _worldtmp: _cleantmp _mtreetmp
301 .ORDER: _cleantmp _mtreetmp
304 .if !defined(NOCLEAN)
305 rm -rf ${BTOOLSDEST} ${CTOOLSDEST} ${WORLDDEST}
307 # XXX - These two can depend on any header file.
308 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
309 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
314 @echo "--------------------------------------------------------------"
315 @echo ">>> Rebuilding the temporary build tree"
316 @echo "--------------------------------------------------------------"
317 mkdir -p ${DESTDIRBASE} ${BTOOLSDEST} ${CTOOLSDEST} ${WORLDDEST}
318 .for _dir in ${WORLDDEST} ${BTOOLSDEST} ${CTOOLSDEST}
319 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \
320 -p ${_dir}/ > /dev/null
321 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
322 -p ${_dir}/usr > /dev/null
324 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
325 -p ${WORLDDEST}/usr/include > /dev/null
326 ${LN} -sf ${.CURDIR}/sys ${WORLDDEST}
329 @echo "--------------------------------------------------------------"
330 @echo ">>> starting buildworld target"
331 @echo "--------------------------------------------------------------"
334 @echo "--------------------------------------------------------------"
335 @echo ">>> stage 1: bootstrap tools"
336 @echo "--------------------------------------------------------------"
337 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
340 @echo "--------------------------------------------------------------"
341 @echo ">>> stage 2a: cleaning up the object tree"
342 @echo "--------------------------------------------------------------"
343 cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
346 @echo "--------------------------------------------------------------"
347 @echo ">>> stage 2b: rebuilding the object tree"
348 @echo "--------------------------------------------------------------"
349 cd ${.CURDIR}; ${WMAKE} par-obj
352 @echo "--------------------------------------------------------------"
353 @echo ">>> stage 2c: build tools"
354 @echo "--------------------------------------------------------------"
355 cd ${.CURDIR}; ${TMAKE} build-tools
358 @echo "--------------------------------------------------------------"
359 @echo ">>> stage 3: cross tools"
360 @echo "--------------------------------------------------------------"
361 cd ${.CURDIR}; ${XMAKE} cross-tools
364 @echo "--------------------------------------------------------------"
365 @echo ">>> stage 4a: populating ${WORLDDEST}/usr/include"
366 @echo "--------------------------------------------------------------"
367 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
370 @echo "--------------------------------------------------------------"
371 @echo ">>> stage 4b: building libraries"
372 @echo "--------------------------------------------------------------"
373 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOMAN -DNOFSCHG libraries
376 @echo "--------------------------------------------------------------"
377 @echo ">>> stage 4c: make dependencies"
378 @echo "--------------------------------------------------------------"
379 cd ${.CURDIR}; ${WMAKE} par-depend
382 @echo "--------------------------------------------------------------"
383 @echo ">>> stage 4d: building everything"
384 @echo "--------------------------------------------------------------"
385 cd ${.CURDIR}; ${WMAKE} all
388 @echo "--------------------------------------------------------------"
389 @echo ">>> stage 5: building rescue and initrd"
390 @echo "--------------------------------------------------------------"
391 .if !defined(NO_INITRD)
392 cd ${.CURDIR}/initrd; ${WMAKEENV} make all
395 @echo "--------------------------------------------------------------"
396 @echo ">>> buildworld target complete"
397 @echo "--------------------------------------------------------------"
399 @echo "--------------------------------------------------------------"
400 @echo ">>> starting quickworld target"
401 @echo "--------------------------------------------------------------"
403 @echo "--------------------------------------------------------------"
404 @echo ">>> quickworld target complete"
405 @echo "--------------------------------------------------------------"
407 @echo "--------------------------------------------------------------"
408 @echo ">>> starting installworld target"
409 @echo "--------------------------------------------------------------"
411 # note: buildworld no longer depends on _cleanobj because we rm -rf the
412 # entire object tree and built the bootstrap tools in a different location.
414 # buildworld - build everything from scratch
415 # quickworld - skip the bootstrap, build, and cross-build steps
416 # realquickworld - skip the bootstrap, build, crossbuild, and depend step.
418 # note: we include _obj in realquickworld to prevent accidental creation
419 # of files in /usr/src.
422 .if !defined(SUBDIR_OVERRIDE)
423 WMAKE_TGTS+= _worldtmp _bootstrap-tools
425 WMAKE_TGTS+= _obj _build-tools
426 .if !defined(SUBDIR_OVERRIDE)
427 WMAKE_TGTS+= _cross-tools
429 WMAKE_TGTS+= _includes _libraries _depend everything _initrd
431 .if defined(WMAKE_TGTS_OVERRIDE)
433 WMAKE_TGTS= ${WMAKE_TGTS_OVERRIDE}
436 QMAKE_TGTS= _mtreetmp _obj _includes _libraries _depend everything _initrd
438 buildworld: _bwinit ${WMAKE_TGTS} _bwdone
440 quickworld: _qwinit ${QMAKE_TGTS} _qwdone
442 realquickworld: _qwinit _mtreetmp _obj _includes _libraries everything _qwdone
444 crossworld: _worldtmp _bootstrap-tools _obj _build-tools _cross-tools
446 GENLOGDIR= /usr/obj${.CURDIR}
447 .ORDER: build-all install-all
453 @echo "Building world, log file in ${GENLOGDIR}/bw.out"
454 @mkdir -p ${GENLOGDIR}
455 @(cd ${.CURDIR}; ${MAKE} -j `sysctl -n hw.ncpu` buildworld > ${GENLOGDIR}/bw.out 2>&1)
457 @echo "Building kernel, log file in ${GENLOGDIR}/bk.out"
458 @(cd ${.CURDIR}; ${MAKE} -j `sysctl -n hw.ncpu` buildkernel > ${GENLOGDIR}/bk.out 2>&1)
459 @echo "build-all completed ok"
463 @echo "Installing kernel, log file in ${GENLOGDIR}/bk.out"
464 @mkdir -p ${GENLOGDIR}
465 @(cd ${.CURDIR}; ${MAKE} -j 1 installkernel >> ${GENLOGDIR}/bk.out 2>&1)
467 @echo "Installing world, log file in ${GENLOGDIR}/bw.out"
468 @(cd ${.CURDIR}; ${MAKE} -j 1 installworld >> ${GENLOGDIR}/bw.out 2>&1)
470 @echo "Upgrading world"
471 @(cd ${.CURDIR}; ${MAKE} -j 1 upgrade >> ${GENLOGDIR}/bw.out 2>&1)
473 @echo "install-all completed ok. reboot recommended and after that, "
474 @echo "when doing a major upgrade, 'pkg upgrade -f' after rebooting"
476 .ORDER: _bwinit ${WMAKE_TGTS} _bwdone
477 .ORDER: _obj _includes
478 .ORDER: _qwinit _mtreetmp _obj
479 .ORDER: installcheck backupworld-auto
480 .ORDER: everything _qwdone
485 # Checks to be sure system is ready for installworld
487 installcheck: _iwinit
488 .if !defined(OVERRIDE_CHECKS)
489 .if !defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/"
490 @case `uname -r` in \
491 1.2*|1.3-*|1.3.*|1.4.*|1.5.0-*|1.5.1-*|1.5.2-*|1.5.3-*) \
492 echo "You must upgrade your kernel to at least 1.5.4" \
493 "and reboot before you can safely installworld," \
494 "due to libc/system call ABI changes."; \
497 @case `uname -r` in \
498 1.*|2.*|3.0*|3.1*|3.2*|3.3*|3.4*|3.5*|3.6*) \
499 echo "The system is too old for a normal installworld," \
500 "you need to use 'installworld-force'."; \
508 # Backs up the current world if ${AUTO_BACKUP} is writable.
509 # Installs everything compiled by a 'buildworld'.
511 installworld: installcheck
512 .if !defined(NO_BACKUP)
513 -@mkdir -p ${AUTO_BACKUP} > /dev/null 2>&1
515 (touch ${AUTO_BACKUP}/.updating > /dev/null 2>&1 && \
516 ${IMAKE} backupworld-auto) || \
517 echo "Cannot write to ${AUTO_BACKUP} - world not backed up"
519 cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
520 ${INSTALL} -o root -g wheel -m 644 ${.CURDIR}/Makefile_upgrade.inc \
521 ${DESTDIR}/etc/upgrade/
522 cd ${.CURDIR}; ${IMAKE} -DWORLDINSTALL os-release
523 .if !defined(NO_INITRD)
524 cd ${.CURDIR}; ${IMAKE} -DWORLDINSTALL initrd
527 @echo "--------------------------------------------------------------"
528 @echo ">>> installworld target complete"
529 @echo "--------------------------------------------------------------"
532 @echo "NAME=DragonFly" > ${DESTDIR}/etc/os-release
533 @echo "VERSION=${OSREL}-SYNTH" >> ${DESTDIR}/etc/os-release
534 @echo "VERSION_ID=${OSREL}" >> ${DESTDIR}/etc/os-release
535 @echo "ID=dragonfly" >> ${DESTDIR}/etc/os-release
536 @echo "ANSI_COLOR=\"0;32\"" >> ${DESTDIR}/etc/os-release
537 @echo "PRETTY_NAME=\"DragonFlyBSD ${OSREL}-SYNTH\"" >> ${DESTDIR}/etc/os-release
538 @echo "CPE_NAME=\"cpe:/o:dragonflybsd:dragonfly:${OSREL}\"" >> ${DESTDIR}/etc/os-release
539 @echo "SUPPORT_URL=\"http://chat.efnet.org:9090/?nick=dflynick&channels=%23dragonflybsd&Login=Login\"" >> ${DESTDIR}/etc/os-release
540 @echo "HOME_URL=\"https://www.dragonflybsd.org/\"" >> ${DESTDIR}/etc/os-release
541 @echo "BUG_REPORT_URL=\"https://bugs.dragonflybsd.org/\"" >> ${DESTDIR}/etc/os-release
542 @echo "MACHINE_ARCH=${MACHINE_ARCH}" >> ${DESTDIR}/etc/os-release
543 @echo "MACHINE=${MACHINE}" >> ${DESTDIR}/etc/os-release
544 @echo "DFLYVERSION=${DFLYVERSION}" >> ${DESTDIR}/etc/os-release
547 @echo "Doing a forced installworld. This will install to a temporary directory,"
548 @echo "then copy the main binaries and libraries with a static cpdup to ${DESTDIR}/"
549 @echo "and finally will issue a normal installworld."
551 @echo "Starting in 5 seconds. ^C to abort."
554 rm -rf /usr/obj/temp > /dev/null 2>&1 || chflags -R noschg /usr/obj/temp
556 mkdir -p /usr/obj/temp/cpdup/bin
557 (cd ${.CURDIR}/bin/cpdup; \
561 make CFLAGS=-static all install DESTDIR=/usr/obj/temp/cpdup NOMAN=TRUE)
562 @echo "XXXXXXXXX Installing to temporary XXXXXXXXX"
564 (cd ${.CURDIR}; ${MAKE} installworld DESTDIR=/usr/obj/temp > /dev/null 2>&1)
565 @echo "XXXXXXXXX Blasting binaries and libraries XXXXXXXXX"
567 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/bin /bin
568 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/sbin /sbin
569 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/lib /lib
570 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/usr/bin /usr/bin
571 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/usr/sbin /usr/sbin
572 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/usr/lib /usr/lib
573 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/libexec /libexec
574 /usr/obj/temp/cpdup/bin/cpdup -i0 /usr/obj/temp/usr/libexec /usr/libexec
575 @echo "XXXXXXXXX Doing final installworld XXXXXXXX"
577 (cd ${.CURDIR}; ${MAKE} installworld OVERRIDE_CHECKS=TRUE)
578 (cd ${.CURDIR}; ${MAKE} upgrade OVERRIDE_CHECKS=TRUE)
579 .if !defined(NO_INITRD)
580 (cd ${.CURDIR}; ${MAKE} initrd)
585 # If you have a build server, you can NFS mount the source and obj directories
586 # and do a 'make reinstall' on the *client* to install new binaries from the
587 # most recent server build.
590 @echo "--------------------------------------------------------------"
591 @echo ">>> Making hierarchy"
592 @echo "--------------------------------------------------------------"
593 cd ${.CURDIR}; make -f Makefile.inc1 hierarchy
595 @echo "--------------------------------------------------------------"
596 @echo ">>> Installing everything"
597 @echo "--------------------------------------------------------------"
598 cd ${.CURDIR}; make -f Makefile.inc1 install
602 # Install the rescue tools and the initrd image built by 'buildworld'.
605 (cd ${.CURDIR}/initrd; ${IMAKEENV} make install)
608 # buildkernel, nativekernel, quickkernel, realquickkernel, and installkernel
610 # Which kernels to build and/or install is specified by setting
611 # KERNCONF. If not defined an X86_64_GENERIC kernel is built/installed.
612 # Only the existing (depending TARGET) config files are used
613 # for building kernels and only the first of these is designated
614 # as the one being installed.
616 # You can specify INSTALLSTRIPPED=1 if you wish the installed
617 # kernel and modules to be stripped of its debug info (required
618 # symbols are left intact). You can specify INSTALLSTRIPPEDMODULES
619 # if you only want to strip the modules of their debug info. These
620 # only apply if you have DEBUG=-g in your kernel config or make line.
622 # Note that we have to use TARGET instead of TARGET_ARCH when
623 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
624 # be set to cross-build, we have to make sure TARGET is set
627 .if !defined(KERNCONF) && defined(KERNEL)
631 # XXX makeshift fix to build the right kernel for the (target) architecture
632 # We should configure this in the platform files somehow
633 .if ${TARGET_ARCH} == "x86_64"
634 KERNCONF?= X86_64_GENERIC
637 INSTKERNNAME?= kernel
639 KRNLSRCDIR= ${.CURDIR}/sys
640 KRNLCONFDIR= ${KRNLSRCDIR}/config
641 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
642 KERNCONFDIR?= ${KRNLCONFDIR}
646 .for _kernel in ${KERNCONF}
647 .if exists(${KERNCONFDIR}/${_kernel})
648 BUILDKERNELS+= ${_kernel}
649 .if empty(INSTALLKERNEL)
650 INSTALLKERNEL= ${_kernel}
655 # kernel version numbers survive rm -rf
657 .for _kernel in ${BUILDKERNELS}
658 .if exists(${KRNLOBJDIR}/${_kernel}/version)
659 KERNEL_VERSION_${_kernel} != cat ${KRNLOBJDIR}/${_kernel}/version
665 # Builds all kernels defined by BUILDKERNELS.
668 @if [ ! -f ${WORLDDEST}/.libraries_done ]; then \
669 echo "You must buildworld before buildkernel. If you wish"; \
670 echo "to build a kernel using native tools, config it manually"; \
671 echo "or use the nativekernel target if you are in a rush"; \
676 .for _kernel in ${BUILDKERNELS}
677 @if [ ! -f ${KRNLOBJDIR}/${_kernel}/.nativekernel_run ]; then \
678 if [ ! -f ${WORLDDEST}/.libraries_done ]; then \
679 echo "The kernel was built using buildworld tools which no" ; \
680 echo "longer appear to exist, (real)quickkernel failed!" ; \
687 .if empty(BUILDKERNELS)
688 @echo ">>> ERROR: Missing kernel configuration file(s)."
689 @echo ">>> ${KERNCONF} not found in ${KERNCONFDIR}."
694 .if defined(KERNWARN)
695 @echo "--------------------------------------------------------------"
696 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
697 @echo "--------------------------------------------------------------"
702 # The buildkernel target rebuilds the specified kernels from scratch
703 # using the crossbuild tools generated by the last buildworld. It is
704 # the safest (but also the most time consuming) way to build a new kernel.
706 buildkernel: bk_tools bk_build_list bk_kernwarn
707 .for _kernel in ${BUILDKERNELS}
708 @echo "--------------------------------------------------------------"
709 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
710 @echo "--------------------------------------------------------------"
711 @echo "===> ${_kernel}"
712 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
713 rm -rf ${KRNLOBJDIR}/${_kernel}
715 @if [ -f ${KRNLOBJDIR}/${_kernel}/.nativekernel_run ]; then \
716 echo "YOU ARE REBUILDING WITH BUILDKERNEL, REMOVING OLD NATIVEKERNEL BUILD"; \
717 rm -rf ${KRNLOBJDIR}/${_kernel}; fi
719 mkdir -p ${KRNLOBJDIR}
720 .if !defined(NO_KERNELCONFIG)
722 PATH=${STRICTTMPPATH} \
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}/.buildkernel_run
730 .if !defined(NO_KERNELDEPEND)
731 cd ${KRNLOBJDIR}/${_kernel}; \
732 ${KMAKEENV} make KERNEL=${INSTKERNNAME} depend
734 cd ${KRNLOBJDIR}/${_kernel}; \
735 ${KMAKEENV} make KERNEL=${INSTKERNNAME} all
736 @echo "--------------------------------------------------------------"
737 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
738 @echo "--------------------------------------------------------------"
741 # The nativekernel target rebuilds the specified kernels from scratch
742 # using the system's standard compiler rather than using the crossbuild
743 # tools generated by the last buildworld. This is fairly safe if your
744 # system is reasonable up-to-date.
746 nativekernel: bk_build_list bk_kernwarn
747 .for _kernel in ${BUILDKERNELS}
748 @echo "--------------------------------------------------------------"
749 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
750 @echo "--------------------------------------------------------------"
751 @echo "===> ${_kernel}"
752 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
753 rm -rf ${KRNLOBJDIR}/${_kernel}
755 @if [ -f ${KRNLOBJDIR}/${_kernel}/.buildkernel_run ]; then \
756 echo "YOU ARE REBUILDING WITH NATIVEKERNEL, REMOVING OLD BUILDKERNEL BUILD"; \
757 rm -rf ${KRNLOBJDIR}/${_kernel}; fi
759 mkdir -p ${KRNLOBJDIR}
760 .if !defined(NO_KERNELCONFIG)
762 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
763 ${KERNCONFDIR}/${_kernel}
765 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN) && defined(KERNEL_VERSION_${_kernel})
766 echo ${KERNEL_VERSION_${_kernel}} > ${KRNLOBJDIR}/${_kernel}/version
768 touch ${KRNLOBJDIR}/${_kernel}/.nativekernel_run
769 .if !defined(NO_KERNELDEPEND)
770 cd ${KRNLOBJDIR}/${_kernel}; \
771 make KERNEL=${INSTKERNNAME} depend
773 cd ${KRNLOBJDIR}/${_kernel}; \
774 make KERNEL=${INSTKERNNAME} all
775 @echo "--------------------------------------------------------------"
776 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
777 @echo "--------------------------------------------------------------"
780 # The (real)quickkernel target rebuilds the specified kernels as quickly
781 # as possible. It will use the native tools or the buildworld cross tools
782 # based on whether the kernel was originally generated via buildkernel or
783 # nativekernel. Config is rerun but the object hierarchy is not rebuilt.
784 # realquickkernel skips the depend step (analogous to realquickworld).
786 quickkernel realquickkernel: maybe_bk_tools bk_build_list bk_kernwarn
787 .for _kernel in ${BUILDKERNELS}
788 @echo "--------------------------------------------------------------"
789 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
790 @echo "--------------------------------------------------------------"
791 @echo "===> ${_kernel}"
792 .if exists(${KRNLOBJDIR}/${_kernel}/.buildkernel_run)
793 .if !defined(NO_KERNELCONFIG)
795 PATH=${STRICTTMPPATH} \
796 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
797 ${KERNCONFDIR}/${_kernel}
799 .if !defined(NO_KERNELDEPEND) && !make(realquickkernel)
800 cd ${KRNLOBJDIR}/${_kernel}; \
801 ${KMAKEENV} make KERNEL=${INSTKERNNAME} depend
803 cd ${KRNLOBJDIR}/${_kernel}; \
804 ${KMAKEENV} make KERNEL=${INSTKERNNAME} all
806 .if !defined(NO_KERNELCONFIG)
808 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
809 ${KERNCONFDIR}/${_kernel}
811 .if !defined(NO_KERNELDEPEND) && !make(realquickkernel)
812 cd ${KRNLOBJDIR}/${_kernel}; \
813 make KERNEL=${INSTKERNNAME} depend
815 cd ${KRNLOBJDIR}/${_kernel}; \
816 make KERNEL=${INSTKERNNAME} all
818 @echo "--------------------------------------------------------------"
819 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
820 @echo "--------------------------------------------------------------"
826 # Install the kernel defined by INSTALLKERNEL
828 installkernel reinstallkernel:
829 @echo "--------------------------------------------------------------"
830 @echo ">>> Kernel install for ${INSTALLKERNEL} started on `LC_ALL=C date`"
831 @echo "--------------------------------------------------------------"
832 .if exists(${KRNLOBJDIR}/${INSTALLKERNEL}/.buildkernel_run)
833 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
834 ${IMAKEENV} make KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
836 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
837 make KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
839 @echo "--------------------------------------------------------------"
840 @echo ">>> Kernel install for ${INSTALLKERNEL} completed on `LC_ALL=C date`"
841 @echo "--------------------------------------------------------------"
844 # ------------------------------------------------------------------------
846 # From here onwards are utility targets used by the 'make world' and
847 # related targets. If your 'world' breaks, you may like to try to fix
848 # the problem and manually run the following targets to attempt to
849 # complete the build. Beware, this is *not* guaranteed to work, you
850 # need to have a pretty good grip on the current state of the system
851 # to attempt to manually finish it. If in doubt, 'make world' again.
854 # bootstrap-tools: Build all tools required to build all tools. Note that
855 # order is important in a number of cases and also note that the bootstrap
856 # and build tools stages have access to earlier binaries they themselves
859 # [x]install: dependencies on various new install features
860 # rpcgen: old rpcgen used a hardwired cpp path, newer OBJFORMAT_PATH
861 # envs are not compatible with older objformat binaries.
864 # BSTRAPDIRS1 - must be built in strict order, no parallelism
866 # order is very important. yacc before m4 before flex. flex exec's m4,
867 # m4's parser file needs the latest byacc (insanity!).
870 bin/chmod bin/cp bin/cpdup bin/dd bin/mkdir bin/rm bin/echo \
871 bin/test bin/cat bin/ln bin/mv bin/expr bin/sh \
872 bin/hostname bin/kill \
873 usr.bin/yacc usr.bin/m4 usr.bin/localedef \
874 usr.bin/uudecode usr.bin/xinstall \
875 usr.bin/rpcgen usr.bin/bmake usr.bin/awk usr.bin/stat \
876 usr.bin/find usr.bin/flex
878 # BSTRAPDIRS2 - may built in parallel
881 usr.bin/sed usr.bin/uname usr.bin/touch \
882 usr.bin/mkdep usr.bin/mktemp usr.bin/lorder usr.bin/file2c \
883 usr.bin/tsort usr.bin/tr usr.bin/join usr.bin/wc usr.bin/basename \
884 usr.bin/gencat usr.bin/chflags \
885 usr.bin/uuencode usr.bin/cap_mkdb usr.bin/true usr.bin/false \
886 usr.bin/cmp usr.bin/xargs usr.bin/env usr.bin/dirname \
887 usr.bin/tail usr.bin/unifdef \
888 usr.sbin/chown usr.sbin/mtree usr.sbin/config \
889 usr.sbin/tzsetup usr.sbin/zic usr.sbin/pwd_mkdb \
890 gnu/usr.bin/grep usr.bin/sort usr.bin/gzip \
891 usr.bin/mkcsmapper usr.bin/mkesdb usr.bin/crunch
893 bootstrap-tools: bootstrap-tools-before bootstrap-tools-targets1 bootstrap-tools-targets2
894 touch ${BTOOLSDEST}/.bootstrap_done
896 bootstrap-tools-before:
897 ${LN} -fs /bin/date ${BTOOLSDEST}/bin/date
899 bootstrap-tools-targets1: ${BSTRAPDIRS1:S/^/bstrap-/}
901 bootstrap-tools-targets2: ${BSTRAPDIRS2:S/^/bstrap-/}
903 .ORDER: bootstrap-tools-before bootstrap-tools-targets1 bootstrap-tools-targets2
905 .ORDER: ${BSTRAPDIRS1:S/^/bstrap-/}
907 .for _tool in ${BSTRAPDIRS1} ${BSTRAPDIRS2}
909 ${ECHODIR} "===> ${_tool} (bootstrap-tools)"; \
910 cd ${.CURDIR}/${_tool}; \
911 make DIRPRFX=${_tool}/ obj && \
912 make DIRPRFX=${_tool}/ depend && \
913 make DIRPRFX=${_tool}/ all && \
914 make DIRPRFX=${_tool}/ DESTDIR=${BTOOLSDEST} install
917 # build-tools: Build special purpose build tools.
919 # XXX we may be able to remove or consolidate this into bootstrap-tools
920 # now that we have the native helper (.nx/.no) infrastructure.
922 # XXX we should separate this into new Makefile.inc2.
923 # Just to prepare for reduction of ORDER: that slows down parallel crossworld.
925 # Make sure Makefile.inc1 logic is intact.
926 .if !defined(WORLD_ALTCOMPILER)
927 .warning undefined WORLD_ALTCOMPILER
930 # gcc80 is now the default compiler. See sys.mk for WORLD_ALTCOMPILER default
931 # and this file for WORLD_CCVER.
933 _gcc47_cross= gnu/usr.bin/cc47
934 _gcc80_cross= gnu/usr.bin/cc80
935 _gcc_common_cross= lib/libz gnu/usr.bin/gmp gnu/usr.bin/mpfr gnu/usr.bin/mpc
937 .if !defined(NO_ALTCOMPILER)
938 . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc47})
939 _altcompiler_cross+= ${_gcc47_cross}
943 _basecompiler_cross= ${_gcc80_cross}
945 _custom_cross= libexec/customcc
946 _binutils= gnu/usr.bin/${WORLD_BINUTILSVER}
948 build-tools: build-tools-targets
949 touch ${BTOOLSDEST}/.build_done
951 build-tools-targets: ${BTOOLSDIRS:S/^/btools-/}
954 # cross-tools: Build cross-building tools
957 CTOOLSDIRS= usr.bin/objformat
959 CTOOLSDIRS+= ${_binutils} \
960 ${_gcc_common_cross} \
961 ${_altcompiler_cross} \
962 ${_basecompiler_cross} ${_custom_cross}
964 cross-tools: cross-tools-targets
965 touch ${CTOOLSDEST}/.cross_done
967 cross-tools-targets: ${CTOOLSDIRS:S/^/ctools-/}
969 .for _tool in ${CTOOLSDIRS}
971 ${ECHODIR} "===> ${_tool} (cross-tools)"; \
972 cd ${.CURDIR}/${_tool}; \
973 make DIRPRFX=${_tool}/ obj && \
974 make DIRPRFX=${_tool}/ depend && \
975 make DIRPRFX=${_tool}/ all && \
976 make DIRPRFX=${_tool}/ DESTDIR=${CTOOLSDEST} install
980 # hierarchy - ensure that all the needed directories are present
983 cd ${.CURDIR}/etc; make distrib-dirs
986 # libraries - build all libraries, and install them under ${DESTDIR}.
988 # The list of libraries with dependents (${_prebuild_libs}) and their
989 # interdependencies (__L) are built automatically by the
990 # ${.CURDIR}/tools/make_libdeps.sh script.
992 # .makeenv does not work when bootstrapping from 4.x, so we must be sure
993 # to specify the correct CCVER or 'cc' will not exec the correct compiler.
997 HOST_CCVER=${HOST_CCVER} CCVER=gcc80 \
998 make -f Makefile.inc1 _startup_libs80 -DSYSBUILD -DLIBGCC_ONLY;
999 .if !defined(NO_ALTCOMPILER)
1000 . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc47})
1002 HOST_CCVER=${HOST_CCVER} CCVER=gcc47 \
1003 make -f Makefile.inc1 _startup_libs47 -DSYSBUILD -DLIBGCC_ONLY;
1007 make -f Makefile.inc1 _startup_libs -DSYSBUILD && \
1008 make -f Makefile.inc1 _prebuild_libs -DSYSBUILD && \
1009 make -f Makefile.inc1 _generic_libs -DSYSBUILD && \
1010 touch ${WORLDDEST}/.libraries_done
1012 # These dependencies are not automatically generated:
1014 # gnu/lib/${CCVER}/libgcc and gnu/lib/${CCVER}/csu must be built before all
1015 # shared libraries for ELF. The target for _startup_libsXX is
1016 # specifically built using gccXX.
1018 _startup_libs47= gnu/usr.bin/cc47/cc_prep \
1019 gnu/usr.bin/cc47/cc_tools \
1021 gnu/lib/gcc47/libgcc \
1022 gnu/lib/gcc47/libgcc_eh \
1023 gnu/lib/gcc47/libgcc_pic
1025 _startup_libs80= gnu/usr.bin/cc80/cc_prep \
1026 gnu/usr.bin/cc80/cc_tools \
1028 gnu/lib/gcc80/libgcc \
1029 gnu/lib/gcc80/libgcc_eh \
1030 gnu/lib/gcc80/libgcc_pic
1032 .if !defined(NO_ALTCOMPILER)
1033 . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc47})
1034 _startup_libs_alt+= _startup_libs47
1038 _startup_libs_base= _startup_libs80
1040 _startup_libs= lib/csu lib/libc lib/libc_rtld
1041 lib/libc__L: lib/csu__L
1043 _prebuild_libs= lib/libbz2 lib/liblzma lib/libz lib/libzstd
1044 _prebuild_libs+= lib/libutil
1046 _prebuild_libs+= lib/libpcap
1048 _generic_libs= gnu/lib
1050 _prebuild_libs+= lib/libcrypt lib/libncurses/libncurses
1054 _prebuild_libs+= lib/librecrypto lib/libressl
1055 lib/libressl__L: lib/librecrypto__L
1057 _prebuild_libs+= lib/libldns
1058 lib/libldns__L: lib/librecrypto__L
1060 _prebuild_libs+= lib/libsbuf lib/libm \
1061 lib/libpam/libpam lib/libypclnt lib/lib${THREAD_LIB} \
1062 lib/libpthread lib/libprop
1064 _generic_libs+= usr.bin/flex/lib
1066 .for _alib in ${_startup_libs_alt} ${_startup_libs_base}
1067 __startup_alibs+= ${${_alib}}
1070 .for _lib in ${__startup_alibs} \
1071 ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
1073 .if exists(${.CURDIR}/${_lib})
1074 @${ECHODIR} "===> ${_lib}"; \
1075 cd ${.CURDIR}/${_lib}; \
1076 echo "STEP DEP ${_lib}" && \
1077 make DIRPRFX=${_lib}/ depend && \
1078 echo "STEP ALL ${_lib}" && \
1079 make DIRPRFX=${_lib}/ all && \
1080 echo "STEP INSTALL ${_lib}" && \
1081 make DIRPRFX=${_lib}/ install && \
1082 echo "STEP DONE ${_lib}";
1084 .warning missing ${.CURDIR}/${_lib} directory.
1088 _startup_libs: ${_startup_libs:S/$/__L/}
1089 .for _alib in ${_startup_libs_alt} ${_startup_libs_base}
1090 ${_alib}: ${${_alib}:C/$/__L/}
1092 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
1093 _generic_libs: ${_generic_libs:S/$/__L/}
1095 # library targets must be ordered because there are inter-library
1096 # races (e.g. generation of tconfig.h)
1098 .for _alib in ${_startup_libs_base} ${_startup_libs_alt}
1099 .ORDER: ${${_alib}:C/$/__L/}
1102 # uncomment if there are missing dependencies
1104 .ORDER: ${_prebuild_libs:S/$/__L/}
1105 # we can disable this one, no lib/* depend on libstdc++
1106 .ORDER: ${_generic_libs:S/$/__L/}
1109 .for __target in clean cleandepend cleandir obj depend includes
1110 .for entry in ${SUBDIR}
1111 ${entry}.${__target}__D: .PHONY
1112 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
1113 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
1114 edir=${entry}.${MACHINE_ARCH}; \
1115 cd ${.CURDIR}/$${edir}; \
1117 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
1119 cd ${.CURDIR}/$${edir}; \
1121 make ${__target} DIRPRFX=${DIRPRFX}$${edir}/
1123 par-${__target}: ${SUBDIR:C/$/.${__target}__D/}
1124 .ORDER: ${SUBDIR:C/$/.${__target}__D/}
1126 .ORDER: par-clean par-cleandepend par-cleandir par-obj par-depend par-includes
1128 # The wmake target is used by /usr/bin/wmake to run make in a
1129 # world build environment.
1132 @echo '${WMAKEENV} make ${WMAKE_ARGS} -DSYSBUILD'
1135 @echo '${WMAKEENV} /bin/sh'
1138 @echo '${BMAKEENV} make ${BMAKE_ARGS} -DSYSBUILD'
1141 @echo '${BMAKEENV} /bin/sh'
1144 @echo '${TMAKEENV} make ${TMAKE_ARGS} -DSYSBUILD'
1147 @echo '${TMAKEENV} /bin/sh'
1150 @echo '${XMAKEENV} make ${XMAKE_ARGS} -DSYSBUILD'
1153 @echo '${XMAKEENV} /bin/sh'
1155 .if !defined(NO_BACKUP)
1156 backupworld: backup-clean
1157 @mkdir -p ${WORLD_BACKUP}
1158 .if (exists(${DESTDIR}/sbin) && exists(${DESTDIR}/bin) && \
1159 exists(${DESTDIR}/usr/sbin) && exists(${DESTDIR}/usr/bin) && \
1160 exists(${DESTDIR}/usr/lib) && exists(${DESTDIR}/usr/libexec))
1161 tar -czf ${WORLD_BACKUP}/binaries.tar.gz -C ${DESTDIR}/ \
1162 --options gzip:compression-level=1 \
1163 sbin bin usr/sbin usr/bin usr/lib usr/libexec
1167 rm -f ${AUTO_BACKUP}/binaries.tar.gz
1168 @mkdir -p ${AUTO_BACKUP}
1169 .if (exists(${DESTDIR}/sbin) && exists(${DESTDIR}/bin) && \
1170 exists(${DESTDIR}/usr/sbin) && exists(${DESTDIR}/usr/bin) && \
1171 exists(${DESTDIR}/usr/lib) && exists(${DESTDIR}/usr/libexec))
1172 /usr/bin/tar -czf ${AUTO_BACKUP}/binaries.tar.gz -C ${DESTDIR}/ \
1173 --options gzip:compression-level=1 \
1174 sbin bin usr/sbin usr/bin usr/lib usr/libexec
1178 rm -f ${AUTO_BACKUP}/binaries.tar.gz
1181 rm -f ${WORLD_BACKUP}/binaries.tar.gz
1184 .if !exists(${WORLD_BACKUP}/binaries.tar.gz)
1185 @echo "There does not seem to be a valid archive present."
1187 @echo "Restoring system binaries from manual backup archive..."
1188 @chflags -R noschg ${DESTDIR}/sbin ${DESTDIR}/bin \
1189 ${DESTDIR}/usr/sbin ${DESTDIR}/usr/bin \
1190 ${DESTDIR}/usr/lib ${DESTDIR}/usr/libexec
1191 tar -xzf ${WORLD_BACKUP}/binaries.tar.gz -C ${DESTDIR}/
1195 .if !exists(${AUTO_BACKUP}/binaries.tar.gz)
1196 @echo "There does not seem to be a valid archive present."
1198 @echo "Restoring system binaries from auto-backup archive..."
1199 @chflags -R noschg ${DESTDIR}/sbin ${DESTDIR}/bin \
1200 ${DESTDIR}/usr/sbin ${DESTDIR}/usr/bin \
1201 ${DESTDIR}/usr/lib ${DESTDIR}/usr/libexec
1202 tar -xzf ${AUTO_BACKUP}/binaries.tar.gz -C ${DESTDIR}/
1206 # Take advantage of bmake error response
1208 MAKE_PRINT_VAR_ON_ERROR= \
1225 .if ${.MAKE.LEVEL} > 0
1226 MAKE_PRINT_VAR_ON_ERROR+= .MAKE.MAKEFILES .PATH
1229 .include <bsd.subdir.mk>