4 # Make command line options:
5 # -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
6 # -DNO_CLEAN do not clean at all
7 # -DDB_FROM_SRC use the user/group databases in src/etc instead of
8 # the system database when installing.
9 # -DNO_SHARE do not go into share subdir
10 # -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,DEPEND,OBJ}
11 # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
12 # -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
13 # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
14 # -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel
15 # -DNO_PORTSUPDATE do not update ports in ${MAKE} update
16 # -DNO_ROOT install without using root privilege
17 # -DNO_DOCUPDATE do not update doc in ${MAKE} update
18 # -DWITHOUT_CTF do not run the DTrace CTF conversion tools on built objects
19 # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
20 # LOCAL_ITOOLS="list of tools" to add additional tools to the ITOOLS list
21 # LOCAL_LIB_DIRS="list of dirs" to add additional dirs to libraries target
22 # LOCAL_MTREE="list of mtree files" to process to allow local directories
23 # to be created before files are installed
24 # LOCAL_TOOL_DIRS="list of dirs" to add additional dirs to the build-tools
26 # METALOG="path to metadata log" to write permission and ownership
27 # when NO_ROOT is set. (default: ${DESTDIR}/METALOG)
28 # TARGET="machine" to crossbuild world for a different machine type
29 # TARGET_ARCH= may be required when a TARGET supports multiple endians
30 # BUILDENV_SHELL= shell to launch for the buildenv target (def:${SHELL})
31 # WORLD_FLAGS= additional flags to pass to make(1) during buildworld
32 # KERNEL_FLAGS= additional flags to pass to make(1) during buildkernel
33 # SUBDIR_OVERRIDE="list of dirs" to build rather than everything.
34 # All libraries and includes, and some build tools will still build.
37 # The intended user-driven targets are:
38 # buildworld - rebuild *everything*, including glue to help do upgrades
39 # installworld- install everything built by "buildworld"
40 # checkworld - run test suite on installed world
41 # doxygen - build API documentation of the kernel
42 # update - convenient way to update your source tree (eg: svn/svnup)
44 # Standard targets (not defined here) are documented in the makefiles in
45 # /usr/share/mk. These include:
46 # obj depend all install clean cleandepend cleanobj
48 .if !defined(TARGET) || !defined(TARGET_ARCH)
49 .error "Both TARGET and TARGET_ARCH must be defined."
52 LOCALBASE?= /usr/local
54 # Cross toolchain changes must be in effect before bsd.compiler.mk
55 # so that gets the right CC, and pass CROSS_TOOLCHAIN to submakes.
56 .if defined(CROSS_TOOLCHAIN)
57 .include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk"
58 CROSSENV+=CROSS_TOOLCHAIN="${CROSS_TOOLCHAIN}"
60 .include <bsd.compiler.mk> # don't depend on src.opts.mk doing it
61 .include "share/mk/src.opts.mk"
63 # We must do lib/ and libexec/ before bin/ in case of a mid-install error to
64 # keep the users system reasonably usable. For static->dynamic root upgrades,
65 # we don't want to install a dynamic binary without rtld and the needed
66 # libraries. More commonly, for dynamic root, we don't want to install a
67 # binary that requires a newer library version that hasn't been installed yet.
68 # This ordering is not a guarantee though. The only guarantee of a working
69 # system here would require fine-grained ordering of all components based
70 # on their dependencies.
72 .if !empty(SUBDIR_OVERRIDE)
73 SUBDIR= ${SUBDIR_OVERRIDE}
76 .if !defined(NO_ROOT) && (make(installworld) || make(install))
77 # Ensure libraries are installed before progressing.
81 .if ${MK_CDDL} != "no"
85 .if ${MK_KERBEROS} != "no"
88 .if ${MK_RESCUE} != "no"
92 .if ${MK_CRYPT} != "no"
95 .if !defined(NO_SHARE)
98 SUBDIR+=sys usr.bin usr.sbin
99 .if ${MK_TESTS} != "no"
102 .if ${MK_OFED} != "no"
106 # Local directories are last, since it is nice to at least get the base
107 # system rebuilt before you do them.
108 .for _DIR in ${LOCAL_DIRS}
109 .if exists(${.CURDIR}/${_DIR}/Makefile)
113 # Add LOCAL_LIB_DIRS, but only if they will not be picked up as a SUBDIR
114 # of a LOCAL_DIRS directory. This allows LOCAL_DIRS=foo and
115 # LOCAL_LIB_DIRS=foo/lib to behave as expected.
116 .for _DIR in ${LOCAL_DIRS:M*/} ${LOCAL_DIRS:N*/:S|$|/|}
117 _REDUNDENT_LIB_DIRS+= ${LOCAL_LIB_DIRS:M${_DIR}*}
119 .for _DIR in ${LOCAL_LIB_DIRS}
120 .if empty(_REDUNDENT_LIB_DIRS:M${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile)
123 .warning ${_DIR} not added to SUBDIR list. See UPDATING 20141121.
127 # We must do etc/ last as it hooks into building the man whatis file
128 # by calling 'makedb' in share/man. This is only relevant for
129 # install/distribute so they build the whatis file after every manpage is
131 .if make(installworld) || make(install)
136 .endif # !empty(SUBDIR_OVERRIDE)
139 .warning NOCLEAN option is deprecated. Use NO_CLEAN instead.
142 .if defined(NO_CLEANDIR)
143 CLEANDIR= clean cleandepend
148 # FAST_DEPEND can skip depend tree-walks.
149 .if ${MK_FAST_DEPEND} == "yes"
153 # Ensure shell checks later have a value.
154 .if defined(NO_DEPEND)
159 PACKAGEDIR?= ${DESTDIR}/${DISTDIR}
161 .if empty(SHELL:M*csh*)
162 BUILDENV_SHELL?=${SHELL}
164 BUILDENV_SHELL?=/bin/sh
167 SVN?= /usr/local/bin/svn
170 MAKEOBJDIRPREFIX?= /usr/obj
171 .if !defined(OSRELDATE)
172 .if exists(/usr/include/osreldate.h)
173 OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
174 /usr/include/osreldate.h
181 # Set VERSION for CTFMERGE to use via the default CTFFLAGS=-L VERSION.
182 .if !defined(VERSION)
183 REVISION!= MK_AUTO_OBJ=no ${MAKE} -C ${SRCDIR}/release -V REVISION
184 BRANCH!= MK_AUTO_OBJ=no ${MAKE} -C ${SRCDIR}/release -V BRANCH
185 SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
186 ${SRCDIR}/sys/sys/param.h
187 VERSION= FreeBSD ${REVISION}-${BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE}
191 KNOWN_ARCHES?= aarch64/arm64 \
210 .if ${TARGET} == ${TARGET_ARCH}
213 _t= ${TARGET_ARCH}/${TARGET}
216 .if empty(KNOWN_ARCHES:M${_t})
217 .error Unknown target ${TARGET_ARCH}:${TARGET}.
221 .if ${TARGET} == ${MACHINE}
222 TARGET_CPUTYPE?=${CPUTYPE}
227 .if !empty(TARGET_CPUTYPE)
228 _TARGET_CPUTYPE=${TARGET_CPUTYPE}
230 _TARGET_CPUTYPE=dummy
232 _CPUTYPE!= MK_AUTO_OBJ=no MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} \
233 -f /dev/null -m ${.CURDIR}/share/mk -V CPUTYPE
234 .if ${_CPUTYPE} != ${_TARGET_CPUTYPE}
235 .error CPUTYPE global should be set with ?=.
238 BUILD_ARCH!= uname -p
239 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
240 .error To cross-build, set TARGET_ARCH.
243 .if ${MACHINE} == ${TARGET} && ${MACHINE_ARCH} == ${TARGET_ARCH} && !defined(CROSS_BUILD_TESTING)
244 OBJTREE= ${MAKEOBJDIRPREFIX}
246 OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}
248 WORLDTMP= ${OBJTREE}${.CURDIR}/tmp
249 BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin
250 XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin
251 STRICTTMPPATH= ${BPATH}:${XPATH}
252 TMPPATH= ${STRICTTMPPATH}:${PATH}
255 # Avoid running mktemp(1) unless actually needed.
256 # It may not be functional, e.g., due to new ABI
257 # when in the middle of installing over this system.
259 .if make(distributeworld) || make(installworld)
260 INSTALLTMP!= /usr/bin/mktemp -d -u -t install
264 # Building a world goes through the following stages
266 # 1. legacy stage [BMAKE]
267 # This stage is responsible for creating compatibility
268 # shims that are needed by the bootstrap-tools,
269 # build-tools and cross-tools stages. These are generally
270 # APIs that tools from one of those three stages need to
271 # build that aren't present on the host.
272 # 1. bootstrap-tools stage [BMAKE]
273 # This stage is responsible for creating programs that
274 # are needed for backward compatibility reasons. They
275 # are not built as cross-tools.
276 # 2. build-tools stage [TMAKE]
277 # This stage is responsible for creating the object
278 # tree and building any tools that are needed during
279 # the build process. Some programs are listed during
280 # this phase because they build binaries to generate
281 # files needed to build these programs. This stage also
282 # builds the 'build-tools' target rather than 'all'.
283 # 3. cross-tools stage [XMAKE]
284 # This stage is responsible for creating any tools that
285 # are needed for building the system. A cross-compiler is one
286 # of them. This differs from build tools in two ways:
287 # 1. the 'all' target is built rather than 'build-tools'
288 # 2. these tools are installed into TMPPATH for stage 4.
289 # 4. world stage [WMAKE]
290 # This stage actually builds the world.
291 # 5. install stage (optional) [IMAKE]
292 # This stage installs a previously built world.
297 # Common environment for world related stages
298 CROSSENV+= MAKEOBJDIRPREFIX=${OBJTREE} \
299 MACHINE_ARCH=${TARGET_ARCH} \
301 CPUTYPE=${TARGET_CPUTYPE}
302 .if ${MK_GROFF} != "no"
303 CROSSENV+= GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \
304 GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \
305 GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac
307 .if defined(TARGET_CFLAGS)
308 CROSSENV+= ${TARGET_CFLAGS}
311 # bootstrap-tools stage
312 BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
313 PATH=${BPATH}:${PATH} \
314 WORLDTMP=${WORLDTMP} \
315 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
316 # need to keep this in sync with targets/pseudo/bootstrap-tools/Makefile
318 BOOTSTRAPPING=${OSRELDATE} \
320 MK_HTML=no NO_LINT=yes MK_MAN=no \
321 -DNO_PIC MK_PROFILE=no -DNO_SHARED \
322 -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
323 MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
324 MK_LLDB=no MK_TESTS=no \
327 BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \
328 ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
332 TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
333 ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
334 TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
336 BOOTSTRAPPING=${OSRELDATE} \
339 -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
340 MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
341 MK_LLDB=no MK_TESTS=no
344 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
345 TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
346 MK_GDB=no MK_TESTS=no
349 KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
350 PATH=${BPATH}:${PATH} \
352 KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOBJDIRPREFIX=${WORLDTMP} \
353 ${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
355 BOOTSTRAPPING=${OSRELDATE} \
357 MK_HTML=no -DNO_LINT MK_MAN=no \
358 -DNO_PIC MK_PROFILE=no -DNO_SHARED \
359 -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no
362 WMAKEENV= ${CROSSENV} \
364 INSTALL="sh ${.CURDIR}/tools/install.sh" \
368 HMAKE= PATH=${TMPPATH} ${MAKE} LOCAL_MTREE=${LOCAL_MTREE:Q}
370 HMAKE+= PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT
373 .if defined(CROSS_TOOLCHAIN_PREFIX)
374 CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
375 CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
378 # If we do not have a bootstrap binutils (because the in-tree one does not
379 # support the target architecture), provide a default cross-binutils prefix.
380 # This allows aarch64 builds, for example, to automatically use the
381 # aarch64-binutils port or package.
382 .if !make(showconfig)
383 .if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \
384 !defined(CROSS_BINUTILS_PREFIX)
385 CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/
386 .if !exists(${CROSS_BINUTILS_PREFIX})
387 .error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX.
392 XCOMPILERS= CC CXX CPP
393 .for COMPILER in ${XCOMPILERS}
394 .if defined(CROSS_COMPILER_PREFIX)
395 X${COMPILER}?= ${CROSS_COMPILER_PREFIX}${${COMPILER}}
397 X${COMPILER}?= ${${COMPILER}}
400 XBINUTILS= AS AR LD NM OBJCOPY OBJDUMP RANLIB SIZE STRINGS
401 .for BINUTIL in ${XBINUTILS}
402 .if defined(CROSS_BINUTILS_PREFIX) && \
403 exists(${CROSS_BINUTILS_PREFIX}${${BINUTIL}})
404 X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${${BINUTIL}}
406 X${BINUTIL}?= ${${BINUTIL}}
409 CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCFLAGS} ${XCXXFLAGS}" \
410 DEPFLAGS="${DEPFLAGS}" \
411 CPP="${XCPP} ${XCFLAGS}" \
412 AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \
413 OBJDUMP=${XOBJDUMP} OBJCOPY="${XOBJCOPY}" \
414 RANLIB=${XRANLIB} STRINGS=${XSTRINGS} \
417 .if ${XCC:N${CCACHE_BIN}:M/*}
418 .if defined(CROSS_BINUTILS_PREFIX)
419 # In the case of xdev-build tools, CROSS_BINUTILS_PREFIX won't be a
420 # directory, but the compiler will look in the right place for it's
421 # tools so we don't need to tell it where to look.
422 .if exists(${CROSS_BINUTILS_PREFIX})
423 BFLAGS+= -B${CROSS_BINUTILS_PREFIX}
426 BFLAGS+= -B${WORLDTMP}/usr/bin
428 .if ${TARGET} == "arm"
429 .if ${TARGET_ARCH:M*hf*} != ""
430 TARGET_ABI= gnueabihf
435 .if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc
436 XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib
437 XCXXFLAGS+= -I${WORLDTMP}/usr/include/c++/v1 -std=gnu++11 -L${WORLDTMP}/../lib/libc++
438 # XXX: DEPFLAGS is a workaround for not properly passing CXXFLAGS to sub-makes
439 # due to CXX="${XCXX} ${XCXXFLAGS}". bsd.dep.mk does use CXXFLAGS when
440 # building C++ files so this can come out if passing CXXFLAGS down is fixed.
441 DEPFLAGS+= -I${WORLDTMP}/usr/include/c++/v1
444 TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0
445 XCFLAGS+= -target ${TARGET_TRIPLE}
447 XCFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS}
448 XCXXFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS}
450 .if defined(CROSS_BINUTILS_PREFIX) && exists(${CROSS_BINUTILS_PREFIX})
451 BFLAGS+= -B${CROSS_BINUTILS_PREFIX}
453 XCXXFLAGS+= ${BFLAGS}
457 .if ${MK_LIB32} != "no" && (${TARGET_ARCH} == "amd64" || \
458 ${TARGET_ARCH} == "powerpc64")
460 .include "Makefile.libcompat"
463 WMAKE= ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 DESTDIR=${WORLDTMP}
465 IMAKEENV= ${CROSSENV:N_LDSCRIPTROOT=*}
466 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \
467 ${IMAKE_INSTALL} ${IMAKE_MTREE}
468 .if empty(.MAKEFLAGS:M-n)
469 IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \
470 LD_LIBRARY_PATH=${INSTALLTMP} \
471 PATH_LOCALE=${INSTALLTMP}/locale
472 IMAKE+= __MAKE_SHELL=${INSTALLTMP}/sh
474 IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP}
476 .if defined(DB_FROM_SRC)
477 INSTALLFLAGS+= -N ${.CURDIR}/etc
478 MTREEFLAGS+= -N ${.CURDIR}/etc
480 _INSTALL_DDIR= ${DESTDIR}/${DISTDIR}
481 INSTALL_DDIR= ${_INSTALL_DDIR:S://:/:g:C:/$::}
483 METALOG?= ${DESTDIR}/${DISTDIR}/METALOG
484 IMAKE+= -DNO_ROOT METALOG=${METALOG}
485 INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR}
488 .if defined(DB_FROM_SRC) || defined(NO_ROOT)
489 IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}"
490 IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}"
494 KMAKEENV= ${WMAKEENV}
495 KMAKE= ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME}
500 # Attempt to rebuild the entire system, with reasonable chance of
501 # success, regardless of how old your existing system is.
504 .if ${.CURDIR:C/[^,]//g} != ""
505 # The m4 build of sendmail files doesn't like it if ',' is used
506 # anywhere in the path of it's files.
508 @echo "*** Error: path to source tree contains a comma ','"
513 @echo "--------------------------------------------------------------"
514 @echo ">>> Rebuilding the temporary build tree"
515 @echo "--------------------------------------------------------------"
516 .if !defined(NO_CLEAN)
518 .if defined(LIBCOMPAT)
519 rm -rf ${LIBCOMPATTMP}
522 rm -rf ${WORLDTMP}/legacy/usr/include
523 # XXX - These can depend on any header file.
524 rm -f ${OBJTREE}${.CURDIR}/lib/libsysdecode/ioctl.c
525 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c
528 lib lib/casper usr legacy/bin legacy/usr
529 mkdir -p ${WORLDTMP}/${_dir}
531 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
532 -p ${WORLDTMP}/legacy/usr >/dev/null
533 .if ${MK_GROFF} != "no"
534 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.groff.dist \
535 -p ${WORLDTMP}/legacy/usr >/dev/null
537 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
538 -p ${WORLDTMP}/usr >/dev/null
539 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
540 -p ${WORLDTMP}/usr/include >/dev/null
541 ln -sf ${.CURDIR}/sys ${WORLDTMP}
542 .if ${MK_DEBUG_FILES} != "no"
543 # We could instead disable debug files for these build stages
544 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
545 -p ${WORLDTMP}/legacy/usr/lib >/dev/null
546 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
547 -p ${WORLDTMP}/usr/lib >/dev/null
549 .if defined(LIBCOMPAT)
550 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
551 -p ${WORLDTMP}/usr >/dev/null
552 .if ${MK_DEBUG_FILES} != "no"
553 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
554 -p ${WORLDTMP}/legacy/usr/lib/debug/usr >/dev/null
555 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
556 -p ${WORLDTMP}/usr/lib/debug/usr >/dev/null
559 .if ${MK_TESTS} != "no"
560 mkdir -p ${WORLDTMP}${TESTSBASE}
561 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
562 -p ${WORLDTMP}${TESTSBASE} >/dev/null
563 .if ${MK_DEBUG_FILES} != "no"
564 mkdir -p ${WORLDTMP}/usr/lib/debug/${TESTSBASE}
565 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
566 -p ${WORLDTMP}/usr/lib/debug/${TESTSBASE} >/dev/null
569 .for _mtree in ${LOCAL_MTREE}
570 mtree -deU -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null
574 @echo "--------------------------------------------------------------"
575 @echo ">>> stage 1.1: legacy release compatibility shims"
576 @echo "--------------------------------------------------------------"
577 ${_+_}cd ${.CURDIR}; ${BMAKE} legacy
580 @echo "--------------------------------------------------------------"
581 @echo ">>> stage 1.2: bootstrap tools"
582 @echo "--------------------------------------------------------------"
583 ${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools
585 .if !defined(NO_CLEAN)
587 @echo "--------------------------------------------------------------"
588 @echo ">>> stage 2.1: cleaning up the object tree"
589 @echo "--------------------------------------------------------------"
590 ${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR}
591 .if defined(LIBCOMPAT)
592 ${_+_}cd ${.CURDIR}; ${LIBCOMPATWMAKE} -f Makefile.inc1 ${CLEANDIR}
597 @echo "--------------------------------------------------------------"
598 @echo ">>> stage 2.2: rebuilding the object tree"
599 @echo "--------------------------------------------------------------"
600 ${_+_}cd ${.CURDIR}; ${WMAKE} obj
603 @echo "--------------------------------------------------------------"
604 @echo ">>> stage 2.3: build tools"
605 @echo "--------------------------------------------------------------"
606 ${_+_}cd ${.CURDIR}; ${TMAKE} build-tools
609 @echo "--------------------------------------------------------------"
610 @echo ">>> stage 3: cross tools"
611 @echo "--------------------------------------------------------------"
612 ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools
613 ${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools
616 @echo "--------------------------------------------------------------"
617 @echo ">>> stage 4.1: building includes"
618 @echo "--------------------------------------------------------------"
619 # Special handling for SUBDIR_OVERRIDE in buildworld as they most likely need
620 # headers from default SUBDIR. Do SUBDIR_OVERRIDE includes last.
621 ${_+_}cd ${.CURDIR}; ${WMAKE} SUBDIR_OVERRIDE= SHARED=symlinks \
623 .if !empty(SUBDIR_OVERRIDE) && make(buildworld)
624 ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks includes
628 @echo "--------------------------------------------------------------"
629 @echo ">>> stage 4.2: building libraries"
630 @echo "--------------------------------------------------------------"
631 ${_+_}cd ${.CURDIR}; \
632 ${WMAKE} -DNO_FSCHG MK_HTML=no -DNO_LINT MK_MAN=no \
633 MK_PROFILE=no MK_TESTS=no MK_TESTS_SUPPORT=${MK_TESTS} libraries
636 @echo "--------------------------------------------------------------"
637 @echo ">>> stage 4.3: make dependencies"
638 @echo "--------------------------------------------------------------"
639 ${_+_}cd ${.CURDIR}; ${WMAKE} depend
642 @echo "--------------------------------------------------------------"
643 @echo ">>> stage 4.4: building everything"
644 @echo "--------------------------------------------------------------"
645 ${_+_}cd ${.CURDIR}; _PARALLEL_SUBDIR_OK=1 ${WMAKE} all
648 WMAKE_TGTS+= _worldtmp _legacy
649 .if empty(SUBDIR_OVERRIDE)
650 WMAKE_TGTS+= _bootstrap-tools
652 WMAKE_TGTS+= _cleanobj _obj _build-tools _cross-tools
653 WMAKE_TGTS+= _includes _libraries
654 .if !defined(NO_DEPEND)
657 WMAKE_TGTS+= everything
658 .if defined(LIBCOMPAT) && empty(SUBDIR_OVERRIDE)
659 WMAKE_TGTS+= build${libcompat}
662 buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
663 .ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
666 @echo "--------------------------------------------------------------"
667 @echo ">>> World build started on `LC_ALL=C date`"
668 @echo "--------------------------------------------------------------"
672 @echo "--------------------------------------------------------------"
673 @echo ">>> World build completed on `LC_ALL=C date`"
674 @echo "--------------------------------------------------------------"
677 # We need to have this as a target because the indirection between Makefile
678 # and Makefile.inc1 causes the correct PATH to be used, rather than a
679 # modification of the current environment's PATH. In addition, we need
680 # to quote multiword values.
683 @echo ${WMAKEENV:Q} ${.MAKE.EXPORTED:@v@$v=\"${$v}\"@}
685 .if ${.TARGETS:Mbuildenv}
686 .if ${.MAKEFLAGS:M-j}
687 .error The buildenv target is incompatible with -j
690 BUILDENV_DIR?= ${.CURDIR}
692 @echo Entering world for ${TARGET_ARCH}:${TARGET}
693 .if ${BUILDENV_SHELL:M*zsh*}
694 @echo For ZSH you must run: export CPUTYPE=${TARGET_CPUTYPE}
696 @cd ${BUILDENV_DIR} && env ${WMAKEENV} BUILDENV=1 ${BUILDENV_SHELL} \
699 TOOLCHAIN_TGTS= ${WMAKE_TGTS:N_depend:Neverything:Nbuild${libcompat}}
700 toolchain: ${TOOLCHAIN_TGTS}
701 kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries}
706 # Checks to be sure system is ready for installworld/installkernel.
708 installcheck: _installcheck_world _installcheck_kernel
710 _installcheck_kernel:
713 # Require DESTDIR to be set if installing for a different architecture or
714 # using the user/group database in the source tree.
716 .if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE} || \
718 .if !make(distributeworld)
719 _installcheck_world: __installcheck_DESTDIR
720 _installcheck_kernel: __installcheck_DESTDIR
721 __installcheck_DESTDIR:
722 .if !defined(DESTDIR) || empty(DESTDIR)
723 @echo "ERROR: Please set DESTDIR!"; \
729 .if !defined(DB_FROM_SRC)
731 # Check for missing UIDs/GIDs.
733 CHECK_UIDS= auditdistd
735 .if ${MK_SENDMAIL} != "no"
741 CHECK_GIDS+= proxy authpf
743 .if ${MK_UNBOUND} != "no"
747 _installcheck_world: __installcheck_UGID
749 .for uid in ${CHECK_UIDS}
750 @if ! `id -u ${uid} >/dev/null 2>&1`; then \
751 echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \
755 .for gid in ${CHECK_GIDS}
756 @if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \
757 echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \
764 # Required install tools to be saved in a scratch dir for safety.
766 .if ${MK_ZONEINFO} != "no"
767 _zoneinfo= zic tzsetup
770 ITOOLS= [ awk cap_mkdb cat chflags chmod chown cmp cp \
771 date echo egrep find grep id install ${_install-info} \
772 ln make mkdir mtree mv pwd_mkdb \
773 rm sed services_mkdb sh strip sysctl test true uname wc ${_zoneinfo} \
776 # Needed for share/man
777 .if ${MK_MAN} != "no"
784 # Distributes everything compiled by a `buildworld'.
788 # Installs everything compiled by a 'buildworld'.
791 # Non-base distributions produced by the base system
792 EXTRA_DISTRIBUTIONS= doc
793 .if defined(LIBCOMPAT)
794 EXTRA_DISTRIBUTIONS+= lib${libcompat}
796 .if ${MK_TESTS} != "no"
797 EXTRA_DISTRIBUTIONS+= tests
801 .if ${MK_DEBUG_FILES} != "no"
802 DEBUG_DISTRIBUTIONS+= base ${EXTRA_DISTRIBUTIONS:S,doc,,:S,tests,,}
805 MTREE_MAGIC?= mtree 2.0
807 distributeworld installworld: _installcheck_world
808 mkdir -p ${INSTALLTMP}
809 progs=$$(for prog in ${ITOOLS}; do \
810 if progpath=`which $$prog`; then \
813 echo "Required tool $$prog not found in PATH." >&2; \
817 libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | \
818 while read line; do \
820 if [ "$$2 $$3" != "not found" ]; then \
823 echo "Required library $$1 not found." >&2; \
827 cp $$libs $$progs ${INSTALLTMP}
828 cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale
830 -mkdir -p ${METALOG:H}
831 echo "#${MTREE_MAGIC}" > ${METALOG}
833 .if make(distributeworld)
834 .for dist in ${EXTRA_DISTRIBUTIONS}
835 -mkdir ${DESTDIR}/${DISTDIR}/${dist}
836 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \
837 -p ${DESTDIR}/${DISTDIR}/${dist} >/dev/null
838 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
839 -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
840 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
841 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null
842 .if ${MK_DEBUG_FILES} != "no"
843 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
844 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null
846 .if defined(LIBCOMPAT)
847 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
848 -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
849 .if ${MK_DEBUG_FILES} != "no"
850 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
851 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/usr >/dev/null
854 .if ${MK_TESTS} != "no" && ${dist} == "tests"
855 -mkdir -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE}
856 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
857 -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null
858 .if ${MK_DEBUG_FILES} != "no"
859 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
860 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/${TESTSBASE} >/dev/null
864 ${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \
865 sed -e 's#^\./#./${dist}/#' >> ${METALOG}
866 ${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \
867 sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
868 ${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \
869 sed -e 's#^\./#./${dist}/usr/include/#' >> ${METALOG}
870 .if defined(LIBCOMPAT)
871 ${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist | \
872 sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
876 -mkdir ${DESTDIR}/${DISTDIR}/base
877 ${_+_}cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \
878 METALOG=${METALOG} ${IMAKE_INSTALL} ${IMAKE_MTREE} \
879 DISTBASE=/base DESTDIR=${DESTDIR}/${DISTDIR}/base \
880 LOCAL_MTREE=${LOCAL_MTREE:Q} distrib-dirs
882 ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \
883 ${IMAKEENV} rm -rf ${INSTALLTMP}
884 .if make(distributeworld)
885 .for dist in ${EXTRA_DISTRIBUTIONS}
886 find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -empty -delete
889 .for dist in base ${EXTRA_DISTRIBUTIONS}
890 @# For each file that exists in this dist, print the corresponding
891 @# line from the METALOG. This relies on the fact that
892 @# a line containing only the filename will sort immediatly before
893 @# the relevant mtree line.
894 cd ${DESTDIR}/${DISTDIR}; \
895 find ./${dist} | sort -u ${METALOG} - | \
896 awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \
897 ${DESTDIR}/${DISTDIR}/${dist}.meta
899 .for dist in ${DEBUG_DISTRIBUTIONS}
900 @# For each file that exists in this dist, print the corresponding
901 @# line from the METALOG. This relies on the fact that
902 @# a line containing only the filename will sort immediatly before
903 @# the relevant mtree line.
904 cd ${DESTDIR}/${DISTDIR}; \
905 find ./${dist}/usr/lib/debug | sort -u ${METALOG} - | \
906 awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \
907 ${DESTDIR}/${DISTDIR}/${dist}.debug.meta
913 .for dist in base ${EXTRA_DISTRIBUTIONS}
915 ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
916 tar cvf - --exclude usr/lib/debug \
917 @${DESTDIR}/${DISTDIR}/${dist}.meta | \
918 ${XZ_CMD} > ${PACKAGEDIR}/${dist}.txz
920 ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
921 tar cvf - --exclude usr/lib/debug . | \
922 ${XZ_CMD} > ${PACKAGEDIR}/${dist}.txz
926 .for dist in ${DEBUG_DISTRIBUTIONS}
927 . if defined(NO_ROOT)
928 ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
929 tar cvf - @${DESTDIR}/${DISTDIR}/${dist}.debug.meta | \
930 ${XZ_CMD} > ${PACKAGEDIR}/${dist}-dbg.txz
932 ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
933 tar cvLf - usr/lib/debug | \
934 ${XZ_CMD} > ${PACKAGEDIR}/${dist}-dbg.txz
941 # If you have a build server, you can NFS mount the source and obj directories
942 # and do a 'make reinstall' on the *client* to install new binaries from the
943 # most recent server build.
945 reinstall: .MAKE .PHONY
946 @echo "--------------------------------------------------------------"
947 @echo ">>> Making hierarchy"
948 @echo "--------------------------------------------------------------"
949 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \
950 LOCAL_MTREE=${LOCAL_MTREE:Q} hierarchy
952 @echo "--------------------------------------------------------------"
953 @echo ">>> Installing everything"
954 @echo "--------------------------------------------------------------"
955 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
956 .if defined(LIBCOMPAT)
957 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install${libcompat}
960 redistribute: .MAKE .PHONY
961 @echo "--------------------------------------------------------------"
962 @echo ">>> Distributing everything"
963 @echo "--------------------------------------------------------------"
964 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
965 .if defined(LIBCOMPAT)
966 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute${libcompat} \
967 DISTRIBUTION=lib${libcompat}
970 distrib-dirs distribution: .MAKE .PHONY
971 ${_+_}cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \
972 ${IMAKE_INSTALL} ${IMAKE_MTREE} METALOG=${METALOG} ${.TARGET}
973 .if make(distribution)
974 ${_+_}cd ${.CURDIR}; ${CROSSENV} PATH=${TMPPATH} \
975 ${MAKE} -f Makefile.inc1 ${IMAKE_INSTALL} \
976 METALOG=${METALOG} MK_TESTS=no installconfig
980 # buildkernel and installkernel
982 # Which kernels to build and/or install is specified by setting
983 # KERNCONF. If not defined a GENERIC kernel is built/installed.
984 # Only the existing (depending TARGET) config files are used
985 # for building kernels and only the first of these is designated
986 # as the one being installed.
988 # Note that we have to use TARGET instead of TARGET_ARCH when
989 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
990 # be set to cross-build, we have to make sure TARGET is set
993 .if defined(KERNFAST)
998 # Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah
999 .if !defined(KERNCONF) && ${KERNFAST} != "1"
1000 KERNCONF=${KERNFAST}
1003 .if ${TARGET_ARCH} == "powerpc64"
1004 KERNCONF?= GENERIC64
1008 INSTKERNNAME?= kernel
1010 KERNSRCDIR?= ${.CURDIR}/sys
1011 KRNLCONFDIR= ${KERNSRCDIR}/${TARGET}/conf
1012 KRNLOBJDIR= ${OBJTREE}${KERNSRCDIR}
1013 KERNCONFDIR?= ${KRNLCONFDIR}
1017 .if defined(NO_INSTALLKERNEL)
1018 # All of the BUILDKERNELS loops start at index 1.
1019 BUILDKERNELS+= dummy
1021 .for _kernel in ${KERNCONF}
1022 .if exists(${KERNCONFDIR}/${_kernel})
1023 BUILDKERNELS+= ${_kernel}
1024 .if empty(INSTALLKERNEL) && !defined(NO_INSTALLKERNEL)
1025 INSTALLKERNEL= ${_kernel}
1030 ${WMAKE_TGTS:N_worldtmp:Nbuild${libcompat}} ${.ALLTARGETS:M_*:N_worldtmp}: .MAKE .PHONY
1035 # Builds all kernels defined by BUILDKERNELS.
1037 buildkernel: .MAKE .PHONY
1038 .if empty(BUILDKERNELS:Ndummy)
1039 @echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \
1043 .for _kernel in ${BUILDKERNELS:Ndummy}
1044 @echo "--------------------------------------------------------------"
1045 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
1046 @echo "--------------------------------------------------------------"
1047 @echo "===> ${_kernel}"
1048 mkdir -p ${KRNLOBJDIR}
1049 .if !defined(NO_KERNELCONFIG)
1051 @echo "--------------------------------------------------------------"
1052 @echo ">>> stage 1: configuring the kernel"
1053 @echo "--------------------------------------------------------------"
1054 cd ${KRNLCONFDIR}; \
1056 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
1057 -I '${KERNCONFDIR}' '${KERNCONFDIR}/${_kernel}'
1059 .if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN)
1061 @echo "--------------------------------------------------------------"
1062 @echo ">>> stage 2.1: cleaning up the object tree"
1063 @echo "--------------------------------------------------------------"
1064 ${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR}
1066 .if !defined(NO_KERNELOBJ)
1068 @echo "--------------------------------------------------------------"
1069 @echo ">>> stage 2.2: rebuilding the object tree"
1070 @echo "--------------------------------------------------------------"
1071 ${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj
1074 @echo "--------------------------------------------------------------"
1075 @echo ">>> stage 2.3: build tools"
1076 @echo "--------------------------------------------------------------"
1077 ${_+_}cd ${.CURDIR}; ${KTMAKE} kernel-tools
1078 .if !defined(NO_KERNELDEPEND)
1080 @echo "--------------------------------------------------------------"
1081 @echo ">>> stage 3.1: making dependencies"
1082 @echo "--------------------------------------------------------------"
1083 ${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} depend -DNO_MODULES_OBJ
1086 @echo "--------------------------------------------------------------"
1087 @echo ">>> stage 3.2: building everything"
1088 @echo "--------------------------------------------------------------"
1089 ${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ
1090 @echo "--------------------------------------------------------------"
1091 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
1092 @echo "--------------------------------------------------------------"
1096 # installkernel, etc.
1098 # Install the kernel defined by INSTALLKERNEL
1100 installkernel installkernel.debug \
1101 reinstallkernel reinstallkernel.debug: _installcheck_kernel
1102 .if !defined(NO_INSTALLKERNEL)
1103 .if empty(INSTALLKERNEL)
1104 @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
1107 @echo "--------------------------------------------------------------"
1108 @echo ">>> Installing kernel ${INSTALLKERNEL}"
1109 @echo "--------------------------------------------------------------"
1110 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
1111 ${CROSSENV} PATH=${TMPPATH} \
1112 ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
1114 .if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS)
1115 .for _kernel in ${BUILDKERNELS:[2..-1]}
1116 @echo "--------------------------------------------------------------"
1117 @echo ">>> Installing kernel ${_kernel}"
1118 @echo "--------------------------------------------------------------"
1119 cd ${KRNLOBJDIR}/${_kernel}; \
1120 ${CROSSENV} PATH=${TMPPATH} \
1121 ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//}
1125 distributekernel distributekernel.debug:
1126 .if !defined(NO_INSTALLKERNEL)
1127 .if empty(INSTALLKERNEL)
1128 @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
1131 mkdir -p ${DESTDIR}/${DISTDIR}
1132 .if defined(NO_ROOT)
1133 echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.premeta
1135 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
1136 ${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.premeta/} \
1137 ${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \
1138 DESTDIR=${INSTALL_DDIR}/kernel \
1139 ${.TARGET:S/distributekernel/install/}
1140 .if defined(NO_ROOT)
1141 sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \
1142 ${DESTDIR}/${DISTDIR}/kernel.meta
1145 .if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS)
1146 .for _kernel in ${BUILDKERNELS:[2..-1]}
1147 .if defined(NO_ROOT)
1148 echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta
1150 cd ${KRNLOBJDIR}/${_kernel}; \
1151 ${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.${_kernel}.premeta/} \
1152 ${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} \
1153 KERNEL=${INSTKERNNAME}.${_kernel} \
1154 DESTDIR=${INSTALL_DDIR}/kernel.${_kernel} \
1155 ${.TARGET:S/distributekernel/install/}
1156 .if defined(NO_ROOT)
1157 sed -e 's|^./kernel|.|' \
1158 ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta > \
1159 ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta
1165 .if defined(NO_ROOT)
1166 .if !defined(NO_INSTALLKERNEL)
1167 cd ${DESTDIR}/${DISTDIR}/kernel; \
1168 tar cvf - --exclude '*.debug' \
1169 @${DESTDIR}/${DISTDIR}/kernel.meta | \
1170 ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz
1172 cd ${DESTDIR}/${DISTDIR}/kernel; \
1173 tar cvf - --include '*/*/*.debug' \
1174 @${DESTDIR}/${DISTDIR}/kernel.meta | \
1175 ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz
1176 .if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS)
1177 .for _kernel in ${BUILDKERNELS:[2..-1]}
1178 cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
1179 tar cvf - --exclude '*.debug' \
1180 @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \
1181 ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz
1182 cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
1183 tar cvf - --include '*/*/*.debug' \
1184 @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \
1185 ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz
1189 .if !defined(NO_INSTALLKERNEL)
1190 cd ${DESTDIR}/${DISTDIR}/kernel; \
1191 tar cvf - --exclude '*.debug' . | \
1192 ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz
1194 cd ${DESTDIR}/${DISTDIR}/kernel; \
1195 tar cvf - --include '*/*/*.debug' $$(eval find .) | \
1196 ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz
1197 .if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS)
1198 .for _kernel in ${BUILDKERNELS:[2..-1]}
1199 cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
1200 tar cvf - --exclude '*.debug' . | \
1201 ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz
1202 cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
1203 tar cvf - --include '*/*/*.debug' $$(eval find .) | \
1204 ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz
1213 # Run test suite on installed world.
1216 @if [ ! -x ${LOCALBASE}/bin/kyua ]; then \
1217 echo "You need kyua (devel/kyua) to run the test suite." | /usr/bin/fmt; \
1220 ${_+_}${LOCALBASE}/bin/kyua test -k ${TESTSBASE}/Kyuafile
1226 # Build the API documentation with doxygen
1229 @if [ ! -x ${LOCALBASE}/bin/doxygen ]; then \
1230 echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \
1233 ${_+_}cd ${.CURDIR}/tools/kerneldoc/subsys; ${MAKE} obj all
1238 # Update the source tree(s), by running svn/svnup to update to the
1242 .if (defined(CVS_UPDATE) || defined(SUP_UPDATE)) && !defined(SVN_UPDATE)
1243 @echo "--------------------------------------------------------------"
1244 @echo "CVS_UPDATE and SUP_UPDATE are no longer supported."
1245 @echo "Please see: https://wiki.freebsd.org/CvsIsDeprecated"
1246 @echo "--------------------------------------------------------------"
1249 .if defined(SVN_UPDATE)
1250 @echo "--------------------------------------------------------------"
1251 @echo ">>> Updating ${.CURDIR} using Subversion"
1252 @echo "--------------------------------------------------------------"
1253 @(cd ${.CURDIR}; ${SVN} update ${SVNFLAGS})
1257 # ------------------------------------------------------------------------
1259 # From here onwards are utility targets used by the 'make world' and
1260 # related targets. If your 'world' breaks, you may like to try to fix
1261 # the problem and manually run the following targets to attempt to
1262 # complete the build. Beware, this is *not* guaranteed to work, you
1263 # need to have a pretty good grip on the current state of the system
1264 # to attempt to manually finish it. If in doubt, 'make world' again.
1268 # legacy: Build compatibility shims for the next three targets. This is a
1269 # minimal set of tools and shims necessary to compensate for older systems
1270 # which don't have the APIs required by the targets built in bootstrap-tools,
1271 # build-tools or cross-tools.
1274 # ELF Tool Chain libraries are needed for ELF tools and dtrace tools.
1275 # r296685 fix cross-endian objcopy
1276 .if ${BOOTSTRAPPING} < 1100102
1277 _elftoolchain_libs= lib/libelf lib/libdwarf
1281 .if ${BOOTSTRAPPING} < 800107 && ${BOOTSTRAPPING} != 0
1282 @echo "ERROR: Source upgrades from versions prior to 8.0 are not supported."; \
1285 .for _tool in tools/build ${_elftoolchain_libs}
1286 ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \
1287 cd ${.CURDIR}/${_tool}; \
1288 ${MAKE} DIRPRFX=${_tool}/ obj; \
1289 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \
1290 if [ -z "${NO_DEPEND}" ]; then ${MAKE} DIRPRFX=${_tool}/ depend; fi; \
1291 ${MAKE} DIRPRFX=${_tool}/ all; \
1292 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
1296 # bootstrap-tools: Build tools needed for compatibility. These are binaries that
1297 # are built to build other binaries in the system. However, the focus of these
1298 # binaries is usually quite narrow. Bootstrap tools use the host's compiler and
1299 # libraries, augmented by -legacy.
1301 _bt= _bootstrap-tools
1303 .if ${MK_GAMES} != "no"
1304 _strfile= usr.bin/fortune/strfile
1307 .if ${MK_GCC} != "no" && ${MK_CXX} != "no"
1308 _gperf= gnu/usr.bin/gperf
1311 .if ${MK_GROFF} != "no"
1312 _groff= gnu/usr.bin/groff \
1316 .if ${MK_VT} != "no"
1317 _vtfontcvt= usr.bin/vtfontcvt
1320 .if ${BOOTSTRAPPING} < 900002
1324 .if ${BOOTSTRAPPING} < 1000033
1325 _libopenbsd= lib/libopenbsd
1329 ${_bt}-usr.bin/m4: ${_bt}-lib/libopenbsd
1330 ${_bt}-usr.bin/lex: ${_bt}-usr.bin/m4
1333 .if ${BOOTSTRAPPING} < 1000026
1334 _nmtree= lib/libnetbsd \
1337 ${_bt}-usr.sbin/nmtree: ${_bt}-lib/libnetbsd
1340 .if ${BOOTSTRAPPING} < 1000027
1344 # r264059 support for status=
1345 .if ${BOOTSTRAPPING} < 1100017
1349 # r277259 crunchide: Correct 64-bit section header offset
1350 # r281674 crunchide: always include both 32- and 64-bit ELF support
1351 # r285986 crunchen: use STRIPBIN rather than STRIP
1352 .if ${BOOTSTRAPPING} < 1100078
1353 _crunch= usr.sbin/crunch
1356 .if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041
1363 ${_bt}-usr.bin/yacc: ${_bt}-lib/liby
1365 .if ${MK_BSNMP} != "no"
1366 _gensnmptree= usr.sbin/bsnmpd/gensnmptree
1369 # We need to build tblgen when we're building clang either as
1370 # the bootstrap compiler, or as the part of the normal build.
1371 .if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no"
1373 lib/clang/libllvmsupport \
1374 lib/clang/libllvmtablegen \
1375 usr.bin/clang/llvm-tblgen \
1376 usr.bin/clang/clang-tblgen
1378 ${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/libllvmtablegen ${_bt}-lib/clang/libllvmsupport
1379 ${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-lib/clang/libllvmtablegen ${_bt}-lib/clang/libllvmsupport
1382 # Default to building the GPL DTC, but build the BSDL one if users explicitly
1385 .if ${MK_GPL_DTC} != "no"
1386 _dtc= gnu/usr.bin/dtc
1389 .if ${MK_KERBEROS} != "no"
1390 _kerberos5_bootstrap_tools= \
1391 kerberos5/tools/make-roken \
1392 kerberos5/lib/libroken \
1393 kerberos5/lib/libvers \
1394 kerberos5/tools/asn1_compile \
1395 kerberos5/tools/slc \
1398 .ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g}
1401 # r283777 makewhatis(1) replaced with mandoc version which builds a database.
1402 .if ${MK_MANDOCDB} != "no" && ${BOOTSTRAPPING} < 1100075
1403 _libopenbsd?= lib/libopenbsd
1404 _makewhatis= lib/libsqlite3 \
1406 ${_bt}-usr.bin/mandoc: ${_bt}-lib/libopenbsd ${_bt}-lib/libsqlite3
1409 bootstrap-tools: .PHONY
1411 # Please document (add comment) why something is in 'bootstrap-tools'.
1412 # Try to bound the building of the bootstrap-tool to just the
1413 # FreeBSD versions that need the tool built at this stage of the build.
1416 ${_kerberos5_bootstrap_tools} \
1439 ${_bt}-${_tool}: .PHONY .MAKE
1440 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
1441 cd ${.CURDIR}/${_tool}; \
1442 ${MAKE} DIRPRFX=${_tool}/ obj; \
1443 if [ -z "${NO_DEPEND}" ]; then ${MAKE} DIRPRFX=${_tool}/ depend; fi; \
1444 ${MAKE} DIRPRFX=${_tool}/ all; \
1445 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
1447 bootstrap-tools: ${_bt}-${_tool}
1451 # build-tools: Build special purpose build tools
1453 .if !defined(NO_SHARE)
1454 _share= share/syscons/scrnmaps
1457 .if ${MK_GCC} != "no"
1458 _gcc_tools= gnu/usr.bin/cc/cc_tools
1461 .if ${MK_RESCUE} != "no"
1462 # rescue includes programs that have build-tools targets
1463 _rescue=rescue/rescue
1469 ${LOCAL_TOOL_DIRS} \
1470 lib/ncurses/ncurses \
1471 lib/ncurses/ncursesw \
1476 usr.bin/mkesdb_static \
1477 usr.bin/mkcsmapper_static \
1479 build-tools_${_tool}: .PHONY
1480 ${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \
1481 cd ${.CURDIR}/${_tool}; \
1482 ${MAKE} DIRPRFX=${_tool}/ obj; \
1483 ${MAKE} DIRPRFX=${_tool}/ build-tools
1484 build-tools: build-tools_${_tool}
1488 build-tools_${_tool}: .PHONY
1489 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \
1490 cd ${.CURDIR}/${_tool}; \
1491 ${MAKE} DIRPRFX=${_tool}/ obj; \
1492 if [ -z "${NO_DEPEND}" ]; then ${MAKE} DIRPRFX=${_tool}/ depend; fi; \
1493 ${MAKE} DIRPRFX=${_tool}/ all
1494 build-tools: build-tools_${_tool}
1498 # kernel-tools: Build kernel-building tools
1501 mkdir -p ${MAKEOBJDIRPREFIX}/usr
1502 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
1503 -p ${MAKEOBJDIRPREFIX}/usr >/dev/null
1506 # cross-tools: All the tools needed to build the rest of the system after
1507 # we get done with the earlier stages. It is the last set of tools needed
1508 # to begin building the target binaries.
1510 .if ${TARGET_ARCH} != ${MACHINE_ARCH}
1511 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
1512 _btxld= usr.sbin/btxld
1516 # Rebuild ctfconvert and ctfmerge to avoid difficult-to-diagnose failures
1517 # resulting from missing bug fixes or ELF Toolchain updates.
1518 .if ${MK_CDDL} != "no"
1519 _dtrace_tools= cddl/lib/libctf cddl/usr.bin/ctfconvert \
1520 cddl/usr.bin/ctfmerge
1523 # If we're given an XAS, don't build binutils.
1524 .if ${XAS:M/*} == ""
1525 .if ${MK_BINUTILS_BOOTSTRAP} != "no"
1526 _binutils= gnu/usr.bin/binutils
1528 .if ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no"
1529 _elftctools= lib/libelftc \
1535 # These are not required by the build, but can be useful for developers who
1536 # cross-build on a FreeBSD 10 host:
1537 _elftctools+= usr.bin/addr2line
1539 .elif ${TARGET_ARCH} != ${MACHINE_ARCH} && ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no"
1540 # If cross-building with an external binutils we still need to build strip for
1541 # the target (for at least crunchide).
1542 _elftctools= lib/libelftc \
1547 # If an full path to an external cross compiler is given, don't build
1549 .if ${XCC:N${CCACHE_BIN}:M/*} == "" && ${MK_CROSS_COMPILER} != "no"
1550 .if ${MK_CLANG_BOOTSTRAP} != "no"
1551 _clang= usr.bin/clang
1552 _clang_libs= lib/clang
1554 .if ${MK_GCC_BOOTSTRAP} != "no"
1558 .if ${MK_USB} != "no"
1559 _usb_tools= sys/boot/usb/tools
1562 cross-tools: .MAKE .PHONY
1573 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
1574 cd ${.CURDIR}/${_tool}; \
1575 ${MAKE} DIRPRFX=${_tool}/ obj; \
1576 if [ -z "${NO_DEPEND}" ]; then ${MAKE} DIRPRFX=${_tool}/ depend; fi; \
1577 ${MAKE} DIRPRFX=${_tool}/ all; \
1578 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
1581 NXBDESTDIR= ${OBJTREE}/nxb-bin
1582 NXBENV= MAKEOBJDIRPREFIX=${OBJTREE}/nxb \
1583 INSTALL="sh ${.CURDIR}/tools/install.sh" \
1584 PATH=${PATH}:${OBJTREE}/gperf_for_gcc/usr/bin
1585 NXBMAKE= ${NXBENV} ${MAKE} \
1586 LLVM_TBLGEN=${NXBDESTDIR}/usr/bin/llvm-tblgen \
1587 CLANG_TBLGEN=${NXBDESTDIR}/usr/bin/clang-tblgen \
1588 MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH} \
1589 MK_GDB=no MK_TESTS=no \
1591 MK_HTML=no NO_LINT=yes MK_MAN=no \
1592 -DNO_PIC MK_PROFILE=no -DNO_SHARED \
1593 -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
1594 MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
1595 MK_LLDB=no MK_DEBUG_FILES=no
1597 # native-xtools is the current target for qemu-user cross builds of ports
1598 # via poudriere and the imgact_binmisc kernel module.
1599 # For non-clang enabled targets that are still using the in tree gcc
1600 # we must build a gperf binary for one instance of its Makefiles. On
1601 # clang-enabled systems, the gperf binary is obsolete.
1602 native-xtools: .PHONY
1603 .if ${MK_GCC_BOOTSTRAP} != "no"
1604 mkdir -p ${OBJTREE}/gperf_for_gcc/usr/bin
1605 ${_+_}@${ECHODIR} "===> ${_gperf} (obj,depend,all,install)"; \
1606 cd ${.CURDIR}/${_gperf}; \
1607 ${NXBMAKE} DIRPRFX=${_gperf}/ obj; \
1608 if [ -z "${NO_DEPEND}" ]; then ${NXBMAKE} DIRPRFX=${_gperf}/ depend; fi; \
1609 ${NXBMAKE} DIRPRFX=${_gperf}/ all; \
1610 ${NXBMAKE} DIRPRFX=${_gperf}/ DESTDIR=${OBJTREE}/gperf_for_gcc install
1612 mkdir -p ${NXBDESTDIR}/bin ${NXBDESTDIR}/sbin ${NXBDESTDIR}/usr
1613 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
1614 -p ${NXBDESTDIR}/usr >/dev/null
1615 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
1616 -p ${NXBDESTDIR}/usr/include >/dev/null
1617 .if ${MK_DEBUG_FILES} != "no"
1618 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
1619 -p ${NXBDESTDIR}/usr/lib >/dev/null
1680 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
1681 cd ${.CURDIR}/${_tool}; \
1682 ${NXBMAKE} DIRPRFX=${_tool}/ obj; \
1683 if [ -z "${NO_DEPEND}" ]; then ${NXBMAKE} DIRPRFX=${_tool}/ depend; fi; \
1684 ${NXBMAKE} DIRPRFX=${_tool}/ all; \
1685 ${NXBMAKE} DIRPRFX=${_tool}/ DESTDIR=${NXBDESTDIR} install
1689 # hierarchy - ensure that all the needed directories are present
1691 hierarchy hier: .MAKE .PHONY
1692 ${_+_}cd ${.CURDIR}/etc; ${HMAKE} distrib-dirs
1695 # libraries - build all libraries, and install them under ${DESTDIR}.
1697 # The list of libraries with dependents (${_prebuild_libs}) and their
1698 # interdependencies (__L) are built automatically by the
1699 # ${.CURDIR}/tools/make_libdeps.sh script.
1701 libraries: .MAKE .PHONY
1702 ${_+_}cd ${.CURDIR}; \
1703 ${MAKE} -f Makefile.inc1 _prereq_libs; \
1704 ${MAKE} -f Makefile.inc1 _startup_libs; \
1705 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
1706 ${MAKE} -f Makefile.inc1 _generic_libs
1709 # static libgcc.a prerequisite for shared libc
1711 _prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc lib/libcompiler_rt
1713 # These dependencies are not automatically generated:
1715 # gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before
1716 # all shared libraries for ELF.
1718 _startup_libs= gnu/lib/csu
1719 _startup_libs+= lib/csu
1720 _startup_libs+= gnu/lib/libgcc
1721 _startup_libs+= lib/libcompiler_rt
1722 _startup_libs+= lib/libc
1723 _startup_libs+= lib/libc_nonshared
1724 .if ${MK_LIBCPLUSPLUS} != "no"
1725 _startup_libs+= lib/libcxxrt
1728 gnu/lib/libgcc__L: lib/libc__L
1729 gnu/lib/libgcc__L: lib/libc_nonshared__L
1730 .if ${MK_LIBCPLUSPLUS} != "no"
1731 lib/libcxxrt__L: gnu/lib/libgcc__L
1734 _prebuild_libs= ${_kerberos5_lib_libasn1} \
1735 ${_kerberos5_lib_libhdb} \
1736 ${_kerberos5_lib_libheimbase} \
1737 ${_kerberos5_lib_libheimntlm} \
1739 ${_kerberos5_lib_libheimipcc} \
1740 ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \
1741 ${_kerberos5_lib_libroken} \
1742 ${_kerberos5_lib_libwind} \
1743 lib/libbz2 ${_libcom_err} lib/libcrypt \
1744 lib/libelf lib/libexpat \
1747 lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \
1749 lib/ncurses/ncurses lib/ncurses/ncursesw \
1750 lib/libopie lib/libpam ${_lib_libthr} \
1751 ${_lib_libradius} lib/libsbuf lib/libtacplus \
1753 ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \
1754 ${_cddl_lib_libuutil} \
1755 ${_cddl_lib_libavl} \
1756 ${_cddl_lib_libzfs_core} \
1757 ${_cddl_lib_libctf} \
1758 lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \
1759 ${_secure_lib_libcrypto} ${_lib_libldns} \
1760 ${_secure_lib_libssh} ${_secure_lib_libssl} \
1762 .if ${MK_GNUCXX} != "no"
1763 _prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++
1764 gnu/lib/libstdc++__L: lib/msun__L
1765 gnu/lib/libsupc++__L: gnu/lib/libstdc++__L
1768 .if ${MK_LIBCPLUSPLUS} != "no"
1769 _prebuild_libs+= lib/libc++
1772 lib/libgeom__L: lib/libexpat__L
1773 lib/libkvm__L: lib/libelf__L
1775 .if ${MK_LIBTHR} != "no"
1776 _lib_libthr= lib/libthr
1779 .if ${MK_RADIUS_SUPPORT} != "no"
1780 _lib_libradius= lib/libradius
1783 .if ${MK_OFED} != "no"
1784 _ofed_lib= contrib/ofed/usr.lib
1785 _prebuild_libs+= contrib/ofed/usr.lib/libosmcomp
1786 _prebuild_libs+= contrib/ofed/usr.lib/libopensm
1787 _prebuild_libs+= contrib/ofed/usr.lib/libibcommon
1788 _prebuild_libs+= contrib/ofed/usr.lib/libibverbs
1789 _prebuild_libs+= contrib/ofed/usr.lib/libibumad
1791 contrib/ofed/usr.lib/libopensm__L: lib/libthr__L
1792 contrib/ofed/usr.lib/libosmcomp__L: lib/libthr__L
1793 contrib/ofed/usr.lib/libibumad__L: contrib/ofed/usr.lib/libibcommon__L
1796 .if ${MK_CASPER} != "no"
1797 _lib_casper= lib/libcasper
1800 lib/libpjdlog__L: lib/libutil__L
1801 lib/libcasper__L: lib/libnv__L
1802 lib/liblzma__L: lib/libthr__L
1804 _generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib}
1805 .for _DIR in ${LOCAL_LIB_DIRS}
1806 .if exists(${.CURDIR}/${_DIR}/Makefile) && empty(_generic_libs:M${_DIR})
1807 _generic_libs+= ${_DIR}
1811 lib/libopie__L lib/libtacplus__L: lib/libmd__L
1813 .if ${MK_CDDL} != "no"
1814 _cddl_lib_libumem= cddl/lib/libumem
1815 _cddl_lib_libnvpair= cddl/lib/libnvpair
1816 _cddl_lib_libavl= cddl/lib/libavl
1817 _cddl_lib_libuutil= cddl/lib/libuutil
1818 _cddl_lib_libzfs_core= cddl/lib/libzfs_core
1819 _cddl_lib_libctf= cddl/lib/libctf
1821 cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L
1822 cddl/lib/libzfs__L: lib/libgeom__L
1823 cddl/lib/libctf__L: lib/libz__L
1825 # cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built
1826 # on select architectures though (see cddl/lib/Makefile)
1827 .if ${MACHINE_CPUARCH} != "sparc64"
1828 _prebuild_libs+= lib/libproc lib/librtld_db
1831 .if ${MK_CRYPT} != "no"
1832 .if ${MK_OPENSSL} != "no"
1833 _secure_lib_libcrypto= secure/lib/libcrypto
1834 _secure_lib_libssl= secure/lib/libssl
1835 lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L
1836 .if ${MK_LDNS} != "no"
1837 _lib_libldns= lib/libldns
1838 lib/libldns__L: secure/lib/libcrypto__L
1840 .if ${MK_OPENSSH} != "no"
1841 _secure_lib_libssh= secure/lib/libssh
1842 secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L
1843 .if ${MK_LDNS} != "no"
1844 secure/lib/libssh__L: lib/libldns__L
1846 .if ${MK_KERBEROS_SUPPORT} != "no"
1847 secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \
1848 kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \
1849 lib/libmd__L kerberos5/lib/libroken__L
1853 _secure_lib= secure/lib
1856 .if ${MK_KERBEROS} != "no"
1857 kerberos5/lib/libasn1__L: lib/libcom_err__L kerberos5/lib/libroken__L
1858 kerberos5/lib/libhdb__L: kerberos5/lib/libasn1__L lib/libcom_err__L \
1859 kerberos5/lib/libkrb5__L kerberos5/lib/libroken__L \
1860 kerberos5/lib/libwind__L lib/libsqlite3__L
1861 kerberos5/lib/libheimntlm__L: secure/lib/libcrypto__L kerberos5/lib/libkrb5__L \
1862 kerberos5/lib/libroken__L lib/libcom_err__L
1863 kerberos5/lib/libhx509__L: kerberos5/lib/libasn1__L lib/libcom_err__L \
1864 secure/lib/libcrypto__L kerberos5/lib/libroken__L kerberos5/lib/libwind__L
1865 kerberos5/lib/libkrb5__L: kerberos5/lib/libasn1__L lib/libcom_err__L \
1866 lib/libcrypt__L secure/lib/libcrypto__L kerberos5/lib/libhx509__L \
1867 kerberos5/lib/libroken__L kerberos5/lib/libwind__L \
1868 kerberos5/lib/libheimbase__L kerberos5/lib/libheimipcc__L
1869 kerberos5/lib/libroken__L: lib/libcrypt__L
1870 kerberos5/lib/libwind__L: kerberos5/lib/libroken__L lib/libcom_err__L
1871 kerberos5/lib/libheimbase__L: lib/libthr__L
1872 kerberos5/lib/libheimipcc__L: kerberos5/lib/libroken__L kerberos5/lib/libheimbase__L lib/libthr__L
1875 lib/libsqlite3__L: lib/libthr__L
1877 .if ${MK_GSSAPI} != "no"
1878 _lib_libgssapi= lib/libgssapi
1881 .if ${MK_KERBEROS} != "no"
1882 _kerberos5_lib= kerberos5/lib
1883 _kerberos5_lib_libasn1= kerberos5/lib/libasn1
1884 _kerberos5_lib_libhdb= kerberos5/lib/libhdb
1885 _kerberos5_lib_libheimbase= kerberos5/lib/libheimbase
1886 _kerberos5_lib_libkrb5= kerberos5/lib/libkrb5
1887 _kerberos5_lib_libhx509= kerberos5/lib/libhx509
1888 _kerberos5_lib_libroken= kerberos5/lib/libroken
1889 _kerberos5_lib_libheimntlm= kerberos5/lib/libheimntlm
1890 _libsqlite3= lib/libsqlite3
1891 _kerberos5_lib_libheimipcc= kerberos5/lib/libheimipcc
1892 _kerberos5_lib_libwind= kerberos5/lib/libwind
1893 _libcom_err= lib/libcom_err
1896 .if ${MK_NIS} != "no"
1897 _lib_libypclnt= lib/libypclnt
1900 .if ${MK_OPENSSL} == "no"
1901 lib/libradius__L: lib/libmd__L
1905 ${_cddl_lib_libctf:D${_cddl_lib_libctf}__L} lib/libelf__L lib/librtld_db__L lib/libutil__L
1906 .if ${MK_CXX} != "no"
1907 .if ${MK_LIBCPLUSPLUS} != "no"
1908 lib/libproc__L: lib/libcxxrt__L
1909 .else # This implies MK_GNUCXX != "no"; see lib/libproc
1910 lib/libproc__L: gnu/lib/libsupc++__L
1914 gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L
1916 .for _lib in ${_prereq_libs}
1917 ${_lib}__PL: .PHONY .MAKE
1918 .if exists(${.CURDIR}/${_lib})
1919 ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
1920 cd ${.CURDIR}/${_lib}; \
1921 ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \
1922 if [ -z "${NO_DEPEND}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend; fi; \
1923 ${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \
1924 DIRPRFX=${_lib}/ all; \
1925 ${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \
1926 DIRPRFX=${_lib}/ install
1930 .for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
1931 ${_lib}__L: .PHONY .MAKE
1932 .if exists(${.CURDIR}/${_lib})
1933 ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
1934 cd ${.CURDIR}/${_lib}; \
1935 ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \
1936 if [ -z "${NO_DEPEND}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend; fi; \
1937 ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ all; \
1938 ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ install
1942 # libpam is special: we need to build static PAM modules before
1943 # static PAM library, and dynamic PAM library before dynamic PAM
1945 lib/libpam__L: .PHONY .MAKE
1946 ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \
1947 cd ${.CURDIR}/lib/libpam; \
1948 ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ obj; \
1949 if [ -z "${NO_DEPEND}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ depend; fi; \
1950 ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \
1951 -D_NO_LIBPAM_SO_YET all; \
1952 ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \
1953 -D_NO_LIBPAM_SO_YET install
1955 _prereq_libs: ${_prereq_libs:S/$/__PL/}
1956 _startup_libs: ${_startup_libs:S/$/__L/}
1957 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
1958 _generic_libs: ${_generic_libs:S/$/__L/}
1960 # Enable SUBDIR_PARALLEL when not calling 'make all', unless called from
1961 # 'everything' with _PARALLEL_SUBDIR_OK set. This is because it is unlikely
1962 # that running 'make all' from the top-level, especially with a SUBDIR_OVERRIDE
1963 # or LOCAL_DIRS set, will have a reliable build if SUBDIRs are built in
1964 # parallel. This is safe for the world stage of buildworld though since it has
1965 # already built libraries in a proper order and installed includes into
1966 # WORLDTMP. Special handling is done for SUBDIR ordering for 'install*' to
1967 # avoid trashing a system if it crashes mid-install.
1968 .if !make(all) || defined(_PARALLEL_SUBDIR_OK)
1972 .include <bsd.subdir.mk>
1974 .if make(check-old) || make(check-old-dirs) || \
1975 make(check-old-files) || make(check-old-libs) || \
1976 make(delete-old) || make(delete-old-dirs) || \
1977 make(delete-old-files) || make(delete-old-libs)
1980 # check for / delete old files section
1983 .include "ObsoleteFiles.inc"
1985 OLD_LIBS_MESSAGE="Please be sure no application still uses those libraries, \
1986 else you can not start such an application. Consult UPDATING for more \
1987 information regarding how to cope with the removal/revision bump of a \
1990 .if !defined(BATCH_DELETE_OLD_FILES)
1997 @echo ">>> Removing old files (only deletes safe to delete libs)"
1998 # Ask for every old file if the user really wants to remove it.
1999 # It's annoying, but better safe than sorry.
2000 # NB: We cannot pass the list of OLD_FILES as a parameter because the
2001 # argument list will get too long. Using .for/.endfor make "loops" will make
2002 # the Makefile parser segfault.
2005 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
2006 -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \
2007 while read file; do \
2008 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
2009 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
2010 rm ${RM_I} "${DESTDIR}/$${file}" <&3; \
2012 for ext in debug symbols; do \
2013 if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \
2014 "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
2015 rm ${RM_I} "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" \
2020 # Remove catpages without corresponding manpages.
2022 find ${DESTDIR}/usr/share/man/cat* ! -type d | \
2023 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
2024 while read catpage; do \
2026 if [ ! -e "$${manpage}" ]; then \
2027 rm ${RM_I} $${catpage} <&3; \
2030 @echo ">>> Old files removed"
2033 @echo ">>> Checking for old files"
2035 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
2036 -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \
2037 while read file; do \
2038 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
2039 echo "${DESTDIR}/$${file}"; \
2041 for ext in debug symbols; do \
2042 if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
2043 echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \
2047 # Check for catpages without corresponding manpages.
2048 @find ${DESTDIR}/usr/share/man/cat* ! -type d | \
2049 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
2050 while read catpage; do \
2052 if [ ! -e "$${manpage}" ]; then \
2058 @echo ">>> Removing old libraries"
2059 @echo "${OLD_LIBS_MESSAGE}" | fmt
2062 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
2063 -V OLD_LIBS | xargs -n1 | \
2064 while read file; do \
2065 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
2066 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
2067 rm ${RM_I} "${DESTDIR}/$${file}" <&3; \
2069 for ext in debug symbols; do \
2070 if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \
2071 "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
2072 rm ${RM_I} "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" \
2077 @echo ">>> Old libraries removed"
2080 @echo ">>> Checking for old libraries"
2082 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
2083 -V OLD_LIBS | xargs -n1 | \
2084 while read file; do \
2085 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
2086 echo "${DESTDIR}/$${file}"; \
2088 for ext in debug symbols; do \
2089 if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
2090 echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \
2096 @echo ">>> Removing old directories"
2098 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
2099 -V OLD_DIRS | xargs -n1 | sort -r | \
2100 while read dir; do \
2101 if [ -d "${DESTDIR}/$${dir}" ]; then \
2102 rmdir -v "${DESTDIR}/$${dir}" || true; \
2103 elif [ -L "${DESTDIR}/$${dir}" ]; then \
2104 echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
2107 @echo ">>> Old directories removed"
2110 @echo ">>> Checking for old directories"
2112 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
2113 -V OLD_DIRS | xargs -n1 | \
2114 while read dir; do \
2115 if [ -d "${DESTDIR}/$${dir}" ]; then \
2116 echo "${DESTDIR}/$${dir}"; \
2117 elif [ -L "${DESTDIR}/$${dir}" ]; then \
2118 echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
2122 delete-old: delete-old-files delete-old-dirs
2123 @echo "To remove old libraries run '${MAKE} delete-old-libs'."
2125 check-old: check-old-files check-old-libs check-old-dirs
2126 @echo "To remove old files and directories run '${MAKE} delete-old'."
2127 @echo "To remove old libraries run '${MAKE} delete-old-libs'."
2132 # showconfig - show build configuration.
2135 @(${MAKE} -n -f ${.CURDIR}/sys/conf/kern.opts.mk -V dummy -dg1; \
2136 ${MAKE} -n -f ${.CURDIR}/share/mk/src.opts.mk -V dummy -dg1) 2>&1 | grep ^MK_ | sort -u
2138 .if !empty(KRNLOBJDIR) && !empty(KERNCONF)
2139 DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/
2141 .if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE)
2142 .if exists(${KERNCONFDIR}/${KERNCONF})
2143 FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ {print $$2}' \
2144 '${KERNCONFDIR}/${KERNCONF}' ; echo
2150 .if !defined(DTBOUTPUTPATH) || !exists(${DTBOUTPUTPATH})
2151 DTBOUTPUTPATH= ${.CURDIR}
2155 # Build 'standalone' Device Tree Blob
2158 @PATH=${TMPPATH} MACHINE=${TARGET} \
2159 ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \
2160 "${FDT_DTS_FILE}" ${DTBOUTPUTPATH}
2165 # In the following, the first 'rm' in a series will usually remove all
2166 # files and directories. If it does not, then there are probably some
2167 # files with file flags set, so this unsets them and tries the 'rm' a
2168 # second time. There are situations where this target will be cleaning
2169 # some directories via more than one method, but that duplication is
2170 # needed to correctly handle all the possible situations. Removing all
2171 # files without file flags set in the first 'rm' instance saves time,
2172 # because 'chflags' will need to operate on fewer files afterwards.
2174 # It is expected that BW_CANONICALOBJDIR == the CANONICALOBJDIR as would be
2175 # created by bsd.obj.mk, except that we don't want to .include that file
2178 BW_CANONICALOBJDIR:=${OBJTREE}${.CURDIR}
2180 .if exists(${BW_CANONICALOBJDIR}/)
2181 -rm -rf ${BW_CANONICALOBJDIR}/*
2182 -chflags -R 0 ${BW_CANONICALOBJDIR}
2183 rm -rf ${BW_CANONICALOBJDIR}/*
2185 .if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR}
2186 # To be safe in this case, fall back to a 'make cleandir'
2187 ${_+_}@cd ${.CURDIR}; ${MAKE} cleandir
2190 .if defined(TARGET) && defined(TARGET_ARCH)
2192 .if ${TARGET} == ${MACHINE} && ${TARGET_ARCH} == ${MACHINE_ARCH}
2193 XDEV_CPUTYPE?=${CPUTYPE}
2195 XDEV_CPUTYPE?=${TARGET_CPUTYPE}
2198 NOFUN=-DNO_FSCHG MK_HTML=no -DNO_LINT \
2199 MK_MAN=no MK_NLS=no MK_PROFILE=no \
2200 MK_KERBEROS=no MK_RESCUE=no MK_TESTS=no MK_WARNS=no \
2201 TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
2202 CPUTYPE=${XDEV_CPUTYPE}
2204 XDDIR=${TARGET_ARCH}-freebsd
2207 .error XDTP variable should be an absolute path
2210 CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \
2211 INSTALL="sh ${.CURDIR}/tools/install.sh"
2213 TOOLS_PREFIX=${XDTP}
2214 CD2CFLAGS=-isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib \
2215 --sysroot=${XDDESTDIR}/ -B${XDDESTDIR}/usr/libexec \
2216 -B${XDDESTDIR}/usr/bin -B${XDDESTDIR}/usr/lib
2217 CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CFLAGS}" \
2218 CPP="${CPP} ${CD2CFLAGS}" \
2219 MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH}
2221 CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp
2222 CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN}
2223 CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} ${NOFUN}
2224 XDDESTDIR=${DESTDIR}/${XDTP}
2226 OSREL!= uname -r | sed -e 's/[-(].*//'
2229 .ORDER: xdev-build xdev-install xdev-links
2230 xdev: xdev-build xdev-install
2232 .ORDER: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools
2233 xdev-build: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools
2235 _xb-worldtmp: .PHONY
2236 mkdir -p ${CDTMP}/usr
2237 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
2238 -p ${CDTMP}/usr >/dev/null
2240 _xb-bootstrap-tools: .PHONY
2244 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
2245 cd ${.CURDIR}/${_tool}; \
2246 ${CDMAKE} DIRPRFX=${_tool}/ obj; \
2247 if [ -z "${NO_DEPEND}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ depend; fi; \
2248 ${CDMAKE} DIRPRFX=${_tool}/ all; \
2249 ${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install
2252 _xb-build-tools: .PHONY
2253 ${_+_}@cd ${.CURDIR}; \
2254 ${CDBENV} ${MAKE} -f Makefile.inc1 ${NOFUN} build-tools
2256 _xb-cross-tools: .PHONY
2264 ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \
2265 cd ${.CURDIR}/${_tool}; \
2266 ${CDMAKE} DIRPRFX=${_tool}/ obj; \
2267 if [ -z "${NO_DEPEND}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ depend; fi; \
2268 ${CDMAKE} DIRPRFX=${_tool}/ all
2272 ${_+_}@${ECHODIR} "mtree populating ${XDDESTDIR}"
2273 mkdir -p ${XDDESTDIR}
2274 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \
2275 -p ${XDDESTDIR} >/dev/null
2276 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
2277 -p ${XDDESTDIR}/usr >/dev/null
2278 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
2279 -p ${XDDESTDIR}/usr/include >/dev/null
2280 .if defined(LIBCOMPAT)
2281 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
2282 -p ${XDDESTDIR}/usr >/dev/null
2284 .if ${MK_TESTS} != "no"
2285 mkdir -p ${XDDESTDIR}${TESTSBASE}
2286 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
2287 -p ${XDDESTDIR}${TESTSBASE} >/dev/null
2290 .ORDER: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries
2291 xdev-install: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries
2293 _xi-cross-tools: .PHONY
2294 @echo "_xi-cross-tools"
2302 ${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \
2303 cd ${.CURDIR}/${_tool}; \
2304 ${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR}
2307 _xi-includes: .PHONY
2308 ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 includes \
2309 DESTDIR=${XDDESTDIR}
2311 _xi-libraries: .PHONY
2312 ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 libraries \
2313 DESTDIR=${XDDESTDIR}
2316 ${_+_}cd ${XDDESTDIR}/usr/bin; \
2317 mkdir -p ../../../../usr/bin; \
2319 ln -sf ../../${XDTP}/usr/bin/$$i \
2320 ../../../../usr/bin/${XDDIR}-$$i; \
2321 ln -sf ../../${XDTP}/usr/bin/$$i \
2322 ../../../../usr/bin/${XDDIR}${OSREL}-$$i; \
2325 xdev xdev-build xdev-install xdev-links:
2326 @echo "*** Error: Both TARGET and TARGET_ARCH must be defined for \"${.TARGET}\" target"