Lines Matching +full:libelf +full:- +full:dev

4 #	-DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
5 # -DNO_CLEAN do not clean at all (enabled by default)
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
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-*)
98 # Make sure sub-makes see the option as disabled so the hack in bsd.sys.mk to
107 .-include "${OBJTOP}/toolchain-metadata.mk"
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}
215 # for cross-builds.
255 # WITH_SYSTEM_COMPILER - Pull in needed values and make a decision.
266 !make(test-system-linker)
282 # GCC cannot be used for cross-arch yet. For clang we pass -target later if
297 # WITH_SYSTEM_LD - Pull in needed values and make a decision.
308 !make(test-system-compiler)
337 # WITH_SYSTEM_COMPILER / WITH_SYSTEM_LINKER - Handle defaults and debug.
361 test-system-${_t}: .PHONY
363 ${_+_}@printf "%-35s= %s\n" "${v}" "${${v}}"
366 .if (make(buildworld) || make(buildkernel) || make(kernel-toolchain) || \
367 make(toolchain) || make(_cross-tools))
369 …EM_COMPILER: Determined that CC=${CC} matches the source tree. Not bootstrapping a cross-compiler.
371 .info SYSTEM_COMPILER: libclang will be built for bootstrapping a cross-compiler.
374 .info SYSTEM_LINKER: Determined that LD=${LD} matches the source tree. Not bootstrapping a cross-l…
376 .info SYSTEM_LINKER: libclang will be built for bootstrapping a cross-linker.
393 toolchain-metadata.mk: .PHONY .META
406 # We must do lib/ and libexec/ before bin/ in case of a mid-install error to
407 # keep the users system reasonably usable. For static->dynamic root upgrades,
412 # system here would require fine-grained ordering of all components based
503 # If filemon is used then we can rely on the build being incremental-safe.
548 # Set VERSION for CTFMERGE to use via the default CTFFLAGS=-L VERSION.
561 VERSION= FreeBSD ${_REVISION}-${_BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE}
576 EXTRA_REVISION= .a${_BRANCH:C/ALPHA([0-9]+).*/\1/}.${_TIMENOW}
579 EXTRA_REVISION= .b${_BRANCH:C/BETA([0-9]+).*/\1/}.${_TIMENOW}
582 EXTRA_REVISION= .rc${_BRANCH:C/RC([0-9]+).*/\1/}.${_TIMENOW}
583 .elif ${_BRANCH:M*-p*}
584 EXTRA_REVISION= p${_BRANCH:C/.*-p([0-9]+$)/\1/}
604 SOURCE_DATE_EPOCH!= ${GIT_CMD} -C ${SRCDIR} show -s --format=%ct HEAD
615 _CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} -f /dev/null \
616 -m ${.CURDIR}/share/mk MK_AUTO_OBJ=no -V CPUTYPE
622 BUILD_ARCH!= uname -p
623 # On some Linux systems uname -p returns "unknown" so skip this check there.
625 # MACHINE_ARCH so skipping it when crossbuilding on non-FreeBSD should be fine.
627 .error To cross-build, set TARGET_ARCH.
650 # When building on non-FreeBSD we can't rely on the tools in /usr/bin being compatible
652 # during the world build stage. We build most tools during the bootstrap-tools
676 INSTALLTMP!= ${MKTEMP} -d -u -t install
687 INSTALLTMP_COPY_HOST_TOOL=ln -s
701 # shims that are needed by the bootstrap-tools,
702 # build-tools and cross-tools stages. These are generally
705 # 1. bootstrap-tools stage [BMAKE]
708 # are not built as cross-tools.
709 # 2. build-tools stage [TMAKE]
715 # builds the 'build-tools' target rather than 'all'.
716 # 3. cross-tools stage [XMAKE]
718 # are needed for building the system. A cross-compiler is one
720 # 1. the 'all' target is built rather than 'build-tools'
739 # Don't rebuild build-tools targets during normal build.
752 # bootstrap-tools stage
757 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
758 # need to keep this in sync with targets/pseudo/bootstrap-tools/Makefile
760 OBJTOP='${WORLDTMP}/obj-tools' \
766 -DNO_CPU_CFLAGS \
767 -DNO_PIC \
768 -DNO_SHARED \
785 ${TIME_ENV} ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
791 # build-tools stage
793 ${TIME_ENV} ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
798 -DNO_CPU_CFLAGS \
811 # cross-tools stage
819 # kernel-tools stage
823 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
827 ${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
829 OBJTOP='${WORLDTMP}/obj-kernel-tools' \
834 -DNO_CPU_CFLAGS \
835 -DNO_PIC \
836 -DNO_SHARED \
846 INSTALL="${INSTALL_CMD} -U" \
853 HMAKE+= PATH=${TMPPATH:Q} METALOG=${METALOG} -DNO_ROOT
864 # In the case of xdev-build tools, CROSS_BINUTILS_PREFIX won't be a
867 BFLAGS+= -B${CROSS_BINUTILS_PREFIX}
873 # always pass an explicit --sysroot and -target.
874 # - External compiler needs sysroot and target flags.
875 # - External ld needs sysroot.
876 # - To be clear about the use of a sysroot when using the internal compiler.
877 # - Easier debugging.
878 # - Allowing WITH_SYSTEM_COMPILER+WITH_META_MODE to work together due to
879 # the flip-flopping build command when sometimes using external and
881 # - Allow using lld which has no support for default paths.
883 BFLAGS+= -B${WORLDTMP}/usr/bin
889 XCFLAGS+= -target ${TARGET_TRIPLE}
891 XCFLAGS+= --sysroot=${WORLDTMP}
912 # r318736 - ino64 major ABI breakage
916 .if exists(${OBJTOP}/host-osreldate.h)
919 ${OBJTOP}/host-osreldate.h
928 # is older than the ABI-breakage OSRELDATE of the HOST then we rebuild.
950 host-osreldate.h: # DO NOT ADD /usr/include/osreldate.h here
952 @cp -f /usr/include/osreldate.h ${.TARGET}
959 WMAKE= ${TIME_ENV} ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
964 IMAKE= ${TIME_ENV} ${IMAKEENV} ${MAKE} -f Makefile.inc1 \
966 .if empty(.MAKEFLAGS:M-n)
977 .if make(distributeworld) || make(distrib-dirs) || make(distribution) || \
983 INSTALLFLAGS+= -N ${.CURDIR}/etc
984 MTREEFLAGS+= -N ${.CURDIR}/etc
991 IMAKE+= -DNO_ROOT METALOG=${METALOG}
992 METALOG_INSTALLFLAGS= -U -M ${METALOG} -D ${INSTALL_DDIR}
995 MTREEFLAGS+= -W
998 INSTALLFLAGS+= -h sha256
1017 CERTCTLFLAGS+= -d /base
1021 CERTCTLFLAGS+= -D "${CERTCTLDESTDIR}"
1023 DESTDIR_MTREEFLAGS= -deU
1025 # so we also pass -W
1026 WORLDTMP_MTREEFLAGS= -deUW
1028 # When building with -DNO_ROOT we shouldn't be changing the directories
1030 DESTDIR_MTREEFLAGS+= -W
1033 DISTR_MTREEFLAGS= -N ${.CURDIR}/etc
1043 METALOG_SORT_CMD= env -i LC_COLLATE=C sort
1064 # Using ':' leaks into PATH and breaks finding cross-tools.
1073 # replacing generated files. Handle these cases here in an ad-hoc fashion.
1079 sh ${.CURDIR}/tools/build/depend-cleanup.sh ${OBJTOP} ${SRCTOP}
1085 @echo "--------------------------------------------------------------"
1087 @echo "--------------------------------------------------------------"
1088 rm -rf ${WORLDTMP}
1090 # Note: for delete-old we need to set $PATH to also include the host $PATH
1094 ${_+_}@if [ -e "${WORLDTMP}" ]; then \
1097 _NO_INCLUDE_COMPILERMK=t -DBATCH_DELETE_OLD_FILES delete-old \
1098 delete-old-libs >/dev/null; \
1100 rm -rf ${WORLDTMP}/legacy/usr/include
1103 if [ -x ${WORLDTMP}/usr/bin/${cc} ]; then \
1104 inum=$$(ls -i ${WORLDTMP}/usr/bin/${cc}); \
1105 find ${WORLDTMP}/usr/bin -inum $${inum%% *} -delete; \
1110 @rm -f ${WORLDTMP}/usr/bin/ld ${WORLDTMP}/usr/bin/ld.lld
1115 @echo "--------------------------------------------------------------"
1117 @echo "--------------------------------------------------------------"
1118 @mkdir -p ${WORLDTMP}
1121 # available on the target system (this happens e.g. when building on non-FreeBSD)
1125 # tools in $WORLDTMP for the tools that we don't build during bootstrap-tools
1127 ${MAKE} DIRPRFX=tools/build/ DESTDIR=${WORLDTMP}/legacy host-symlinks
1131 @echo "--------------------------------------------------------------"
1133 @echo "--------------------------------------------------------------"
1135 _bootstrap-tools:
1137 @echo "--------------------------------------------------------------"
1139 @echo "--------------------------------------------------------------"
1143 ${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools
1144 mkdir -p ${WORLDTMP}/usr ${WORLDTMP}/lib/geom ${WORLDTMP}/bin
1145 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
1146 -p ${WORLDTMP}/usr >/dev/null
1147 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
1148 -p ${WORLDTMP}/usr/include >/dev/null
1150 mkdir -p ${WORLDTMP}/usr/include/${d}
1152 ln -sf ${.CURDIR}/sys ${WORLDTMP}
1154 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
1155 -p ${WORLDTMP}/usr/lib >/dev/null
1158 ${WORLDTMP_MTREE} -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null
1163 @echo "--------------------------------------------------------------"
1165 @echo "--------------------------------------------------------------"
1170 ${_+_}cd ${.CURDIR}; ${LIB${LIBCOMPAT}WMAKE} _NO_INCLUDE_COMPILERMK=t -f Makefile.inc1 ${CLEANDIR}
1178 @echo "--------------------------------------------------------------"
1180 @echo "--------------------------------------------------------------"
1182 _build-tools:
1184 @echo "--------------------------------------------------------------"
1186 @echo "--------------------------------------------------------------"
1187 ${_+_}cd ${.CURDIR}; ${TMAKE} build-tools
1188 _cross-tools:
1190 @echo "--------------------------------------------------------------"
1192 @echo "--------------------------------------------------------------"
1193 @rm -f ${OBJTOP}/toolchain-metadata.mk
1194 ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools
1195 ${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools
1196 _build-metadata:
1198 @echo "--------------------------------------------------------------"
1200 @echo "--------------------------------------------------------------"
1201 ${_+_}cd ${.CURDIR}; ${WMAKE} toolchain-metadata.mk
1202 ${_+_}cd ${.CURDIR}; ${WMAKE} host-osreldate.h
1205 @echo "--------------------------------------------------------------"
1207 @echo "--------------------------------------------------------------"
1215 ${_+_}cd ${.CURDIR}; ${WMAKE} test-includes
1218 @echo "--------------------------------------------------------------"
1220 @echo "--------------------------------------------------------------"
1222 ${WMAKE} -DNO_FSCHG MK_HTML=no MK_MAN=no \
1227 @echo "--------------------------------------------------------------"
1229 @echo "--------------------------------------------------------------"
1236 WMAKE_TGTS+= _bootstrap-tools
1242 WMAKE_TGTS+= _build-tools _cross-tools
1243 WMAKE_TGTS+= _build-metadata
1273 _ncpu_cmd=sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo unknown
1276 @echo "--------------------------------------------------------------"
1278 @echo "--------------------------------------------------------------"
1282 @echo "--------------------------------------------------------------"
1284 @seconds=$$(($$(date '+%s') - ${_BUILDWORLD_START})); \
1285 echo ">>> World built in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
1286 @echo "--------------------------------------------------------------"
1298 .if ${.MAKEFLAGS:M-j}
1299 .error The buildenv target is incompatible with -j
1323 .if make(kernel-toolchain)
1326 kernel-toolchain: ${KERNEL_TOOLCHAIN_TGTS} .PHONY
1335 @echo "--------------------------------------------------------------"
1337 @echo "--------------------------------------------------------------"
1339 @echo "--------------------------------------------------------------"
1341 @echo "--------------------------------------------------------------"
1377 @if ! `id -u ${uid} >/dev/null 2>&1`; then \
1383 @if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \
1399 @if [ "`${OBJTOP}/rescue/rescue/rescue sh -c 'echo OK'`" != \
1439 # Non-base distributions produced by the base system
1456 mkdir -p ${INSTALLTMP}
1465 if [ -z "${CROSSBUILD_HOST}" ] ; then \
1466 libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | grep -Ev '\[.*]' | \
1468 set -- $$line; \
1478 cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale
1480 -mkdir -p ${METALOG:H}
1485 -mkdir ${DESTDIR}/${DISTDIR}/${dist}
1486 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.root.dist \
1487 -p ${DESTDIR}/${DISTDIR}/${dist} >/dev/null
1488 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
1489 -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
1490 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
1491 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null
1493 -mkdir ${DESTDIR}/${DISTDIR}/${dist}/usr/include/${d}
1496 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
1497 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null
1500 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
1501 -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
1503 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
1504 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/usr >/dev/null
1508 -mkdir -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE}
1509 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
1510 -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null
1512 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
1513 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug${TESTSBASE} >/dev/null
1516 ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \
1517 sed -e 's#^\./#./${dist}/#' >> ${METALOG}
1518 ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \
1519 sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
1520 ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \
1521 sed -e 's#^\./#./${dist}/usr/include/#' >> ${METALOG}
1526 ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist | \
1527 sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
1530 -mkdir ${DESTDIR}/${DISTDIR}/base
1534 LOCAL_MTREE=${LOCAL_MTREE:Q} distrib-dirs
1538 ${IMAKEENV} rm -rf ${INSTALLTMP}
1546 find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -type d -empty -delete
1555 find ./${dist}${path} | ${METALOG_SORT_CMD} -u ${METALOG} - | \
1565 ${TAR_CMD} cvf - --exclude usr/lib/debug \
1572 ${TAR_CMD} cvf - @${DESTDIR}/${DISTDIR}/${dist}.debug.meta | \
1573 ${XZ_CMD} > ${PACKAGEDIR}/${dist}-dbg.txz
1580 # Ensure no regressions in self-includeability of sys/*.h and net*/*.h
1581 test-includes: .PHONY
1582 ${_+_}cd ${.CURDIR}/tools/build/test-includes; \
1584 ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} DESTDIR=${WORLDTMP} test-includes
1601 sysent-${_dir}: .PHONY
1602 @echo "${MAKE} -C ${.CURDIR}/${_dir} sysent"
1603 ${_+_}@env PATH=${_sysent_PATH:Q} ${MAKE} -C ${.CURDIR}/${_dir} sysent
1605 sysent: sysent-${_dir}
1616 @echo "--------------------------------------------------------------"
1618 @echo "--------------------------------------------------------------"
1619 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \
1622 @echo "--------------------------------------------------------------"
1624 @echo "--------------------------------------------------------------"
1625 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \
1629 @echo "--------------------------------------------------------------"
1631 @echo "--------------------------------------------------------------"
1632 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
1634 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install${libcompat}
1636 @echo "--------------------------------------------------------------"
1638 @seconds=$$(($$(date '+%s') - ${_INSTALLWORLD_START})); \
1639 …> Install world completed in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
1640 @echo "--------------------------------------------------------------"
1643 @echo "--------------------------------------------------------------"
1645 @echo "--------------------------------------------------------------"
1646 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
1648 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute${libcompat} \
1652 distrib-dirs distribution: .MAKE .PHONY
1657 ${MAKE} -f Makefile.inc1 ${IMAKE_INSTALL} \
1666 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 _worldtmp
1667 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 _legacy
1668 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 _bootstrap-tools \
1670 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 _obj
1671 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 buildconfig
1672 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 everything \
1676 @echo "--------------------------------------------------------------"
1678 @echo "--------------------------------------------------------------"
1679 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distrib-dirs
1680 @echo "--------------------------------------------------------------"
1682 @echo "--------------------------------------------------------------"
1683 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribution
1695 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
1696 # be set to cross-build, we have to make sure TARGET is set
1703 # Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah
1718 .for _k in ${GENERIC_KERNCONF} MINIMAL${GENERIC_KERNCONF_SUFX_${TARGET_ARCH}} ${GENERIC_KERNCONF}-M…
1722 .if exists(${KERNCONFDIR}/${_k}-${_dbg})
1723 PKG_KERNCONF+= ${_k}-${_dbg}
1755 @if [ -e "${KRNLOBJDIR}/${KERNCONF}/modules${SRCTOP}/sys/modules/${m}/.depend.${f}.o" ] && \
1756 …grep -q ${f}.S "${KRNLOBJDIR}/${KERNCONF}/modules${SRCTOP}/sys/modules/${m}/.depend.${f}.o"; then \
1758 rm -f ${KRNLOBJDIR}/${KERNCONF}/modules${SRCTOP}/sys/modules/${m}/.depend.${f}.*; \
1784 @echo "--------------------------------------------------------------"
1786 @echo "--------------------------------------------------------------"
1788 mkdir -p ${KRNLOBJDIR}
1791 @echo "--------------------------------------------------------------"
1793 @echo "--------------------------------------------------------------"
1796 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
1797 -I '${KERNCONFDIR}' -I '${KRNLCONFDIR}' \
1802 @echo "--------------------------------------------------------------"
1804 @echo "--------------------------------------------------------------"
1811 @echo "--------------------------------------------------------------"
1813 @echo "--------------------------------------------------------------"
1817 @echo "--------------------------------------------------------------"
1819 @echo "--------------------------------------------------------------"
1820 ${_+_}cd ${.CURDIR}; ${KTMAKE} kernel-tools
1822 @echo "--------------------------------------------------------------"
1824 @echo "--------------------------------------------------------------"
1825 ${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ
1826 @echo "--------------------------------------------------------------"
1828 @echo "--------------------------------------------------------------"
1831 @seconds=$$(($$(date '+%s') - ${_BUILDKERNEL_START})); \
1832 …(s) ${BUILDKERNELS} built in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
1833 @echo "--------------------------------------------------------------"
1835 .if !make(packages) && !make(update-packages)
1838 # packages/update-packages installs kernels to a staging directory then builds
1850 # /boot/kernel, rather than to a config-suffixed directory.
1851 INSTALLEXTRAKERNELS= ${BUILDKERNELS:[2..-1]}
1873 . if !defined(ALLOW_PKGBASE_INSTALLKERNEL) && exists(${LOCALBASE}/sbin/pkg-static)
1875 # This means people can continue to use installkernel for non-packaged
1882 @if ${LOCALBASE}/sbin/pkg-static which /boot/${_kernel}/kernel \
1883 >/dev/null 2>&1; then \
1898 . endif # !defined(ALLOW_PKGBASE_INSTALLKERNEL) && exists(pkg-static)
1900 . if !defined(ALLOW_PKGBASE_INSTALLWORLD) && exists(${LOCALBASE}/sbin/pkg-static)
1903 @if ${LOCALBASE}/sbin/pkg-static info -e ${PKG_NAME_PREFIX}-runtime; then \
1915 . endif # !defined(ALLOW_PKGBASE_INSTALLWORLD) && exists(pkg-static)
1930 @echo "--------------------------------------------------------------"
1932 @echo "--------------------------------------------------------------"
1937 @echo "--------------------------------------------------------------"
1939 @echo "--------------------------------------------------------------"
1940 @seconds=$$(($$(date '+%s') - ${_INSTALLKERNEL_START})); \
1941 …{INSTALLKERNEL} completed in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
1942 @echo "--------------------------------------------------------------"
1946 @echo "--------------------------------------------------------------"
1948 @echo "--------------------------------------------------------------"
1953 @echo "--------------------------------------------------------------"
1955 @echo "--------------------------------------------------------------"
1957 @seconds=$$(($$(date '+%s') - ${_INSTALLKERNEL_START})); \
1958 …${BUILDKERNELS} completed in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
1959 @echo "--------------------------------------------------------------"
1968 mkdir -p ${DESTDIR}/${DISTDIR}
1969 rm -f ${DESTDIR}/${DISTDIR}/kernel.premeta
1978 sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta | \
1984 rm -f ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta
1994 sed -e "s|^./kernel.${_kernel}|.|" \
2004 ${TAR_CMD} cvf - --exclude '*.debug' \
2010 ${TAR_CMD} cvf - --include '*/*/*.debug' \
2012 ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz
2017 ${TAR_CMD} cvf - --exclude '*.debug' \
2022 ${TAR_CMD} cvf - --include '*/*/*.debug' \
2024 ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz
2030 ${_+_}${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} DISTDIR=. distributekernel
2038 PKG_LEVEL?= -1
2039 PKG_CLEVEL?= ${"${PKG_FORMAT:Mtar}" != "":?:-l ${PKG_LEVEL}}
2044 .if make(create-*-packages*) || make(real-update-packages) || make(real-sign-packages)
2045 PKG_ABI!= ${PKG_CMD} -o ABI_FILE=${PKG_ABI_FILE} config ABI
2048 .ORDER: stage-packages create-packages
2049 .ORDER: create-packages create-world-packages
2050 .ORDER: create-packages create-source-packages
2051 .ORDER: create-packages create-kernel-packages
2052 .ORDER: create-packages sign-packages
2057 env - UNAME_r=${UNAME_r} PATH=$$PATH \
2058 make -C ${PORTSDIR}/ports-mgmt/pkg \
2067 PKG_BIN_VERSION!=${PKG_CMD} --version </dev/null 2>/dev/null |\
2068 awk -F. '/^[0-9.]+(-.*)?$$/ {print $$1 * 10000 + $$2 * 100 + $$3}'
2071 .if !defined(PKG_VERSION_FROM) && make(real-update-packages) && \
2101 ${_+_}${MAKE} -C ${.CURDIR} ${PKGMAKEARGS} real-packages
2103 update-packages: .PHONY
2104 ${_+_}${MAKE} -C ${.CURDIR} ${PKGMAKEARGS} real-update-packages
2106 package-pkg: _pkgbootstrap _repodir .PHONY
2109 rm -rf /tmp/ports.${TARGET} || :
2114 sh ${.CURDIR}/release/scripts/make-pkg-package.sh
2118 real-packages: stage-packages create-packages sign-packages .PHONY
2120 real-update-packages: stage-packages .PHONY
2121 ${_+_}${MAKE} -C ${.CURDIR} PKG_VERSION=${PKG_VERSION} create-packages
2124 @for pkg in ${PKG_VERSION_FROM_DIR}/${PKG_NAME_PREFIX}-*; do \
2125 pkgname=$$(pkg query -F $${pkg} '%n' | sed 's/${PKG_NAME_PREFIX}-\(.*\)/\1/') ; \
2126 newpkgname=${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION}.${PKG_EXT} ; \
2127 oldsum=$$(pkg query -F $${pkg} '%X') ; \
2128 if [ ! -f ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} ]; then \
2131 newsum=$$(pkg query -F ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} '%X') ; \
2132 if [ "${BRANCH_EXT_FROM}" = "${BRANCH_EXT}" -a "$${oldsum}" = "$${newsum}" ]; then \
2133 echo "==> Keeping old ${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION_FROM}.${PKG_EXT}" ; \
2143 ${_+_}${MAKE} -C ${.CURDIR} -f Makefile.inc1 PKG_VERSION=${PKG_VERSION} sign-packages
2145 stage-packages-world: .PHONY
2146 @mkdir -p ${WSTAGEDIR}
2148 ${MAKE} DESTDIR=${WSTAGEDIR} -DNO_ROOT stageworld
2150 stage-packages-kernel: .PHONY
2151 @mkdir -p ${KSTAGEDIR}
2153 ${MAKE} DESTDIR=${KSTAGEDIR} -DNO_ROOT stagekernel
2155 stage-packages-source: .PHONY
2156 @mkdir -p ${SSTAGEDIR};
2158 stage-packages: .PHONY stage-packages-world stage-packages-kernel stage-packages-source
2161 @mkdir -p ${REPODIR}
2163 create-packages-world: _pkgbootstrap _repodir .PHONY
2165 ${MAKE} -f Makefile.inc1 \
2167 PKG_VERSION=${PKG_VERSION} create-world-packages
2169 .ORDER: create-packages-world create-packages-sets
2170 .ORDER: create-packages-kernel create-packages-sets
2171 .ORDER: create-packages-source create-packages-sets
2172 create-packages-sets: _pkgbootstrap _repodir .PHONY
2174 ${MAKE} -f Makefile.inc1 \
2176 PKG_VERSION=${PKG_VERSION} create-sets-packages
2178 create-packages-kernel: _pkgbootstrap _repodir .PHONY
2180 ${MAKE} -f Makefile.inc1 \
2184 create-kernel-packages
2186 create-packages-kernel-repo: .PHONY create-packages-kernel sign-packages
2188 create-packages-world-repo: .PHONY create-packages-world sign-packages
2190 create-packages-sets-repo: .PHONY create-packages-sets sign-packages
2192 create-packages-source: _pkgbootstrap _repodir .PHONY
2194 ${MAKE} -f Makefile.inc1 \
2198 create-source-packages
2200 create-packages: .PHONY create-packages-world create-packages-kernel create-packages-source package
2202 create-source-src-package: _pkgbootstrap .PHONY
2203 rm -f ${SSTAGEDIR}/src.plist 2>/dev/null || :
2207 ${GIT_CMD} ls-files --recurse-submodules ":!:sys/" ) \
2209 ${SRCDIR}/release/packages/generate-ucl.lua \
2219 ${PKG_CMD} -o ABI=${PKG_ABI} \
2220 -o OSVERSION="${SRCRELDATE}" \
2221 create -f ${PKG_FORMAT} ${PKG_CLEVEL} -T${PKG_CTHREADS} \
2222 -M ${SSTAGEDIR}/src.ucl \
2223 -p ${SSTAGEDIR}/src.plist \
2224 -r ${SRCDIR} \
2225 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
2228 create-source-src-sys-package: _pkgbootstrap .PHONY
2229 rm -f ${SSTAGEDIR}/src-sys.plist 2>/dev/null || :
2233 ${GIT_CMD} ls-files --recurse-submodules "sys/" ) \
2234 > ${SSTAGEDIR}/src-sys.plist
2235 ${SRCDIR}/release/packages/generate-ucl.lua \
2236 PKGNAME "src-sys" \
2237 PKGGENNAME "src-sys" \
2244 ${SSTAGEDIR}/src-sys.ucl
2245 ${PKG_CMD} -o ABI=${PKG_ABI} \
2246 -o OSVERSION="${SRCRELDATE}" \
2247 create -f ${PKG_FORMAT} ${PKG_CLEVEL} -T${PKG_CTHREADS} \
2248 -M ${SSTAGEDIR}/src-sys.ucl \
2249 -p ${SSTAGEDIR}/src-sys.plist \
2250 -r ${SRCDIR} \
2251 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
2254 create-source-packages: .PHONY _pkgbootstrap create-source-src-package create-source-src-sys-package
2256 create-world-packages: _pkgbootstrap .PHONY
2257 @rm -f ${WSTAGEDIR}/*.plist 2>/dev/null || :
2260 awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk
2267 ${MAKE} -f Makefile.inc1 create-world-packages-jobs \
2271 .if make(create-world-packages-jobs)
2275 create-world-packages-jobs: .PHONY
2277 create-world-packages-jobs: create-world-package-${pkgname}
2278 create-world-package-${pkgname}: .PHONY
2279 @sh ${SRCDIR}/release/packages/generate-ucl.sh -o ${pkgname} \
2280 -s ${SRCDIR} -u ${WSTAGEDIR}/${pkgname}.ucl
2281 @if [ "$$(grep -vc '^@dir' ${WSTAGEDIR}/${pkgname}.plist)" -gt 0 ]; then \
2282 awk -F\" ' \
2283 /^name/ { printf("===> Creating %s-", $$2); next } \
2286 ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \
2287 -o OSVERSION="${SRCRELDATE}" \
2288 create -f ${PKG_FORMAT} ${PKG_CLEVEL} -T${PKG_CTHREADS} \
2289 -M ${WSTAGEDIR}/${pkgname}.ucl \
2290 -p ${WSTAGEDIR}/${pkgname}.plist \
2291 -r ${WSTAGEDIR} \
2292 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}; \
2294 awk -F\" ' \
2295 /^name/ { printf("===> Skipping %s-", $$2); next } \
2301 create-sets-packages-jobs: .PHONY create-sets-packages
2302 create-sets-packages: .PHONY
2304 sh "${SRCDIR}/release/packages/create-sets.sh" "${SRCDIR}" \
2310 @for manifest in ${WSTAGEDIR}/set-*.ucl; do \
2311 echo "--> Processing manifest: $$manifest"; \
2312 ${PKG_CMD} -o ABI=${PKG_ABI} -o OSVERSION="${SRCRELDATE}" \
2313 create -f ${PKG_FORMAT} ${PKG_CLEVEL} -T${PKG_CTHREADS} \
2314 -M $$manifest \
2315 -o "${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}" \
2319 _default_flavor= -default
2322 _debug=-dbg
2325 create-dtb-package: .PHONY
2326 @if [ -f ${KSTAGEDIR}/${DISTDIR}/dtb.plist ]; then \
2327 ${SRCDIR}/release/packages/generate-ucl.lua \
2337 awk -F\" ' \
2338 /name/ { printf("===> Creating %s-", $$2); next } \
2341 ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \
2342 -o OSVERSION="${SRCRELDATE}" \
2343 create -f ${PKG_FORMAT} ${PKG_CLEVEL} -T${PKG_CTHREADS} \
2344 -M ${KSTAGEDIR}/${DISTDIR}/dtb.ucl \
2345 -p ${KSTAGEDIR}/${DISTDIR}/dtb.plist \
2346 -r ${KSTAGEDIR}/${DISTDIR} \
2347 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR} ; \
2350 create-kernel-packages: .PHONY create-kernel-flavored-packages create-dtb-package
2351 create-kernel-flavored-packages: .PHONY
2352 .ORDER: create-kernel-flavored-packages create-dtb-package
2355 create-kernel-flavored-packages: create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}
2356 create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap .PHONY
2359 awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
2360 -v kernel=yes -v _kernconf=${INSTALLKERNEL} ; \
2361 ${SRCDIR}/release/packages/generate-ucl.lua \
2362 PKGNAME "kernel-${INSTALLKERNEL:tl}${flavor}" \
2374 awk -F\" ' \
2375 /name/ { printf("===> Creating %s-", $$2); next } \
2378 ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \
2379 -o OSVERSION="${SRCRELDATE}" \
2380 create -f ${PKG_FORMAT} ${PKG_CLEVEL} -T${PKG_CTHREADS} \
2381 -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \
2382 -p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \
2383 -r ${KSTAGEDIR}/${DISTDIR} \
2384 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
2387 create-kernel-packages: .PHONY
2394 _debug=-dbg
2397 create-kernel-packages: create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_…
2398 create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel}: _pkgbootstrap .…
2401 awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
2402 -v kernel=yes -v _kernconf=${_kernel} ; \
2403 ${SRCDIR}/release/packages/generate-ucl.lua \
2404 PKGNAME "kernel-${_kernel:tl}${flavor}" \
2417 awk -F\" ' \
2418 /name/ { printf("===> Creating %s-", $$2); next } \
2421 ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \
2422 -o OSVERSION="${SRCRELDATE}" \
2423 create -f ${PKG_FORMAT} ${PKG_CLEVEL} -T${PKG_CTHREADS} \
2424 -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \
2425 -p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \
2426 -r ${KSTAGEDIR}/kernel.${_kernel} \
2427 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
2433 sign-packages: .PHONY
2435 ${MAKE} -f Makefile.inc1 \
2438 real-sign-packages
2440 real-sign-packages: _pkgbootstrap .PHONY
2442 @${PKG_CMD} -o ABI=${PKG_ABI} -o OSVERSION="${SRCRELDATE}" \
2443 -o WORKERS_COUNT=${PKG_WORKERS_COUNT} repo \
2444 -m ${WSTAGEDIR}/meta \
2445 -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \
2449 ln -hfs ${PKG_OUTPUT_DIR} latest
2458 @if [ ! -x "${LOCALBASE}/bin/kyua" ] && [ ! -x "/usr/bin/kyua" ]; then \
2462 ${_+_}PATH="$$PATH:${LOCALBASE}/bin" kyua test -k ${TESTSBASE}/Kyuafile
2471 @if [ ! -x "${LOCALBASE}/bin/doxygen" ]; then \
2475 @if [ ! -x "${LOCALBASE}/bin/tex" ]; then \
2476 …echo "You need TeX (print/texlive-full) to generate the API documentation of the kernel." | /usr/b…
2479 @if [ ! -x "${LOCALBASE}/bin/dot" ]; then \
2486 # ------------------------------------------------------------------------
2499 # which don't have the APIs required by the targets built in bootstrap-tools,
2500 # build-tools or cross-tools.
2513 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
2521 # bootstrap-tools: Build tools needed for compatibility. These are binaries that
2524 # libraries, augmented by -legacy, in addition to the libraries built during
2525 # bootstrap-tools.
2527 _bt= _bootstrap-tools
2535 # from the FreeBSD sources during the bootstrap-tools stage.
2536 # We want to build without the user's $PATH starting in the bootstrap-tools
2545 # $PATH during the bootstrap-tools stage.
2546 # When building on non-FreeBSD systems we can't assume that the host binaries
2580 # version of m4 (with pre-generated files) then use that to build the real m4.
2583 # For lex we also use the pre-gerated files since we would otherwise need to
2587 _m4= tools/build/bootstrap-m4 usr.bin/m4
2588 ${_bt}-tools/build/bootstrap-m4: ${_bt}-usr.bin/lex ${_bt}-lib/libopenbsd ${_bt}-usr.bin/yacc
2589 ${_bt}-usr.bin/m4: ${_bt}-lib/libopenbsd ${_bt}-usr.bin/yacc ${_bt}-usr.bin/lex ${_bt}-tools/build/…
2590 _bt_m4_depend=${_bt}-usr.bin/m4
2591 _bt_lex_depend=${_bt}-usr.bin/lex ${_bt_m4_depend}
2597 # r296685 fix cross-endian objcopy
2601 # r339083 libelf: correct mips64el test to use ELF header
2604 _elftoolchain_libs= lib/libelf lib/libdwarf lib/libzstd
2605 ${_bt}-lib/libelf: ${_bt_m4_depend}
2606 ${_bt}-lib/libdwarf: ${_bt_m4_depend}
2607 _bt_libelf_depend=${_bt}-lib/libelf
2611 ${_bt}-lib/libkldelf: ${_bt_libelf_depend}
2612 _bt_libkldelf_depend=${_bt}-lib/libkldelf
2615 ${_bt}-usr.sbin/kldxref: ${_bt_libelf_depend} ${_bt_libkldelf_depend}
2618 # 13.0-CURRENT cycle, thus needs to be built on -older releases and stable
2621 ${_bt}-libexec/flua: ${_bt}-lib/liblua
2625 ${_bt}-libexec/flua: ${_bt}-lib/libmd ${_bt}-lib/libucl ${_bt}-lib/libyaml
2629 # r245440 mtree -N support added
2636 ${_bt}-lib/libnetbsd: ${_bt}-lib/libmd
2637 ${_bt}-usr.sbin/nmtree: ${_bt}-lib/libnetbsd
2642 # r246097: log addition login.conf.db, passwd, pwd.db, and spwd.db with cat -l
2649 # r277259 crunchide: Correct 64-bit section header offset
2650 # r281674 crunchide: always include both 32- and 64-bit ELF support
2657 # 1400052, 1300526, 1203507: Removed -dc from linker invocation
2680 ${_bt}-usr.sbin/makefs: ${_bt}-lib/libnetbsd
2684 ${_bt}-usr.sbin/makefs: ${_bt}-lib/libsbuf
2706 # llvm-tblgen is also needed for various llvm binutils (e.g. objcopy).
2713 usr.bin/clang/llvm-min-tblgen \
2714 usr.bin/clang/llvm-tblgen
2718 _clang_tblgen+= usr.bin/clang/clang-tblgen
2721 _clang_tblgen+= usr.bin/clang/lldb-tblgen
2723 ${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/libllvmminimal
2724 ${_bt}-usr.bin/clang/lldb-tblgen: ${_bt}-lib/clang/libllvmminimal
2725 ${_bt}-usr.bin/clang/llvm-min-tblgen: ${_bt}-lib/clang/libllvmminimal
2726 ${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-lib/clang/libllvmminimal
2727 ${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-usr.bin/clang/llvm-min-tblgen
2730 # C.UTF-8 is always built in share/ctypes and we need localedef for that.
2732 ${_bt}-usr.bin/localedef: ${_bt}-usr.bin/yacc ${_bt_lex_depend}
2737 ${_bt}-usr.bin/mkesdb: ${_bt}-usr.bin/yacc ${_bt_lex_depend}
2738 ${_bt}-usr.bin/mkcsmapper: ${_bt}-usr.bin/yacc ${_bt_lex_depend}
2744 krb5/util/build-tools \
2757 kerberos5/tools/make-roken \
2765 .ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g}
2767 ${_bt}-${_tool}: ${_bt}-usr.bin/yacc ${_bt_lex_depend}
2771 ${_bt}-usr.bin/mandoc: ${_bt}-lib/libopenbsd
2779 # subdirectory and comma-separated list of files.
2803 # bootstrap ldd on non-FreeBSD systems
2813 # When building on non-FreeBSD, install a fake chflags instead since the
2815 # are install with -DNO_ROOT.
2816 _other_bootstrap_tools+=tools/build/cross-build/fake_chflags
2840 ${_bt}-usr.sbin/certctl: ${_bt}-secure/lib/libcrypto
2850 ${_bt}-usr.bin/awk: ${_bt_lex_depend} ${_bt}-usr.bin/yacc
2851 ${_bt}-bin/expr: ${_bt_lex_depend} ${_bt}-usr.bin/yacc
2853 ${_bt}-usr.sbin/config: ${_bt}-usr.bin/file2c ${_bt_lex_depend}
2856 # `make legacy` step. Not adding a link to make is important on non-FreeBSD
2862 ${_bt}-usr.bin/grep: ${_bt}-lib/libbz2
2866 ${_bt}-lib/libdwarf: ${_bt}-lib/libz
2870 ${_bt}-lib/libroken: ${_bt}-lib/libcrypt
2884 ${_bt}-links: .PHONY
2887 ${_bt}-link-${_tool}: .PHONY
2888 @rm -f "${WORLDTMP}/legacy/bin/${_tool}"; \
2890 if [ ! -e "$${source_path}" ] ; then \
2893 install -p "$${source_path}" "${WORLDTMP}/legacy/bin/${_tool}"
2894 ${_bt}-links: ${_bt}-link-${_tool}
2897 bootstrap-tools: ${_bt}-links .PHONY
2899 # Please document (add comment) why something is in 'bootstrap-tools'.
2900 # Try to bound the building of the bootstrap-tool to just the
2945 # but the target may have been defined earlier to express dependencies -- thus,
2947 .if !commands(${_bt}-${_tool})
2948 ${_bt}-${_tool}: ${_bt}-links .PHONY .MAKE
2951 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
2957 bootstrap-tools: ${_bt}-${_tool}
2960 .if target(${_bt}-lib/libmd)
2963 ${_bt}-usr.bin/sort: ${_bt}-lib/libmd
2964 ${_bt}-usr.bin/xinstall: ${_bt}-lib/libmd
2965 ${_bt}-sbin/md5: ${_bt}-lib/libmd
2970 # build-tools: Build special purpose build tools
2977 # rescue includes programs that have build-tools targets
2989 _jevents=lib/libpmc/pmu-events
2992 # kernel-toolchain skips _cleanobj, so handle cleaning up previous
2993 # build-tools directories if needed.
2994 .if ${MK_CLEAN} == "yes" && make(kernel-toolchain)
3009 build-tools_${_tool}: .PHONY
3010 ${_+_}@${ECHODIR} "===> ${_tool} (${_bt_clean:D${_bt_clean},}obj,build-tools)"; \
3012 if [ -n "${_bt_clean}" ]; then ${MAKE} DIRPRFX=${_tool}/ ${_bt_clean}; fi; \
3013 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
3014 ${MAKE} DIRPRFX=${_tool}/ build-tools
3015 build-tools: build-tools_${_tool}
3019 # kernel-tools: Build kernel-building tools
3021 kernel-tools: .PHONY
3022 mkdir -p ${WORLDTMP}/usr
3023 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
3024 -p ${WORLDTMP}/usr >/dev/null
3027 # cross-tools: All the tools needed to build the rest of the system after
3037 # Rebuild ctfconvert and ctfmerge to avoid difficult-to-diagnose failures
3046 # because llvm-objcopy is currently not capable of translating ELF to PE32+,
3059 # cross-build on a FreeBSD 10 host:
3075 _llvm_binutils= usr.bin/clang/llvm-ar \
3076 usr.bin/clang/llvm-nm \
3077 usr.bin/clang/llvm-objcopy \
3078 usr.bin/clang/llvm-size
3088 cross-tools: .MAKE .PHONY
3102 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
3108 # native-xtools is the current target for qemu-user cross builds of ports
3117 NXTP?= /nxb-bin
3192 # XXX: native-xtools passes along ${NXBDIRS} in SUBDIR_OVERRIDE that needs
3201 -DNO_SHARED \
3202 -DNO_CPU_CFLAGS \
3203 -DNO_PIC \
3231 .if make(native-xtools*) && \
3237 NXBTMAKE= ${NXBMAKEENV} ${MAKE} ${NXBMAKEARGS:N-DNO_PIC:N-DNO_SHARED} \
3239 # For 'everything' we want to produce native binaries (hence -target to
3253 NXBMAKE+= ${NXBMAKEENV} ${MAKE} -f Makefile.inc1 ${NXBMAKEARGS} \
3258 # invoke a sub-make to reevaluate MK_CLANG, etc, for NXBDIRS.
3260 # Need to avoid the -isystem logic when using clang as an external toolchain
3263 native-xtools: .PHONY
3266 ${_+_}cd ${.CURDIR}; ${NXBTMAKE} kernel-toolchain
3270 # polluting the cross-compiler build. The LLVM libs are skipped
3279 @echo ">> native-xtools done. Use 'make native-xtools-install' to install to a given DESTDIR"
3281 native-xtools-install: .PHONY
3282 mkdir -p ${NXBDESTDIR}/bin ${NXBDESTDIR}/sbin ${NXBDESTDIR}/usr
3283 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
3284 -p ${NXBDESTDIR}/usr >/dev/null
3285 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
3286 -p ${NXBDESTDIR}/usr/include >/dev/null
3288 mkdir -p ${NXBDESTDIR}/usr/include/${d}
3292 -DNO_ROOT \
3296 # hierarchy - ensure that all the needed directories are present
3299 ${_+_}cd ${.CURDIR}/etc; ${HMAKE} distrib-dirs
3302 # libraries - build all libraries, and install them under ${DESTDIR}.
3310 ${MAKE} -f Makefile.inc1 _prereq_libs; \
3311 ${MAKE} -f Makefile.inc1 _startup_libs; \
3312 ${MAKE} -f Makefile.inc1 _prebuild_libs -DLIBCRYPTO_WITHOUT_SUBDIRS; \
3313 ${MAKE} -f Makefile.inc1 _generic_libs
3324 _prereq_libs+= lib/libclang_rt/asan-preinit
3367 lib/libelf lib/libexpat \
3591 _krb5_util_build_tools= krb5/util/build-tools
3643 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; fi; \
3644 ${MAKE} MK_TESTS=no -DNO_PIC \
3646 ${MAKE} MK_TESTS=no -DNO_PIC \
3656 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; fi; \
3669 # that running 'make all' from the top-level, especially with a SUBDIR_OVERRIDE
3674 # avoid trashing a system if it crashes mid-install.
3681 .if make(check-old) || make(check-old-dirs) || \
3682 make(check-old-files) || make(check-old-libs) || \
3683 make(delete-old) || make(delete-old-dirs) || \
3684 make(delete-old-files) || make(delete-old-libs) || \
3685 make(list-old-dirs) || make(list-old-files) || make(list-old-libs)
3699 RM_I=-i
3701 RM_I=-fv
3704 list-old-files: .PHONY
3706 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
3707 -V "OLD_FILES:ts\n" -V "OLD_FILES:Musr/share/*.gz:R:ts\n" \
3708 -V "MOVED_LIBS:ts\n" \
3709 ${_ALL_libcompats:@v@-V "OLD_FILES:Mlib/*.so.*:S,^lib,usr/lib$v,:ts\n"@} \
3710 ${_ALL_libcompats:@v@-V "OLD_FILES:Musr/lib/*:S,^usr/lib,usr/lib$v,:ts\n"@} | \
3713 delete-old-files: .PHONY
3722 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-files | \
3724 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
3725 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
3729 if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \
3739 …find ${DESTDIR}/usr/share/man ${DESTDIR}/usr/share/openssl/man ! -type d ! -name \*.gz 2>/dev/null…
3741 if [ -e "$${manpage}.gz" ]; then \
3748 …find ${DESTDIR}/usr/share/man ${DESTDIR}/usr/share/openssl/man ! -type d ! -name \*.gz 2>/dev/null…
3750 if [ -e "$${manpage}.gz" ]; then \
3757 …find -E /usr/share/man/man4/ -mindepth 1 -type d ! -regex '.*/(${MAN_ARCH:C/[[:space:]]+/|/gW})' |…
3759 find $$dir ! -type d -exec rm ${RM_I} {} + <&3; \
3764 check-old-files: .PHONY
3767 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-files | \
3769 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
3773 if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
3780 …@find ${DESTDIR}/usr/share/man ${DESTDIR}/usr/share/openssl/man ! -type d ! -name \*.gz 2>/dev/nul…
3782 if [ -e "$${manpage}.gz" ]; then \
3788 …@find ${DESTDIR}/usr/share/man ${DESTDIR}/usr/share/openssl/man ! -type d ! -name \*.gz 2>/dev/nul…
3790 if [ -e "$${manpage}.gz" ]; then \
3796 …@find -E /usr/share/man/man4/ -mindepth 1 -type d ! -regex '.*/(${MAN_ARCH:C/[[:space:]]+/|/gW})' …
3798 find $$dir ! -type d; \
3802 list-old-libs: .PHONY
3804 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
3805 -V "OLD_LIBS:ts\n" \
3806 ${_ALL_libcompats:@v@-V "OLD_LIBS:Mlib/*:S,^lib,usr/lib$v,:ts\n"@} \
3807 ${_ALL_libcompats:@v@-V "OLD_LIBS:Musr/lib/*:S,^usr/lib,usr/lib$v,:ts\n"@} \
3808 ${_ALL_libcompats:@v@-V "OLD_LIBS:Mlib/casper/*:S,^lib/casper,usr/lib$v,:ts\n"@} | \
3811 delete-old-libs: .PHONY
3816 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-libs | \
3818 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
3819 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
3823 if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \
3832 check-old-libs: .PHONY
3835 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-libs | \
3837 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
3841 if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
3847 list-old-dirs: .PHONY
3849 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
3850 -V "OLD_DIRS:ts\n" | sort -r
3852 delete-old-dirs: .PHONY
3855 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-dirs | \
3857 if [ -d "${DESTDIR}/$${dir}" ]; then \
3858 rmdir -v "${DESTDIR}/$${dir}" || true; \
3859 elif [ -L "${DESTDIR}/$${dir}" ]; then \
3862 if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
3863 rmdir -v "${DESTDIR}${DEBUGDIR}/$${dir}" || true; \
3864 elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
3870 check-old-dirs: .PHONY
3873 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-dirs | \
3875 if [ -d "${DESTDIR}/$${dir}" ]; then \
3877 elif [ -L "${DESTDIR}/$${dir}" ]; then \
3880 if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
3882 elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
3887 delete-old: delete-old-files delete-old-dirs .PHONY
3888 @echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'."
3890 check-old: check-old-files check-old-libs check-old-dirs .PHONY
3891 @echo "To remove old files and directories run '${MAKE_CMD} delete-old'."
3892 @echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'."
3897 # showconfig - show build configuration.
3902 …@(${MAKE} -n -f ${.CURDIR}/sys/conf/kern.opts.mk -V dummy -dg1 UPDATE_DEPENDFILE=no NO_OBJ=yes MAC…
3903 …${MAKE} -n -f ${.CURDIR}/share/mk/src.opts.mk -V dummy -dg1 UPDATE_DEPENDFILE=no NO_OBJ=yes MACHIN…
3904 grep -E '^(MK|OPT)_[A-Z]' | sort -u
3960 -(cd ${BW_CANONICALOBJDIR} && rm -rf *)
3961 -chflags -R 0 ${BW_CANONICALOBJDIR}
3962 -(cd ${BW_CANONICALOBJDIR} && rm -rf *)
3978 NOFUN=-DNO_FSCHG MK_HTML=no \
3984 XDDIR=${TARGET_ARCH}-freebsd
4003 # GCC requires -isystem and -L when using a cross-compiler. --sysroot
4004 # won't set header path and -L is used to ensure the base library path
4006 CD2CFLAGS+= -isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib
4007 # GCC requires -B to find /usr/lib/crti.o when using a cross-compiler
4008 # combined with --sysroot.
4009 CD2CFLAGS+= -B${XDDESTDIR}/usr/lib
4013 CD2CXXFLAGS+= -isystem ${XDDESTDIR}/usr/include/c++/v1 -std=c++11 \
4014 -nostdinc++
4017 CD2CFLAGS+= --sysroot=${XDDESTDIR}/
4027 # Don't rebuild build-tools targets during normal build.
4032 .ORDER: xdev-build xdev-install xdev-links
4033 xdev: xdev-build xdev-install .PHONY
4035 .ORDER: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools
4036 xdev-build: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools .PHONY
4038 _xb-worldtmp: .PHONY
4039 mkdir -p ${CDTMP}/usr
4040 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
4041 -p ${CDTMP}/usr >/dev/null
4043 _xb-bootstrap-tools: .PHONY
4049 if [ -z "${NO_OBJWALK}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ obj; fi; \
4054 _xb-build-tools: .PHONY
4056 ${CDBENV} ${MAKE} ${CDMAKEARGS} -f Makefile.inc1 ${NOFUN} build-tools
4065 _xb-cross-tools: .PHONY
4069 if [ -z "${NO_OBJWALK}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ obj; fi; \
4073 _xi-mtree: .PHONY
4075 mkdir -p ${XDDESTDIR}
4076 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.root.dist \
4077 -p ${XDDESTDIR} >/dev/null
4078 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
4079 -p ${XDDESTDIR}/usr >/dev/null
4080 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
4081 -p ${XDDESTDIR}/usr/include >/dev/null
4083 mkdir -p ${XDDESTDIR}/usr/include/${d}
4086 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
4087 -p ${XDDESTDIR}/usr >/dev/null
4090 mkdir -p ${XDDESTDIR}${TESTSBASE}
4091 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
4092 -p ${XDDESTDIR}${TESTSBASE} >/dev/null
4095 .ORDER: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries
4096 xdev-install: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries .PHONY
4098 _xi-cross-tools: .PHONY
4099 @echo "_xi-cross-tools"
4106 _xi-includes: .PHONY
4108 ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 _obj \
4111 ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 includes \
4114 _xi-libraries: .PHONY
4115 ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 libraries \
4118 xdev-links: .PHONY
4120 mkdir -p ../../../../usr/bin; \
4122 ln -sf ../../${XDTP}/usr/bin/$$i \
4123 ../../../../usr/bin/${XDDIR}-$$i; \
4124 ln -sf ../../${XDTP}/usr/bin/$$i \
4125 ../../../../usr/bin/${XDDIR}${_REVISION}-$$i; \