Lines Matching +full:libz +full:- +full:dev
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
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}
214 # for cross-builds.
248 # WITH_SYSTEM_COMPILER - Pull in needed values and make a decision.
259 !make(test-system-linker)
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
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
492 # If filemon is used then we can rely on the build being incremental-safe.
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/}
614 _CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} -f /dev/null \
615 -m ${.CURDIR}/share/mk MK_AUTO_OBJ=no -V CPUTYPE
621 BUILD_ARCH!= uname -p
622 # On some Linux systems uname -p returns "unknown" so skip this check there.
624 # MACHINE_ARCH so skipping it when crossbuilding on non-FreeBSD should be fine.
626 .error To cross-build, set TARGET_ARCH.
646 # When building on non-FreeBSD we can't rely on the tools in /usr/bin being compatible
648 # during the world build stage. We build most tools during the bootstrap-tools
672 INSTALLTMP!= ${MKTEMP} -d -u -t install
683 INSTALLTMP_COPY_HOST_TOOL=ln -s
697 # shims that are needed by the bootstrap-tools,
698 # build-tools and cross-tools stages. These are generally
701 # 1. bootstrap-tools stage [BMAKE]
704 # are not built as cross-tools.
705 # 2. build-tools stage [TMAKE]
711 # builds the 'build-tools' target rather than 'all'.
712 # 3. cross-tools stage [XMAKE]
714 # are needed for building the system. A cross-compiler is one
716 # 1. the 'all' target is built rather than 'build-tools'
735 # Don't rebuild build-tools targets during normal build.
748 # bootstrap-tools stage
753 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
754 # need to keep this in sync with targets/pseudo/bootstrap-tools/Makefile
756 OBJTOP='${WORLDTMP}/obj-tools' \
762 -DNO_CPU_CFLAGS \
763 -DNO_LINT \
764 -DNO_PIC \
765 -DNO_SHARED \
782 ${TIME_ENV} ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
788 # build-tools stage
790 ${TIME_ENV} ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
795 -DNO_CPU_CFLAGS \
796 -DNO_LINT \
809 # cross-tools stage
817 # kernel-tools stage
821 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
825 ${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
827 OBJTOP='${WORLDTMP}/obj-kernel-tools' \
832 -DNO_CPU_CFLAGS \
833 -DNO_LINT \
834 -DNO_PIC \
835 -DNO_SHARED \
845 INSTALL="${INSTALL_CMD} -U" \
852 HMAKE+= PATH=${TMPPATH:Q} METALOG=${METALOG} -DNO_ROOT
863 # In the case of xdev-build tools, CROSS_BINUTILS_PREFIX won't be a
866 BFLAGS+= -B${CROSS_BINUTILS_PREFIX}
872 # always pass an explicit --sysroot and -target.
873 # - External compiler needs sysroot and target flags.
874 # - External ld needs sysroot.
875 # - To be clear about the use of a sysroot when using the internal compiler.
876 # - Easier debugging.
877 # - Allowing WITH_SYSTEM_COMPILER+WITH_META_MODE to work together due to
878 # the flip-flopping build command when sometimes using external and
880 # - Allow using lld which has no support for default paths.
882 BFLAGS+= -B${WORLDTMP}/usr/bin
888 XCFLAGS+= -target ${TARGET_TRIPLE}
890 XCFLAGS+= --sysroot=${WORLDTMP}
911 # r318736 - ino64 major ABI breakage
915 .if exists(${OBJTOP}/host-osreldate.h)
918 ${OBJTOP}/host-osreldate.h
927 # is older than the ABI-breakage OSRELDATE of the HOST then we rebuild.
949 host-osreldate.h: # DO NOT ADD /usr/include/osreldate.h here
951 @cp -f /usr/include/osreldate.h ${.TARGET}
958 WMAKE= ${TIME_ENV} ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
963 IMAKE= ${TIME_ENV} ${IMAKEENV} ${MAKE} -f Makefile.inc1 \
965 .if empty(.MAKEFLAGS:M-n)
976 .if make(distributeworld) || make(distrib-dirs) || make(distribution) || \
982 INSTALLFLAGS+= -N ${.CURDIR}/etc
983 MTREEFLAGS+= -N ${.CURDIR}/etc
990 IMAKE+= -DNO_ROOT METALOG=${METALOG}
991 METALOG_INSTALLFLAGS= -U -M ${METALOG} -D ${INSTALL_DDIR}
994 MTREEFLAGS+= -W
997 INSTALLFLAGS+= -h sha256
1005 CERTCTLFLAGS+= -d /base
1009 CERTCTLFLAGS+= -D "${CERTCTLDESTDIR}"
1011 DESTDIR_MTREEFLAGS= -deU
1013 # so we also pass -W
1014 WORLDTMP_MTREEFLAGS= -deUW
1016 # When building with -DNO_ROOT we shouldn't be changing the directories
1018 DESTDIR_MTREEFLAGS+= -W
1021 DISTR_MTREEFLAGS= -N ${.CURDIR}/etc
1031 METALOG_SORT_CMD= env -i LC_COLLATE=C sort
1052 # Using ':' leaks into PATH and breaks finding cross-tools.
1061 # replacing generated files. Handle these cases here in an ad-hoc fashion.
1066 sh ${.CURDIR}/tools/build/depend-cleanup.sh ${OBJTOP}
1071 @echo "--------------------------------------------------------------"
1073 @echo "--------------------------------------------------------------"
1074 rm -rf ${WORLDTMP}
1076 # Note: for delete-old we need to set $PATH to also include the host $PATH
1080 ${_+_}@if [ -e "${WORLDTMP}" ]; then \
1083 _NO_INCLUDE_COMPILERMK=t -DBATCH_DELETE_OLD_FILES delete-old \
1084 delete-old-libs >/dev/null; \
1086 rm -rf ${WORLDTMP}/legacy/usr/include
1089 if [ -x ${WORLDTMP}/usr/bin/${cc} ]; then \
1090 inum=$$(ls -i ${WORLDTMP}/usr/bin/${cc}); \
1091 find ${WORLDTMP}/usr/bin -inum $${inum%% *} -delete; \
1096 @rm -f ${WORLDTMP}/usr/bin/ld ${WORLDTMP}/usr/bin/ld.lld
1101 @echo "--------------------------------------------------------------"
1103 @echo "--------------------------------------------------------------"
1104 @mkdir -p ${WORLDTMP}
1107 # available on the target system (this happens e.g. when building on non-FreeBSD)
1111 # tools in $WORLDTMP for the tools that we don't build during bootstrap-tools
1113 ${MAKE} DIRPRFX=tools/build/ DESTDIR=${WORLDTMP}/legacy host-symlinks
1117 @echo "--------------------------------------------------------------"
1119 @echo "--------------------------------------------------------------"
1121 _bootstrap-tools:
1123 @echo "--------------------------------------------------------------"
1125 @echo "--------------------------------------------------------------"
1129 ${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools
1130 mkdir -p ${WORLDTMP}/usr ${WORLDTMP}/lib/geom ${WORLDTMP}/bin
1131 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
1132 -p ${WORLDTMP}/usr >/dev/null
1133 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
1134 -p ${WORLDTMP}/usr/include >/dev/null
1136 mkdir -p ${WORLDTMP}/usr/include/${d}
1138 ln -sf ${.CURDIR}/sys ${WORLDTMP}
1140 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
1141 -p ${WORLDTMP}/usr/lib >/dev/null
1144 ${WORLDTMP_MTREE} -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null
1149 @echo "--------------------------------------------------------------"
1151 @echo "--------------------------------------------------------------"
1156 ${_+_}cd ${.CURDIR}; ${LIB${LIBCOMPAT}WMAKE} _NO_INCLUDE_COMPILERMK=t -f Makefile.inc1 ${CLEANDIR}
1163 @echo "--------------------------------------------------------------"
1165 @echo "--------------------------------------------------------------"
1167 _build-tools:
1169 @echo "--------------------------------------------------------------"
1171 @echo "--------------------------------------------------------------"
1172 ${_+_}cd ${.CURDIR}; ${TMAKE} build-tools
1173 _cross-tools:
1175 @echo "--------------------------------------------------------------"
1177 @echo "--------------------------------------------------------------"
1178 @rm -f ${OBJTOP}/toolchain-metadata.mk
1179 ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools
1180 ${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools
1181 _build-metadata:
1183 @echo "--------------------------------------------------------------"
1185 @echo "--------------------------------------------------------------"
1186 ${_+_}cd ${.CURDIR}; ${WMAKE} toolchain-metadata.mk
1187 ${_+_}cd ${.CURDIR}; ${WMAKE} host-osreldate.h
1190 @echo "--------------------------------------------------------------"
1192 @echo "--------------------------------------------------------------"
1200 ${_+_}cd ${.CURDIR}; ${WMAKE} test-includes
1203 @echo "--------------------------------------------------------------"
1205 @echo "--------------------------------------------------------------"
1207 ${WMAKE} -DNO_FSCHG MK_HTML=no -DNO_LINT MK_MAN=no \
1212 @echo "--------------------------------------------------------------"
1214 @echo "--------------------------------------------------------------"
1221 WMAKE_TGTS+= _bootstrap-tools
1227 WMAKE_TGTS+= _build-tools _cross-tools
1228 WMAKE_TGTS+= _build-metadata
1258 _ncpu_cmd=sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo unknown
1261 @echo "--------------------------------------------------------------"
1263 @echo "--------------------------------------------------------------"
1267 @echo "--------------------------------------------------------------"
1269 @seconds=$$(($$(date '+%s') - ${_BUILDWORLD_START})); \
1270 echo ">>> World built in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
1271 @echo "--------------------------------------------------------------"
1283 .if ${.MAKEFLAGS:M-j}
1284 .error The buildenv target is incompatible with -j
1308 .if make(kernel-toolchain)
1311 kernel-toolchain: ${KERNEL_TOOLCHAIN_TGTS} .PHONY
1320 @echo "--------------------------------------------------------------"
1322 @echo "--------------------------------------------------------------"
1324 @echo "--------------------------------------------------------------"
1326 @echo "--------------------------------------------------------------"
1362 @if ! `id -u ${uid} >/dev/null 2>&1`; then \
1368 @if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \
1384 @if [ "`${OBJTOP}/rescue/rescue/rescue sh -c 'echo OK'`" != \
1399 date echo egrep find grep id install ${_install-info} \
1424 # Non-base distributions produced by the base system
1441 mkdir -p ${INSTALLTMP}
1450 if [ -z "${CROSSBUILD_HOST}" ] ; then \
1451 libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | grep -Ev '\[.*]' | \
1453 set -- $$line; \
1463 cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale
1465 -mkdir -p ${METALOG:H}
1470 -mkdir ${DESTDIR}/${DISTDIR}/${dist}
1471 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.root.dist \
1472 -p ${DESTDIR}/${DISTDIR}/${dist} >/dev/null
1473 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
1474 -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
1475 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
1476 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null
1478 -mkdir ${DESTDIR}/${DISTDIR}/${dist}/usr/include/${d}
1481 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
1482 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null
1485 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
1486 -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
1488 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
1489 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/usr >/dev/null
1493 -mkdir -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE}
1494 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
1495 -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null
1497 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
1498 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/${TESTSBASE} >/dev/null
1502 ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \
1503 sed -e 's#^\./#./${dist}/#' >> ${METALOG}
1504 ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \
1505 sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
1506 ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \
1507 sed -e 's#^\./#./${dist}/usr/include/#' >> ${METALOG}
1512 ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist | \
1513 sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
1517 -mkdir ${DESTDIR}/${DISTDIR}/base
1521 LOCAL_MTREE=${LOCAL_MTREE:Q} distrib-dirs
1525 ${IMAKEENV} rm -rf ${INSTALLTMP}
1527 @if which openssl>/dev/null; then \
1532 …echo "No openssl on the host, not rehashing certificates target -- /etc/ssl may not be populated."…
1537 find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -type d -empty -delete
1546 find ./${dist} | ${METALOG_SORT_CMD} -u ${METALOG} - | \
1556 find ./${dist}/usr/lib/debug | ${METALOG_SORT_CMD} -u ${METALOG} - | \
1567 ${TAR_CMD} cvf - --exclude usr/lib/debug \
1572 ${TAR_CMD} cvf - --exclude usr/lib/debug . | \
1580 ${TAR_CMD} cvf - @${DESTDIR}/${DISTDIR}/${dist}.debug.meta | \
1581 ${XZ_CMD} > ${PACKAGEDIR}/${dist}-dbg.txz
1584 ${TAR_CMD} cvLf - usr/lib/debug | \
1585 ${XZ_CMD} > ${PACKAGEDIR}/${dist}-dbg.txz
1593 # Ensure no regressions in self-includeability of sys/*.h and net*/*.h
1594 test-includes: .PHONY
1595 ${_+_}cd ${.CURDIR}/tools/build/test-includes; \
1596 ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} DESTDIR=${WORLDTMP} test-includes
1612 sysent-${_dir}: .PHONY
1613 @echo "${MAKE} -C ${.CURDIR}/${_dir} sysent"
1614 ${_+_}@env PATH=${_sysent_PATH:Q} ${MAKE} -C ${.CURDIR}/${_dir} sysent
1616 sysent: sysent-${_dir}
1627 @echo "--------------------------------------------------------------"
1629 @echo "--------------------------------------------------------------"
1630 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \
1633 @echo "--------------------------------------------------------------"
1635 @echo "--------------------------------------------------------------"
1636 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \
1640 @echo "--------------------------------------------------------------"
1642 @echo "--------------------------------------------------------------"
1643 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
1645 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install${libcompat}
1647 @echo "--------------------------------------------------------------"
1649 @seconds=$$(($$(date '+%s') - ${_INSTALLWORLD_START})); \
1650 …> Install world completed in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
1651 @echo "--------------------------------------------------------------"
1654 @echo "--------------------------------------------------------------"
1656 @echo "--------------------------------------------------------------"
1657 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
1659 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute${libcompat} \
1663 distrib-dirs distribution: .MAKE .PHONY
1668 ${MAKE} -f Makefile.inc1 ${IMAKE_INSTALL} \
1677 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 _worldtmp
1678 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 _legacy
1679 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 _bootstrap-tools \
1681 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 _obj \
1683 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 everything \
1687 @echo "--------------------------------------------------------------"
1689 @echo "--------------------------------------------------------------"
1690 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distrib-dirs
1691 @echo "--------------------------------------------------------------"
1693 @echo "--------------------------------------------------------------"
1694 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribution
1706 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
1707 # be set to cross-build, we have to make sure TARGET is set
1714 # Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah
1730 .for _k in ${GENERIC_KERNCONF} MINIMAL${GENERIC_KERNCONF_SUFX_${TARGET_ARCH}} ${GENERIC_KERNCONF}-M…
1734 .if exists(${KERNCONFDIR}/${_k}-${_dbg})
1735 PKG_KERNCONF+= ${_k}-${_dbg}
1771 @if [ -e "${KRNLOBJDIR}/${KERNCONF}/modules${SRCTOP}/sys/modules/${m}/.depend.${f}.o" ] && \
1772 …grep -q ${f}.S "${KRNLOBJDIR}/${KERNCONF}/modules${SRCTOP}/sys/modules/${m}/.depend.${f}.o"; then \
1774 rm -f ${KRNLOBJDIR}/${KERNCONF}/modules${SRCTOP}/sys/modules/${m}/.depend.${f}.*; \
1800 @echo "--------------------------------------------------------------"
1802 @echo "--------------------------------------------------------------"
1804 mkdir -p ${KRNLOBJDIR}
1807 @echo "--------------------------------------------------------------"
1809 @echo "--------------------------------------------------------------"
1812 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
1813 -I '${KERNCONFDIR}' -I '${KRNLCONFDIR}' \
1818 @echo "--------------------------------------------------------------"
1820 @echo "--------------------------------------------------------------"
1827 @echo "--------------------------------------------------------------"
1829 @echo "--------------------------------------------------------------"
1833 @echo "--------------------------------------------------------------"
1835 @echo "--------------------------------------------------------------"
1836 ${_+_}cd ${.CURDIR}; ${KTMAKE} kernel-tools
1838 @echo "--------------------------------------------------------------"
1840 @echo "--------------------------------------------------------------"
1841 ${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ
1842 @echo "--------------------------------------------------------------"
1844 @echo "--------------------------------------------------------------"
1847 @seconds=$$(($$(date '+%s') - ${_BUILDKERNEL_START})); \
1848 …(s) ${BUILDKERNELS} built in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
1849 @echo "--------------------------------------------------------------"
1851 .if !make(packages) && !make(update-packages)
1854 # packages/update-packages installs kernels to a staging directory then builds
1873 @echo "--------------------------------------------------------------"
1875 @echo "--------------------------------------------------------------"
1880 @echo "--------------------------------------------------------------"
1882 @echo "--------------------------------------------------------------"
1883 @seconds=$$(($$(date '+%s') - ${_INSTALLKERNEL_START})); \
1884 …{INSTALLKERNEL} completed in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
1885 @echo "--------------------------------------------------------------"
1888 .for _kernel in ${BUILDKERNELS:[2..-1]}
1889 @echo "--------------------------------------------------------------"
1891 @echo "--------------------------------------------------------------"
1896 @echo "--------------------------------------------------------------"
1898 @echo "--------------------------------------------------------------"
1900 @seconds=$$(($$(date '+%s') - ${_INSTALLKERNEL_START})); \
1901 …${BUILDKERNELS} completed in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
1902 @echo "--------------------------------------------------------------"
1911 mkdir -p ${DESTDIR}/${DISTDIR}
1922 @sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \
1927 .for _kernel in ${BUILDKERNELS:[2..-1]}
1939 @sed -e "s|^./kernel.${_kernel}|.|" \
1950 ${TAR_CMD} cvf - --exclude '*.debug' \
1956 ${TAR_CMD} cvf - --include '*/*/*.debug' \
1958 ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz
1961 .for _kernel in ${BUILDKERNELS:[2..-1]}
1963 ${TAR_CMD} cvf - --exclude '*.debug' \
1968 ${TAR_CMD} cvf - --include '*/*/*.debug' \
1970 ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz
1977 ${TAR_CMD} cvf - --exclude '*.debug' . | \
1982 ${TAR_CMD} cvf - --include '*/*/*.debug' $$(eval find .) | \
1983 ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz
1986 .for _kernel in ${BUILDKERNELS:[2..-1]}
1988 ${TAR_CMD} cvf - --exclude '*.debug' . | \
1992 ${TAR_CMD} cvf - --include '*/*/*.debug' $$(eval find .) | \
1993 ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz
2000 ${_+_}${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} distributekernel
2008 PKG_LEVEL?= -1
2009 PKG_CLEVEL?= ${"${PKG_FORMAT:Mtar}" != "":?:-l ${PKG_LEVEL}}
2013 .if make(create-*-packages*) || make(real-update-packages) || make(real-sign-packages)
2014 PKG_ABI!= ${PKG_CMD} -o ABI_FILE=${PKG_ABI_FILE} config ABI
2017 .ORDER: stage-packages create-packages
2018 .ORDER: create-packages create-world-packages
2019 .ORDER: create-packages create-source-packages
2020 .ORDER: create-packages create-kernel-packages
2021 .ORDER: create-packages sign-packages
2028 PKG_BIN_VERSION!=${PKG_CMD} --version </dev/null 2>/dev/null |\
2029 awk -F. '/^[0-9.]+$$/ {print $$1 * 10000 + $$2 * 100 + $$3}'
2036 .if !defined(PKG_VERSION_FROM) && make(real-update-packages)
2071 ${_+_}${MAKE} -C ${.CURDIR} ${PKGMAKEARGS} real-packages
2073 update-packages: .PHONY
2074 ${_+_}${MAKE} -C ${.CURDIR} ${PKGMAKEARGS} real-update-packages
2076 package-pkg: .PHONY
2077 rm -rf /tmp/ports.${TARGET} || :
2082 sh ${.CURDIR}/release/scripts/make-pkg-package.sh
2084 real-packages: stage-packages create-packages sign-packages .PHONY
2086 real-update-packages: stage-packages .PHONY
2087 ${_+_}${MAKE} -C ${.CURDIR} PKG_VERSION=${PKG_VERSION} create-packages
2092 @for pkg in ${PKG_VERSION_FROM_DIR}/${PKG_NAME_PREFIX}-*; do \
2093 pkgname=$$(pkg query -F $${pkg} '%n' | sed 's/${PKG_NAME_PREFIX}-\(.*\)/\1/') ; \
2094 newpkgname=${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION}.${PKG_EXT} ; \
2095 oldsum=$$(pkg query -F $${pkg} '%X') ; \
2096 if [ ! -f ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} ]; then \
2099 newsum=$$(pkg query -F ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} '%X') ; \
2100 if [ "${BRANCH_EXT_FROM}" = "${BRANCH_EXT}" -a "$${oldsum}" = "$${newsum}" ]; then \
2101 echo "==> Keeping old ${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION_FROM}.${PKG_EXT}" ; \
2110 ${MAKE} -f Makefile.inc1 PKG_VERSION=${PKG_VERSION} sign-packages
2112 stage-packages-world: .PHONY
2113 @mkdir -p ${WSTAGEDIR}
2115 ${MAKE} DESTDIR=${WSTAGEDIR} -DNO_ROOT stageworld
2117 stage-packages-kernel: .PHONY
2118 @mkdir -p ${KSTAGEDIR}
2120 ${MAKE} DESTDIR=${KSTAGEDIR} -DNO_ROOT stagekernel
2122 stage-packages-source: .PHONY
2123 @mkdir -p ${SSTAGEDIR};
2125 stage-packages: .PHONY stage-packages-world stage-packages-kernel stage-packages-source
2128 @mkdir -p ${REPODIR}
2130 create-packages-world: _pkgbootstrap _repodir .PHONY
2132 ${MAKE} -f Makefile.inc1 \
2134 PKG_VERSION=${PKG_VERSION} create-world-packages
2136 create-packages-kernel: _pkgbootstrap _repodir .PHONY
2138 ${MAKE} -f Makefile.inc1 \
2142 create-kernel-packages
2144 create-packages-kernel-repo: .PHONY create-packages-kernel sign-packages
2146 create-packages-world-repo: .PHONY create-packages-world sign-packages
2148 create-packages-source: _pkgbootstrap _repodir .PHONY
2150 ${MAKE} -f Makefile.inc1 \
2152 PKG_VERSION=${PKG_VERSION} create-source-packages
2154 create-packages: .PHONY create-packages-world create-packages-kernel create-packages-source
2156 create-source-src-package: _pkgbootstrap .PHONY
2157 rm -f ${SSTAGEDIR}/src.plist 2>/dev/null || :
2161 ${GIT_CMD} ls-files --recurse-submodules ":!:sys/" ) \
2163 ${SRCDIR}/release/packages/generate-ucl.lua \
2174 ${PKG_CMD} -o ABI=${PKG_ABI} \
2175 -o OSVERSION="${SRCRELDATE}" \
2176 create -f ${PKG_FORMAT} ${PKG_CLEVEL} \
2177 -M ${SSTAGEDIR}/src.ucl \
2178 -p ${SSTAGEDIR}/src.plist \
2179 -r ${SRCDIR} \
2180 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
2183 create-source-src-sys-package: _pkgbootstrap .PHONY
2184 rm -f ${SSTAGEDIR}/src-sys.plist 2>/dev/null || :
2188 ${GIT_CMD} ls-files --recurse-submodules "sys/" ) \
2189 > ${SSTAGEDIR}/src-sys.plist
2190 ${SRCDIR}/release/packages/generate-ucl.lua \
2191 PKGNAME "src-sys" \
2200 ${SSTAGEDIR}/src-sys.ucl
2201 ${PKG_CMD} -o ABI=${PKG_ABI} \
2202 -o OSVERSION="${SRCRELDATE}" \
2203 create -f ${PKG_FORMAT} ${PKG_CLEVEL} \
2204 -M ${SSTAGEDIR}/src-sys.ucl \
2205 -p ${SSTAGEDIR}/src-sys.plist \
2206 -r ${SRCDIR} \
2207 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
2210 create-source-packages: .PHONY _pkgbootstrap create-source-src-package create-source-src-sys-package
2212 create-world-packages: _pkgbootstrap .PHONY
2213 @rm -f ${WSTAGEDIR}/*.plist 2>/dev/null || :
2216 awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk
2223 ${MAKE} -f Makefile.inc1 create-world-packages-jobs \
2227 .if make(create-world-packages-jobs)
2231 create-world-packages-jobs: .PHONY
2233 create-world-packages-jobs: create-world-package-${pkgname}
2234 create-world-package-${pkgname}: .PHONY
2235 @sh ${SRCDIR}/release/packages/generate-ucl.sh -o ${pkgname} \
2236 -s ${SRCDIR} -u ${WSTAGEDIR}/${pkgname}.ucl
2237 @awk -F\" ' \
2238 /^name/ { printf("===> Creating %s-", $$2); next } \
2242 sed -i '' -e "s/%VCS_REVISION%/${VCS_REVISION}/" ${WSTAGEDIR}/${pkgname}.ucl ; \
2244 ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \
2245 -o OSVERSION="${SRCRELDATE}" \
2246 create -f ${PKG_FORMAT} ${PKG_CLEVEL} \
2247 -M ${WSTAGEDIR}/${pkgname}.ucl \
2248 -p ${WSTAGEDIR}/${pkgname}.plist \
2249 -r ${WSTAGEDIR} \
2250 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
2253 _default_flavor= -default
2256 _debug=-dbg
2259 create-dtb-package:
2260 @if [ -f ${KSTAGEDIR}/${DISTDIR}/dtb.plist ]; then \
2261 ${SRCDIR}/release/packages/generate-ucl.lua \
2271 awk -F\" ' \
2272 /name/ { printf("===> Creating %s-", $$2); next } \
2275 ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \
2276 -o OSVERSION="${SRCRELDATE}" \
2277 create -f ${PKG_FORMAT} ${PKG_CLEVEL} \
2278 -M ${KSTAGEDIR}/${DISTDIR}/dtb.ucl \
2279 -p ${KSTAGEDIR}/${DISTDIR}/dtb.plist \
2280 -r ${KSTAGEDIR}/${DISTDIR} \
2281 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR} ; \
2284 create-kernel-packages: .PHONY
2286 create-kernel-packages: create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},} create-dt…
2287 create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap .PHONY
2290 awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
2291 -v kernel=yes -v _kernconf=${INSTALLKERNEL} ; \
2292 ${SRCDIR}/release/packages/generate-ucl.lua \
2293 PKGNAME "kernel-${INSTALLKERNEL:tl}${flavor}" \
2303 awk -F\" ' \
2304 /name/ { printf("===> Creating %s-", $$2); next } \
2307 ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \
2308 -o OSVERSION="${SRCRELDATE}" \
2309 create -f ${PKG_FORMAT} ${PKG_CLEVEL} \
2310 -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \
2311 -p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \
2312 -r ${KSTAGEDIR}/${DISTDIR} \
2313 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
2317 . for _kernel in ${BUILDKERNELS:[2..-1]}
2320 _debug=-dbg
2323 create-kernel-packages: create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_…
2324 create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel}: _pkgbootstrap .…
2327 awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
2328 -v kernel=yes -v _kernconf=${_kernel} ; \
2329 ${SRCDIR}/release/packages/generate-ucl.lua \
2330 PKGNAME "kernel-${_kernel:tl}${flavor}" \
2343 awk -F\" ' \
2344 /name/ { printf("===> Creating %s-", $$2); next } \
2347 ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \
2348 -o OSVERSION="${SRCRELDATE}" \
2349 create -f ${PKG_FORMAT} ${PKG_CLEVEL} \
2350 -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \
2351 -p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \
2352 -r ${KSTAGEDIR}/kernel.${_kernel} \
2353 -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
2359 sign-packages: .PHONY
2361 ${MAKE} -f Makefile.inc1 PKG_VERSION=${PKG_VERSION} real-sign-packages
2363 real-sign-packages: _pkgbootstrap .PHONY
2368 @${PKG_CMD} -o ABI=${PKG_ABI} repo -o OSVERSION="${SRCRELDATE}" \
2369 -m ${WSTAGEDIR}/meta \
2370 -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \
2374 ln -hfs ${PKG_OUTPUT_DIR} latest
2383 @if [ ! -x "${LOCALBASE}/bin/kyua" ] && [ ! -x "/usr/bin/kyua" ]; then \
2387 ${_+_}PATH="$$PATH:${LOCALBASE}/bin" kyua test -k ${TESTSBASE}/Kyuafile
2396 @if [ ! -x "${LOCALBASE}/bin/doxygen" ]; then \
2403 # ------------------------------------------------------------------------
2416 # which don't have the APIs required by the targets built in bootstrap-tools,
2417 # build-tools or cross-tools.
2430 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
2438 # bootstrap-tools: Build tools needed for compatibility. These are binaries that
2441 # libraries, augmented by -legacy, in addition to the libraries built during
2442 # bootstrap-tools.
2444 _bt= _bootstrap-tools
2452 # from the FreeBSD sources during the bootstrap-tools stage.
2453 # We want to build without the user's $PATH starting in the bootstrap-tools
2462 # $PATH during the bootstrap-tools stage.
2463 # When building on non-FreeBSD systems we can't assume that the host binaries
2497 # version of m4 (with pre-generated files) then use that to build the real m4.
2500 # For lex we also use the pre-gerated files since we would otherwise need to
2504 _m4= tools/build/bootstrap-m4 usr.bin/m4
2505 ${_bt}-tools/build/bootstrap-m4: ${_bt}-usr.bin/lex ${_bt}-lib/libopenbsd ${_bt}-usr.bin/yacc
2506 ${_bt}-usr.bin/m4: ${_bt}-lib/libopenbsd ${_bt}-usr.bin/yacc ${_bt}-usr.bin/lex ${_bt}-tools/build/…
2507 _bt_m4_depend=${_bt}-usr.bin/m4
2508 _bt_lex_depend=${_bt}-usr.bin/lex ${_bt_m4_depend}
2514 # r296685 fix cross-endian objcopy
2522 ${_bt}-lib/libelf: ${_bt_m4_depend}
2523 ${_bt}-lib/libdwarf: ${_bt_m4_depend}
2524 _bt_libelf_depend=${_bt}-lib/libelf
2528 ${_bt}-lib/libkldelf: ${_bt_libelf_depend}
2529 _bt_libkldelf_depend=${_bt}-lib/libkldelf
2532 ${_bt}-usr.sbin/kldxref: ${_bt_libelf_depend} ${_bt_libkldelf_depend}
2535 # 13.0-CURRENT cycle, thus needs to be built on -older releases and stable
2538 ${_bt}-libexec/flua: ${_bt}-lib/liblua
2542 # r245440 mtree -N support added
2549 ${_bt}-lib/libnetbsd: ${_bt}-lib/libmd
2550 ${_bt}-usr.sbin/nmtree: ${_bt}-lib/libnetbsd
2555 # r246097: log addition login.conf.db, passwd, pwd.db, and spwd.db with cat -l
2562 # r277259 crunchide: Correct 64-bit section header offset
2563 # r281674 crunchide: always include both 32- and 64-bit ELF support
2570 # 1400052, 1300526, 1203507: Removed -dc from linker invocation
2593 ${_bt}-usr.sbin/makefs: ${_bt}-lib/libnetbsd
2597 ${_bt}-usr.sbin/makefs: ${_bt}-lib/libsbuf
2619 # llvm-tblgen is also needed for various llvm binutils (e.g. objcopy).
2625 usr.bin/clang/llvm-min-tblgen \
2626 usr.bin/clang/llvm-tblgen
2630 _clang_tblgen+= usr.bin/clang/clang-tblgen
2633 _clang_tblgen+= usr.bin/clang/lldb-tblgen
2635 ${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/libllvmminimal
2636 ${_bt}-usr.bin/clang/lldb-tblgen: ${_bt}-lib/clang/libllvmminimal
2637 ${_bt}-usr.bin/clang/llvm-min-tblgen: ${_bt}-lib/clang/libllvmminimal
2638 ${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-lib/clang/libllvmminimal
2639 ${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-usr.bin/clang/llvm-min-tblgen
2642 # C.UTF-8 is always built in share/ctypes and we need localedef for that.
2644 ${_bt}-usr.bin/localedef: ${_bt}-usr.bin/yacc ${_bt_lex_depend}
2649 ${_bt}-usr.bin/mkesdb: ${_bt}-usr.bin/yacc ${_bt_lex_depend}
2650 ${_bt}-usr.bin/mkcsmapper: ${_bt}-usr.bin/yacc ${_bt_lex_depend}
2655 kerberos5/tools/make-roken \
2662 .ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g}
2664 ${_bt}-${_tool}: ${_bt}-usr.bin/yacc ${_bt_lex_depend}
2668 ${_bt}-usr.bin/mandoc: ${_bt}-lib/libopenbsd
2676 # subdirectory and comma-separated list of files.
2700 # bootstrap ldd on non-FreeBSD systems
2710 # When building on non-FreeBSD, install a fake chflags instead since the
2712 # are install with -DNO_ROOT.
2713 _other_bootstrap_tools+=tools/build/cross-build/fake_chflags
2735 ${_bt}-usr.bin/awk: ${_bt_lex_depend} ${_bt}-usr.bin/yacc
2736 ${_bt}-bin/expr: ${_bt_lex_depend} ${_bt}-usr.bin/yacc
2738 ${_bt}-usr.sbin/config: ${_bt}-usr.bin/file2c ${_bt_lex_depend}
2741 # `make legacy` step. Not adding a link to make is important on non-FreeBSD
2747 ${_bt}-usr.bin/grep: ${_bt}-lib/libbz2
2749 # libdwarf depends on libz
2750 _other_bootstrap_tools+=lib/libz
2751 ${_bt}-lib/libdwarf: ${_bt}-lib/libz
2755 ${_bt}-lib/libroken: ${_bt}-lib/libcrypt
2769 ${_bt}-links: .PHONY
2772 ${_bt}-link-${_tool}: .PHONY
2773 @rm -f "${WORLDTMP}/legacy/bin/${_tool}"; \
2775 if [ ! -e "$${source_path}" ] ; then \
2778 cp -pf "$${source_path}" "${WORLDTMP}/legacy/bin/${_tool}"
2779 ${_bt}-links: ${_bt}-link-${_tool}
2782 bootstrap-tools: ${_bt}-links .PHONY
2784 # Please document (add comment) why something is in 'bootstrap-tools'.
2785 # Try to bound the building of the bootstrap-tool to just the
2822 ${_bt}-${_tool}: ${_bt}-links .PHONY .MAKE
2825 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
2832 bootstrap-tools: ${_bt}-${_tool}
2834 .if target(${_bt}-lib/libmd)
2837 ${_bt}-usr.bin/sort: ${_bt}-lib/libmd
2838 ${_bt}-usr.bin/xinstall: ${_bt}-lib/libmd
2839 ${_bt}-sbin/md5: ${_bt}-lib/libmd
2844 # build-tools: Build special purpose build tools
2851 # rescue includes programs that have build-tools targets
2863 _jevents=lib/libpmc/pmu-events
2866 # kernel-toolchain skips _cleanobj, so handle cleaning up previous
2867 # build-tools directories if needed.
2868 .if ${MK_CLEAN} == "yes" && make(kernel-toolchain)
2883 build-tools_${_tool}: .PHONY
2884 ${_+_}@${ECHODIR} "===> ${_tool} (${_bt_clean:D${_bt_clean},}obj,build-tools)"; \
2886 if [ -n "${_bt_clean}" ]; then ${MAKE} DIRPRFX=${_tool}/ ${_bt_clean}; fi; \
2887 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
2888 ${MAKE} DIRPRFX=${_tool}/ build-tools
2889 build-tools: build-tools_${_tool}
2893 # kernel-tools: Build kernel-building tools
2895 kernel-tools: .PHONY
2896 mkdir -p ${WORLDTMP}/usr
2897 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
2898 -p ${WORLDTMP}/usr >/dev/null
2901 # cross-tools: All the tools needed to build the rest of the system after
2911 # Rebuild ctfconvert and ctfmerge to avoid difficult-to-diagnose failures
2930 # cross-build on a FreeBSD 10 host:
2934 # If cross-building with an external binutils we still need to build strip for
2960 cross-tools: .MAKE .PHONY
2973 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
2979 # native-xtools is the current target for qemu-user cross builds of ports
2988 NXTP?= /nxb-bin
3063 # XXX: native-xtools passes along ${NXBDIRS} in SUBDIR_OVERRIDE that needs
3072 -DNO_SHARED \
3073 -DNO_CPU_CFLAGS \
3074 -DNO_PIC \
3101 .if make(native-xtools*) && \
3107 NXBTMAKE= ${NXBMAKEENV} ${MAKE} ${NXBMAKEARGS:N-DNO_PIC:N-DNO_SHARED} \
3109 # For 'everything' we want to produce native binaries (hence -target to
3123 NXBMAKE+= ${NXBMAKEENV} ${MAKE} -f Makefile.inc1 ${NXBMAKEARGS} \
3128 # invoke a sub-make to reevaluate MK_CLANG, etc, for NXBDIRS.
3130 # Need to avoid the -isystem logic when using clang as an external toolchain
3133 native-xtools: .PHONY
3136 ${_+_}cd ${.CURDIR}; ${NXBTMAKE} kernel-toolchain
3140 # polluting the cross-compiler build. The LLVM libs are skipped
3149 @echo ">> native-xtools done. Use 'make native-xtools-install' to install to a given DESTDIR"
3151 native-xtools-install: .PHONY
3152 mkdir -p ${NXBDESTDIR}/bin ${NXBDESTDIR}/sbin ${NXBDESTDIR}/usr
3153 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
3154 -p ${NXBDESTDIR}/usr >/dev/null
3155 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
3156 -p ${NXBDESTDIR}/usr/include >/dev/null
3158 mkdir -p ${NXBDESTDIR}/usr/include/${d}
3162 -DNO_ROOT \
3166 # hierarchy - ensure that all the needed directories are present
3169 ${_+_}cd ${.CURDIR}/etc; ${HMAKE} distrib-dirs
3172 # libraries - build all libraries, and install them under ${DESTDIR}.
3180 ${MAKE} -f Makefile.inc1 _prereq_libs; \
3181 ${MAKE} -f Makefile.inc1 _startup_libs; \
3182 ${MAKE} -f Makefile.inc1 _prebuild_libs -DLIBCRYPTO_WITHOUT_SUBDIRS; \
3183 ${MAKE} -f Makefile.inc1 _generic_libs
3194 _prereq_libs+= lib/libclang_rt/asan-preinit
3260 lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \
3450 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; fi; \
3451 ${MAKE} MK_TESTS=no -DNO_PIC \
3453 ${MAKE} MK_TESTS=no -DNO_PIC \
3463 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; fi; \
3476 # that running 'make all' from the top-level, especially with a SUBDIR_OVERRIDE
3481 # avoid trashing a system if it crashes mid-install.
3488 .if make(check-old) || make(check-old-dirs) || \
3489 make(check-old-files) || make(check-old-libs) || \
3490 make(delete-old) || make(delete-old-dirs) || \
3491 make(delete-old-files) || make(delete-old-libs) || \
3492 make(list-old-dirs) || make(list-old-files) || make(list-old-libs)
3506 RM_I=-i
3508 RM_I=-fv
3511 list-old-files: .PHONY
3513 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
3514 -V "OLD_FILES:ts\n" -V "OLD_FILES:Musr/share/*.gz:R:ts\n" \
3515 -V "MOVED_LIBS:ts\n" \
3516 ${_ALL_libcompats:@v@-V "OLD_FILES:Mlib/*.so.*:S,^lib,usr/lib$v,:ts\n"@} \
3517 ${_ALL_libcompats:@v@-V "OLD_FILES:Musr/lib/*:S,^usr/lib,usr/lib$v,:ts\n"@} | \
3520 delete-old-files: .PHONY
3529 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-files | \
3531 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
3532 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
3536 if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \
3545 find ${DESTDIR}/usr/share/man/cat* ! -type d 2>/dev/null | sort | \
3546 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
3549 if [ ! -e "$${manpage}" ]; then \
3555 check-old-files: .PHONY
3558 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-files | \
3560 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
3564 if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
3570 @find ${DESTDIR}/usr/share/man/cat* ! -type d 2>/dev/null | \
3571 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
3574 if [ ! -e "$${manpage}" ]; then \
3579 list-old-libs: .PHONY
3581 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
3582 -V "OLD_LIBS:ts\n" \
3583 ${_ALL_libcompats:@v@-V "OLD_LIBS:Mlib/*:S,^lib,usr/lib$v,:ts\n"@} \
3584 ${_ALL_libcompats:@v@-V "OLD_LIBS:Musr/lib/*:S,^usr/lib,usr/lib$v,:ts\n"@} \
3585 ${_ALL_libcompats:@v@-V "OLD_LIBS:Mlib/casper/*:S,^lib/casper,usr/lib$v,:ts\n"@} | \
3588 delete-old-libs: .PHONY
3593 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-libs | \
3595 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
3596 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
3600 if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \
3609 check-old-libs: .PHONY
3612 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-libs | \
3614 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
3618 if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
3624 list-old-dirs: .PHONY
3626 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
3627 -V OLD_DIRS | sed -E 's/[[:space:]]+/\n/g' | sort -r
3629 delete-old-dirs: .PHONY
3632 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-dirs | \
3634 if [ -d "${DESTDIR}/$${dir}" ]; then \
3635 rmdir -v "${DESTDIR}/$${dir}" || true; \
3636 elif [ -L "${DESTDIR}/$${dir}" ]; then \
3639 if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
3640 rmdir -v "${DESTDIR}${DEBUGDIR}/$${dir}" || true; \
3641 elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
3647 check-old-dirs: .PHONY
3650 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-dirs | \
3652 if [ -d "${DESTDIR}/$${dir}" ]; then \
3654 elif [ -L "${DESTDIR}/$${dir}" ]; then \
3657 if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
3659 elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
3664 delete-old: delete-old-files delete-old-dirs .PHONY
3665 @echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'."
3667 check-old: check-old-files check-old-libs check-old-dirs .PHONY
3668 @echo "To remove old files and directories run '${MAKE_CMD} delete-old'."
3669 @echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'."
3674 # showconfig - show build configuration.
3679 …@(${MAKE} -n -f ${.CURDIR}/sys/conf/kern.opts.mk -V dummy -dg1 UPDATE_DEPENDFILE=no NO_OBJ=yes MAC…
3680 …${MAKE} -n -f ${.CURDIR}/share/mk/src.opts.mk -V dummy -dg1 UPDATE_DEPENDFILE=no NO_OBJ=yes MACHIN…
3681 grep -E '^(MK|OPT)_[A-Z]' | sort -u
3737 -(cd ${BW_CANONICALOBJDIR} && rm -rf *)
3738 -chflags -R 0 ${BW_CANONICALOBJDIR}
3739 -(cd ${BW_CANONICALOBJDIR} && rm -rf *)
3755 NOFUN=-DNO_FSCHG MK_HTML=no -DNO_LINT \
3761 XDDIR=${TARGET_ARCH}-freebsd
3780 # GCC requires -isystem and -L when using a cross-compiler. --sysroot
3781 # won't set header path and -L is used to ensure the base library path
3783 CD2CFLAGS+= -isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib
3784 # GCC requires -B to find /usr/lib/crti.o when using a cross-compiler
3785 # combined with --sysroot.
3786 CD2CFLAGS+= -B${XDDESTDIR}/usr/lib
3790 CD2CXXFLAGS+= -isystem ${XDDESTDIR}/usr/include/c++/v1 -std=c++11 \
3791 -nostdinc++
3794 CD2CFLAGS+= --sysroot=${XDDESTDIR}/
3804 # Don't rebuild build-tools targets during normal build.
3809 .ORDER: xdev-build xdev-install xdev-links
3810 xdev: xdev-build xdev-install .PHONY
3812 .ORDER: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools
3813 xdev-build: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools .PHONY
3815 _xb-worldtmp: .PHONY
3816 mkdir -p ${CDTMP}/usr
3817 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
3818 -p ${CDTMP}/usr >/dev/null
3820 _xb-bootstrap-tools: .PHONY
3826 if [ -z "${NO_OBJWALK}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ obj; fi; \
3831 _xb-build-tools: .PHONY
3833 ${CDBENV} ${MAKE} ${CDMAKEARGS} -f Makefile.inc1 ${NOFUN} build-tools
3842 _xb-cross-tools: .PHONY
3846 if [ -z "${NO_OBJWALK}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ obj; fi; \
3850 _xi-mtree: .PHONY
3852 mkdir -p ${XDDESTDIR}
3853 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.root.dist \
3854 -p ${XDDESTDIR} >/dev/null
3855 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
3856 -p ${XDDESTDIR}/usr >/dev/null
3857 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
3858 -p ${XDDESTDIR}/usr/include >/dev/null
3860 mkdir -p ${XDDESTDIR}/usr/include/${d}
3863 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
3864 -p ${XDDESTDIR}/usr >/dev/null
3867 mkdir -p ${XDDESTDIR}${TESTSBASE}
3868 ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
3869 -p ${XDDESTDIR}${TESTSBASE} >/dev/null
3872 .ORDER: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries
3873 xdev-install: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries .PHONY
3875 _xi-cross-tools: .PHONY
3876 @echo "_xi-cross-tools"
3883 _xi-includes: .PHONY
3885 ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 _obj \
3888 ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 includes \
3891 _xi-libraries: .PHONY
3892 ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 libraries \
3895 xdev-links: .PHONY
3897 mkdir -p ../../../../usr/bin; \
3899 ln -sf ../../${XDTP}/usr/bin/$$i \
3900 ../../../../usr/bin/${XDDIR}-$$i; \
3901 ln -sf ../../${XDTP}/usr/bin/$$i \
3902 ../../../../usr/bin/${XDDIR}${_REVISION}-$$i; \