1# 2# $FreeBSD$ 3# 4# Make command line options: 5# -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir 6# -DNO_CLEAN do not clean at all 7# -DDB_FROM_SRC use the user/group databases in src/etc instead of 8# the system database when installing. 9# -DNO_SHARE do not go into share subdir 10# -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,DEPEND,OBJ} 11# -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel 12# -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel 13# -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel 14# -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel 15# -DNO_PORTSUPDATE do not update ports in ${MAKE} update 16# -DNO_ROOT install without using root privilege 17# -DNO_DOCUPDATE do not update doc in ${MAKE} update 18# -DWITHOUT_CTF do not run the DTrace CTF conversion tools on built objects 19# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list 20# LOCAL_ITOOLS="list of tools" to add additional tools to the ITOOLS list 21# LOCAL_LIB_DIRS="list of dirs" to add additional dirs to libraries target 22# LOCAL_MTREE="list of mtree files" to process to allow local directories 23# to be created before files are installed 24# LOCAL_TOOL_DIRS="list of dirs" to add additional dirs to the build-tools 25# list 26# METALOG="path to metadata log" to write permission and ownership 27# when NO_ROOT is set. (default: ${DESTDIR}/METALOG) 28# TARGET="machine" to crossbuild world for a different machine type 29# TARGET_ARCH= may be required when a TARGET supports multiple endians 30# BUILDENV_SHELL= shell to launch for the buildenv target (def:/bin/sh) 31# WORLD_FLAGS= additional flags to pass to make(1) during buildworld 32# KERNEL_FLAGS= additional flags to pass to make(1) during buildkernel 33 34# 35# The intended user-driven targets are: 36# buildworld - rebuild *everything*, including glue to help do upgrades 37# installworld- install everything built by "buildworld" 38# doxygen - build API documentation of the kernel 39# update - convenient way to update your source tree (eg: svn/svnup) 40# 41# Standard targets (not defined here) are documented in the makefiles in 42# /usr/share/mk. These include: 43# obj depend all install clean cleandepend cleanobj 44 45.if !defined(TARGET) || !defined(TARGET_ARCH) 46.error "Both TARGET and TARGET_ARCH must be defined." 47.endif 48 49.include "share/mk/src.opts.mk" 50.include <bsd.arch.inc.mk> 51.include <bsd.compiler.mk> 52 53# We must do share/info early so that installation of info `dir' 54# entries works correctly. Do it first since it is less likely to 55# grow dependencies on include and lib than vice versa. 56# 57# We must do lib/ and libexec/ before bin/, because if installworld 58# installs a new /bin/sh, the 'make' command will *immediately* 59# use that new version. And the new (dynamically-linked) /bin/sh 60# will expect to find appropriate libraries in /lib and /libexec. 61# 62SRCDIR?= ${.CURDIR} 63.if defined(SUBDIR_OVERRIDE) 64SUBDIR= ${SUBDIR_OVERRIDE} 65.else 66SUBDIR= share/info lib libexec 67SUBDIR+=bin 68.if ${MK_GAMES} != "no" 69SUBDIR+=games 70.endif 71.if ${MK_CDDL} != "no" 72SUBDIR+=cddl 73.endif 74SUBDIR+=gnu include 75.if ${MK_KERBEROS} != "no" 76SUBDIR+=kerberos5 77.endif 78.if ${MK_RESCUE} != "no" 79SUBDIR+=rescue 80.endif 81SUBDIR+=sbin 82.if ${MK_CRYPT} != "no" 83SUBDIR+=secure 84.endif 85.if !defined(NO_SHARE) 86SUBDIR+=share 87.endif 88SUBDIR+=sys usr.bin usr.sbin 89.if ${MK_TESTS} != "no" 90SUBDIR+= tests 91.endif 92.if ${MK_OFED} != "no" 93SUBDIR+=contrib/ofed 94.endif 95# 96# We must do etc/ last for install/distribute to work. 97# 98SUBDIR+=etc 99 100# These are last, since it is nice to at least get the base system 101# rebuilt before you do them. 102.for _DIR in ${LOCAL_LIB_DIRS} ${LOCAL_DIRS} 103.if exists(${.CURDIR}/${_DIR}/Makefile) 104SUBDIR+= ${_DIR} 105.endif 106.endfor 107.endif 108 109.if defined(NOCLEAN) 110NO_CLEAN= ${NOCLEAN} 111.endif 112.if defined(NO_CLEANDIR) 113CLEANDIR= clean cleandepend 114.else 115CLEANDIR= cleandir 116.endif 117 118LOCAL_TOOL_DIRS?= 119 120BUILDENV_SHELL?=/bin/sh 121 122SVN?= /usr/local/bin/svn 123SVNFLAGS?= -r HEAD 124 125MAKEOBJDIRPREFIX?= /usr/obj 126.if !defined(OSRELDATE) 127.if exists(/usr/include/osreldate.h) 128OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ 129 /usr/include/osreldate.h 130.else 131OSRELDATE= 0 132.endif 133.endif 134 135.if !defined(VERSION) 136REVISION!= ${MAKE} -C ${SRCDIR}/release -V REVISION 137BRANCH!= ${MAKE} -C ${SRCDIR}/release -V BRANCH 138SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ 139 ${SRCDIR}/sys/sys/param.h 140VERSION= FreeBSD ${REVISION}-${BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE} 141.endif 142 143KNOWN_ARCHES?= amd64 arm armeb/arm armv6/arm armv6hf/arm i386 i386/pc98 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64 144.if ${TARGET} == ${TARGET_ARCH} 145_t= ${TARGET} 146.else 147_t= ${TARGET_ARCH}/${TARGET} 148.endif 149.for _t in ${_t} 150.if empty(KNOWN_ARCHES:M${_t}) 151.error Unknown target ${TARGET_ARCH}:${TARGET}. 152.endif 153.endfor 154 155.if ${TARGET} == ${MACHINE} 156TARGET_CPUTYPE?=${CPUTYPE} 157.else 158TARGET_CPUTYPE?= 159.endif 160 161.if !empty(TARGET_CPUTYPE) 162_TARGET_CPUTYPE=${TARGET_CPUTYPE} 163.else 164_TARGET_CPUTYPE=dummy 165.endif 166_CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} \ 167 -f /dev/null -m ${.CURDIR}/share/mk -V CPUTYPE 168.if ${_CPUTYPE} != ${_TARGET_CPUTYPE} 169.error CPUTYPE global should be set with ?=. 170.endif 171.if make(buildworld) 172BUILD_ARCH!= uname -p 173.if ${MACHINE_ARCH} != ${BUILD_ARCH} 174.error To cross-build, set TARGET_ARCH. 175.endif 176.endif 177.if ${MACHINE} == ${TARGET} && ${MACHINE_ARCH} == ${TARGET_ARCH} && !defined(CROSS_BUILD_TESTING) 178OBJTREE= ${MAKEOBJDIRPREFIX} 179.else 180OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH} 181.endif 182WORLDTMP= ${OBJTREE}${.CURDIR}/tmp 183# /usr/games added for fortune which depend on strfile 184BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games:${WORLDTMP}/legacy/bin 185XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games 186STRICTTMPPATH= ${BPATH}:${XPATH} 187TMPPATH= ${STRICTTMPPATH}:${PATH} 188 189# 190# Avoid running mktemp(1) unless actually needed. 191# It may not be functional, e.g., due to new ABI 192# when in the middle of installing over this system. 193# 194.if make(distributeworld) || make(installworld) 195INSTALLTMP!= /usr/bin/mktemp -d -u -t install 196.endif 197 198# 199# Building a world goes through the following stages 200# 201# 1. legacy stage [BMAKE] 202# This stage is responsible for creating compatibility 203# shims that are needed by the bootstrap-tools, 204# build-tools and cross-tools stages. 205# 1. bootstrap-tools stage [BMAKE] 206# This stage is responsible for creating programs that 207# are needed for backward compatibility reasons. They 208# are not built as cross-tools. 209# 2. build-tools stage [TMAKE] 210# This stage is responsible for creating the object 211# tree and building any tools that are needed during 212# the build process. 213# 3. cross-tools stage [XMAKE] 214# This stage is responsible for creating any tools that 215# are needed for cross-builds. A cross-compiler is one 216# of them. 217# 4. world stage [WMAKE] 218# This stage actually builds the world. 219# 5. install stage (optional) [IMAKE] 220# This stage installs a previously built world. 221# 222 223BOOTSTRAPPING?= 0 224 225# Common environment for world related stages 226CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \ 227 MACHINE_ARCH=${TARGET_ARCH} \ 228 MACHINE=${TARGET} \ 229 CPUTYPE=${TARGET_CPUTYPE} 230.if ${MK_GROFF} != "no" 231CROSSENV+= GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \ 232 GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \ 233 GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac 234.endif 235.if defined(TARGET_CFLAGS) 236CROSSENV+= ${TARGET_CFLAGS} 237.endif 238 239# bootstrap-tools stage 240BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ 241 PATH=${BPATH}:${PATH} \ 242 WORLDTMP=${WORLDTMP} \ 243 VERSION="${VERSION}" \ 244 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" 245BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ 246 ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ 247 DESTDIR= \ 248 BOOTSTRAPPING=${OSRELDATE} \ 249 SSP_CFLAGS= \ 250 MK_HTML=no MK_INFO=no NO_LINT=yes MK_MAN=no \ 251 -DNO_PIC MK_PROFILE=no -DNO_SHARED \ 252 -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ 253 MK_CLANG_FULL=no MK_LLDB=no MK_TESTS=no 254 255# build-tools stage 256TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ 257 ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ 258 TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ 259 DESTDIR= \ 260 BOOTSTRAPPING=${OSRELDATE} \ 261 SSP_CFLAGS= \ 262 -DNO_LINT \ 263 -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no MK_CLANG_FULL=no MK_LLDB=no MK_TESTS=no 264 265# cross-tools stage 266XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ 267 TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ 268 MK_GDB=no MK_TESTS=no 269 270# kernel-tools stage 271KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ 272 PATH=${BPATH}:${PATH} \ 273 WORLDTMP=${WORLDTMP} \ 274 VERSION="${VERSION}" 275KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOBJDIRPREFIX=${WORLDTMP} \ 276 ${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ 277 DESTDIR= \ 278 BOOTSTRAPPING=${OSRELDATE} \ 279 SSP_CFLAGS= \ 280 MK_HTML=no MK_INFO=no -DNO_LINT MK_MAN=no \ 281 -DNO_PIC MK_PROFILE=no -DNO_SHARED \ 282 -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no 283 284# world stage 285WMAKEENV= ${CROSSENV} \ 286 _SHLIBDIRPREFIX=${WORLDTMP} \ 287 _LDSCRIPTROOT= \ 288 VERSION="${VERSION}" \ 289 INSTALL="sh ${.CURDIR}/tools/install.sh" \ 290 PATH=${TMPPATH} 291 292# make hierarchy 293HMAKE= PATH=${TMPPATH} ${MAKE} LOCAL_MTREE=${LOCAL_MTREE:Q} 294.if defined(NO_ROOT) 295HMAKE+= PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT 296.endif 297 298.if ${MK_CDDL} == "no" 299WMAKEENV+= MK_CTF=no 300.endif 301 302.if defined(CROSS_TOOLCHAIN_PREFIX) 303CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} 304CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} 305.endif 306XCOMPILERS= CC CXX CPP 307.for COMPILER in ${XCOMPILERS} 308.if defined(CROSS_COMPILER_PREFIX) 309X${COMPILER}?= ${CROSS_COMPILER_PREFIX}${${COMPILER}} 310.else 311X${COMPILER}?= ${${COMPILER}} 312.endif 313.endfor 314XBINUTILS= AS AR LD NM OBJDUMP RANLIB STRINGS 315.for BINUTIL in ${XBINUTILS} 316.if defined(CROSS_BINUTILS_PREFIX) 317X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${${BINUTIL}} 318.else 319X${BINUTIL}?= ${${BINUTIL}} 320.endif 321.endfor 322WMAKEENV+= CC="${XCC} ${XFLAGS}" CXX="${XCXX} ${XFLAGS}" \ 323 CPP="${XCPP} ${XFLAGS}" \ 324 AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \ 325 OBJDUMP=${XOBJDUMP} RANLIB=${XRANLIB} STRINGS=${XSTRINGS} 326 327.if ${XCC:M/*} 328XFLAGS= --sysroot=${WORLDTMP} 329.if defined(CROSS_BINUTILS_PREFIX) 330# In the case of xdev-build tools, CROSS_BINUTILS_PREFIX won't be a 331# directory, but the compiler will look in the right place for it's 332# tools so we don't need to tell it where to look. 333.if exists(${CROSS_BINUTILS_PREFIX}) 334XFLAGS+= -B${CROSS_BINUTILS_PREFIX} 335.endif 336.else 337XFLAGS+= -B${WORLDTMP}/usr/bin 338.endif 339.if ${TARGET} == "arm" 340.if ${TARGET_ARCH:M*hf*} != "" 341TARGET_ABI= gnueabihf 342.else 343TARGET_ABI= gnueabi 344.endif 345.endif 346TARGET_ABI?= unknown 347TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 348XFLAGS+= -target ${TARGET_TRIPLE} 349.endif 350 351WMAKE= ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 DESTDIR=${WORLDTMP} 352 353.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" 354# 32 bit world 355LIB32_OBJTREE= ${OBJTREE}${.CURDIR}/world32 356LIB32TMP= ${OBJTREE}${.CURDIR}/lib32 357 358.if ${TARGET_ARCH} == "amd64" 359.if empty(TARGET_CPUTYPE) 360LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2 361.else 362LIB32CPUFLAGS= -march=${TARGET_CPUTYPE} 363.endif 364LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \ 365 MACHINE_CPU="i686 mmx sse sse2" 366LIB32WMAKEFLAGS= \ 367 AS="${AS} --32" \ 368 LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" 369 370.elif ${TARGET_ARCH} == "powerpc64" 371.if empty(TARGET_CPUTYPE) 372LIB32CPUFLAGS= -mcpu=powerpc 373.else 374LIB32CPUFLAGS= -mcpu=${TARGET_CPUTYPE} 375.endif 376LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc 377LIB32WMAKEFLAGS= \ 378 LD="${LD} -m elf32ppc_fbsd" 379.endif 380 381 382LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -DCOMPAT_32BIT \ 383 -isystem ${LIB32TMP}/usr/include/ \ 384 -L${LIB32TMP}/usr/lib32 \ 385 -B${LIB32TMP}/usr/lib32 386.if ${XCC:M/*} 387LIB32FLAGS+= --sysroot=${WORLDTMP} 388.endif 389 390# Yes, the flags are redundant. 391LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${LIB32_OBJTREE} \ 392 _SHLIBDIRPREFIX=${LIB32TMP} \ 393 _LDSCRIPTROOT=${LIB32TMP} \ 394 VERSION="${VERSION}" \ 395 INSTALL="sh ${.CURDIR}/tools/install.sh" \ 396 PATH=${TMPPATH} \ 397 LIBDIR=/usr/lib32 \ 398 SHLIBDIR=/usr/lib32 \ 399 LIBPRIVATEDIR=/usr/lib32/private \ 400 DTRACE="${DTRACE} -32" 401LIB32WMAKEFLAGS+= CC="${XCC} ${LIB32FLAGS}" \ 402 CXX="${XCXX} ${LIB32FLAGS}" \ 403 DESTDIR=${LIB32TMP} \ 404 -DCOMPAT_32BIT \ 405 -DLIBRARIES_ONLY \ 406 -DNO_CPU_CFLAGS \ 407 MK_CTF=no \ 408 -DNO_LINT \ 409 MK_TESTS=no 410 411LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \ 412 MK_MAN=no MK_INFO=no MK_HTML=no 413LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} \ 414 MK_TOOLCHAIN=no ${IMAKE_INSTALL} 415.endif 416 417IMAKEENV= ${CROSSENV:N_LDSCRIPTROOT=*} 418IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ 419 ${IMAKE_INSTALL} ${IMAKE_MTREE} 420.if empty(.MAKEFLAGS:M-n) 421IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \ 422 LD_LIBRARY_PATH=${INSTALLTMP} \ 423 PATH_LOCALE=${INSTALLTMP}/locale 424IMAKE+= __MAKE_SHELL=${INSTALLTMP}/sh 425.else 426IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP} 427.endif 428.if defined(DB_FROM_SRC) 429INSTALLFLAGS+= -N ${.CURDIR}/etc 430MTREEFLAGS+= -N ${.CURDIR}/etc 431.endif 432_INSTALL_DDIR= ${DESTDIR}/${DISTDIR} 433INSTALL_DDIR= ${_INSTALL_DDIR:S://:/:g:C:/$::} 434.if defined(NO_ROOT) 435METALOG?= ${DESTDIR}/${DISTDIR}/METALOG 436IMAKE+= -DNO_ROOT METALOG=${METALOG} 437INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR} 438MTREEFLAGS+= -W 439.endif 440.if defined(DB_FROM_SRC) || defined(NO_ROOT) 441IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}" 442IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}" 443.endif 444 445# kernel stage 446KMAKEENV= ${WMAKEENV} 447KMAKE= ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME} 448 449# 450# buildworld 451# 452# Attempt to rebuild the entire system, with reasonable chance of 453# success, regardless of how old your existing system is. 454# 455_worldtmp: 456.if ${.CURDIR:C/[^,]//g} != "" 457# The m4 build of sendmail files doesn't like it if ',' is used 458# anywhere in the path of it's files. 459 @echo 460 @echo "*** Error: path to source tree contains a comma ','" 461 @echo 462 false 463.endif 464 @echo 465 @echo "--------------------------------------------------------------" 466 @echo ">>> Rebuilding the temporary build tree" 467 @echo "--------------------------------------------------------------" 468.if !defined(NO_CLEAN) 469 rm -rf ${WORLDTMP} 470.if defined(LIB32TMP) 471 rm -rf ${LIB32TMP} 472.endif 473.else 474 rm -rf ${WORLDTMP}/legacy/usr/include 475# XXX - These three can depend on any header file. 476 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c 477 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c 478 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c 479.endif 480.for _dir in \ 481 lib usr legacy/bin legacy/usr 482 mkdir -p ${WORLDTMP}/${_dir} 483.endfor 484 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ 485 -p ${WORLDTMP}/legacy/usr >/dev/null 486.if ${MK_GROFF} != "no" 487 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.groff.dist \ 488 -p ${WORLDTMP}/legacy/usr >/dev/null 489.endif 490 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ 491 -p ${WORLDTMP}/usr >/dev/null 492 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ 493 -p ${WORLDTMP}/usr/include >/dev/null 494 ln -sf ${.CURDIR}/sys ${WORLDTMP} 495.if ${MK_DEBUG_FILES} != "no" 496 # We could instead disable debug files for these build stages 497 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ 498 -p ${WORLDTMP}/legacy/usr/lib >/dev/null 499 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ 500 -p ${WORLDTMP}/usr/lib >/dev/null 501.endif 502.if ${MK_TESTS} != "no" 503 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ 504 -p ${WORLDTMP}/usr >/dev/null 505.endif 506.for _mtree in ${LOCAL_MTREE} 507 mtree -deU -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null 508.endfor 509_legacy: 510 @echo 511 @echo "--------------------------------------------------------------" 512 @echo ">>> stage 1.1: legacy release compatibility shims" 513 @echo "--------------------------------------------------------------" 514 ${_+_}cd ${.CURDIR}; ${BMAKE} legacy 515_bootstrap-tools: 516 @echo 517 @echo "--------------------------------------------------------------" 518 @echo ">>> stage 1.2: bootstrap tools" 519 @echo "--------------------------------------------------------------" 520 ${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools 521_cleanobj: 522.if !defined(NO_CLEAN) 523 @echo 524 @echo "--------------------------------------------------------------" 525 @echo ">>> stage 2.1: cleaning up the object tree" 526 @echo "--------------------------------------------------------------" 527 ${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/} 528.if defined(LIB32TMP) 529 ${_+_}cd ${.CURDIR}; ${LIB32WMAKE} -f Makefile.inc1 ${CLEANDIR:S/^/par-/} 530.endif 531.endif 532_obj: 533 @echo 534 @echo "--------------------------------------------------------------" 535 @echo ">>> stage 2.2: rebuilding the object tree" 536 @echo "--------------------------------------------------------------" 537 ${_+_}cd ${.CURDIR}; ${WMAKE} par-obj 538_build-tools: 539 @echo 540 @echo "--------------------------------------------------------------" 541 @echo ">>> stage 2.3: build tools" 542 @echo "--------------------------------------------------------------" 543 ${_+_}cd ${.CURDIR}; ${TMAKE} build-tools 544_cross-tools: 545 @echo 546 @echo "--------------------------------------------------------------" 547 @echo ">>> stage 3: cross tools" 548 @echo "--------------------------------------------------------------" 549 ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools 550 ${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools 551_includes: 552 @echo 553 @echo "--------------------------------------------------------------" 554 @echo ">>> stage 4.1: building includes" 555 @echo "--------------------------------------------------------------" 556 ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes 557_libraries: 558 @echo 559 @echo "--------------------------------------------------------------" 560 @echo ">>> stage 4.2: building libraries" 561 @echo "--------------------------------------------------------------" 562 ${_+_}cd ${.CURDIR}; \ 563 ${WMAKE} -DNO_FSCHG MK_HTML=no MK_INFO=no -DNO_LINT MK_MAN=no \ 564 MK_PROFILE=no MK_TESTS=no libraries 565_depend: 566 @echo 567 @echo "--------------------------------------------------------------" 568 @echo ">>> stage 4.3: make dependencies" 569 @echo "--------------------------------------------------------------" 570 ${_+_}cd ${.CURDIR}; ${WMAKE} par-depend 571everything: 572 @echo 573 @echo "--------------------------------------------------------------" 574 @echo ">>> stage 4.4: building everything" 575 @echo "--------------------------------------------------------------" 576 ${_+_}cd ${.CURDIR}; ${WMAKE} par-all 577.if defined(LIB32TMP) 578build32: 579 @echo 580 @echo "--------------------------------------------------------------" 581 @echo ">>> stage 5.1: building 32 bit shim libraries" 582 @echo "--------------------------------------------------------------" 583 mkdir -p ${LIB32TMP}/usr/include 584 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ 585 -p ${LIB32TMP}/usr >/dev/null 586 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ 587 -p ${LIB32TMP}/usr/include >/dev/null 588.if ${MK_DEBUG_FILES} != "no" 589 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ 590 -p ${LIB32TMP}/usr/lib >/dev/null 591.endif 592 mkdir -p ${WORLDTMP} 593 ln -sf ${.CURDIR}/sys ${WORLDTMP} 594.for _t in obj includes 595 cd ${.CURDIR}/include; ${LIB32WMAKE} DIRPRFX=include/ ${_t} 596 cd ${.CURDIR}/lib; ${LIB32WMAKE} DIRPRFX=lib/ ${_t} 597.if ${MK_CDDL} != "no" 598 cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} DIRPRFX=cddl/lib/ ${_t} 599.endif 600 cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} DIRPRFX=gnu/lib/ ${_t} 601.if ${MK_CRYPT} != "no" 602 cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} DIRPRFX=secure/lib/ ${_t} 603.endif 604.if ${MK_KERBEROS} != "no" 605 cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} DIRPRFX=kerberos5/lib ${_t} 606.endif 607.endfor 608.for _dir in usr.bin/lex/lib 609 cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} DIRPRFX=${_dir}/ obj 610.endfor 611.for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic 612 cd ${.CURDIR}/${_dir}; \ 613 WORLDTMP=${WORLDTMP} \ 614 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ 615 MAKEOBJDIRPREFIX=${LIB32_OBJTREE} ${MAKE} SSP_CFLAGS= DESTDIR= \ 616 DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ 617 build-tools 618.endfor 619 cd ${.CURDIR}; \ 620 ${LIB32WMAKE} -f Makefile.inc1 libraries 621.for _t in obj depend all 622 cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \ 623 DIRPRFX=libexec/rtld-elf/ ${_t} 624 cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \ 625 DIRPRFX=usr.bin/ldd ${_t} 626.endfor 627 628distribute32 install32: 629 cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} 630.if ${MK_CDDL} != "no" 631 cd ${.CURDIR}/cddl/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} 632.endif 633 cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} 634.if ${MK_CRYPT} != "no" 635 cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} 636.endif 637.if ${MK_KERBEROS} != "no" 638 cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} 639.endif 640 cd ${.CURDIR}/libexec/rtld-elf; \ 641 PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//} 642 cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} ${.TARGET:S/32$//} 643.endif 644 645WMAKE_TGTS= 646.if !defined(SUBDIR_OVERRIDE) 647WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools 648.endif 649WMAKE_TGTS+= _cleanobj _obj _build-tools 650.if !defined(SUBDIR_OVERRIDE) 651WMAKE_TGTS+= _cross-tools 652.endif 653WMAKE_TGTS+= _includes _libraries _depend everything 654.if defined(LIB32TMP) && ${MK_LIB32} != "no" 655WMAKE_TGTS+= build32 656.endif 657 658buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue 659.ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue 660 661buildworld_prologue: 662 @echo "--------------------------------------------------------------" 663 @echo ">>> World build started on `LC_ALL=C date`" 664 @echo "--------------------------------------------------------------" 665 666buildworld_epilogue: 667 @echo 668 @echo "--------------------------------------------------------------" 669 @echo ">>> World build completed on `LC_ALL=C date`" 670 @echo "--------------------------------------------------------------" 671 672# 673# We need to have this as a target because the indirection between Makefile 674# and Makefile.inc1 causes the correct PATH to be used, rather than a 675# modification of the current environment's PATH. In addition, we need 676# to quote multiword values. 677# 678buildenvvars: 679 @echo ${WMAKEENV:Q} 680 681buildenv: 682 @echo Entering world for ${TARGET_ARCH}:${TARGET} 683 @cd ${.CURDIR} && env ${WMAKEENV} ${BUILDENV_SHELL} || true 684 685TOOLCHAIN_TGTS= ${WMAKE_TGTS:N_depend:Neverything:Nbuild32} 686toolchain: ${TOOLCHAIN_TGTS} 687kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries} 688 689# 690# installcheck 691# 692# Checks to be sure system is ready for installworld/installkernel. 693# 694installcheck: _installcheck_world _installcheck_kernel 695_installcheck_world: 696_installcheck_kernel: 697 698# 699# Require DESTDIR to be set if installing for a different architecture or 700# using the user/group database in the source tree. 701# 702.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE} || \ 703 defined(DB_FROM_SRC) 704.if !make(distributeworld) 705_installcheck_world: __installcheck_DESTDIR 706_installcheck_kernel: __installcheck_DESTDIR 707__installcheck_DESTDIR: 708.if !defined(DESTDIR) || empty(DESTDIR) 709 @echo "ERROR: Please set DESTDIR!"; \ 710 false 711.endif 712.endif 713.endif 714 715.if !defined(DB_FROM_SRC) 716# 717# Check for missing UIDs/GIDs. 718# 719CHECK_UIDS= auditdistd 720CHECK_GIDS= audit 721.if ${MK_SENDMAIL} != "no" 722CHECK_UIDS+= smmsp 723CHECK_GIDS+= smmsp 724.endif 725.if ${MK_PF} != "no" 726CHECK_UIDS+= proxy 727CHECK_GIDS+= proxy authpf 728.endif 729.if ${MK_UNBOUND} != "no" 730CHECK_UIDS+= unbound 731CHECK_GIDS+= unbound 732.endif 733_installcheck_world: __installcheck_UGID 734__installcheck_UGID: 735.for uid in ${CHECK_UIDS} 736 @if ! `id -u ${uid} >/dev/null 2>&1`; then \ 737 echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \ 738 false; \ 739 fi 740.endfor 741.for gid in ${CHECK_GIDS} 742 @if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \ 743 echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \ 744 false; \ 745 fi 746.endfor 747.endif 748 749# 750# Required install tools to be saved in a scratch dir for safety. 751# 752.if ${MK_INFO} != "no" 753_install-info= install-info 754.endif 755.if ${MK_ZONEINFO} != "no" 756_zoneinfo= zic tzsetup 757.endif 758 759ITOOLS= [ awk cap_mkdb cat chflags chmod chown \ 760 date echo egrep find grep id install ${_install-info} \ 761 ln lockf make mkdir mtree mv pwd_mkdb \ 762 rm sed services_mkdb sh sysctl test true uname wc ${_zoneinfo} \ 763 ${LOCAL_ITOOLS} 764 765# 766# distributeworld 767# 768# Distributes everything compiled by a `buildworld'. 769# 770# installworld 771# 772# Installs everything compiled by a 'buildworld'. 773# 774 775# Non-base distributions produced by the base system 776EXTRA_DISTRIBUTIONS= doc 777.if ${MK_GAMES} != "no" 778EXTRA_DISTRIBUTIONS+= games 779.endif 780.if defined(LIB32TMP) && ${MK_LIB32} != "no" 781EXTRA_DISTRIBUTIONS+= lib32 782.endif 783.if ${MK_TESTS} != "no" 784EXTRA_DISTRIBUTIONS+= tests 785.endif 786 787DEBUG_DISTRIBUTIONS= 788.if ${MK_DEBUG_FILES} != "no" 789DEBUG_DISTRIBUTIONS+= base ${EXTRA_DISTRIBUTIONS:S,doc,,} 790.endif 791 792MTREE_MAGIC?= mtree 2.0 793 794distributeworld installworld: _installcheck_world 795 mkdir -p ${INSTALLTMP} 796 progs=$$(for prog in ${ITOOLS}; do \ 797 if progpath=`which $$prog`; then \ 798 echo $$progpath; \ 799 else \ 800 echo "Required tool $$prog not found in PATH." >&2; \ 801 exit 1; \ 802 fi; \ 803 done); \ 804 libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | \ 805 while read line; do \ 806 set -- $$line; \ 807 if [ "$$2 $$3" != "not found" ]; then \ 808 echo $$2; \ 809 else \ 810 echo "Required library $$1 not found." >&2; \ 811 exit 1; \ 812 fi; \ 813 done); \ 814 cp $$libs $$progs ${INSTALLTMP} 815 cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale 816.if defined(NO_ROOT) 817 echo "#${MTREE_MAGIC}" > ${METALOG} 818.endif 819.if make(distributeworld) 820.for dist in ${EXTRA_DISTRIBUTIONS} 821 -mkdir ${DESTDIR}/${DISTDIR}/${dist} 822 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \ 823 -p ${DESTDIR}/${DISTDIR}/${dist} >/dev/null 824 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ 825 -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null 826 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ 827 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null 828.if ${MK_DEBUG_FILES} != "no" 829 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ 830 -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null 831.endif 832.if ${MK_TESTS} != "no" && ${dist} == "tests" 833 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ 834 -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null 835.endif 836.if defined(NO_ROOT) 837 ${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \ 838 sed -e 's#^\./#./${dist}/#' >> ${METALOG} 839 ${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \ 840 sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG} 841 ${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \ 842 sed -e 's#^\./#./${dist}/usr/include/#' >> ${METALOG} 843.endif 844.endfor 845 -mkdir ${DESTDIR}/${DISTDIR}/base 846 cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ 847 METALOG=${METALOG} ${IMAKE_INSTALL} ${IMAKE_MTREE} \ 848 DISTBASE=/base DESTDIR=${DESTDIR}/${DISTDIR}/base \ 849 LOCAL_MTREE=${LOCAL_MTREE:Q} distrib-dirs 850.endif 851 ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \ 852 ${IMAKEENV} rm -rf ${INSTALLTMP} 853.if make(distributeworld) 854.for dist in ${EXTRA_DISTRIBUTIONS} 855 find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -empty -delete 856.endfor 857.if defined(NO_ROOT) 858.for dist in base ${EXTRA_DISTRIBUTIONS} 859 @# For each file that exists in this dist, print the corresponding 860 @# line from the METALOG. This relies on the fact that 861 @# a line containing only the filename will sort immediatly before 862 @# the relevant mtree line. 863 cd ${DESTDIR}/${DISTDIR}; \ 864 find ./${dist} | sort -u ${METALOG} - | \ 865 awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \ 866 ${DESTDIR}/${DISTDIR}/${dist}.meta 867.endfor 868.for dist in ${DEBUG_DISTRIBUTIONS} 869 @# For each file that exists in this dist, print the corresponding 870 @# line from the METALOG. This relies on the fact that 871 @# a line containing only the filename will sort immediatly before 872 @# the relevant mtree line. 873 cd ${DESTDIR}/${DISTDIR}; \ 874 find ./${dist}/usr/lib/debug | sort -u ${METALOG} - | \ 875 awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \ 876 ${DESTDIR}/${DISTDIR}/${dist}.debug.meta 877.endfor 878.endif 879.endif 880 881packageworld: 882.for dist in base ${EXTRA_DISTRIBUTIONS} 883.if defined(NO_ROOT) 884 ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ 885 tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \ 886 --exclude usr/lib/debug \ 887 @${DESTDIR}/${DISTDIR}/${dist}.meta 888.else 889 ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ 890 tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \ 891 --exclude usr/lib/debug . 892.endif 893.endfor 894 895.for dist in ${DEBUG_DISTRIBUTIONS} 896. if defined(NO_ROOT) 897 ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ 898 tar cvJf ${DESTDIR}/${DISTDIR}/${dist}-dbg.txz \ 899 @${DESTDIR}/${DISTDIR}/${dist}.debug.meta 900. else 901 ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ 902 tar cvJfL ${DESTDIR}/${DISTDIR}/${dist}-dbg.txz \ 903 usr/lib/debug 904. endif 905.endfor 906 907# 908# reinstall 909# 910# If you have a build server, you can NFS mount the source and obj directories 911# and do a 'make reinstall' on the *client* to install new binaries from the 912# most recent server build. 913# 914reinstall: .MAKE 915 @echo "--------------------------------------------------------------" 916 @echo ">>> Making hierarchy" 917 @echo "--------------------------------------------------------------" 918 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \ 919 LOCAL_MTREE=${LOCAL_MTREE:Q} hierarchy 920 @echo 921 @echo "--------------------------------------------------------------" 922 @echo ">>> Installing everything" 923 @echo "--------------------------------------------------------------" 924 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install 925.if defined(LIB32TMP) && ${MK_LIB32} != "no" 926 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32 927.endif 928 929redistribute: .MAKE 930 @echo "--------------------------------------------------------------" 931 @echo ">>> Distributing everything" 932 @echo "--------------------------------------------------------------" 933 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute 934.if defined(LIB32TMP) && ${MK_LIB32} != "no" 935 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 \ 936 DISTRIBUTION=lib32 937.endif 938 939distrib-dirs distribution: .MAKE 940 cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ 941 ${IMAKE_INSTALL} ${IMAKE_MTREE} METALOG=${METALOG} ${.TARGET} 942 943# 944# buildkernel and installkernel 945# 946# Which kernels to build and/or install is specified by setting 947# KERNCONF. If not defined a GENERIC kernel is built/installed. 948# Only the existing (depending TARGET) config files are used 949# for building kernels and only the first of these is designated 950# as the one being installed. 951# 952# Note that we have to use TARGET instead of TARGET_ARCH when 953# we're in kernel-land. Since only TARGET_ARCH is (expected) to 954# be set to cross-build, we have to make sure TARGET is set 955# properly. 956 957.if defined(KERNFAST) 958NO_KERNELCLEAN= t 959NO_KERNELCONFIG= t 960NO_KERNELDEPEND= t 961NO_KERNELOBJ= t 962# Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah 963.if !defined(KERNCONF) && ${KERNFAST} != "1" 964KERNCONF=${KERNFAST} 965.endif 966.endif 967.if ${TARGET_ARCH} == "powerpc64" 968KERNCONF?= GENERIC64 969.else 970KERNCONF?= GENERIC 971.endif 972INSTKERNNAME?= kernel 973 974KERNSRCDIR?= ${.CURDIR}/sys 975KRNLCONFDIR= ${KERNSRCDIR}/${TARGET}/conf 976KRNLOBJDIR= ${OBJTREE}${KERNSRCDIR} 977KERNCONFDIR?= ${KRNLCONFDIR} 978 979BUILDKERNELS= 980INSTALLKERNEL= 981.for _kernel in ${KERNCONF} 982.if exists(${KERNCONFDIR}/${_kernel}) 983BUILDKERNELS+= ${_kernel} 984.if empty(INSTALLKERNEL) 985INSTALLKERNEL= ${_kernel} 986.endif 987.endif 988.endfor 989 990buildkernel ${WMAKE_TGTS} ${.ALLTARGETS:M_*}: .MAKE 991 992# 993# buildkernel 994# 995# Builds all kernels defined by BUILDKERNELS. 996# 997buildkernel: 998.if empty(BUILDKERNELS) 999 @echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \ 1000 false 1001.endif 1002 @echo 1003.for _kernel in ${BUILDKERNELS} 1004 @echo "--------------------------------------------------------------" 1005 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`" 1006 @echo "--------------------------------------------------------------" 1007 @echo "===> ${_kernel}" 1008 mkdir -p ${KRNLOBJDIR} 1009.if !defined(NO_KERNELCONFIG) 1010 @echo 1011 @echo "--------------------------------------------------------------" 1012 @echo ">>> stage 1: configuring the kernel" 1013 @echo "--------------------------------------------------------------" 1014 cd ${KRNLCONFDIR}; \ 1015 PATH=${TMPPATH} \ 1016 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \ 1017 -I '${KERNCONFDIR}' '${KERNCONFDIR}/${_kernel}' 1018.endif 1019.if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN) 1020 @echo 1021 @echo "--------------------------------------------------------------" 1022 @echo ">>> stage 2.1: cleaning up the object tree" 1023 @echo "--------------------------------------------------------------" 1024 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR} 1025.endif 1026.if !defined(NO_KERNELOBJ) 1027 @echo 1028 @echo "--------------------------------------------------------------" 1029 @echo ">>> stage 2.2: rebuilding the object tree" 1030 @echo "--------------------------------------------------------------" 1031 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj 1032.endif 1033 @echo 1034 @echo "--------------------------------------------------------------" 1035 @echo ">>> stage 2.3: build tools" 1036 @echo "--------------------------------------------------------------" 1037 ${_+_}cd ${.CURDIR}; ${KTMAKE} kernel-tools 1038.if !defined(NO_KERNELDEPEND) 1039 @echo 1040 @echo "--------------------------------------------------------------" 1041 @echo ">>> stage 3.1: making dependencies" 1042 @echo "--------------------------------------------------------------" 1043 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} depend -DNO_MODULES_OBJ 1044.endif 1045 @echo 1046 @echo "--------------------------------------------------------------" 1047 @echo ">>> stage 3.2: building everything" 1048 @echo "--------------------------------------------------------------" 1049 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ 1050 @echo "--------------------------------------------------------------" 1051 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`" 1052 @echo "--------------------------------------------------------------" 1053.endfor 1054 1055# 1056# installkernel, etc. 1057# 1058# Install the kernel defined by INSTALLKERNEL 1059# 1060installkernel installkernel.debug \ 1061reinstallkernel reinstallkernel.debug: _installcheck_kernel 1062.if empty(INSTALLKERNEL) 1063 @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \ 1064 false 1065.endif 1066 @echo "--------------------------------------------------------------" 1067 @echo ">>> Installing kernel ${INSTALLKERNEL}" 1068 @echo "--------------------------------------------------------------" 1069 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ 1070 ${CROSSENV} PATH=${TMPPATH} \ 1071 ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} 1072 1073distributekernel distributekernel.debug: 1074.if empty(INSTALLKERNEL) 1075 @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \ 1076 false 1077.endif 1078 mkdir -p ${DESTDIR}/${DISTDIR} 1079.if defined(NO_ROOT) 1080 echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.premeta 1081.endif 1082 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ 1083 ${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.premeta/} \ 1084 ${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \ 1085 DESTDIR=${INSTALL_DDIR}/kernel \ 1086 ${.TARGET:S/distributekernel/install/} 1087.if defined(NO_ROOT) 1088 sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \ 1089 ${DESTDIR}/${DISTDIR}/kernel.meta 1090.endif 1091.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} 1092.if defined(NO_ROOT) 1093 echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta 1094.endif 1095 cd ${KRNLOBJDIR}/${_kernel}; \ 1096 ${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.${_kernel}.premeta/} \ 1097 ${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} \ 1098 KERNEL=${INSTKERNNAME}.${_kernel} \ 1099 DESTDIR=${INSTALL_DDIR}/kernel.${_kernel} \ 1100 ${.TARGET:S/distributekernel/install/} 1101.if defined(NO_ROOT) 1102 sed -e 's|^./kernel|.|' \ 1103 ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta > \ 1104 ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta 1105.endif 1106.endfor 1107 1108packagekernel: 1109.if defined(NO_ROOT) 1110 cd ${DESTDIR}/${DISTDIR}/kernel; \ 1111 tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz \ 1112 @${DESTDIR}/${DISTDIR}/kernel.meta 1113.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} 1114 cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ 1115 tar cvJf ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz \ 1116 @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta 1117.endfor 1118.else 1119 cd ${DESTDIR}/${DISTDIR}/kernel; \ 1120 tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz . 1121.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} 1122 cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ 1123 tar cvJf ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz . 1124.endfor 1125.endif 1126 1127# 1128# doxygen 1129# 1130# Build the API documentation with doxygen 1131# 1132doxygen: 1133 @if [ ! -x `/usr/bin/which doxygen` ]; then \ 1134 echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \ 1135 exit 1; \ 1136 fi 1137 cd ${.CURDIR}/tools/kerneldoc/subsys && ${MAKE} obj all 1138 1139# 1140# update 1141# 1142# Update the source tree(s), by running svn/svnup to update to the 1143# latest copy. 1144# 1145update: 1146.if (defined(CVS_UPDATE) || defined(SUP_UPDATE)) && !defined(SVN_UPDATE) 1147 @echo "--------------------------------------------------------------" 1148 @echo "CVS_UPDATE and SUP_UPDATE are no longer supported." 1149 @echo "Please see: https://wiki.freebsd.org/CvsIsDeprecated" 1150 @echo "--------------------------------------------------------------" 1151 @exit 1 1152.endif 1153.if defined(SVN_UPDATE) 1154 @echo "--------------------------------------------------------------" 1155 @echo ">>> Updating ${.CURDIR} using Subversion" 1156 @echo "--------------------------------------------------------------" 1157 @(cd ${.CURDIR} && ${SVN} update ${SVNFLAGS}) 1158.endif 1159 1160# 1161# ------------------------------------------------------------------------ 1162# 1163# From here onwards are utility targets used by the 'make world' and 1164# related targets. If your 'world' breaks, you may like to try to fix 1165# the problem and manually run the following targets to attempt to 1166# complete the build. Beware, this is *not* guaranteed to work, you 1167# need to have a pretty good grip on the current state of the system 1168# to attempt to manually finish it. If in doubt, 'make world' again. 1169# 1170 1171# 1172# legacy: Build compatibility shims for the next three targets 1173# 1174legacy: 1175.if ${BOOTSTRAPPING} < 800107 && ${BOOTSTRAPPING} != 0 1176 @echo "ERROR: Source upgrades from versions prior to 8.0 not supported."; \ 1177 false 1178.endif 1179.for _tool in tools/build 1180 ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \ 1181 cd ${.CURDIR}/${_tool} && \ 1182 ${MAKE} DIRPRFX=${_tool}/ obj && \ 1183 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes && \ 1184 ${MAKE} DIRPRFX=${_tool}/ depend && \ 1185 ${MAKE} DIRPRFX=${_tool}/ all && \ 1186 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install 1187.endfor 1188 1189# 1190# bootstrap-tools: Build tools needed for compatibility 1191# 1192.if ${MK_GAMES} != "no" 1193_strfile= games/fortune/strfile 1194.endif 1195 1196.if ${MK_CXX} != "no" 1197_gperf= gnu/usr.bin/gperf 1198.endif 1199 1200.if ${MK_GROFF} != "no" 1201_groff= gnu/usr.bin/groff 1202.endif 1203 1204.if ${MK_VT} != "no" 1205_vtfontcvt= usr.bin/vtfontcvt 1206.endif 1207 1208.if ${BOOTSTRAPPING} < 900002 1209_sed= usr.bin/sed 1210.endif 1211 1212.if ${BOOTSTRAPPING} < 1000002 1213_m4= lib/libohash \ 1214 usr.bin/m4 1215.endif 1216 1217.if ${BOOTSTRAPPING} < 1000013 1218_yacc= lib/liby \ 1219 usr.bin/yacc 1220.endif 1221 1222.if ${BOOTSTRAPPING} < 1000014 1223_crunch= usr.sbin/crunch 1224.endif 1225 1226.if ${BOOTSTRAPPING} < 1000026 1227_nmtree= lib/libnetbsd \ 1228 usr.sbin/nmtree 1229.endif 1230 1231.if ${BOOTSTRAPPING} < 1000027 1232_cat= bin/cat 1233.endif 1234 1235.if ${BOOTSTRAPPING} < 1000033 1236_lex= usr.bin/lex 1237.endif 1238 1239.if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 1240_awk= usr.bin/awk 1241.endif 1242 1243.if ${MK_BSNMP} != "no" 1244_gensnmptree= usr.sbin/bsnmpd/gensnmptree 1245.endif 1246 1247# We need to build tblgen when we're building clang either as 1248# the bootstrap compiler, or as the part of the normal build. 1249.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" 1250_clang_tblgen= \ 1251 lib/clang/libllvmsupport \ 1252 lib/clang/libllvmtablegen \ 1253 usr.bin/clang/tblgen \ 1254 usr.bin/clang/clang-tblgen 1255.endif 1256 1257# dtrace tools are required for older bootstrap env and cross-build 1258# pre libdwarf 1259.if ${MK_CDDL} != "no" && (${BOOTSTRAPPING} < 1100006 \ 1260 || (${MACHINE} != ${TARGET} || ${MACHINE_ARCH} != ${TARGET_ARCH})) 1261_dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ 1262 lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge 1263.endif 1264 1265# Default to building the GPL DTC, but build the BSDL one if users explicitly 1266# request it. 1267_dtc= usr.bin/dtc 1268.if ${MK_GPL_DTC} != "no" 1269_dtc= gnu/usr.bin/dtc 1270.endif 1271 1272.if ${MK_KERBEROS} != "no" 1273_kerberos5_bootstrap_tools= \ 1274 kerberos5/tools/make-roken \ 1275 kerberos5/lib/libroken \ 1276 kerberos5/lib/libvers \ 1277 kerberos5/tools/asn1_compile \ 1278 kerberos5/tools/slc \ 1279 usr.bin/compile_et 1280.endif 1281 1282# Please document (add comment) why something is in 'bootstrap-tools'. 1283# Try to bound the building of the bootstrap-tool to just the 1284# FreeBSD versions that need the tool built at this stage of the build. 1285bootstrap-tools: .MAKE 1286.for _tool in \ 1287 ${_clang_tblgen} \ 1288 ${_kerberos5_bootstrap_tools} \ 1289 ${_dtrace_tools} \ 1290 ${_strfile} \ 1291 ${_gperf} \ 1292 ${_groff} \ 1293 ${_dtc} \ 1294 ${_awk} \ 1295 ${_cat} \ 1296 usr.bin/lorder \ 1297 usr.bin/makewhatis \ 1298 usr.bin/rpcgen \ 1299 ${_sed} \ 1300 ${_yacc} \ 1301 ${_m4} \ 1302 ${_lex} \ 1303 lib/libmd \ 1304 usr.bin/xinstall \ 1305 ${_gensnmptree} \ 1306 usr.sbin/config \ 1307 ${_crunch} \ 1308 ${_nmtree} \ 1309 ${_vtfontcvt} 1310 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ 1311 cd ${.CURDIR}/${_tool} && \ 1312 ${MAKE} DIRPRFX=${_tool}/ obj && \ 1313 ${MAKE} DIRPRFX=${_tool}/ depend && \ 1314 ${MAKE} DIRPRFX=${_tool}/ all && \ 1315 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install 1316.endfor 1317 1318# 1319# build-tools: Build special purpose build tools 1320# 1321.if !defined(NO_SHARE) 1322_share= share/syscons/scrnmaps 1323.endif 1324 1325.if ${MK_GCC} != "no" 1326_gcc_tools= gnu/usr.bin/cc/cc_tools 1327.endif 1328 1329.if ${MK_RESCUE} != "no" 1330_rescue= rescue/rescue 1331.endif 1332 1333build-tools: .MAKE 1334.for _tool in \ 1335 bin/csh \ 1336 bin/sh \ 1337 ${_rescue} \ 1338 ${LOCAL_TOOL_DIRS} \ 1339 lib/ncurses/ncurses \ 1340 lib/ncurses/ncursesw \ 1341 ${_share} \ 1342 usr.bin/awk \ 1343 lib/libmagic \ 1344 usr.bin/mkesdb_static \ 1345 usr.bin/mkcsmapper_static \ 1346 usr.bin/vi/catalog 1347 ${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \ 1348 cd ${.CURDIR}/${_tool} && \ 1349 ${MAKE} DIRPRFX=${_tool}/ obj && \ 1350 ${MAKE} DIRPRFX=${_tool}/ build-tools 1351.endfor 1352.for _tool in \ 1353 ${_gcc_tools} 1354 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \ 1355 cd ${.CURDIR}/${_tool} && \ 1356 ${MAKE} DIRPRFX=${_tool}/ obj && \ 1357 ${MAKE} DIRPRFX=${_tool}/ depend && \ 1358 ${MAKE} DIRPRFX=${_tool}/ all 1359.endfor 1360 1361# 1362# kernel-tools: Build kernel-building tools 1363# 1364kernel-tools: .MAKE 1365 mkdir -p ${MAKEOBJDIRPREFIX}/usr 1366 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ 1367 -p ${MAKEOBJDIRPREFIX}/usr >/dev/null 1368 1369# 1370# cross-tools: Build cross-building tools 1371# 1372.if ${TARGET_ARCH} != ${MACHINE_ARCH} 1373.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" 1374_btxld= usr.sbin/btxld 1375.endif 1376.endif 1377.if ${TARGET_ARCH} != ${MACHINE_ARCH} 1378.if ${MK_RESCUE} != "no" || defined(RELEASEDIR) 1379_crunchide= usr.sbin/crunch/crunchide 1380.endif 1381.if ${TARGET_ARCH} == "i386" && defined(RELEASEDIR) 1382_kgzip= usr.sbin/kgzip 1383.endif 1384.endif 1385 1386# If we're given an XAS, don't build binutils. 1387.if ${XAS:M/*} == "" && ${MK_BINUTILS_BOOTSTRAP} != "no" 1388_binutils= gnu/usr.bin/binutils 1389.endif 1390 1391# If an full path to an external cross compiler is given, don't build 1392# a cross compiler. 1393.if ${XCC:M/*} == "" && ${MK_CROSS_COMPILER} != "no" 1394.if ${MK_CLANG_BOOTSTRAP} != "no" 1395_clang= usr.bin/clang 1396_clang_libs= lib/clang 1397.endif 1398.if ${MK_GCC_BOOTSTRAP} != "no" 1399_cc= gnu/usr.bin/cc 1400.endif 1401.endif 1402 1403cross-tools: .MAKE 1404.for _tool in \ 1405 ${_clang_libs} \ 1406 ${_clang} \ 1407 ${_binutils} \ 1408 ${_cc} \ 1409 usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \ 1410 ${_btxld} \ 1411 ${_crunchide} \ 1412 ${_kgzip} \ 1413 sys/boot/usb/tools 1414 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ 1415 cd ${.CURDIR}/${_tool} && \ 1416 ${MAKE} DIRPRFX=${_tool}/ obj && \ 1417 ${MAKE} DIRPRFX=${_tool}/ depend && \ 1418 ${MAKE} DIRPRFX=${_tool}/ all && \ 1419 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install 1420.endfor 1421 1422NXBENV= MAKEOBJDIRPREFIX=${OBJTREE}/nxb \ 1423 INSTALL="sh ${.CURDIR}/tools/install.sh" \ 1424 VERSION="${VERSION}" 1425NXBMAKE= ${NXBENV} ${MAKE} \ 1426 TBLGEN=${OBJTREE}/nxb-bin/usr/bin/tblgen \ 1427 CLANG_TBLGEN=${OBJTREE}/nxb-bin/usr/bin/clang-tblgen \ 1428 MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH} \ 1429 MK_GDB=no MK_TESTS=no \ 1430 SSP_CFLAGS= \ 1431 MK_HTML=no MK_INFO=no NO_LINT=yes MK_MAN=no \ 1432 -DNO_PIC MK_PROFILE=no -DNO_SHARED \ 1433 -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ 1434 MK_CLANG_FULL=no MK_LLDB=no 1435 1436native-xtools: .MAKE 1437 mkdir -p ${OBJTREE}/nxb-bin/usr 1438 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ 1439 -p ${OBJTREE}/nxb-bin/usr >/dev/null 1440 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ 1441 -p ${OBJTREE}/nxb-bin/usr/include >/dev/null 1442.for _tool in \ 1443 ${_clang_tblgen} \ 1444 usr.bin/ar \ 1445 ${_binutils} \ 1446 ${_cc} \ 1447 ${_gcc_tools} \ 1448 ${_clang_libs} \ 1449 ${_clang} \ 1450 usr.bin/awk \ 1451 usr.bin/bmake \ 1452 usr.bin/lex \ 1453 usr.bin/lorder \ 1454 usr.bin/sed \ 1455 usr.bin/yacc 1456 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ 1457 cd ${.CURDIR}/${_tool} && \ 1458 ${NXBMAKE} DIRPRFX=${_tool}/ obj && \ 1459 ${NXBMAKE} DIRPRFX=${_tool}/ depend && \ 1460 ${NXBMAKE} DIRPRFX=${_tool}/ all && \ 1461 ${NXBMAKE} DIRPRFX=${_tool}/ DESTDIR=${OBJTREE}/nxb-bin install 1462.endfor 1463 1464# 1465# hierarchy - ensure that all the needed directories are present 1466# 1467hierarchy hier: .MAKE 1468 cd ${.CURDIR}/etc && ${HMAKE} distrib-dirs 1469 1470# 1471# libraries - build all libraries, and install them under ${DESTDIR}. 1472# 1473# The list of libraries with dependents (${_prebuild_libs}) and their 1474# interdependencies (__L) are built automatically by the 1475# ${.CURDIR}/tools/make_libdeps.sh script. 1476# 1477libraries: .MAKE 1478 cd ${.CURDIR} && \ 1479 ${MAKE} -f Makefile.inc1 _prereq_libs && \ 1480 ${MAKE} -f Makefile.inc1 _startup_libs && \ 1481 ${MAKE} -f Makefile.inc1 _prebuild_libs && \ 1482 ${MAKE} -f Makefile.inc1 _generic_libs 1483 1484# 1485# static libgcc.a prerequisite for shared libc 1486# 1487_prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc lib/libcompiler_rt 1488 1489# These dependencies are not automatically generated: 1490# 1491# gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before 1492# all shared libraries for ELF. 1493# 1494_startup_libs= gnu/lib/csu 1495.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf) 1496_startup_libs+= lib/csu/${MACHINE_ARCH}-elf 1497.elif exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}) 1498_startup_libs+= lib/csu/${MACHINE_ARCH} 1499.else 1500_startup_libs+= lib/csu/${MACHINE_CPUARCH} 1501.endif 1502_startup_libs+= gnu/lib/libgcc 1503_startup_libs+= lib/libcompiler_rt 1504_startup_libs+= lib/libc 1505_startup_libs+= lib/libc_nonshared 1506.if ${MK_LIBCPLUSPLUS} != "no" 1507_startup_libs+= lib/libcxxrt 1508.endif 1509 1510gnu/lib/libgcc__L: lib/libc__L 1511gnu/lib/libgcc__L: lib/libc_nonshared__L 1512.if ${MK_LIBCPLUSPLUS} != "no" 1513lib/libcxxrt__L: gnu/lib/libgcc__L 1514.endif 1515 1516_prebuild_libs= ${_kerberos5_lib_libasn1} \ 1517 ${_kerberos5_lib_libhdb} \ 1518 ${_kerberos5_lib_libheimbase} \ 1519 ${_kerberos5_lib_libheimntlm} \ 1520 ${_kerberos5_lib_libheimsqlite} \ 1521 ${_kerberos5_lib_libheimipcc} \ 1522 ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \ 1523 ${_kerberos5_lib_libroken} \ 1524 ${_kerberos5_lib_libwind} \ 1525 ${_lib_atf} \ 1526 lib/libbz2 ${_libcom_err} lib/libcrypt \ 1527 lib/libelf lib/libexpat \ 1528 ${_lib_libgssapi} \ 1529 lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \ 1530 ${_lib_libcapsicum} \ 1531 lib/ncurses/ncurses lib/ncurses/ncursesw \ 1532 lib/libopie lib/libpam ${_lib_libthr} \ 1533 lib/libradius lib/libsbuf lib/libtacplus \ 1534 lib/libgeom \ 1535 ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ 1536 ${_cddl_lib_libuutil} \ 1537 ${_cddl_lib_libavl} \ 1538 ${_cddl_lib_libzfs_core} \ 1539 ${_cddl_lib_libctf} \ 1540 lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ 1541 ${_secure_lib_libcrypto} ${_lib_libldns} \ 1542 ${_secure_lib_libssh} ${_secure_lib_libssl} 1543.if ${MK_GNUCXX} != "no" 1544_prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++ 1545gnu/lib/libstdc++__L: lib/msun__L 1546gnu/lib/libsupc++__L: gnu/lib/libstdc++__L 1547.endif 1548 1549lib/libgeom__L: lib/libexpat__L 1550 1551.if defined(WITH_ATF) || ${MK_TESTS} != "no" 1552.if !defined(WITH_ATF) 1553# Ensure that the ATF libraries will be built during make libraries, even 1554# though they will have WITHOUT_TESTS 1555MAKE+= -DWITH_ATF 1556.endif 1557_lib_atf= lib/atf 1558.endif 1559 1560.if ${MK_LIBTHR} != "no" 1561_lib_libthr= lib/libthr 1562.endif 1563 1564.if ${MK_OFED} != "no" 1565_ofed_lib= contrib/ofed/usr.lib/ 1566.endif 1567 1568.if ${MK_CASPER} != "no" 1569_lib_libcapsicum=lib/libcapsicum 1570.endif 1571 1572lib/libcapsicum__L: lib/libnv__L 1573lib/libpjdlog__L: lib/libutil__L 1574 1575_generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib} 1576.for _DIR in ${LOCAL_LIB_DIRS} 1577.if exists(${.CURDIR}/${_DIR}/Makefile) 1578_generic_libs+= ${_DIR} 1579.endif 1580.endfor 1581 1582lib/libopie__L lib/libtacplus__L: lib/libmd__L 1583 1584.if ${MK_CDDL} != "no" 1585_cddl_lib_libumem= cddl/lib/libumem 1586_cddl_lib_libnvpair= cddl/lib/libnvpair 1587_cddl_lib_libavl= cddl/lib/libavl 1588_cddl_lib_libuutil= cddl/lib/libuutil 1589_cddl_lib_libzfs_core= cddl/lib/libzfs_core 1590_cddl_lib_libctf= cddl/lib/libctf 1591_cddl_lib= cddl/lib 1592cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L 1593cddl/lib/libzfs__L: lib/libgeom__L 1594cddl/lib/libctf__L: lib/libz__L 1595.endif 1596 1597.if ${MK_CRYPT} != "no" 1598.if ${MK_OPENSSL} != "no" 1599_secure_lib_libcrypto= secure/lib/libcrypto 1600_secure_lib_libssl= secure/lib/libssl 1601lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L 1602.if ${MK_LDNS} != "no" 1603_lib_libldns= lib/libldns 1604lib/libldns__L: secure/lib/libcrypto__L 1605.endif 1606.if ${MK_OPENSSH} != "no" 1607_secure_lib_libssh= secure/lib/libssh 1608secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L 1609.if ${MK_LDNS} != "no" 1610secure/lib/libssh__L: lib/libldns__L 1611.endif 1612.if ${MK_KERBEROS_SUPPORT} != "no" 1613secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \ 1614 kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \ 1615 lib/libmd__L kerberos5/lib/libroken__L 1616.endif 1617.endif 1618.endif 1619_secure_lib= secure/lib 1620.endif 1621 1622.if ${MK_KERBEROS} != "no" 1623kerberos5/lib/libasn1__L: lib/libcom_err__L kerberos5/lib/libroken__L 1624kerberos5/lib/libhdb__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ 1625 kerberos5/lib/libkrb5__L kerberos5/lib/libroken__L \ 1626 kerberos5/lib/libwind__L kerberos5/lib/libheimsqlite__L 1627kerberos5/lib/libheimntlm__L: secure/lib/libcrypto__L kerberos5/lib/libkrb5__L \ 1628 kerberos5/lib/libroken__L lib/libcom_err__L 1629kerberos5/lib/libhx509__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ 1630 secure/lib/libcrypto__L kerberos5/lib/libroken__L kerberos5/lib/libwind__L 1631kerberos5/lib/libkrb5__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ 1632 lib/libcrypt__L secure/lib/libcrypto__L kerberos5/lib/libhx509__L \ 1633 kerberos5/lib/libroken__L kerberos5/lib/libwind__L \ 1634 kerberos5/lib/libheimbase__L kerberos5/lib/libheimipcc__L 1635kerberos5/lib/libroken__L: lib/libcrypt__L 1636kerberos5/lib/libwind__L: kerberos5/lib/libroken__L lib/libcom_err__L 1637kerberos5/lib/libheimbase__L: lib/libthr__L 1638kerberos5/lib/libheimipcc__L: kerberos5/lib/libroken__L kerberos5/lib/libheimbase__L lib/libthr__L 1639kerberos5/lib/libheimsqlite__L: lib/libthr__L 1640.endif 1641 1642.if ${MK_GSSAPI} != "no" 1643_lib_libgssapi= lib/libgssapi 1644.endif 1645 1646.if ${MK_KERBEROS} != "no" 1647_kerberos5_lib= kerberos5/lib 1648_kerberos5_lib_libasn1= kerberos5/lib/libasn1 1649_kerberos5_lib_libhdb= kerberos5/lib/libhdb 1650_kerberos5_lib_libheimbase= kerberos5/lib/libheimbase 1651_kerberos5_lib_libkrb5= kerberos5/lib/libkrb5 1652_kerberos5_lib_libhx509= kerberos5/lib/libhx509 1653_kerberos5_lib_libroken= kerberos5/lib/libroken 1654_kerberos5_lib_libheimntlm= kerberos5/lib/libheimntlm 1655_kerberos5_lib_libheimsqlite= kerberos5/lib/libheimsqlite 1656_kerberos5_lib_libheimipcc= kerberos5/lib/libheimipcc 1657_kerberos5_lib_libwind= kerberos5/lib/libwind 1658_libcom_err= lib/libcom_err 1659.endif 1660 1661.if ${MK_NIS} != "no" 1662_lib_libypclnt= lib/libypclnt 1663.endif 1664 1665.if ${MK_OPENSSL} == "no" 1666lib/libradius__L: lib/libmd__L 1667.endif 1668 1669.for _lib in ${_prereq_libs} 1670${_lib}__PL: .PHONY .MAKE 1671.if exists(${.CURDIR}/${_lib}) 1672 ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ 1673 cd ${.CURDIR}/${_lib} && \ 1674 ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj && \ 1675 ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend && \ 1676 ${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \ 1677 DIRPRFX=${_lib}/ all && \ 1678 ${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \ 1679 DIRPRFX=${_lib}/ install 1680.endif 1681.endfor 1682 1683.for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs} 1684${_lib}__L: .PHONY .MAKE 1685.if exists(${.CURDIR}/${_lib}) 1686 ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ 1687 cd ${.CURDIR}/${_lib} && \ 1688 ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj && \ 1689 ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend && \ 1690 ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ all && \ 1691 ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ install 1692.endif 1693.endfor 1694 1695# libpam is special: we need to build static PAM modules before 1696# static PAM library, and dynamic PAM library before dynamic PAM 1697# modules. 1698lib/libpam__L: .PHONY .MAKE 1699 ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \ 1700 cd ${.CURDIR}/lib/libpam && \ 1701 ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ obj && \ 1702 ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ depend && \ 1703 ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \ 1704 -D_NO_LIBPAM_SO_YET all && \ 1705 ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \ 1706 -D_NO_LIBPAM_SO_YET install 1707 1708_prereq_libs: ${_prereq_libs:S/$/__PL/} 1709_startup_libs: ${_startup_libs:S/$/__L/} 1710_prebuild_libs: ${_prebuild_libs:S/$/__L/} 1711_generic_libs: ${_generic_libs:S/$/__L/} 1712 1713.for __target in all clean cleandepend cleandir depend includes obj 1714.for entry in ${SUBDIR} 1715${entry}.${__target}__D: .PHONY .MAKE 1716 ${_+_}@set -e; if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \ 1717 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH} (${__target})"; \ 1718 edir=${entry}.${MACHINE_ARCH}; \ 1719 cd ${.CURDIR}/$${edir}; \ 1720 else \ 1721 ${ECHODIR} "===> ${DIRPRFX}${entry} (${__target})"; \ 1722 edir=${entry}; \ 1723 cd ${.CURDIR}/$${edir}; \ 1724 fi; \ 1725 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/ 1726.endfor 1727par-${__target}: ${SUBDIR:S/$/.${__target}__D/} 1728.endfor 1729 1730.include <bsd.subdir.mk> 1731 1732.if make(check-old) || make(check-old-dirs) || \ 1733 make(check-old-files) || make(check-old-libs) || \ 1734 make(delete-old) || make(delete-old-dirs) || \ 1735 make(delete-old-files) || make(delete-old-libs) 1736 1737# 1738# check for / delete old files section 1739# 1740 1741.include "ObsoleteFiles.inc" 1742 1743OLD_LIBS_MESSAGE="Please be sure no application still uses those libraries, \ 1744else you can not start such an application. Consult UPDATING for more \ 1745information regarding how to cope with the removal/revision bump of a \ 1746specific library." 1747 1748.if !defined(BATCH_DELETE_OLD_FILES) 1749RM_I=-i 1750.else 1751RM_I=-v 1752.endif 1753 1754delete-old-files: 1755 @echo ">>> Removing old files (only deletes safe to delete libs)" 1756# Ask for every old file if the user really wants to remove it. 1757# It's annoying, but better safe than sorry. 1758# NB: We cannot pass the list of OLD_FILES as a parameter because the 1759# argument list will get too long. Using .for/.endfor make "loops" will make 1760# the Makefile parser segfault. 1761 @exec 3<&0; \ 1762 cd ${.CURDIR}; \ 1763 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ 1764 -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \ 1765 while read file; do \ 1766 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ 1767 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ 1768 rm ${RM_I} "${DESTDIR}/$${file}" <&3; \ 1769 fi; \ 1770 done 1771# Remove catpages without corresponding manpages. 1772 @exec 3<&0; \ 1773 find ${DESTDIR}/usr/share/man/cat* ! -type d | \ 1774 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ 1775 while read catpage; do \ 1776 read manpage; \ 1777 if [ ! -e "$${manpage}" ]; then \ 1778 rm ${RM_I} $${catpage} <&3; \ 1779 fi; \ 1780 done 1781 @echo ">>> Old files removed" 1782 1783check-old-files: 1784 @echo ">>> Checking for old files" 1785 @cd ${.CURDIR}; \ 1786 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ 1787 -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \ 1788 while read file; do \ 1789 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ 1790 echo "${DESTDIR}/$${file}"; \ 1791 fi; \ 1792 done 1793# Check for catpages without corresponding manpages. 1794 @find ${DESTDIR}/usr/share/man/cat* ! -type d | \ 1795 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ 1796 while read catpage; do \ 1797 read manpage; \ 1798 if [ ! -e "$${manpage}" ]; then \ 1799 echo $${catpage}; \ 1800 fi; \ 1801 done 1802 1803delete-old-libs: 1804 @echo ">>> Removing old libraries" 1805 @echo "${OLD_LIBS_MESSAGE}" | fmt 1806 @exec 3<&0; \ 1807 cd ${.CURDIR}; \ 1808 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ 1809 -V OLD_LIBS | xargs -n1 | \ 1810 while read file; do \ 1811 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ 1812 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ 1813 rm ${RM_I} "${DESTDIR}/$${file}" <&3; \ 1814 fi; \ 1815 for ext in debug symbols; do \ 1816 if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \ 1817 "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \ 1818 rm ${RM_I} "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" \ 1819 <&3; \ 1820 fi; \ 1821 done; \ 1822 done 1823 @echo ">>> Old libraries removed" 1824 1825check-old-libs: 1826 @echo ">>> Checking for old libraries" 1827 @cd ${.CURDIR}; \ 1828 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ 1829 -V OLD_LIBS | xargs -n1 | \ 1830 while read file; do \ 1831 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ 1832 echo "${DESTDIR}/$${file}"; \ 1833 fi; \ 1834 for ext in debug symbols; do \ 1835 if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \ 1836 echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \ 1837 fi; \ 1838 done; \ 1839 done 1840 1841delete-old-dirs: 1842 @echo ">>> Removing old directories" 1843 @cd ${.CURDIR}; \ 1844 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ 1845 -V OLD_DIRS | xargs -n1 | sort -r | \ 1846 while read dir; do \ 1847 if [ -d "${DESTDIR}/$${dir}" ]; then \ 1848 rmdir -v "${DESTDIR}/$${dir}" || true; \ 1849 elif [ -L "${DESTDIR}/$${dir}" ]; then \ 1850 echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ 1851 fi; \ 1852 done 1853 @echo ">>> Old directories removed" 1854 1855check-old-dirs: 1856 @echo ">>> Checking for old directories" 1857 @cd ${.CURDIR}; \ 1858 ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ 1859 -V OLD_DIRS | xargs -n1 | \ 1860 while read dir; do \ 1861 if [ -d "${DESTDIR}/$${dir}" ]; then \ 1862 echo "${DESTDIR}/$${dir}"; \ 1863 elif [ -L "${DESTDIR}/$${dir}" ]; then \ 1864 echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ 1865 fi; \ 1866 done 1867 1868delete-old: delete-old-files delete-old-dirs 1869 @echo "To remove old libraries run '${MAKE} delete-old-libs'." 1870 1871check-old: check-old-files check-old-libs check-old-dirs 1872 @echo "To remove old files and directories run '${MAKE} delete-old'." 1873 @echo "To remove old libraries run '${MAKE} delete-old-libs'." 1874 1875.endif 1876 1877# 1878# showconfig - show build configuration. 1879# 1880showconfig: 1881 @${MAKE} -n -f src.opts.mk -V dummy -dg1 2>&1 | grep ^MK_ | sort 1882 1883.if !empty(KRNLOBJDIR) && !empty(KERNCONF) 1884DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/ 1885 1886.if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE) 1887.if exists(${KERNCONFDIR}/${KERNCONF}) 1888FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ {print $$2}' \ 1889 '${KERNCONFDIR}/${KERNCONF}' ; echo 1890.endif 1891.endif 1892 1893.endif 1894 1895.if !defined(DTBOUTPUTPATH) || !exists(${DTBOUTPUTPATH}) 1896DTBOUTPUTPATH= ${.CURDIR} 1897.endif 1898 1899# 1900# Build 'standalone' Device Tree Blob 1901# 1902builddtb: 1903 @PATH=${TMPPATH} MACHINE=${TARGET} \ 1904 ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \ 1905 "${FDT_DTS_FILE}" ${DTBOUTPUTPATH} 1906 1907############### 1908 1909.if defined(TARGET) && defined(TARGET_ARCH) 1910 1911.if ${TARGET} == ${MACHINE} && ${TARGET_ARCH} == ${MACHINE_ARCH} 1912XDEV_CPUTYPE?=${CPUTYPE} 1913.else 1914XDEV_CPUTYPE?=${TARGET_CPUTYPE} 1915.endif 1916 1917NOFUN=-DNO_FSCHG MK_HTML=no MK_INFO=no -DNO_LINT \ 1918 MK_MAN=no MK_NLS=no MK_PROFILE=no \ 1919 MK_KERBEROS=no MK_RESCUE=no MK_TESTS=no MK_WARNS=no \ 1920 TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ 1921 CPUTYPE=${XDEV_CPUTYPE} 1922 1923XDDIR=${TARGET_ARCH}-freebsd 1924XDTP?=/usr/${XDDIR} 1925.if ${XDTP:N/*} 1926.error XDTP variable should be an absolute path 1927.endif 1928 1929CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \ 1930 INSTALL="sh ${.CURDIR}/tools/install.sh" 1931CDENV= ${CDBENV} \ 1932 _SHLIBDIRPREFIX=${XDDESTDIR} \ 1933 TOOLS_PREFIX=${XDTP} 1934CD2CFLAGS=-isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib \ 1935 --sysroot=${XDDESTDIR}/ -B${XDDESTDIR}/usr/libexec \ 1936 -B${XDDESTDIR}/usr/bin -B${XDDESTDIR}/usr/lib 1937CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CFLAGS}" \ 1938 CPP="${CPP} ${CD2CFLAGS}" \ 1939 MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH} 1940 1941CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp 1942CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN} 1943CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} ${NOFUN} 1944XDDESTDIR=${DESTDIR}/${XDTP} 1945.if !defined(OSREL) 1946OSREL!= uname -r | sed -e 's/[-(].*//' 1947.endif 1948 1949.ORDER: xdev-build xdev-install xdev-links 1950xdev: xdev-build xdev-install 1951 1952.ORDER: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools 1953xdev-build: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools 1954 1955_xb-worldtmp: 1956 mkdir -p ${CDTMP}/usr 1957 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ 1958 -p ${CDTMP}/usr >/dev/null 1959 1960_xb-bootstrap-tools: 1961.for _tool in \ 1962 ${_clang_tblgen} 1963 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ 1964 cd ${.CURDIR}/${_tool} && \ 1965 ${CDMAKE} DIRPRFX=${_tool}/ obj && \ 1966 ${CDMAKE} DIRPRFX=${_tool}/ depend && \ 1967 ${CDMAKE} DIRPRFX=${_tool}/ all && \ 1968 ${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install 1969.endfor 1970 1971_xb-build-tools: 1972 ${_+_}@cd ${.CURDIR}; \ 1973 ${CDBENV} ${MAKE} -f Makefile.inc1 ${NOFUN} build-tools 1974 1975_xb-cross-tools: 1976.for _tool in \ 1977 ${_binutils} \ 1978 usr.bin/ar \ 1979 ${_clang_libs} \ 1980 ${_clang} \ 1981 ${_cc} 1982 ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ 1983 cd ${.CURDIR}/${_tool} && \ 1984 ${CDMAKE} DIRPRFX=${_tool}/ obj && \ 1985 ${CDMAKE} DIRPRFX=${_tool}/ depend && \ 1986 ${CDMAKE} DIRPRFX=${_tool}/ all 1987.endfor 1988 1989_xi-mtree: 1990 ${_+_}@${ECHODIR} "mtree populating ${XDDESTDIR}" 1991 mkdir -p ${XDDESTDIR} 1992 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \ 1993 -p ${XDDESTDIR} >/dev/null 1994 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ 1995 -p ${XDDESTDIR}/usr >/dev/null 1996 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ 1997 -p ${XDDESTDIR}/usr/include >/dev/null 1998.if ${MK_TESTS} != "no" 1999 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ 2000 -p ${XDDESTDIR}/usr >/dev/null 2001.endif 2002 2003.ORDER: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries 2004xdev-install: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries 2005 2006_xi-cross-tools: 2007 @echo "_xi-cross-tools" 2008.for _tool in \ 2009 ${_binutils} \ 2010 usr.bin/ar \ 2011 ${_clang_libs} \ 2012 ${_clang} \ 2013 ${_cc} 2014 ${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \ 2015 cd ${.CURDIR}/${_tool}; \ 2016 ${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR} 2017.endfor 2018 2019_xi-includes: 2020 ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 par-includes \ 2021 DESTDIR=${XDDESTDIR} 2022 2023_xi-libraries: 2024 ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 libraries \ 2025 DESTDIR=${XDDESTDIR} 2026 2027xdev-links: 2028 ${_+_}cd ${XDDESTDIR}/usr/bin; \ 2029 mkdir -p ../../../../usr/bin; \ 2030 for i in *; do \ 2031 ln -sf ../../${XDTP}/usr/bin/$$i \ 2032 ../../../../usr/bin/${XDDIR}-$$i; \ 2033 ln -sf ../../${XDTP}/usr/bin/$$i \ 2034 ../../../../usr/bin/${XDDIR}${OSREL}-$$i; \ 2035 done 2036.else 2037xdev xdev-build xdev-install xdev-links: 2038 @echo "*** Error: Both TARGET and TARGET_ARCH must be defined for \"${.TARGET}\" target" 2039.endif 2040