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