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# -DNO_SHARE do not go into share subdir 8# -DKERNFAST define NO_KERNELCONFIG, NO_KERNELCLEAN and NO_KERNELDEPEND 9# -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel 10# -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel 11# -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel 12# -DNO_PORTSUPDATE do not update ports in ${MAKE} update 13# -DNO_DOCUPDATE do not update doc in ${MAKE} update 14# -DNO_CTF do not run the DTrace CTF conversion tools on built objects 15# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list 16# TARGET="machine" to crossbuild world for a different machine type 17 18# 19# The intended user-driven targets are: 20# buildworld - rebuild *everything*, including glue to help do upgrades 21# installworld- install everything built by "buildworld" 22# doxygen - build API documentation of the kernel 23# update - convenient way to update your source tree (eg: cvsup/cvs) 24# 25# Standard targets (not defined here) are documented in the makefiles in 26# /usr/share/mk. These include: 27# obj depend all install clean cleandepend cleanobj 28 29.include <bsd.own.mk> 30 31.if ${MACHINE_ARCH} == "mips" 32MK_RESCUE=no # not yet 33.endif 34 35# We must do share/info early so that installation of info `dir' 36# entries works correctly. Do it first since it is less likely to 37# grow dependencies on include and lib than vice versa. 38# 39# We must do lib/ and libexec/ before bin/, because if installworld 40# installs a new /bin/sh, the 'make' command will *immediately* 41# use that new version. And the new (dynamically-linked) /bin/sh 42# will expect to find appropriate libraries in /lib and /libexec. 43# 44SUBDIR= share/info lib libexec 45SUBDIR+=bin 46.if ${MK_GAMES} != "no" 47SUBDIR+=games 48.endif 49.if ${MK_CDDL} != "no" 50SUBDIR+=cddl 51.else 52NO_CTF=1 53.endif 54SUBDIR+=gnu include 55.if ${MK_KERBEROS} != "no" 56SUBDIR+=kerberos5 57.endif 58.if ${MK_RESCUE} != "no" 59SUBDIR+=rescue 60.endif 61SUBDIR+=sbin 62.if ${MK_CRYPT} != "no" 63SUBDIR+=secure 64.endif 65.if !defined(NO_SHARE) 66SUBDIR+=share 67.endif 68SUBDIR+=sys usr.bin usr.sbin 69# 70# We must do etc/ last for install/distribute to work. 71# 72SUBDIR+=etc 73 74# These are last, since it is nice to at least get the base system 75# rebuilt before you do them. 76.for _DIR in ${LOCAL_DIRS} 77.if exists(${.CURDIR}/${_DIR}/Makefile) 78SUBDIR+= ${_DIR} 79.endif 80.endfor 81 82.if defined(SUBDIR_OVERRIDE) 83SUBDIR= ${SUBDIR_OVERRIDE} 84.endif 85 86.if defined(NOCLEAN) 87NO_CLEAN= ${NOCLEAN} 88.endif 89.if defined(NO_CLEANDIR) 90CLEANDIR= clean cleandepend 91.else 92CLEANDIR= cleandir 93.endif 94 95CVS?= cvs 96CVSFLAGS?= -A -P -d -I! 97SVN?= svn 98SVNFLAGS?= -r HEAD 99SUP?= /usr/bin/csup 100SUPFLAGS?= -g -L 2 101.if defined(SUPHOST) 102SUPFLAGS+= -h ${SUPHOST} 103.endif 104 105MAKEOBJDIRPREFIX?= /usr/obj 106.if !defined(OSRELDATE) 107.if exists(/usr/include/osreldate.h) 108OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ 109 /usr/include/osreldate.h 110.else 111OSRELDATE= 0 112.endif 113.endif 114 115.if !defined(VERSION) 116VERSION!= uname -srp 117VERSION+= ${OSRELDATE} 118.endif 119 120# Guess machine architecture from machine type, and vice versa. 121.if !defined(TARGET_ARCH) && defined(TARGET) 122TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun4v/sparc64/} 123.elif !defined(TARGET) && defined(TARGET_ARCH) && \ 124 ${TARGET_ARCH} != ${MACHINE_ARCH} 125TARGET= ${TARGET_ARCH} 126.endif 127# Otherwise, default to current machine type and architecture. 128TARGET?= ${MACHINE} 129TARGET_ARCH?= ${MACHINE_ARCH} 130 131KNOWN_ARCHES?= amd64 arm i386 i386/pc98 ia64 mips powerpc sparc64 sparc64/sun4v 132.if ${TARGET} == ${TARGET_ARCH} 133_t= ${TARGET} 134.else 135_t= ${TARGET_ARCH}/${TARGET} 136.endif 137.for _t in ${_t} 138.if empty(KNOWN_ARCHES:M${_t}) 139.error Unknown target ${TARGET_ARCH}:${TARGET}. 140.endif 141.endfor 142 143.if ${TARGET} == ${MACHINE} 144TARGET_CPUTYPE?=${CPUTYPE} 145.else 146TARGET_CPUTYPE?= 147.endif 148 149.if !empty(TARGET_CPUTYPE) 150_TARGET_CPUTYPE=${TARGET_CPUTYPE} 151.else 152_TARGET_CPUTYPE=dummy 153.endif 154_CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} \ 155 -f /dev/null -m ${.CURDIR}/share/mk -V CPUTYPE 156.if ${_CPUTYPE} != ${_TARGET_CPUTYPE} 157.error CPUTYPE global should be set with ?=. 158.endif 159.if make(buildworld) 160BUILD_ARCH!= uname -p 161.if ${MACHINE_ARCH} != ${BUILD_ARCH} 162.error To cross-build, set TARGET_ARCH. 163.endif 164.endif 165.if ${MACHINE} == ${TARGET} && !defined(CROSS_BUILD_TESTING) 166OBJTREE= ${MAKEOBJDIRPREFIX} 167.else 168OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET} 169.endif 170WORLDTMP= ${OBJTREE}${.CURDIR}/tmp 171# /usr/games added for fortune which depend on strfile 172BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games 173XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games 174STRICTTMPPATH= ${BPATH}:${XPATH} 175TMPPATH= ${STRICTTMPPATH}:${PATH} 176 177# 178# Avoid running mktemp(1) unless actually needed. 179# It may not be functional, e.g., due to new ABI 180# when in the middle of installing over this system. 181# 182.if make(distributeworld) || make(installworld) 183INSTALLTMP!= /usr/bin/mktemp -d -u -t install 184.endif 185 186# 187# Building a world goes through the following stages 188# 189# 1. legacy stage [BMAKE] 190# This stage is responsible for creating compatibility 191# shims that are needed by the bootstrap-tools, 192# build-tools and cross-tools stages. 193# 1. bootstrap-tools stage [BMAKE] 194# This stage is responsible for creating programs that 195# are needed for backward compatibility reasons. They 196# are not built as cross-tools. 197# 2. build-tools stage [TMAKE] 198# This stage is responsible for creating the object 199# tree and building any tools that are needed during 200# the build process. 201# 3. cross-tools stage [XMAKE] 202# This stage is responsible for creating any tools that 203# are needed for cross-builds. A cross-compiler is one 204# of them. 205# 4. world stage [WMAKE] 206# This stage actually builds the world. 207# 5. install stage (optional) [IMAKE] 208# This stage installs a previously built world. 209# 210 211BOOTSTRAPPING?= 0 212 213# Common environment for world related stages 214CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \ 215 MACHINE_ARCH=${TARGET_ARCH} \ 216 MACHINE=${TARGET} \ 217 CPUTYPE=${TARGET_CPUTYPE} \ 218 GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \ 219 GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \ 220 GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac 221.if ${OSRELDATE} < 700044 222CROSSENV+= AR=gnu-ar RANLIB=gnu-ranlib 223.endif 224 225# bootstrap-tools stage 226BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ 227 PATH=${BPATH}:${PATH} \ 228 WORLDTMP=${WORLDTMP} \ 229 VERSION="${VERSION}" \ 230 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" 231BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ 232 ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ 233 DESTDIR= \ 234 BOOTSTRAPPING=${OSRELDATE} \ 235 SSP_CFLAGS= \ 236 -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \ 237 -DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \ 238 -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF 239 240# build-tools stage 241TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ 242 ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ 243 TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ 244 DESTDIR= \ 245 SSP_CFLAGS= \ 246 BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS \ 247 -DNO_WARNS -DNO_CTF 248 249# cross-tools stage 250XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ 251 TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ 252 -DWITHOUT_GDB 253 254# world stage 255WMAKEENV= ${CROSSENV} \ 256 _SHLIBDIRPREFIX=${WORLDTMP} \ 257 VERSION="${VERSION}" \ 258 INSTALL="sh ${.CURDIR}/tools/install.sh" \ 259 PATH=${TMPPATH} 260.if ${MK_CDDL} == "no" || defined(NO_CTF) 261WMAKEENV+= NO_CTF=1 262.endif 263WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP} 264 265.if ${TARGET_ARCH} == "amd64" 266# 32 bit world 267LIB32TMP= ${OBJTREE}${.CURDIR}/lib32 268 269.if empty(TARGET_CPUTYPE) 270LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2 271.else 272LIB32CPUFLAGS= -march=${TARGET_CPUTYPE} 273.endif 274LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -mfancy-math-387 -DCOMPAT_32BIT \ 275 -isystem ${LIB32TMP}/usr/include/ \ 276 -L${LIB32TMP}/usr/lib32 \ 277 -B${LIB32TMP}/usr/lib32 278 279# Yes, the flags are redundant. 280LIB32WMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \ 281 _SHLIBDIRPREFIX=${LIB32TMP} \ 282 VERSION="${VERSION}" \ 283 MACHINE=i386 \ 284 MACHINE_ARCH=i386 \ 285 INSTALL="sh ${.CURDIR}/tools/install.sh" \ 286 PATH=${TMPPATH} \ 287 CC="${CC} ${LIB32FLAGS}" \ 288 CXX="${CXX} ${LIB32FLAGS}" \ 289 OBJC="${OBJC} ${LIB32FLAGS}" \ 290 LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \ 291 AS="${AS} --32" \ 292 LIBDIR=/usr/lib32 \ 293 SHLIBDIR=/usr/lib32 294 295LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \ 296 -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO \ 297 -DWITHOUT_HTML -DNO_CTF DESTDIR=${LIB32TMP} 298LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*} -DNO_INCS 299.endif 300 301# install stage 302IMAKEENV= ${CROSSENV} 303IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 304.if empty(.MAKEFLAGS:M-n) 305IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \ 306 LD_LIBRARY_PATH=${INSTALLTMP} \ 307 PATH_LOCALE=${INSTALLTMP}/locale 308IMAKE+= __MAKE_SHELL=${INSTALLTMP}/sh 309.else 310IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP} 311.endif 312 313# kernel stage 314KMAKEENV= ${WMAKEENV} 315KMAKE= ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} 316 317# 318# buildworld 319# 320# Attempt to rebuild the entire system, with reasonable chance of 321# success, regardless of how old your existing system is. 322# 323_worldtmp: 324.if ${.CURDIR:C/[^,]//g} != "" 325# The m4 build of sendmail files doesn't like it if ',' is used 326# anywhere in the path of it's files. 327 @echo 328 @echo "*** Error: path to source tree contains a comma ','" 329 @echo 330 false 331.endif 332 @echo 333 @echo "--------------------------------------------------------------" 334 @echo ">>> Rebuilding the temporary build tree" 335 @echo "--------------------------------------------------------------" 336.if !defined(NO_CLEAN) 337 rm -rf ${WORLDTMP} 338.if ${TARGET_ARCH} == "amd64" 339 rm -rf ${LIB32TMP} 340.endif 341.else 342 rm -rf ${WORLDTMP}/legacy/usr/include 343# XXX - These three can depend on any header file. 344 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c 345 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c 346 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c 347.endif 348.for _dir in \ 349 lib usr legacy/usr 350 mkdir -p ${WORLDTMP}/${_dir} 351.endfor 352 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ 353 -p ${WORLDTMP}/legacy/usr >/dev/null 354 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ 355 -p ${WORLDTMP}/usr >/dev/null 356 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ 357 -p ${WORLDTMP}/usr/include >/dev/null 358 ln -sf ${.CURDIR}/sys ${WORLDTMP} 359.if ${MK_BIND_LIBS} != "no" 360 mtree -deU -f ${.CURDIR}/etc/mtree/BIND.include.dist \ 361 -p ${WORLDTMP}/usr/include >/dev/null 362.endif 363_legacy: 364 @echo 365 @echo "--------------------------------------------------------------" 366 @echo ">>> stage 1.1: legacy release compatibility shims" 367 @echo "--------------------------------------------------------------" 368 ${_+_}cd ${.CURDIR}; ${BMAKE} legacy 369_bootstrap-tools: 370 @echo 371 @echo "--------------------------------------------------------------" 372 @echo ">>> stage 1.2: bootstrap tools" 373 @echo "--------------------------------------------------------------" 374 ${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools 375_cleanobj: 376.if !defined(NO_CLEAN) 377 @echo 378 @echo "--------------------------------------------------------------" 379 @echo ">>> stage 2.1: cleaning up the object tree" 380 @echo "--------------------------------------------------------------" 381 ${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/} 382.if ${TARGET_ARCH} == "amd64" 383 ${_+_}cd ${.CURDIR}; ${LIB32WMAKE} -f Makefile.inc1 ${CLEANDIR:S/^/par-/} 384.endif 385.endif 386_obj: 387 @echo 388 @echo "--------------------------------------------------------------" 389 @echo ">>> stage 2.2: rebuilding the object tree" 390 @echo "--------------------------------------------------------------" 391 ${_+_}cd ${.CURDIR}; ${WMAKE} par-obj 392_build-tools: 393 @echo 394 @echo "--------------------------------------------------------------" 395 @echo ">>> stage 2.3: build tools" 396 @echo "--------------------------------------------------------------" 397 ${_+_}cd ${.CURDIR}; ${TMAKE} build-tools 398_cross-tools: 399 @echo 400 @echo "--------------------------------------------------------------" 401 @echo ">>> stage 3: cross tools" 402 @echo "--------------------------------------------------------------" 403 ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools 404_includes: 405 @echo 406 @echo "--------------------------------------------------------------" 407 @echo ">>> stage 4.1: building includes" 408 @echo "--------------------------------------------------------------" 409 ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes 410_libraries: 411 @echo 412 @echo "--------------------------------------------------------------" 413 @echo ">>> stage 4.2: building libraries" 414 @echo "--------------------------------------------------------------" 415 ${_+_}cd ${.CURDIR}; \ 416 ${WMAKE} -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \ 417 -DWITHOUT_MAN -DWITHOUT_PROFILE libraries 418_depend: 419 @echo 420 @echo "--------------------------------------------------------------" 421 @echo ">>> stage 4.3: make dependencies" 422 @echo "--------------------------------------------------------------" 423 ${_+_}cd ${.CURDIR}; ${WMAKE} par-depend 424everything: 425 @echo 426 @echo "--------------------------------------------------------------" 427 @echo ">>> stage 4.4: building everything" 428 @echo "--------------------------------------------------------------" 429 ${_+_}cd ${.CURDIR}; ${WMAKE} par-all 430.if ${TARGET_ARCH} == "amd64" 431build32: 432 @echo 433 @echo "--------------------------------------------------------------" 434 @echo ">>> stage 5.1: building 32 bit shim libraries" 435 @echo "--------------------------------------------------------------" 436 mkdir -p ${LIB32TMP}/usr/lib32 437 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ 438 -p ${LIB32TMP}/usr >/dev/null 439 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ 440 -p ${LIB32TMP}/usr/include >/dev/null 441 mkdir -p ${WORLDTMP} 442 ln -sf ${.CURDIR}/sys ${WORLDTMP} 443.if ${MK_KERBEROS} != "no" 444.for _t in obj depend all 445 cd ${.CURDIR}/kerberos5/tools; \ 446 MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ 447 ${_t} 448.endfor 449.endif 450.for _t in obj includes 451 cd ${.CURDIR}/include; ${LIB32WMAKE} ${_t} 452 cd ${.CURDIR}/lib; ${LIB32WMAKE} ${_t} 453.if ${MK_CDDL} != "no" 454 cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} ${_t} 455.endif 456 cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} ${_t} 457.if ${MK_CRYPT} != "no" 458 cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} ${_t} 459.endif 460.if ${MK_KERBEROS} != "no" 461 cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} ${_t} 462.endif 463.endfor 464.for _dir in usr.bin/lex/lib 465 cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} obj 466.endfor 467.for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic 468 cd ${.CURDIR}/${_dir}; \ 469 MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ 470 build-tools 471.endfor 472 cd ${.CURDIR}; \ 473 ${LIB32WMAKE} -f Makefile.inc1 libraries 474.for _t in obj depend all 475 cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} ${_t} 476 cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} ${_t} 477.endfor 478 479distribute32 install32: 480.if make(distribute32) 481 mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32 # XXX add to mtree 482 mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32/dtrace # XXX add to mtree 483.else 484 mkdir -p ${DESTDIR}/usr/lib32 # XXX add to mtree 485 mkdir -p ${DESTDIR}/usr/lib32/dtrace # XXX add to mtree 486.endif 487 cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} 488.if ${MK_CDDL} != "no" 489 cd ${.CURDIR}/cddl/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} 490.endif 491 cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} 492.if ${MK_CRYPT} != "no" 493 cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} 494.endif 495.if ${MK_KERBEROS} != "no" 496 cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} 497.endif 498 cd ${.CURDIR}/libexec/rtld-elf; \ 499 PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//} 500 cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} ${.TARGET:S/32$//} 501.endif 502 503WMAKE_TGTS= 504.if !defined(SUBDIR_OVERRIDE) 505WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools 506.endif 507WMAKE_TGTS+= _cleanobj _obj _build-tools 508.if !defined(SUBDIR_OVERRIDE) 509WMAKE_TGTS+= _cross-tools 510.endif 511WMAKE_TGTS+= _includes _libraries _depend everything 512.if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no" 513WMAKE_TGTS+= build32 514.endif 515 516buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue 517.ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue 518 519buildworld_prologue: 520 @echo "--------------------------------------------------------------" 521 @echo ">>> World build started on `LC_ALL=C date`" 522 @echo "--------------------------------------------------------------" 523 524buildworld_epilogue: 525 @echo 526 @echo "--------------------------------------------------------------" 527 @echo ">>> World build completed on `LC_ALL=C date`" 528 @echo "--------------------------------------------------------------" 529 530# 531# We need to have this as a target because the indirection between Makefile 532# and Makefile.inc1 causes the correct PATH to be used, rather than a 533# modification of the current environment's PATH. In addition, we need 534# to quote multiword values. 535# 536buildenvvars: 537 @echo ${WMAKEENV:Q} 538 539buildenv: 540 @echo Entering world for ${TARGET_ARCH}:${TARGET} 541 @cd ${.CURDIR} && env ${WMAKEENV} sh || true 542 543TOOLCHAIN_TGTS= ${WMAKE_TGTS:N_depend:Neverything:Nbuild32} 544toolchain: ${TOOLCHAIN_TGTS} 545kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries} 546 547# 548# installcheck 549# 550# Checks to be sure system is ready for installworld/installkernel. 551# 552installcheck: 553 554# 555# Require DESTDIR to be set if installing for a different architecture. 556# 557.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE} 558.if !make(distributeworld) 559installcheck: installcheck_DESTDIR 560installcheck_DESTDIR: 561.if !defined(DESTDIR) || empty(DESTDIR) 562 @echo "ERROR: Please set DESTDIR!"; \ 563 false 564.endif 565.endif 566.endif 567 568# 569# Check for missing UIDs/GIDs. 570# 571CHECK_UIDS= 572CHECK_GIDS= audit 573.if ${MK_SENDMAIL} != "no" 574CHECK_UIDS+= smmsp 575CHECK_GIDS+= smmsp 576.endif 577.if ${MK_PF} != "no" 578CHECK_UIDS+= proxy 579CHECK_GIDS+= proxy authpf 580.endif 581installcheck: installcheck_UGID 582installcheck_UGID: 583.for uid in ${CHECK_UIDS} 584 @if ! `id -u ${uid} >/dev/null 2>&1`; then \ 585 echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \ 586 false; \ 587 fi 588.endfor 589.for gid in ${CHECK_GIDS} 590 @if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \ 591 echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \ 592 false; \ 593 fi 594.endfor 595 596# 597# Required install tools to be saved in a scratch dir for safety. 598# 599.if ${MK_INFO} != "no" 600_install-info= install-info 601.endif 602.if ${MK_ZONEINFO} != "no" 603_zoneinfo= zic tzsetup 604.endif 605 606ITOOLS= [ awk cap_mkdb cat chflags chmod chown \ 607 date echo egrep find grep ${_install-info} \ 608 ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \ 609 test true uname wc ${_zoneinfo} 610 611# 612# distributeworld 613# 614# Distributes everything compiled by a `buildworld'. 615# 616# installworld 617# 618# Installs everything compiled by a 'buildworld'. 619# 620distributeworld installworld: installcheck 621 mkdir -p ${INSTALLTMP} 622 progs=$$(for prog in ${ITOOLS}; do \ 623 if progpath=`which $$prog`; then \ 624 echo $$progpath; \ 625 else \ 626 echo "Required tool $$prog not found in PATH." >&2; \ 627 exit 1; \ 628 fi; \ 629 done); \ 630 libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | \ 631 while read line; do \ 632 set -- $$line; \ 633 if [ "$$2 $$3" != "not found" ]; then \ 634 echo $$2; \ 635 else \ 636 echo "Required library $$1 not found." >&2; \ 637 exit 1; \ 638 fi; \ 639 done); \ 640 cp $$libs $$progs ${INSTALLTMP} 641 cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale 642 ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \ 643 ${IMAKEENV} rm -rf ${INSTALLTMP} 644 645# 646# reinstall 647# 648# If you have a build server, you can NFS mount the source and obj directories 649# and do a 'make reinstall' on the *client* to install new binaries from the 650# most recent server build. 651# 652reinstall: 653 @echo "--------------------------------------------------------------" 654 @echo ">>> Making hierarchy" 655 @echo "--------------------------------------------------------------" 656 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy 657 @echo 658 @echo "--------------------------------------------------------------" 659 @echo ">>> Installing everything" 660 @echo "--------------------------------------------------------------" 661 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install 662.if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no" 663 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32 664.endif 665 666redistribute: 667 @echo "--------------------------------------------------------------" 668 @echo ">>> Distributing everything" 669 @echo "--------------------------------------------------------------" 670 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute 671.if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no" 672 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 \ 673 DISTRIBUTION=lib32 674.endif 675 676distrib-dirs distribution: 677 cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} ${.TARGET} 678 679# 680# buildkernel and installkernel 681# 682# Which kernels to build and/or install is specified by setting 683# KERNCONF. If not defined a GENERIC kernel is built/installed. 684# Only the existing (depending TARGET) config files are used 685# for building kernels and only the first of these is designated 686# as the one being installed. 687# 688# Note that we have to use TARGET instead of TARGET_ARCH when 689# we're in kernel-land. Since only TARGET_ARCH is (expected) to 690# be set to cross-build, we have to make sure TARGET is set 691# properly. 692 693.if defined(KERNFAST) 694NO_KERNELCLEAN= t 695NO_KERNELCONFIG= t 696NO_KERNELDEPEND= t 697# Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah 698.if !defined(KERNCONF) && ${KERNFAST} != "1" 699KERNCONF=${KERNFAST} 700.endif 701.endif 702.if !defined(KERNCONF) && defined(KERNEL) 703KERNCONF= ${KERNEL} 704KERNWARN= 705.else 706KERNCONF?= GENERIC 707.endif 708INSTKERNNAME?= kernel 709 710KERNSRCDIR?= ${.CURDIR}/sys 711KRNLCONFDIR= ${KERNSRCDIR}/${TARGET}/conf 712KRNLOBJDIR= ${OBJTREE}${KERNSRCDIR} 713KERNCONFDIR?= ${KRNLCONFDIR} 714 715BUILDKERNELS= 716INSTALLKERNEL= 717.for _kernel in ${KERNCONF} 718.if exists(${KERNCONFDIR}/${_kernel}) 719BUILDKERNELS+= ${_kernel} 720.if empty(INSTALLKERNEL) 721INSTALLKERNEL= ${_kernel} 722.endif 723.endif 724.endfor 725 726# 727# buildkernel 728# 729# Builds all kernels defined by BUILDKERNELS. 730# 731buildkernel: 732.if empty(BUILDKERNELS) 733 @echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \ 734 false 735.endif 736.if defined(KERNWARN) 737 @echo "--------------------------------------------------------------" 738 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF=" 739 @echo "--------------------------------------------------------------" 740 @sleep 3 741.endif 742 @echo 743.for _kernel in ${BUILDKERNELS} 744 @echo "--------------------------------------------------------------" 745 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`" 746 @echo "--------------------------------------------------------------" 747 @echo "===> ${_kernel}" 748 mkdir -p ${KRNLOBJDIR} 749.if !defined(NO_KERNELCONFIG) 750 @echo 751 @echo "--------------------------------------------------------------" 752 @echo ">>> stage 1: configuring the kernel" 753 @echo "--------------------------------------------------------------" 754 cd ${KRNLCONFDIR}; \ 755 PATH=${TMPPATH} \ 756 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \ 757 ${KERNCONFDIR}/${_kernel} 758.endif 759.if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN) 760 @echo 761 @echo "--------------------------------------------------------------" 762 @echo ">>> stage 2.1: cleaning up the object tree" 763 @echo "--------------------------------------------------------------" 764 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR} 765.endif 766 @echo 767 @echo "--------------------------------------------------------------" 768 @echo ">>> stage 2.2: rebuilding the object tree" 769 @echo "--------------------------------------------------------------" 770 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj 771 @echo 772 @echo "--------------------------------------------------------------" 773 @echo ">>> stage 2.3: build tools" 774 @echo "--------------------------------------------------------------" 775 cd ${KRNLOBJDIR}/${_kernel}; \ 776 MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ 777 ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \ 778 -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile 779# XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case. 780.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) 781.for target in obj depend all 782 cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \ 783 MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \ 784 ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF ${target} 785.endfor 786.endif 787.if !defined(NO_KERNELDEPEND) 788 @echo 789 @echo "--------------------------------------------------------------" 790 @echo ">>> stage 3.1: making dependencies" 791 @echo "--------------------------------------------------------------" 792 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} depend -DNO_MODULES_OBJ 793.endif 794 @echo 795 @echo "--------------------------------------------------------------" 796 @echo ">>> stage 3.2: building everything" 797 @echo "--------------------------------------------------------------" 798 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ 799 @echo "--------------------------------------------------------------" 800 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`" 801 @echo "--------------------------------------------------------------" 802.endfor 803 804# 805# installkernel, etc. 806# 807# Install the kernel defined by INSTALLKERNEL 808# 809installkernel installkernel.debug \ 810reinstallkernel reinstallkernel.debug: installcheck 811.if empty(INSTALLKERNEL) 812 @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \ 813 false 814.endif 815 @echo "--------------------------------------------------------------" 816 @echo ">>> Installing kernel" 817 @echo "--------------------------------------------------------------" 818 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ 819 ${CROSSENV} PATH=${TMPPATH} \ 820 ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} 821 822# 823# doxygen 824# 825# Build the API documentation with doxygen 826# 827doxygen: 828 @if [ ! -x `/usr/bin/which doxygen` ]; then \ 829 echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \ 830 exit 1; \ 831 fi 832 cd ${.CURDIR}/tools/kerneldoc/subsys && ${MAKE} obj all 833 834# 835# update 836# 837# Update the source tree, by running cvsup and/or running cvs to update to the 838# latest copy. 839# 840update: 841.if defined(SUP_UPDATE) 842 @echo "--------------------------------------------------------------" 843 @echo ">>> Running ${SUP}" 844 @echo "--------------------------------------------------------------" 845.if defined(SUPFILE) 846 @${SUP} ${SUPFLAGS} ${SUPFILE} 847.endif 848.if defined(SUPFILE1) 849 @${SUP} ${SUPFLAGS} ${SUPFILE1} 850.endif 851.if defined(SUPFILE2) 852 @${SUP} ${SUPFLAGS} ${SUPFILE2} 853.endif 854.if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE) 855 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE} 856.endif 857.if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE) 858 @${SUP} ${SUPFLAGS} ${DOCSUPFILE} 859.endif 860.endif 861.if defined(CVS_UPDATE) 862 @cd ${.CURDIR} ; \ 863 if [ -d CVS ] ; then \ 864 echo "--------------------------------------------------------------" ; \ 865 echo ">>> Updating ${.CURDIR} from CVS repository" ${CVSROOT} ; \ 866 echo "--------------------------------------------------------------" ; \ 867 echo ${CVS} -R -q update ${CVSFLAGS} ; \ 868 ${CVS} -R -q update ${CVSFLAGS} ; \ 869 fi 870.endif 871.if defined(SVN_UPDATE) 872 @cd ${.CURDIR} ; \ 873 if [ -d .svn ] ; then \ 874 echo "--------------------------------------------------------------" ; \ 875 echo ">>> Updating ${.CURDIR} using Subversion" ; \ 876 echo "--------------------------------------------------------------" ; \ 877 echo ${SVN} update ${SVNFLAGS} ; \ 878 ${SVN} update ${SVNFLAGS} ; \ 879 fi 880.endif 881 882# 883# ------------------------------------------------------------------------ 884# 885# From here onwards are utility targets used by the 'make world' and 886# related targets. If your 'world' breaks, you may like to try to fix 887# the problem and manually run the following targets to attempt to 888# complete the build. Beware, this is *not* guaranteed to work, you 889# need to have a pretty good grip on the current state of the system 890# to attempt to manually finish it. If in doubt, 'make world' again. 891# 892 893# 894# legacy: Build compatibility shims for the next three targets 895# 896legacy: 897.if ${BOOTSTRAPPING} < 600034 && ${BOOTSTRAPPING} != 0 898 @echo "ERROR: Source upgrades from versions prior to 6.0 not supported."; \ 899 false 900.endif 901.for _tool in tools/build 902 ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \ 903 cd ${.CURDIR}/${_tool}; \ 904 ${MAKE} DIRPRFX=${_tool}/ obj; \ 905 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \ 906 ${MAKE} DIRPRFX=${_tool}/ depend; \ 907 ${MAKE} DIRPRFX=${_tool}/ all; \ 908 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install 909.endfor 910 911# 912# bootstrap-tools: Build tools needed for compatibility 913# 914.if ${MK_GAMES} != "no" 915_strfile= games/fortune/strfile 916.endif 917 918.if ${MK_CXX} != "no" 919_gperf= gnu/usr.bin/gperf 920.if ${BOOTSTRAPPING} < 700004 921_groff= gnu/usr.bin/groff 922.else 923_groff= gnu/usr.bin/groff/tmac 924.endif 925.endif 926 927.if ${BOOTSTRAPPING} >= 700044 && ${BOOTSTRAPPING} < 800022 928_ar= usr.bin/ar 929.endif 930 931.if ${BOOTSTRAPPING} < 800013 932_mklocale= usr.bin/mklocale 933.endif 934 935.if ${BOOTSTRAPPING} < 900002 936_sed= usr.bin/sed 937.endif 938 939.if ${BOOTSTRAPPING} < 700018 940_gensnmptree= usr.sbin/bsnmpd/gensnmptree 941.endif 942 943.if ${MK_RESCUE} != "no" && \ 944 ${BOOTSTRAPPING} < 700026 945_crunchgen= usr.sbin/crunch/crunchgen 946.endif 947 948.if ${MK_CDDL} != "no" 949_dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ 950 lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge 951.endif 952 953bootstrap-tools: 954.for _tool in \ 955 ${_dtrace_tools} \ 956 ${_strfile} \ 957 ${_gperf} \ 958 ${_groff} \ 959 ${_ar} \ 960 usr.bin/lorder \ 961 usr.bin/makewhatis \ 962 ${_mklocale} \ 963 usr.bin/rpcgen \ 964 ${_sed} \ 965 usr.bin/xinstall \ 966 ${_gensnmptree} \ 967 usr.sbin/config \ 968 ${_crunchgen} 969 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ 970 cd ${.CURDIR}/${_tool}; \ 971 ${MAKE} DIRPRFX=${_tool}/ obj; \ 972 ${MAKE} DIRPRFX=${_tool}/ depend; \ 973 ${MAKE} DIRPRFX=${_tool}/ all; \ 974 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install 975.endfor 976 977# 978# build-tools: Build special purpose build tools 979# 980.if defined(MODULES_WITH_WORLD) && exists(${KERNSRCDIR}/modules) 981_aicasm= sys/modules/aic7xxx/aicasm 982.endif 983 984.if !defined(NO_SHARE) 985_share= share/syscons/scrnmaps 986.endif 987 988.if ${MK_KERBEROS} != "no" 989_kerberos5_tools= kerberos5/tools 990.endif 991 992.if ${MK_RESCUE} != "no" 993_rescue= rescue/rescue 994.endif 995 996build-tools: 997.for _tool in \ 998 bin/csh \ 999 bin/sh \ 1000 ${_rescue} \ 1001 lib/ncurses/ncurses \ 1002 lib/ncurses/ncursesw \ 1003 ${_share} \ 1004 ${_aicasm} \ 1005 usr.bin/awk \ 1006 lib/libmagic \ 1007 usr.sbin/sysinstall 1008 ${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \ 1009 cd ${.CURDIR}/${_tool}; \ 1010 ${MAKE} DIRPRFX=${_tool}/ obj; \ 1011 ${MAKE} DIRPRFX=${_tool}/ build-tools 1012.endfor 1013.for _tool in \ 1014 gnu/usr.bin/cc/cc_tools \ 1015 ${_kerberos5_tools} 1016 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \ 1017 cd ${.CURDIR}/${_tool}; \ 1018 ${MAKE} DIRPRFX=${_tool}/ obj; \ 1019 ${MAKE} DIRPRFX=${_tool}/ depend; \ 1020 ${MAKE} DIRPRFX=${_tool}/ all 1021.endfor 1022 1023# 1024# cross-tools: Build cross-building tools 1025# 1026.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 800035 1027.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" 1028_btxld= usr.sbin/btxld 1029.endif 1030.endif 1031.if ${TARGET_ARCH} != ${MACHINE_ARCH} 1032.if ${MK_RESCUE} != "no" || defined(RELEASEDIR) 1033_crunchide= usr.sbin/crunch/crunchide 1034.endif 1035.if ${TARGET_ARCH} == "i386" && defined(RELEASEDIR) 1036_kgzip= usr.sbin/kgzip 1037.endif 1038.endif 1039 1040cross-tools: 1041.for _tool in \ 1042 gnu/usr.bin/binutils \ 1043 gnu/usr.bin/cc \ 1044 usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \ 1045 ${_btxld} \ 1046 ${_crunchide} \ 1047 ${_kgzip} 1048 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ 1049 cd ${.CURDIR}/${_tool}; \ 1050 ${MAKE} DIRPRFX=${_tool}/ obj; \ 1051 ${MAKE} DIRPRFX=${_tool}/ depend; \ 1052 ${MAKE} DIRPRFX=${_tool}/ all; \ 1053 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install 1054.endfor 1055 1056# 1057# hierarchy - ensure that all the needed directories are present 1058# 1059hierarchy: 1060 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs 1061 1062# 1063# libraries - build all libraries, and install them under ${DESTDIR}. 1064# 1065# The list of libraries with dependents (${_prebuild_libs}) and their 1066# interdependencies (__L) are built automatically by the 1067# ${.CURDIR}/tools/make_libdeps.sh script. 1068# 1069libraries: 1070 cd ${.CURDIR}; \ 1071 ${MAKE} -f Makefile.inc1 _prereq_libs; \ 1072 ${MAKE} -f Makefile.inc1 _startup_libs; \ 1073 ${MAKE} -f Makefile.inc1 _prebuild_libs; \ 1074 ${MAKE} -f Makefile.inc1 _generic_libs; 1075 1076# 1077# static libgcc.a prerequisite for shared libc 1078# 1079_prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc 1080 1081# These dependencies are not automatically generated: 1082# 1083# gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before 1084# all shared libraries for ELF. 1085# 1086_startup_libs= gnu/lib/csu 1087.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf) 1088_startup_libs+= lib/csu/${MACHINE_ARCH}-elf 1089.else 1090_startup_libs+= lib/csu/${MACHINE_ARCH} 1091.endif 1092_startup_libs+= gnu/lib/libgcc 1093_startup_libs+= lib/libc 1094 1095gnu/lib/libgcc__L: lib/libc__L 1096 1097_prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libkrb5} \ 1098 ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libroken} \ 1099 ${_kerberos5_lib_libheimntlm} ${_kerberos5_lib_libgssapi_krb5} \ 1100 lib/libbz2 lib/libcom_err lib/libcrypt lib/libelf \ 1101 lib/libexpat \ 1102 ${_lib_cddl} ${_lib_libgssapi} ${_lib_libipx} \ 1103 lib/libkiconv lib/libkvm lib/libmd \ 1104 lib/ncurses/ncurses lib/ncurses/ncursesw \ 1105 lib/libopie lib/libpam ${_lib_libthr} \ 1106 lib/libradius lib/libsbuf lib/libtacplus lib/libulog \ 1107 lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ 1108 ${_secure_lib_libcrypto} ${_secure_lib_libssh} \ 1109 ${_secure_lib_libssl} lib/libdwarf lib/libproc 1110 1111.if ${MK_LIBTHR} != "no" 1112_lib_libthr= lib/libthr 1113.endif 1114 1115_generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib 1116 1117lib/libopie__L lib/libtacplus__L: lib/libmd__L 1118 1119.if ${MK_CDDL} != "no" 1120_cddl_lib= cddl/lib 1121.endif 1122 1123.if ${MK_CRYPT} != "no" 1124.if ${MK_OPENSSL} != "no" 1125_secure_lib_libcrypto= secure/lib/libcrypto 1126_secure_lib_libssl= secure/lib/libssl 1127lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L 1128.if ${MK_OPENSSH} != "no" 1129_secure_lib_libssh= secure/lib/libssh 1130secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L 1131.if ${MK_KERBEROS} != "no" 1132kerberos5/lib/libgssapi_krb5__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \ 1133 kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \ 1134 lib/libmd__L kerberos5/lib/libroken__L secure/lib/libcrypto__L \ 1135 lib/libcrypt__L 1136secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libgssapi_krb5__L 1137.endif 1138.endif 1139.endif 1140_secure_lib= secure/lib 1141.endif 1142 1143.if ${MK_IPX} != "no" 1144_lib_libipx= lib/libipx 1145.endif 1146 1147.if ${MK_KERBEROS} != "no" 1148_kerberos5_lib= kerberos5/lib 1149_kerberos5_lib_libasn1= kerberos5/lib/libasn1 1150_kerberos5_lib_libkrb5= kerberos5/lib/libkrb5 1151_kerberos5_lib_libhx509= kerberos5/lib/libhx509 1152_kerberos5_lib_libroken= kerberos5/lib/libroken 1153_kerberos5_lib_libheimntlm= kerberos5/lib/libheimntlm 1154_kerberos5_lib_libgssapi_krb5= kerberos5/lib/libgssapi_krb5 1155_lib_libgssapi= lib/libgssapi 1156.endif 1157 1158.if ${MK_NIS} != "no" 1159_lib_libypclnt= lib/libypclnt 1160.endif 1161 1162.if ${MK_OPENSSL} == "no" 1163lib/libradius__L: lib/libmd__L 1164.endif 1165 1166.for _lib in ${_prereq_libs} 1167${_lib}__PL: .PHONY 1168.if exists(${.CURDIR}/${_lib}) 1169 ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ 1170 cd ${.CURDIR}/${_lib}; \ 1171 ${MAKE} DIRPRFX=${_lib}/ obj; \ 1172 ${MAKE} DIRPRFX=${_lib}/ depend; \ 1173 ${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all; \ 1174 ${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ install 1175.endif 1176.endfor 1177 1178.for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs} 1179${_lib}__L: .PHONY 1180.if exists(${.CURDIR}/${_lib}) 1181 ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ 1182 cd ${.CURDIR}/${_lib}; \ 1183 ${MAKE} DIRPRFX=${_lib}/ obj; \ 1184 ${MAKE} DIRPRFX=${_lib}/ depend; \ 1185 ${MAKE} DIRPRFX=${_lib}/ all; \ 1186 ${MAKE} DIRPRFX=${_lib}/ install 1187.endif 1188.endfor 1189 1190# libpam is special: we need to build static PAM modules before 1191# static PAM library, and dynamic PAM library before dynamic PAM 1192# modules. 1193lib/libpam__L: .PHONY 1194 ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \ 1195 cd ${.CURDIR}/lib/libpam; \ 1196 ${MAKE} DIRPRFX=lib/libpam/ obj; \ 1197 ${MAKE} DIRPRFX=lib/libpam/ depend; \ 1198 ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \ 1199 ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install 1200 1201_prereq_libs: ${_prereq_libs:S/$/__PL/} 1202_startup_libs: ${_startup_libs:S/$/__L/} 1203_prebuild_libs: ${_prebuild_libs:S/$/__L/} 1204_generic_libs: ${_generic_libs:S/$/__L/} 1205 1206.for __target in all clean cleandepend cleandir depend includes obj 1207.for entry in ${SUBDIR} 1208${entry}.${__target}__D: .PHONY 1209 ${_+_}@if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \ 1210 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH} (${__target})"; \ 1211 edir=${entry}.${MACHINE_ARCH}; \ 1212 cd ${.CURDIR}/$${edir}; \ 1213 else \ 1214 ${ECHODIR} "===> ${DIRPRFX}${entry} (${__target})"; \ 1215 edir=${entry}; \ 1216 cd ${.CURDIR}/$${edir}; \ 1217 fi; \ 1218 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/ 1219.endfor 1220par-${__target}: ${SUBDIR:S/$/.${__target}__D/} 1221.endfor 1222 1223.include <bsd.subdir.mk> 1224 1225.if make(check-old) || make(check-old-dirs) || \ 1226 make(check-old-files) || make(check-old-libs) || \ 1227 make(delete-old) || make(delete-old-dirs) || \ 1228 make(delete-old-files) || make(delete-old-libs) 1229 1230# 1231# check for / delete old files section 1232# 1233 1234.include "ObsoleteFiles.inc" 1235 1236OLD_LIBS_MESSAGE="Please be sure no application still uses those libraries, \ 1237else you can not start such an application. Consult UPDATING for more \ 1238information regarding how to cope with the removal/revision bump of a \ 1239specific library." 1240 1241.if !defined(BATCH_DELETE_OLD_FILES) 1242RM_I=-i 1243.else 1244RM_I=-v 1245.endif 1246 1247delete-old-files: 1248 @echo ">>> Removing old files (only deletes safe to delete libs)" 1249# Ask for every old file if the user really wants to remove it. 1250# It's annoying, but better safe than sorry. 1251 @for file in ${OLD_FILES}; do \ 1252 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ 1253 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ 1254 rm ${RM_I} "${DESTDIR}/$${file}"; \ 1255 fi; \ 1256 done 1257# Remove catpages without corresponding manpages. 1258 @3<&0; \ 1259 find ${DESTDIR}/usr/share/man/cat* ! -type d | \ 1260 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ 1261 while read catpage; do \ 1262 read manpage; \ 1263 if [ ! -e "$${manpage}" ]; then \ 1264 rm ${RM_I} $${catpage} <&3 ; \ 1265 fi; \ 1266 done 1267 @echo ">>> Old files removed" 1268 1269check-old-files: 1270 @echo ">>> Checking for old files" 1271 @for file in ${OLD_FILES}; do \ 1272 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ 1273 echo "${DESTDIR}/$${file}"; \ 1274 fi; \ 1275 done 1276# Check for catpages without corresponding manpages. 1277 @find ${DESTDIR}/usr/share/man/cat* ! -type d | \ 1278 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ 1279 while read catpage; do \ 1280 read manpage; \ 1281 if [ ! -e "$${manpage}" ]; then \ 1282 echo $${catpage} ; \ 1283 fi; \ 1284 done 1285 1286delete-old-libs: 1287 @echo ">>> Removing old libraries" 1288 @echo "${OLD_LIBS_MESSAGE}" | fmt 1289 @for file in ${OLD_LIBS}; do \ 1290 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ 1291 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ 1292 rm ${RM_I} "${DESTDIR}/$${file}"; \ 1293 fi; \ 1294 done 1295 @echo ">>> Old libraries removed" 1296 1297check-old-libs: 1298 @echo ">>> Checking for old libraries" 1299 @for file in ${OLD_LIBS}; do \ 1300 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ 1301 echo "${DESTDIR}/$${file}"; \ 1302 fi; \ 1303 done 1304 1305delete-old-dirs: 1306 @echo ">>> Removing old directories" 1307 @for dir in ${OLD_DIRS}; do \ 1308 if [ -d "${DESTDIR}/$${dir}" ]; then \ 1309 rmdir -v "${DESTDIR}/$${dir}" || true; \ 1310 elif [ -L "${DESTDIR}/$${dir}" ]; then \ 1311 echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ 1312 fi; \ 1313 done 1314 @echo ">>> Old directories removed" 1315 1316check-old-dirs: 1317 @echo ">>> Checking for old directories" 1318 @for dir in ${OLD_DIRS}; do \ 1319 if [ -d "${DESTDIR}/$${dir}" ]; then \ 1320 echo "${DESTDIR}/$${dir}"; \ 1321 elif [ -L "${DESTDIR}/$${dir}" ]; then \ 1322 echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ 1323 fi; \ 1324 done 1325 1326delete-old: delete-old-files delete-old-dirs 1327 @echo "To remove old libraries run '${MAKE} delete-old-libs'." 1328 1329check-old: check-old-files check-old-libs check-old-dirs 1330 @echo "To remove old files and directories run '${MAKE} delete-old'." 1331 @echo "To remove old libraries run '${MAKE} delete-old-libs'." 1332 1333.endif 1334 1335# 1336# showconfig - show build configuration. 1337# 1338showconfig: 1339 @${MAKE} -n -f bsd.own.mk -V dummy -dg1 | grep ^MK_ | sort 1340 1341 1342############### 1343 1344.if defined(XDEV) && defined(XDEV_ARCH) 1345 1346NOFUN=-DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \ 1347 -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE \ 1348 -DWITHOUT_KERBEROS -DWITHOUT_RESCUE -DNO_WARNS 1349 1350XDDIR=${XDEV}-freebsd 1351XDTP=/usr/${XDDIR} 1352CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \ 1353 TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} 1354CDENV= ${CDBENV} \ 1355 _SHLIBDIRPREFIX=${XDTP} \ 1356 TOOLS_PREFIX=${XDTP} 1357CD2ENV=${CDENV} \ 1358 MACHINE=${XDEV} MACHINE_ARCH=${XDEV_ARCH} 1359 1360CDTMP= ${MAKEOBJDIRPREFIX}/${XDEV}/${.CURDIR}/tmp 1361CDMAKE=${CDENV} ${MAKE} ${NOFUN} 1362CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDTP}/usr/bin:${PATH} ${MAKE} ${NOFUN} 1363XDDESTDIR=${DESTDIR}${XDTP} 1364.if !defined(OSREL) 1365OSREL!= uname -r | sed -e 's/[-(].*//' 1366.endif 1367 1368.ORDER: xdev-build xdev-install 1369xdev: xdev-build xdev-install 1370 1371.ORDER: _xb-build-tools _xb-cross-tools 1372xdev-build: _xb-build-tools _xb-cross-tools 1373 1374_xb-build-tools: 1375 ${_+_}cd ${.CURDIR}; \ 1376 ${CDBENV} ${MAKE} -f Makefile.inc1 ${NOFUN} build-tools 1377 1378_xb-cross-tools: 1379.for _tool in \ 1380 gnu/usr.bin/binutils \ 1381 gnu/usr.bin/cc 1382 ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ 1383 cd ${.CURDIR}/${_tool}; \ 1384 ${CDMAKE} DIRPRFX=${_tool}/ obj; \ 1385 ${CDMAKE} DIRPRFX=${_tool}/ depend; \ 1386 ${CDMAKE} DIRPRFX=${_tool}/ all 1387.endfor 1388 1389_xi-mtree: 1390 ${_+_}@${ECHODIR} "mtree populating ${XDDESTDIR}" 1391 mkdir -p ${XDDESTDIR} 1392 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \ 1393 -p ${XDDESTDIR} >/dev/null 1394 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ 1395 -p ${XDDESTDIR}/usr >/dev/null 1396 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ 1397 -p ${XDDESTDIR}/usr/include >/dev/null 1398 1399.ORDER: _xi-mtree _xi-cross-tools _xi-includes _xi-libraries _xi-links 1400xdev-install: _xi-mtree _xi-cross-tools _xi-includes _xi-libraries _xi-links 1401 1402_xi-cross-tools: 1403 @echo "_xi-cross-tools" 1404.for _tool in \ 1405 gnu/usr.bin/binutils \ 1406 gnu/usr.bin/cc 1407 ${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \ 1408 cd ${.CURDIR}/${_tool}; \ 1409 ${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR} 1410.endfor 1411 1412_xi-includes: 1413 ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 par-includes \ 1414 DESTDIR=${XDDESTDIR} 1415 1416_xi-libraries: 1417 ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 libraries \ 1418 DESTDIR=${XDDESTDIR} 1419 1420_xi-links: 1421 ${_+_}cd ${XDDESTDIR}/usr/bin; \ 1422 for i in *; do \ 1423 ln -sf ../../${XDTP}/usr/bin/$$i \ 1424 ../../../../usr/bin/${XDDIR}-$$i; \ 1425 ln -sf ../../${XDTP}/usr/bin/$$i \ 1426 ../../../../usr/bin/${XDDIR}${OSREL}-$$i; \ 1427 done 1428.endif 1429