Lines Matching +full:qemu +full:- +full:4 +full:- +full:build
4 # -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
5 # -DNO_CLEAN do not clean at all
6 # -DDB_FROM_SRC use the user/group databases in src/etc instead of
8 # -DNO_SHARE do not go into share subdir
9 # -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,OBJ}
10 # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
11 # -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
12 # -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel
13 # -DNO_ROOT install without using root privilege
14 # -DWITHOUT_CTF do not run the DTrace CTF conversion tools on built objects
23 # bootstrap-tools target
24 # LOCAL_TOOL_DIRS="list of dirs" to add additional dirs to the build-tools
27 # cross-tools target
36 # SUBDIR_OVERRIDE="list of dirs" to build rather than everything.
37 # All libraries and includes, and some build tools will still build.
40 # The intended user-driven targets are:
41 # buildworld - rebuild *everything*, including glue to help do upgrades
42 # installworld- install everything built by "buildworld"
43 # checkworld - run test suite on installed world
44 # doxygen - build API documentation of the kernel
54 .if make(showconfig) || make(test-system-*)
94 # If a full path to an external cross compiler is given, don't build
98 # Make sure sub-makes see the option as disabled so the hack in bsd.sys.mk to
107 .-include "${OBJTOP}/toolchain-metadata.mk"
109 .error A build is required first. You may have the wrong MAKEOBJDIRPREFIX set.
144 MACHINE_TRIPLE?=${MACHINE_ARCH:S/amd64/x86_64/}-${MACHINE_TRIPLE_ABI}-freebsd${OS_REVISION}
146 TARGET_TRIPLE?= ${TARGET_ARCH:S/amd64/x86_64/}-${TARGET_TRIPLE_ABI}-freebsd${OS_REVISION}
192 .warning Trying build anyway.
194 .error Avoiding broken build. Define TRY_GCC_BROKEN to try anyway.
203 .warning Unsupported crossbuild system: ${.MAKE.OS}. Build will probably fail!
214 # for cross-builds.
236 # If a full path to an external linker is given, don't build lld.
248 # WITH_SYSTEM_COMPILER - Pull in needed values and make a decision.
259 !make(test-system-linker)
273 # It needs to be the same revision as we would build for the bootstrap.
275 # GCC cannot be used for cross-arch yet. For clang we pass -target later if
290 # WITH_SYSTEM_LD - Pull in needed values and make a decision.
301 !make(test-system-compiler)
330 # WITH_SYSTEM_COMPILER / WITH_SYSTEM_LINKER - Handle defaults and debug.
354 test-system-${_t}: .PHONY
356 ${_+_}@printf "%-35s= %s\n" "${v}" "${${v}}"
359 .if (make(buildworld) || make(buildkernel) || make(kernel-toolchain) || \
360 make(toolchain) || make(_cross-tools))
362 …EM_COMPILER: Determined that CC=${CC} matches the source tree. Not bootstrapping a cross-compiler.
364 .info SYSTEM_COMPILER: libclang will be built for bootstrapping a cross-compiler.
367 .info SYSTEM_LINKER: Determined that LD=${LD} matches the source tree. Not bootstrapping a cross-l…
369 .info SYSTEM_LINKER: libclang will be built for bootstrapping a cross-linker.
386 toolchain-metadata.mk: .PHONY .META
388 @echo ".info Using cached toolchain metadata from build at $$(hostname) on $$(date)" \
399 # We must do lib/ and libexec/ before bin/ in case of a mid-install error to
400 # keep the users system reasonably usable. For static->dynamic root upgrades,
405 # system here would require fine-grained ordering of all components based
463 # install/distribute so they build the whatis file after every manpage is
492 # If filemon is used then we can rely on the build being incremental-safe.
493 # The .meta files will also track the build command and rebuild should
556 # Set VERSION for CTFMERGE to use via the default CTFFLAGS=-L VERSION.
569 VERSION= FreeBSD ${_REVISION}-${_BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE}
584 EXTRA_REVISION= .${_BRANCH:C/ALPHA([0-9]+).*/\1/}.${_TIMENOW}
587 EXTRA_REVISION= .${_BRANCH:C/BETA([0-9]+).*/\1/}.${_TIMENOW}
590 EXTRA_REVISION= .rc${_BRANCH:C/RC([0-9]+).*/\1/}.${_TIMENOW}
591 .elif ${_BRANCH:M*-p*}
592 EXTRA_REVISION= p${_BRANCH:C/.*-p([0-9]+$)/\1/}
601 SOURCE_DATE_EPOCH!= ${GIT_CMD} -C ${SRCDIR} show -s --format=%ct HEAD
619 _CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} -f /dev/null \
620 -m ${.CURDIR}/share/mk MK_AUTO_OBJ=no -V CPUTYPE
626 BUILD_ARCH!= uname -p
627 # On some Linux systems uname -p returns "unknown" so skip this check there.
629 # MACHINE_ARCH so skipping it when crossbuilding on non-FreeBSD should be fine.
631 .error To cross-build, set TARGET_ARCH.
643 # the build to break on other systems that don't have that tool. For now we
647 # Currently strict $PATH can cause build failures. Once the remaining issues
651 # When building on non-FreeBSD we can't rely on the tools in /usr/bin being compatible
653 # during the world build stage. We build most tools during the bootstrap-tools
677 INSTALLTMP!= ${MKTEMP} -d -u -t install
688 INSTALLTMP_COPY_HOST_TOOL=ln -s
702 # shims that are needed by the bootstrap-tools,
703 # build-tools and cross-tools stages. These are generally
705 # build that aren't present on the host.
706 # 1. bootstrap-tools stage [BMAKE]
709 # are not built as cross-tools.
710 # 2. build-tools stage [TMAKE]
713 # the build process. Some programs are listed during
714 # this phase because they build binaries to generate
715 # files needed to build these programs. This stage also
716 # builds the 'build-tools' target rather than 'all'.
717 # 3. cross-tools stage [XMAKE]
719 # are needed for building the system. A cross-compiler is one
720 # of them. This differs from build tools in two ways:
721 # 1. the 'all' target is built rather than 'build-tools'
722 # 2. these tools are installed into TMPPATH for stage 4.
723 # 4. world stage [WMAKE]
740 # Don't rebuild build-tools targets during normal build.
753 # bootstrap-tools stage
758 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
759 # need to keep this in sync with targets/pseudo/bootstrap-tools/Makefile
761 OBJTOP='${WORLDTMP}/obj-tools' \
767 -DNO_CPU_CFLAGS \
768 -DNO_LINT \
769 -DNO_PIC \
770 -DNO_SHARED \
787 ${TIME_ENV} ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
793 # build-tools stage
795 ${TIME_ENV} ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
800 -DNO_CPU_CFLAGS \
801 -DNO_LINT \
814 # cross-tools stage
822 # kernel-tools stage
826 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
830 ${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
832 OBJTOP='${WORLDTMP}/obj-kernel-tools' \
837 -DNO_CPU_CFLAGS \
838 -DNO_LINT \
839 -DNO_PIC \
840 -DNO_SHARED \
850 INSTALL="${INSTALL_CMD} -U" \
857 HMAKE+= PATH=${TMPPATH:Q} METALOG=${METALOG} -DNO_ROOT
868 # In the case of xdev-build tools, CROSS_BINUTILS_PREFIX won't be a
871 BFLAGS+= -B${CROSS_BINUTILS_PREFIX}
877 # always pass an explicit --sysroot and -target.
878 # - External compiler needs sysroot and target flags.
879 # - External ld needs sysroot.
880 # - To be clear about the use of a sysroot when using the internal compiler.
881 # - Easier debugging.
882 # - Allowing WITH_SYSTEM_COMPILER+WITH_META_MODE to work together due to
883 # the flip-flopping build command when sometimes using external and
885 # - Allow using lld which has no support for default paths.
887 BFLAGS+= -B${WORLDTMP}/usr/bin
893 XCFLAGS+= -target ${TARGET_TRIPLE}
895 XCFLAGS+= --sysroot=${WORLDTMP}
909 # META_MODE normally ignores host file changes since every build updates
916 # r318736 - ino64 major ABI breakage
920 .if exists(${OBJTOP}/host-osreldate.h)
923 ${OBJTOP}/host-osreldate.h
932 # is older than the ABI-breakage OSRELDATE of the HOST then we rebuild.
954 host-osreldate.h: # DO NOT ADD /usr/include/osreldate.h here
956 @cp -f /usr/include/osreldate.h ${.TARGET}
963 WMAKE= ${TIME_ENV} ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
968 IMAKE= ${TIME_ENV} ${IMAKEENV} ${MAKE} -f Makefile.inc1 \
970 .if empty(.MAKEFLAGS:M-n)
980 # the build host to affect the contents of the distribution.
981 .if make(distributeworld) || make(distrib-dirs) || make(distribution) || \
987 INSTALLFLAGS+= -N ${.CURDIR}/etc
988 MTREEFLAGS+= -N ${.CURDIR}/etc
995 IMAKE+= -DNO_ROOT METALOG=${METALOG}
996 METALOG_INSTALLFLAGS= -U -M ${METALOG} -D ${INSTALL_DDIR}
999 MTREEFLAGS+= -W
1002 INSTALLFLAGS+= -h sha256
1021 CERTCTLFLAGS+= -d /base
1025 CERTCTLFLAGS+= -D "${CERTCTLDESTDIR}"
1027 DESTDIR_MTREEFLAGS= -deU
1029 # so we also pass -W
1030 WORLDTMP_MTREEFLAGS= -deUW
1032 # When building with -DNO_ROOT we shouldn't be changing the directories
1034 DESTDIR_MTREEFLAGS+= -W
1037 DISTR_MTREEFLAGS= -N ${.CURDIR}/etc
1047 METALOG_SORT_CMD= env -i LC_COLLATE=C sort
1061 # The m4 build of sendmail files doesn't like it if ',' is used
1068 # Using ':' leaks into PATH and breaks finding cross-tools.
1077 # replacing generated files. Handle these cases here in an ad-hoc fashion.
1082 sh ${.CURDIR}/tools/build/depend-cleanup.sh ${OBJTOP}
1087 @echo "--------------------------------------------------------------"
1088 @echo ">>> Cleaning up the temporary build tree"
1089 @echo "--------------------------------------------------------------"
1090 rm -rf ${WORLDTMP}
1092 # Note: for delete-old we need to set $PATH to also include the host $PATH
1093 # since otherwise a partial build with missing symlinks in ${WORLDTMP}/legacy/
1096 ${_+_}@if [ -e "${WORLDTMP}" ]; then \
1097 echo ">>> Deleting stale files in build tree..."; \
1099 _NO_INCLUDE_COMPILERMK=t -DBATCH_DELETE_OLD_FILES delete-old \
1100 delete-old-libs >/dev/null; \
1102 rm -rf ${WORLDTMP}/legacy/usr/include
1105 if [ -x ${WORLDTMP}/usr/bin/${cc} ]; then \
1106 inum=$$(ls -i ${WORLDTMP}/usr/bin/${cc}); \
1107 find ${WORLDTMP}/usr/bin -inum $${inum%% *} -delete; \
1112 @rm -f ${WORLDTMP}/usr/bin/ld ${WORLDTMP}/usr/bin/ld.lld
1117 @echo "--------------------------------------------------------------"
1118 @echo ">>> Rebuilding the temporary build tree"
1119 @echo "--------------------------------------------------------------"
1120 @mkdir -p ${WORLDTMP}
1123 # available on the target system (this happens e.g. when building on non-FreeBSD)
1124 ${_+_}cd ${.CURDIR}/tools/build; \
1125 ${MAKE} DIRPRFX=tools/build/ DESTDIR=${WORLDTMP}/legacy installdirs
1126 # In order to build without inheriting $PATH we need to add symlinks to the host
1127 # tools in $WORLDTMP for the tools that we don't build during bootstrap-tools
1128 ${_+_}cd ${.CURDIR}/tools/build; \
1129 ${MAKE} DIRPRFX=tools/build/ DESTDIR=${WORLDTMP}/legacy host-symlinks
1133 @echo "--------------------------------------------------------------"
1135 @echo "--------------------------------------------------------------"
1137 _bootstrap-tools:
1139 @echo "--------------------------------------------------------------"
1141 @echo "--------------------------------------------------------------"
1145 ${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools
1146 mkdir -p ${WORLDTMP}/usr ${WORLDTMP}/lib/geom ${WORLDTMP}/bin
1147 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
1148 -p ${WORLDTMP}/usr >/dev/null
1149 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
1150 -p ${WORLDTMP}/usr/include >/dev/null
1152 mkdir -p ${WORLDTMP}/usr/include/${d}
1154 ln -sf ${.CURDIR}/sys ${WORLDTMP}
1156 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
1157 -p ${WORLDTMP}/usr/lib >/dev/null
1160 ${WORLDTMP_MTREE} -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null
1165 @echo "--------------------------------------------------------------"
1167 @echo "--------------------------------------------------------------"
1172 ${_+_}cd ${.CURDIR}; ${LIB${LIBCOMPAT}WMAKE} _NO_INCLUDE_COMPILERMK=t -f Makefile.inc1 ${CLEANDIR}
1179 @echo "--------------------------------------------------------------"
1181 @echo "--------------------------------------------------------------"
1183 _build-tools:
1185 @echo "--------------------------------------------------------------"
1186 @echo ">>> stage 2.3: build tools"
1187 @echo "--------------------------------------------------------------"
1188 ${_+_}cd ${.CURDIR}; ${TMAKE} build-tools
1189 _cross-tools:
1191 @echo "--------------------------------------------------------------"
1193 @echo "--------------------------------------------------------------"
1194 @rm -f ${OBJTOP}/toolchain-metadata.mk
1195 ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools
1196 ${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools
1197 _build-metadata:
1199 @echo "--------------------------------------------------------------"
1200 @echo ">>> stage 3.1: recording build metadata"
1201 @echo "--------------------------------------------------------------"
1202 ${_+_}cd ${.CURDIR}; ${WMAKE} toolchain-metadata.mk
1203 ${_+_}cd ${.CURDIR}; ${WMAKE} host-osreldate.h
1206 @echo "--------------------------------------------------------------"
1208 @echo "--------------------------------------------------------------"
1216 ${_+_}cd ${.CURDIR}; ${WMAKE} test-includes
1219 @echo "--------------------------------------------------------------"
1221 @echo "--------------------------------------------------------------"
1223 ${WMAKE} -DNO_FSCHG MK_HTML=no -DNO_LINT MK_MAN=no \
1228 @echo "--------------------------------------------------------------"
1230 @echo "--------------------------------------------------------------"
1237 WMAKE_TGTS+= _bootstrap-tools
1243 WMAKE_TGTS+= _build-tools _cross-tools
1244 WMAKE_TGTS+= _build-metadata
1252 WMAKE_TGTS+= build${libcompat}
1274 _ncpu_cmd=sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo unknown
1277 @echo "--------------------------------------------------------------"
1278 @echo ">>> World build started on `LC_ALL=C date`"
1279 @echo "--------------------------------------------------------------"
1283 @echo "--------------------------------------------------------------"
1284 @echo ">>> World build completed on `LC_ALL=C date`"
1285 @seconds=$$(($$(date '+%s') - ${_BUILDWORLD_START})); \
1286 echo ">>> World built in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
1287 @echo "--------------------------------------------------------------"
1299 .if ${.MAKEFLAGS:M-j}
1300 .error The buildenv target is incompatible with -j
1310 # Some scripts in tools rely on this behavior to report build errors.
1324 .if make(kernel-toolchain)
1327 kernel-toolchain: ${KERNEL_TOOLCHAIN_TGTS} .PHONY
1336 @echo "--------------------------------------------------------------"
1338 @echo "--------------------------------------------------------------"
1340 @echo "--------------------------------------------------------------"
1342 @echo "--------------------------------------------------------------"
1378 @if ! `id -u ${uid} >/dev/null 2>&1`; then \
1384 @if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \
1400 @if [ "`${OBJTOP}/rescue/rescue/rescue sh -c 'echo OK'`" != \
1415 date echo egrep find grep id install ${_install-info} \
1440 # Non-base distributions produced by the base system
1457 mkdir -p ${INSTALLTMP}
1466 if [ -z "${CROSSBUILD_HOST}" ] ; then \
1467 libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | grep -Ev '\[.*]' | \
1469 set -- $$line; \
1479 cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale
1481 -mkdir -p ${METALOG:H}
1486 -mkdir ${DESTDIR}/${DISTDIR}/${dist}
1487 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.root.dist \
1488 -p ${DESTDIR}/${DISTDIR}/${dist} >/dev/null
1489 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
1490 -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
1491 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
1492 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null
1494 -mkdir ${DESTDIR}/${DISTDIR}/${dist}/usr/include/${d}
1497 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
1498 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null
1501 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
1502 -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
1504 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
1505 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/usr >/dev/null
1509 -mkdir -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE}
1510 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
1511 -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null
1513 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
1514 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug${TESTSBASE} >/dev/null
1517 ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \
1518 sed -e 's#^\./#./${dist}/#' >> ${METALOG}
1519 ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \
1520 sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
1521 ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \
1522 sed -e 's#^\./#./${dist}/usr/include/#' >> ${METALOG}
1527 ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist | \
1528 sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
1531 -mkdir ${DESTDIR}/${DISTDIR}/base
1535 LOCAL_MTREE=${LOCAL_MTREE:Q} distrib-dirs
1539 ${IMAKEENV} rm -rf ${INSTALLTMP}
1546 …echo "No openssl on the host, not rehashing certificates target -- /etc/ssl may not be populated."…
1551 find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -type d -empty -delete
1560 find ./${dist}${path} | ${METALOG_SORT_CMD} -u ${METALOG} - | \
1571 ${TAR_CMD} cvf - --exclude usr/lib/debug \
1576 ${TAR_CMD} cvf - --exclude usr/lib/debug . | \
1584 ${TAR_CMD} cvf - @${DESTDIR}/${DISTDIR}/${dist}.debug.meta | \
1585 ${XZ_CMD} > ${PACKAGEDIR}/${dist}-dbg.txz
1588 ${TAR_CMD} cvLf - usr/lib/debug | \
1589 ${XZ_CMD} > ${PACKAGEDIR}/${dist}-dbg.txz
1594 ${_+_}cd ${.CURDIR}/tools/build/options; sh makeman > \
1597 # Ensure no regressions in self-includeability of sys/*.h and net*/*.h
1598 test-includes: .PHONY
1599 ${_+_}cd ${.CURDIR}/tools/build/test-includes; \
1600 ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} DESTDIR=${WORLDTMP} test-includes
1617 sysent-${_dir}: .PHONY
1618 @echo "${MAKE} -C ${.CURDIR}/${_dir} sysent"
1619 ${_+_}@env PATH=${_sysent_PATH:Q} ${MAKE} -C ${.CURDIR}/${_dir} sysent
1621 sysent: sysent-${_dir}
1627 # If you have a build server, you can NFS mount the source and obj directories
1629 # most recent server build.
1632 @echo "--------------------------------------------------------------"
1634 @echo "--------------------------------------------------------------"
1635 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \
1638 @echo "--------------------------------------------------------------"
1640 @echo "--------------------------------------------------------------"
1641 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \
1645 @echo "--------------------------------------------------------------"
1647 @echo "--------------------------------------------------------------"
1648 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
1650 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install${libcompat}
1652 @echo "--------------------------------------------------------------"
1654 @seconds=$$(($$(date '+%s') - ${_INSTALLWORLD_START})); \
1655 …> Install world completed in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
1656 @echo "--------------------------------------------------------------"
1659 @echo "--------------------------------------------------------------"
1661 @echo "--------------------------------------------------------------"
1662 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
1664 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute${libcompat} \
1668 distrib-dirs distribution: .MAKE .PHONY
1673 ${MAKE} -f Makefile.inc1 ${IMAKE_INSTALL} \
1682 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 _worldtmp
1683 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 _legacy
1684 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 _bootstrap-tools \
1686 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 _obj \
1688 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 everything \
1692 @echo "--------------------------------------------------------------"
1694 @echo "--------------------------------------------------------------"
1695 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distrib-dirs
1696 @echo "--------------------------------------------------------------"
1698 @echo "--------------------------------------------------------------"
1699 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribution
1704 # Which kernels to build and/or install is specified by setting
1711 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
1712 # be set to cross-build, we have to make sure TARGET is set
1719 # Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah
1735 .for _k in ${GENERIC_KERNCONF} MINIMAL${GENERIC_KERNCONF_SUFX_${TARGET_ARCH}} ${GENERIC_KERNCONF}-M…
1739 .if exists(${KERNCONFDIR}/${_k}-${_dbg})
1740 PKG_KERNCONF+= ${_k}-${_dbg}
1776 @if [ -e "${KRNLOBJDIR}/${KERNCONF}/modules${SRCTOP}/sys/modules/${m}/.depend.${f}.o" ] && \
1777 …grep -q ${f}.S "${KRNLOBJDIR}/${KERNCONF}/modules${SRCTOP}/sys/modules/${m}/.depend.${f}.o"; then \
1779 rm -f ${KRNLOBJDIR}/${KERNCONF}/modules${SRCTOP}/sys/modules/${m}/.depend.${f}.*; \
1788 # record kernel(s) build time in seconds
1805 @echo "--------------------------------------------------------------"
1806 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
1807 @echo "--------------------------------------------------------------"
1809 mkdir -p ${KRNLOBJDIR}
1812 @echo "--------------------------------------------------------------"
1814 @echo "--------------------------------------------------------------"
1817 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
1818 -I '${KERNCONFDIR}' -I '${KRNLCONFDIR}' \
1823 @echo "--------------------------------------------------------------"
1825 @echo "--------------------------------------------------------------"
1832 @echo "--------------------------------------------------------------"
1834 @echo "--------------------------------------------------------------"
1838 @echo "--------------------------------------------------------------"
1839 @echo ">>> stage 2.3: build tools"
1840 @echo "--------------------------------------------------------------"
1841 ${_+_}cd ${.CURDIR}; ${KTMAKE} kernel-tools
1843 @echo "--------------------------------------------------------------"
1845 @echo "--------------------------------------------------------------"
1846 ${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ
1847 @echo "--------------------------------------------------------------"
1848 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
1849 @echo "--------------------------------------------------------------"
1852 @seconds=$$(($$(date '+%s') - ${_BUILDKERNEL_START})); \
1853 …(s) ${BUILDKERNELS} built in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
1854 @echo "--------------------------------------------------------------"
1856 .if !make(packages) && !make(update-packages)
1859 # packages/update-packages installs kernels to a staging directory then builds
1878 @echo "--------------------------------------------------------------"
1880 @echo "--------------------------------------------------------------"
1885 @echo "--------------------------------------------------------------"
1887 @echo "--------------------------------------------------------------"
1888 @seconds=$$(($$(date '+%s') - ${_INSTALLKERNEL_START})); \
1889 …{INSTALLKERNEL} completed in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
1890 @echo "--------------------------------------------------------------"
1893 .for _kernel in ${BUILDKERNELS:[2..-1]}
1894 @echo "--------------------------------------------------------------"
1896 @echo "--------------------------------------------------------------"
1901 @echo "--------------------------------------------------------------"
1903 @echo "--------------------------------------------------------------"
1905 @seconds=$$(($$(date '+%s') - ${_INSTALLKERNEL_START})); \
1906 …${BUILDKERNELS} completed in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
1907 @echo "--------------------------------------------------------------"
1916 mkdir -p ${DESTDIR}/${DISTDIR}
1917 rm -f ${DESTDIR}/${DISTDIR}/kernel.premeta
1926 sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta | \
1931 .for _kernel in ${BUILDKERNELS:[2..-1]}
1932 rm -f ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta
1942 sed -e "s|^./kernel.${_kernel}|.|" \
1953 ${TAR_CMD} cvf - --exclude '*.debug' \
1959 ${TAR_CMD} cvf - --include '*/*/*.debug' \
1961 ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz
1964 .for _kernel in ${BUILDKERNELS:[2..-1]}
1966 ${TAR_CMD} cvf - --exclude '*.debug' \
1971 ${TAR_CMD} cvf - --include '*/*/*.debug' \
1973 ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz
1980 ${TAR_CMD} cvf - --exclude '*.debug' . | \
1985 ${TAR_CMD} cvf - --include '*/*/*.debug' $$(eval find .) | \
1986 ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz
1989 .for _kernel in ${BUILDKERNELS:[2..-1]}
1991 ${TAR_CMD} cvf - --exclude '*.debug' . | \
1995 ${TAR_CMD} cvf - --include '*/*/*.debug' $$(eval find .) | \
1996 ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz
2003 ${_+_}${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} DISTDIR=. distributekernel
2011 PKG_LEVEL?= -1
2012 PKG_CLEVEL?= ${"${PKG_FORMAT:Mtar}" != "":?:-l ${PKG_LEVEL}}
2016 .if make(create-*-packages*) || make(real-update-packages) || make(real-sign-packages)
2017 PKG_ABI!= ${PKG_CMD} -o ABI_FILE=${PKG_ABI_FILE} config ABI
2020 .ORDER: stage-packages create-packages
2021 .ORDER: create-packages create-world-packages
2022 .ORDER: create-packages create-source-packages
2023 .ORDER: create-packages create-kernel-packages
2024 .ORDER: create-packages sign-packages
2031 PKG_BIN_VERSION!=${PKG_CMD} --version </dev/null 2>/dev/null |\
2032 awk -F. '/^[0-9.]+$$/ {print $$1 * 10000 + $$2 * 100 + $$3}'
2039 .if !defined(PKG_VERSION_FROM) && make(real-update-packages)
2074 ${_+_}${MAKE} -C ${.CURDIR} ${PKGMAKEARGS} real-packages
2076 update-packages: .PHONY
2077 ${_+_}${MAKE} -C ${.CURDIR} ${PKGMAKEARGS} real-update-packages
2079 package-pkg: .PHONY
2080 rm -rf /tmp/ports.${TARGET} || :
2085 sh ${.CURDIR}/release/scripts/make-pkg-package.sh
2087 real-packages: stage-packages create-packages sign-packages .PHONY
2089 real-update-packages: stage-packages .PHONY
2090 ${_+_}${MAKE} -C ${.CURDIR} PKG_VERSION=${PKG_VERSION} create-packages
2095 @for pkg in ${PKG_VERSION_FROM_DIR}/${PKG_NAME_PREFIX}-*; do \
2096 pkgname=$$(pkg query -F $${pkg} '%n' | sed 's/${PKG_NAME_PREFIX}-\(.*\)/\1/') ; \
2097 newpkgname=${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION}.${PKG_EXT} ; \
2098 oldsum=$$(pkg query -F $${pkg} '%X') ; \
2099 if [ ! -f ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} ]; then \
2102 newsum=$$(pkg query -F ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} '%X') ; \
2103 if [ "${BRANCH_EXT_FROM}" = "${BRANCH_EXT}" -a "$${oldsum}" = "$${newsum}" ]; then \
2104 echo "==> Keeping old ${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION_FROM}.${PKG_EXT}" ; \
2113 ${MAKE} -f Makefile.inc1 PKG_VERSION=${PKG_VERSION} sign-packages
2115 stage-packages-world: .PHONY
2116 @mkdir -p ${WSTAGEDIR}
2118 ${MAKE} DESTDIR=${WSTAGEDIR} -DNO_ROOT stageworld
2120 stage-packages-kernel: .PHONY
2121 @mkdir -p ${KSTAGEDIR}
2123 ${MAKE} DESTDIR=${KSTAGEDIR} -DNO_ROOT stagekernel
2125 stage-packages-source: .PHONY
2126 @mkdir -p ${SSTAGEDIR};
2128 stage-packages: .PHONY stage-packages-world stage-packages-kernel stage-packages-source
2131 @mkdir -p ${REPODIR}
2133 create-packages-world: _pkgbootstrap _repodir .PHONY
2135 ${MAKE} -f Makefile.inc1 \
2137 PKG_VERSION=${PKG_VERSION} create-world-packages
2139 create-packages-kernel: _pkgbootstrap _repodir .PHONY
2141 ${MAKE} -f Makefile.inc1 \
2145 create-kernel-packages
2147 create-packages-kernel-repo: .PHONY create-packages-kernel sign-packages
2149 create-packages-world-repo: .PHONY create-packages-world sign-packages
2151 create-packages-source: _pkgbootstrap _repodir .PHONY
2153 ${MAKE} -f Makefile.inc1 \
2155 PKG_VERSION=${PKG_VERSION} create-source-packages
2157 create-packages: .PHONY create-packages-world create-packages-kernel create-packages-source
2159 create-source-src-package: _pkgbootstrap .PHONY
2160 rm -f ${SSTAGEDIR}/src.plist 2>/dev/null || :
2164 ${GIT_CMD} ls-files --recurse-submodules ":!:sys/" ) \
2166 ${SRCDIR}/release/packages/generate-ucl.lua \
2177 ${PKG_CMD} -o ABI=${PKG_ABI} \
2178 -o OSVERSION="${SRCRELDATE}" \
2179 create -f ${PKG_FORMAT} ${PKG_CLEVEL} \
2180 -M ${SSTAGEDIR}/src.ucl \
2181 -p ${SSTAGEDIR}/src.plist \
2182 -r ${SRCDIR} \
2183 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
2186 create-source-src-sys-package: _pkgbootstrap .PHONY
2187 rm -f ${SSTAGEDIR}/src-sys.plist 2>/dev/null || :
2191 ${GIT_CMD} ls-files --recurse-submodules "sys/" ) \
2192 > ${SSTAGEDIR}/src-sys.plist
2193 ${SRCDIR}/release/packages/generate-ucl.lua \
2194 PKGNAME "src-sys" \
2203 ${SSTAGEDIR}/src-sys.ucl
2204 ${PKG_CMD} -o ABI=${PKG_ABI} \
2205 -o OSVERSION="${SRCRELDATE}" \
2206 create -f ${PKG_FORMAT} ${PKG_CLEVEL} \
2207 -M ${SSTAGEDIR}/src-sys.ucl \
2208 -p ${SSTAGEDIR}/src-sys.plist \
2209 -r ${SRCDIR} \
2210 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
2213 create-source-packages: .PHONY _pkgbootstrap create-source-src-package create-source-src-sys-package
2215 create-world-packages: _pkgbootstrap .PHONY
2216 @rm -f ${WSTAGEDIR}/*.plist 2>/dev/null || :
2219 awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk
2226 ${MAKE} -f Makefile.inc1 create-world-packages-jobs \
2230 .if make(create-world-packages-jobs)
2234 create-world-packages-jobs: .PHONY
2236 create-world-packages-jobs: create-world-package-${pkgname}
2237 create-world-package-${pkgname}: .PHONY
2238 @sh ${SRCDIR}/release/packages/generate-ucl.sh -o ${pkgname} \
2239 -s ${SRCDIR} -u ${WSTAGEDIR}/${pkgname}.ucl
2240 @awk -F\" ' \
2241 /^name/ { printf("===> Creating %s-", $$2); next } \
2245 sed -i '' -e "s/%VCS_REVISION%/${VCS_REVISION}/" ${WSTAGEDIR}/${pkgname}.ucl ; \
2247 ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \
2248 -o OSVERSION="${SRCRELDATE}" \
2249 create -f ${PKG_FORMAT} ${PKG_CLEVEL} \
2250 -M ${WSTAGEDIR}/${pkgname}.ucl \
2251 -p ${WSTAGEDIR}/${pkgname}.plist \
2252 -r ${WSTAGEDIR} \
2253 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
2256 _default_flavor= -default
2259 _debug=-dbg
2262 create-dtb-package:
2263 @if [ -f ${KSTAGEDIR}/${DISTDIR}/dtb.plist ]; then \
2264 ${SRCDIR}/release/packages/generate-ucl.lua \
2274 awk -F\" ' \
2275 /name/ { printf("===> Creating %s-", $$2); next } \
2278 ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \
2279 -o OSVERSION="${SRCRELDATE}" \
2280 create -f ${PKG_FORMAT} ${PKG_CLEVEL} \
2281 -M ${KSTAGEDIR}/${DISTDIR}/dtb.ucl \
2282 -p ${KSTAGEDIR}/${DISTDIR}/dtb.plist \
2283 -r ${KSTAGEDIR}/${DISTDIR} \
2284 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR} ; \
2287 create-kernel-packages: .PHONY
2289 create-kernel-packages: create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},} create-dt…
2290 create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap .PHONY
2293 awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
2294 -v kernel=yes -v _kernconf=${INSTALLKERNEL} ; \
2295 ${SRCDIR}/release/packages/generate-ucl.lua \
2296 PKGNAME "kernel-${INSTALLKERNEL:tl}${flavor}" \
2306 awk -F\" ' \
2307 /name/ { printf("===> Creating %s-", $$2); next } \
2310 ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \
2311 -o OSVERSION="${SRCRELDATE}" \
2312 create -f ${PKG_FORMAT} ${PKG_CLEVEL} \
2313 -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \
2314 -p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \
2315 -r ${KSTAGEDIR}/${DISTDIR} \
2316 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
2320 . for _kernel in ${BUILDKERNELS:[2..-1]}
2323 _debug=-dbg
2326 create-kernel-packages: create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_…
2327 create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel}: _pkgbootstrap .…
2330 awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
2331 -v kernel=yes -v _kernconf=${_kernel} ; \
2332 ${SRCDIR}/release/packages/generate-ucl.lua \
2333 PKGNAME "kernel-${_kernel:tl}${flavor}" \
2346 awk -F\" ' \
2347 /name/ { printf("===> Creating %s-", $$2); next } \
2350 ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \
2351 -o OSVERSION="${SRCRELDATE}" \
2352 create -f ${PKG_FORMAT} ${PKG_CLEVEL} \
2353 -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \
2354 -p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \
2355 -r ${KSTAGEDIR}/kernel.${_kernel} \
2356 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
2362 sign-packages: .PHONY
2364 ${MAKE} -f Makefile.inc1 PKG_VERSION=${PKG_VERSION} real-sign-packages
2366 real-sign-packages: _pkgbootstrap .PHONY
2371 @${PKG_CMD} -o ABI=${PKG_ABI} -o OSVERSION="${SRCRELDATE}" \
2372 -o WORKERS_COUNT=${PKG_WORKERS_COUNT} repo \
2373 -m ${WSTAGEDIR}/meta \
2374 -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \
2378 ln -hfs ${PKG_OUTPUT_DIR} latest
2387 @if [ ! -x "${LOCALBASE}/bin/kyua" ] && [ ! -x "/usr/bin/kyua" ]; then \
2391 ${_+_}PATH="$$PATH:${LOCALBASE}/bin" kyua test -k ${TESTSBASE}/Kyuafile
2397 # Build the API documentation with doxygen
2400 @if [ ! -x "${LOCALBASE}/bin/doxygen" ]; then \
2407 # ------------------------------------------------------------------------
2412 # complete the build. Beware, this is *not* guaranteed to work, you
2418 # legacy: Build compatibility shims for the next three targets. This is a
2420 # which don't have the APIs required by the targets built in bootstrap-tools,
2421 # build-tools or cross-tools.
2430 tools/build \
2434 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
2442 # bootstrap-tools: Build tools needed for compatibility. These are binaries that
2443 # are built to build other binaries in the system. However, the focus of these
2445 # libraries, augmented by -legacy, in addition to the libraries built during
2446 # bootstrap-tools.
2448 _bt= _bootstrap-tools
2450 # We want to run the build with only ${WORLDTMP} in $PATH to ensure we don't
2453 # programs used during the build accept different flags or generate different
2455 # (e.g. basic utilities such as mkdir) into ${WORLDTMP} and build all others
2456 # from the FreeBSD sources during the bootstrap-tools stage.
2457 # We want to build without the user's $PATH starting in the bootstrap-tools
2460 # variable in tools/build/Makefile and are linked during the legacy phase.
2464 # If BOOTSTRAP_ALL_TOOLS is set we will build all the required tools from the
2466 # $PATH during the bootstrap-tools stage.
2467 # When building on non-FreeBSD systems we can't assume that the host binaries
2469 # BOOTSTRAP_ALL_TOOLS and just build the FreeBSD version of the binary.
2483 # vtfontcvt is used to build font files for loader and to generate
2499 # Note: lex needs m4 to build but m4 also depends on lex (which needs m4 to
2500 # generate any files). To fix this cyclic dependency we can build a bootstrap
2501 # version of m4 (with pre-generated files) then use that to build the real m4.
2504 # For lex we also use the pre-gerated files since we would otherwise need to
2505 # build awk and sed first (which need lex to build)
2506 # TODO: add a _bootstrap_lex and then build the real lex afterwards
2508 _m4= tools/build/bootstrap-m4 usr.bin/m4
2509 ${_bt}-tools/build/bootstrap-m4: ${_bt}-usr.bin/lex ${_bt}-lib/libopenbsd ${_bt}-usr.bin/yacc
2510 ${_bt}-usr.bin/m4: ${_bt}-lib/libopenbsd ${_bt}-usr.bin/yacc ${_bt}-usr.bin/lex ${_bt}-tools/build/…
2511 _bt_m4_depend=${_bt}-usr.bin/m4
2512 _bt_lex_depend=${_bt}-usr.bin/lex ${_bt_m4_depend}
2518 # r296685 fix cross-endian objcopy
2526 ${_bt}-lib/libelf: ${_bt_m4_depend}
2527 ${_bt}-lib/libdwarf: ${_bt_m4_depend}
2528 _bt_libelf_depend=${_bt}-lib/libelf
2532 ${_bt}-lib/libkldelf: ${_bt_libelf_depend}
2533 _bt_libkldelf_depend=${_bt}-lib/libkldelf
2536 ${_bt}-usr.sbin/kldxref: ${_bt_libelf_depend} ${_bt_libkldelf_depend}
2539 # 13.0-CURRENT cycle, thus needs to be built on -older releases and stable
2542 ${_bt}-libexec/flua: ${_bt}-lib/liblua
2546 # r245440 mtree -N support added
2553 ${_bt}-lib/libnetbsd: ${_bt}-lib/libmd
2554 ${_bt}-usr.sbin/nmtree: ${_bt}-lib/libnetbsd
2559 # r246097: log addition login.conf.db, passwd, pwd.db, and spwd.db with cat -l
2566 # r277259 crunchide: Correct 64-bit section header offset
2567 # r281674 crunchide: always include both 32- and 64-bit ELF support
2574 # 1400052, 1300526, 1203507: Removed -dc from linker invocation
2597 ${_bt}-usr.sbin/makefs: ${_bt}-lib/libnetbsd
2601 ${_bt}-usr.sbin/makefs: ${_bt}-lib/libsbuf
2621 # We need to build tblgen when we're building clang or lld, either as
2622 # bootstrap tools, or as the part of the normal build.
2623 # llvm-tblgen is also needed for various llvm binutils (e.g. objcopy).
2629 usr.bin/clang/llvm-min-tblgen \
2630 usr.bin/clang/llvm-tblgen
2634 _clang_tblgen+= usr.bin/clang/clang-tblgen
2637 _clang_tblgen+= usr.bin/clang/lldb-tblgen
2639 ${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/libllvmminimal
2640 ${_bt}-usr.bin/clang/lldb-tblgen: ${_bt}-lib/clang/libllvmminimal
2641 ${_bt}-usr.bin/clang/llvm-min-tblgen: ${_bt}-lib/clang/libllvmminimal
2642 ${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-lib/clang/libllvmminimal
2643 ${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-usr.bin/clang/llvm-min-tblgen
2646 # C.UTF-8 is always built in share/ctypes and we need localedef for that.
2648 ${_bt}-usr.bin/localedef: ${_bt}-usr.bin/yacc ${_bt_lex_depend}
2653 ${_bt}-usr.bin/mkesdb: ${_bt}-usr.bin/yacc ${_bt_lex_depend}
2654 ${_bt}-usr.bin/mkcsmapper: ${_bt}-usr.bin/yacc ${_bt_lex_depend}
2659 kerberos5/tools/make-roken \
2666 .ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g}
2668 ${_bt}-${_tool}: ${_bt}-usr.bin/yacc ${_bt_lex_depend}
2672 ${_bt}-usr.bin/mandoc: ${_bt}-lib/libopenbsd
2676 # Linux or MacOS host the host versions are incompatible so we need to build
2680 # subdirectory and comma-separated list of files.
2687 # Some build scripts use nawk instead of awk (this happens at least in
2704 # bootstrap ldd on non-FreeBSD systems
2711 # matter since we don't need any of the new features for the build.
2714 # When building on non-FreeBSD, install a fake chflags instead since the
2716 # are install with -DNO_ROOT.
2717 _other_bootstrap_tools+=tools/build/cross-build/fake_chflags
2739 ${_bt}-usr.bin/awk: ${_bt_lex_depend} ${_bt}-usr.bin/yacc
2740 ${_bt}-bin/expr: ${_bt_lex_depend} ${_bt}-usr.bin/yacc
2741 # If we are bootstrapping file2c, we have to build it before config:
2742 ${_bt}-usr.sbin/config: ${_bt}-usr.bin/file2c ${_bt_lex_depend}
2745 # `make legacy` step. Not adding a link to make is important on non-FreeBSD
2751 ${_bt}-usr.bin/grep: ${_bt}-lib/libbz2
2755 ${_bt}-lib/libdwarf: ${_bt}-lib/libz
2759 ${_bt}-lib/libroken: ${_bt}-lib/libcrypt
2773 ${_bt}-links: .PHONY
2776 ${_bt}-link-${_tool}: .PHONY
2777 @rm -f "${WORLDTMP}/legacy/bin/${_tool}"; \
2779 if [ ! -e "$${source_path}" ] ; then \
2782 cp -pf "$${source_path}" "${WORLDTMP}/legacy/bin/${_tool}"
2783 ${_bt}-links: ${_bt}-link-${_tool}
2786 bootstrap-tools: ${_bt}-links .PHONY
2788 # Please document (add comment) why something is in 'bootstrap-tools'.
2789 # Try to bound the building of the bootstrap-tool to just the
2790 # FreeBSD versions that need the tool built at this stage of the build.
2826 ${_bt}-${_tool}: ${_bt}-links .PHONY .MAKE
2829 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
2836 bootstrap-tools: ${_bt}-${_tool}
2838 .if target(${_bt}-lib/libmd)
2841 ${_bt}-usr.bin/sort: ${_bt}-lib/libmd
2842 ${_bt}-usr.bin/xinstall: ${_bt}-lib/libmd
2843 ${_bt}-sbin/md5: ${_bt}-lib/libmd
2848 # build-tools: Build special purpose build tools
2855 # rescue includes programs that have build-tools targets
2867 _jevents=lib/libpmc/pmu-events
2870 # kernel-toolchain skips _cleanobj, so handle cleaning up previous
2871 # build-tools directories if needed.
2872 .if ${MK_CLEAN} == "yes" && make(kernel-toolchain)
2887 build-tools_${_tool}: .PHONY
2888 ${_+_}@${ECHODIR} "===> ${_tool} (${_bt_clean:D${_bt_clean},}obj,build-tools)"; \
2890 if [ -n "${_bt_clean}" ]; then ${MAKE} DIRPRFX=${_tool}/ ${_bt_clean}; fi; \
2891 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
2892 ${MAKE} DIRPRFX=${_tool}/ build-tools
2893 build-tools: build-tools_${_tool}
2897 # kernel-tools: Build kernel-building tools
2899 kernel-tools: .PHONY
2900 mkdir -p ${WORLDTMP}/usr
2901 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
2902 -p ${WORLDTMP}/usr >/dev/null
2905 # cross-tools: All the tools needed to build the rest of the system after
2915 # Rebuild ctfconvert and ctfmerge to avoid difficult-to-diagnose failures
2922 # If we're given an XAS, don't build binutils.
2933 # These are not required by the build, but can be useful for developers who
2934 # cross-build on a FreeBSD 10 host:
2938 # If cross-building with an external binutils we still need to build strip for
2964 cross-tools: .MAKE .PHONY
2977 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
2983 # native-xtools is the current target for qemu-user cross builds of ports
2992 NXTP?= /nxb-bin
2999 # appropriate to build for the given TARGET.TARGET_ARCH.
3067 # XXX: native-xtools passes along ${NXBDIRS} in SUBDIR_OVERRIDE that needs
3076 -DNO_SHARED \
3077 -DNO_CPU_CFLAGS \
3078 -DNO_PIC \
3105 .if make(native-xtools*) && \
3111 NXBTMAKE= ${NXBMAKEENV} ${MAKE} ${NXBMAKEARGS:N-DNO_PIC:N-DNO_SHARED} \
3113 # For 'everything' we want to produce native binaries (hence -target to
3127 NXBMAKE+= ${NXBMAKEENV} ${MAKE} -f Makefile.inc1 ${NXBMAKEARGS} \
3132 # invoke a sub-make to reevaluate MK_CLANG, etc, for NXBDIRS.
3134 # Need to avoid the -isystem logic when using clang as an external toolchain
3137 native-xtools: .PHONY
3139 # Build the bootstrap/host/cross tools that produce native binaries
3140 ${_+_}cd ${.CURDIR}; ${NXBTMAKE} kernel-toolchain
3144 # polluting the cross-compiler build. The LLVM libs are skipped
3146 # needed build tools are built.
3153 @echo ">> native-xtools done. Use 'make native-xtools-install' to install to a given DESTDIR"
3155 native-xtools-install: .PHONY
3156 mkdir -p ${NXBDESTDIR}/bin ${NXBDESTDIR}/sbin ${NXBDESTDIR}/usr
3157 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
3158 -p ${NXBDESTDIR}/usr >/dev/null
3159 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
3160 -p ${NXBDESTDIR}/usr/include >/dev/null
3162 mkdir -p ${NXBDESTDIR}/usr/include/${d}
3166 -DNO_ROOT \
3170 # hierarchy - ensure that all the needed directories are present
3173 ${_+_}cd ${.CURDIR}/etc; ${HMAKE} distrib-dirs
3176 # libraries - build all libraries, and install them under ${DESTDIR}.
3184 ${MAKE} -f Makefile.inc1 _prereq_libs; \
3185 ${MAKE} -f Makefile.inc1 _startup_libs; \
3186 ${MAKE} -f Makefile.inc1 _prebuild_libs -DLIBCRYPTO_WITHOUT_SUBDIRS; \
3187 ${MAKE} -f Makefile.inc1 _generic_libs
3198 _prereq_libs+= lib/libclang_rt/asan-preinit
3454 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; fi; \
3455 ${MAKE} MK_TESTS=no -DNO_PIC \
3457 ${MAKE} MK_TESTS=no -DNO_PIC \
3467 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; fi; \
3480 # that running 'make all' from the top-level, especially with a SUBDIR_OVERRIDE
3481 # or LOCAL_DIRS set, will have a reliable build if SUBDIRs are built in
3485 # avoid trashing a system if it crashes mid-install.
3492 .if make(check-old) || make(check-old-dirs) || \
3493 make(check-old-files) || make(check-old-libs) || \
3494 make(delete-old) || make(delete-old-dirs) || \
3495 make(delete-old-files) || make(delete-old-libs) || \
3496 make(list-old-dirs) || make(list-old-files) || make(list-old-libs)
3510 RM_I=-i
3512 RM_I=-fv
3515 list-old-files: .PHONY
3517 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
3518 -V "OLD_FILES:ts\n" -V "OLD_FILES:Musr/share/*.gz:R:ts\n" \
3519 -V "MOVED_LIBS:ts\n" \
3520 ${_ALL_libcompats:@v@-V "OLD_FILES:Mlib/*.so.*:S,^lib,usr/lib$v,:ts\n"@} \
3521 ${_ALL_libcompats:@v@-V "OLD_FILES:Musr/lib/*:S,^usr/lib,usr/lib$v,:ts\n"@} | \
3524 delete-old-files: .PHONY
3533 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-files | \
3535 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
3540 if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \
3549 find ${DESTDIR}/usr/share/man/cat* ! -type d 2>/dev/null | sort | \
3550 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
3553 if [ ! -e "$${manpage}" ]; then \
3559 check-old-files: .PHONY
3562 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-files | \
3564 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
3568 if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
3574 @find ${DESTDIR}/usr/share/man/cat* ! -type d 2>/dev/null | \
3575 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
3578 if [ ! -e "$${manpage}" ]; then \
3583 list-old-libs: .PHONY
3585 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
3586 -V "OLD_LIBS:ts\n" \
3587 ${_ALL_libcompats:@v@-V "OLD_LIBS:Mlib/*:S,^lib,usr/lib$v,:ts\n"@} \
3588 ${_ALL_libcompats:@v@-V "OLD_LIBS:Musr/lib/*:S,^usr/lib,usr/lib$v,:ts\n"@} \
3589 ${_ALL_libcompats:@v@-V "OLD_LIBS:Mlib/casper/*:S,^lib/casper,usr/lib$v,:ts\n"@} | \
3592 delete-old-libs: .PHONY
3597 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-libs | \
3599 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
3604 if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \
3613 check-old-libs: .PHONY
3616 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-libs | \
3618 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
3622 if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
3628 list-old-dirs: .PHONY
3630 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
3631 -V OLD_DIRS | sed -E 's/[[:space:]]+/\n/g' | sort -r
3633 delete-old-dirs: .PHONY
3636 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-dirs | \
3638 if [ -d "${DESTDIR}/$${dir}" ]; then \
3639 rmdir -v "${DESTDIR}/$${dir}" || true; \
3640 elif [ -L "${DESTDIR}/$${dir}" ]; then \
3643 if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
3644 rmdir -v "${DESTDIR}${DEBUGDIR}/$${dir}" || true; \
3645 elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
3651 check-old-dirs: .PHONY
3654 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-dirs | \
3656 if [ -d "${DESTDIR}/$${dir}" ]; then \
3658 elif [ -L "${DESTDIR}/$${dir}" ]; then \
3661 if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
3663 elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
3668 delete-old: delete-old-files delete-old-dirs .PHONY
3669 @echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'."
3671 check-old: check-old-files check-old-libs check-old-dirs .PHONY
3672 @echo "To remove old files and directories run '${MAKE_CMD} delete-old'."
3673 @echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'."
3678 # showconfig - show build configuration.
3683 …@(${MAKE} -n -f ${.CURDIR}/sys/conf/kern.opts.mk -V dummy -dg1 UPDATE_DEPENDFILE=no NO_OBJ=yes MAC…
3684 …${MAKE} -n -f ${.CURDIR}/share/mk/src.opts.mk -V dummy -dg1 UPDATE_DEPENDFILE=no NO_OBJ=yes MACHIN…
3685 grep -E '^(MK|OPT)_[A-Z]' | sort -u
3704 # Build 'standalone' Device Tree Blob
3741 -(cd ${BW_CANONICALOBJDIR} && rm -rf *)
3742 -chflags -R 0 ${BW_CANONICALOBJDIR}
3743 -(cd ${BW_CANONICALOBJDIR} && rm -rf *)
3759 NOFUN=-DNO_FSCHG MK_HTML=no -DNO_LINT \
3765 XDDIR=${TARGET_ARCH}-freebsd
3784 # GCC requires -isystem and -L when using a cross-compiler. --sysroot
3785 # won't set header path and -L is used to ensure the base library path
3787 CD2CFLAGS+= -isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib
3788 # GCC requires -B to find /usr/lib/crti.o when using a cross-compiler
3789 # combined with --sysroot.
3790 CD2CFLAGS+= -B${XDDESTDIR}/usr/lib
3794 CD2CXXFLAGS+= -isystem ${XDDESTDIR}/usr/include/c++/v1 -std=c++11 \
3795 -nostdinc++
3798 CD2CFLAGS+= --sysroot=${XDDESTDIR}/
3808 # Don't rebuild build-tools targets during normal build.
3813 .ORDER: xdev-build xdev-install xdev-links
3814 xdev: xdev-build xdev-install .PHONY
3816 .ORDER: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools
3817 xdev-build: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools .PHONY
3819 _xb-worldtmp: .PHONY
3820 mkdir -p ${CDTMP}/usr
3821 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
3822 -p ${CDTMP}/usr >/dev/null
3824 _xb-bootstrap-tools: .PHONY
3830 if [ -z "${NO_OBJWALK}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ obj; fi; \
3835 _xb-build-tools: .PHONY
3837 ${CDBENV} ${MAKE} ${CDMAKEARGS} -f Makefile.inc1 ${NOFUN} build-tools
3846 _xb-cross-tools: .PHONY
3850 if [ -z "${NO_OBJWALK}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ obj; fi; \
3854 _xi-mtree: .PHONY
3856 mkdir -p ${XDDESTDIR}
3857 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.root.dist \
3858 -p ${XDDESTDIR} >/dev/null
3859 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
3860 -p ${XDDESTDIR}/usr >/dev/null
3861 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
3862 -p ${XDDESTDIR}/usr/include >/dev/null
3864 mkdir -p ${XDDESTDIR}/usr/include/${d}
3867 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
3868 -p ${XDDESTDIR}/usr >/dev/null
3871 mkdir -p ${XDDESTDIR}${TESTSBASE}
3872 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
3873 -p ${XDDESTDIR}${TESTSBASE} >/dev/null
3876 .ORDER: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries
3877 xdev-install: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries .PHONY
3879 _xi-cross-tools: .PHONY
3880 @echo "_xi-cross-tools"
3887 _xi-includes: .PHONY
3889 ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 _obj \
3892 ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 includes \
3895 _xi-libraries: .PHONY
3896 ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 libraries \
3899 xdev-links: .PHONY
3901 mkdir -p ../../../../usr/bin; \
3903 ln -sf ../../${XDTP}/usr/bin/$$i \
3904 ../../../../usr/bin/${XDDIR}-$$i; \
3905 ln -sf ../../${XDTP}/usr/bin/$$i \
3906 ../../../../usr/bin/${XDDIR}${_REVISION}-$$i; \