Makefile.inc1 revision 133873
1# 2# $FreeBSD: head/Makefile.inc1 133873 2004-08-16 18:17:14Z ru $ 3# 4# Make command line options: 5# -DNO_DYNAMICROOT do not link /bin and /sbin dynamically 6# -DNO_KERBEROS Do not build Heimdal (Kerberos 5) 7# -DNO_RESCUE do not build rescue binaries 8# -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir 9# -DNOCLEAN do not clean at all 10# -DNOCRYPT will prevent building of crypt versions 11# -DNOMAN do not build the manual pages 12# -DNOPROFILE do not build profiled libraries 13# -DNOGAMES do not go into games subdir 14# -DNOSHARE do not go into share subdir 15# -DNOINFO do not make or install info files 16# -DNOLIBC_R do not build libc_r. 17# -DNO_FORTRAN do not build g77 and related libraries. 18# -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel 19# -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel 20# -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel 21# -DNO_PORTSUPDATE do not update ports in ${MAKE} update 22# -DNO_DOCUPDATE do not update doc in ${MAKE} update 23# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list 24# TARGET_ARCH="arch" to crossbuild world to a different arch 25 26# 27# The intended user-driven targets are: 28# buildworld - rebuild *everything*, including glue to help do upgrades 29# installworld- install everything built by "buildworld" 30# update - convenient way to update your source tree (eg: sup/cvs) 31# 32# Standard targets (not defined here) are documented in the makefiles in 33# /usr/share/mk. These include: 34# obj depend all install clean cleandepend cleanobj 35 36# We must do share/info early so that installation of info `dir' 37# entries works correctly. Do it first since it is less likely to 38# grow dependencies on include and lib than vice versa. 39# 40# We must do lib and libexec before bin, because if installworld 41# installs a new /bin/sh, the 'make' command will *immediately* 42# use that new version. And the new (dynamically-linked) /bin/sh 43# will expect to find appropriate libraries in /lib and /libexec. 44# 45# We must do etc last for install/distribute to work. 46# 47SUBDIR= share/info include lib libexec bin 48.if !defined(NOGAMES) 49SUBDIR+=games 50.endif 51SUBDIR+=gnu 52.if !defined(NO_KERBEROS) && !defined(NOCRYPT) && !defined(NO_OPENSSL) 53SUBDIR+=kerberos5 54.endif 55.if !defined(NO_RESCUE) 56SUBDIR+=rescue 57.endif 58SUBDIR+=sbin 59.if !defined(NOCRYPT) 60SUBDIR+=secure 61.endif 62.if !defined(NOSHARE) 63SUBDIR+=share 64.endif 65SUBDIR+=sys usr.bin usr.sbin etc 66 67# These are last, since it is nice to at least get the base system 68# rebuilt before you do them. 69.for _DIR in ${LOCAL_DIRS} 70.if exists(${.CURDIR}/${_DIR}/Makefile) 71SUBDIR+= ${_DIR} 72.endif 73.endfor 74 75.if defined(SUBDIR_OVERRIDE) 76SUBDIR= ${SUBDIR_OVERRIDE} 77.endif 78 79.if defined(NOCLEANDIR) 80CLEANDIR= clean cleandepend 81.else 82CLEANDIR= cleandir 83.endif 84 85CVS?= cvs 86SUP?= /usr/local/bin/cvsup 87SUPFLAGS?= -g -L 2 -P - 88.if defined(SUPHOST) 89SUPFLAGS+= -h ${SUPHOST} 90.endif 91 92MAKEOBJDIRPREFIX?= /usr/obj 93_MAKEOBJDIRPREFIX!= env -i PATH=${PATH} MAKEFLAGS="${.MAKEFLAGS}" ${MAKE} \ 94 -f /dev/null -V MAKEOBJDIRPREFIX dummy 95.if !empty(_MAKEOBJDIRPREFIX) 96.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\ 97 (in /etc/make.conf) or command-line variable. 98.endif 99 100.if !defined(OSRELDATE) 101.if exists(/usr/include/osreldate.h) 102OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ 103 /usr/include/osreldate.h 104.else 105OSRELDATE= 0 106.endif 107.endif 108TARGET_ARCH?= ${MACHINE_ARCH} 109.if ${TARGET_ARCH} == ${MACHINE_ARCH} 110TARGET?= ${MACHINE} 111TARGET_CPUTYPE?=${CPUTYPE} 112.else 113TARGET?= ${TARGET_ARCH} 114TARGET_CPUTYPE?= 115.endif 116.if !empty(TARGET_CPUTYPE) 117_TARGET_CPUTYPE=${TARGET_CPUTYPE} 118.else 119_TARGET_CPUTYPE=dummy 120.endif 121_CPUTYPE!= MAKEFLAGS= ${MAKE} -f /dev/null -m ${.CURDIR}/share/mk \ 122 CPUTYPE=${_TARGET_CPUTYPE} -V CPUTYPE 123.if ${_CPUTYPE} != ${_TARGET_CPUTYPE} 124.error CPUTYPE global should be set with ?=. 125.endif 126.if make(buildworld) 127BUILD_ARCH!= sysctl -n hw.machine_arch 128.if ${MACHINE_ARCH} != ${BUILD_ARCH} 129.error To cross-build, set TARGET_ARCH. 130.endif 131.endif 132.if ${MACHINE} == ${TARGET} 133OBJTREE= ${MAKEOBJDIRPREFIX} 134.else 135OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET} 136.endif 137WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH} 138# /usr/games added for fortune which depend on strfile 139BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games 140XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games 141STRICTTMPPATH= ${BPATH}:${XPATH} 142TMPPATH= ${STRICTTMPPATH}:${PATH} 143 144INSTALLTMP!= /usr/bin/mktemp -d -u -t install 145 146# 147# Building a world goes through the following stages 148# 149# 1. legacy stage [BMAKE] 150# This stage is responsible for creating compatibility 151# shims that are needed by the bootstrap-tools, 152# build-tools and cross-tools stages. 153# 1. bootstrap-tools stage [BMAKE] 154# This stage is responsible for creating programs that 155# are needed for backward compatibility reasons. They 156# are not built as cross-tools. 157# 2. build-tools stage [TMAKE] 158# This stage is responsible for creating the object 159# tree and building any tools that are needed during 160# the build process. 161# 3. cross-tools stage [XMAKE] 162# This stage is responsible for creating any tools that 163# are needed for cross-builds. A cross-compiler is one 164# of them. 165# 4. world stage [WMAKE] 166# This stage actually builds the world. 167# 5. install stage (optional) [IMAKE] 168# This stage installs a previously built world. 169# 170 171BOOTSTRAPPING?= 0 172 173# Common environment for world related stages 174CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \ 175 MACHINE_ARCH=${TARGET_ARCH} \ 176 MACHINE=${TARGET} \ 177 CPUTYPE=${TARGET_CPUTYPE} \ 178 GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \ 179 GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \ 180 GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac 181 182# bootstrap-tools stage 183BMAKEENV= DESTDIR= \ 184 INSTALL="sh ${.CURDIR}/tools/install.sh" \ 185 PATH=${BPATH}:${PATH} \ 186 WORLDTMP=${WORLDTMP} \ 187 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" 188BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ 189 ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ 190 BOOTSTRAPPING=${OSRELDATE} \ 191 -DNOHTML -DNOINFO -DNOLINT -DNOMAN -DNOPIC -DNOPROFILE \ 192 -DNOSHARED -DNO_CPU_CFLAGS -DNO_WARNS 193 194# build-tools stage 195TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ 196 ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ 197 BOOTSTRAPPING=${OSRELDATE} -DNOLINT -DNO_CPU_CFLAGS -DNO_WARNS 198 199# cross-tools stage 200XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB 201 202# world stage 203WMAKEENV= ${CROSSENV} \ 204 DESTDIR=${WORLDTMP} \ 205 _SHLIBDIRPREFIX=${WORLDTMP} \ 206 INSTALL="sh ${.CURDIR}/tools/install.sh" \ 207 PATH=${TMPPATH} 208WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 209 210# install stage 211.if empty(.MAKEFLAGS:M-n) 212IMAKEENV= ${CROSSENV} \ 213 PATH=${STRICTTMPPATH}:${INSTALLTMP} 214.else 215IMAKEENV= ${CROSSENV} \ 216 PATH=${TMPPATH}:${INSTALLTMP} 217.endif 218IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 219 220# kernel stage 221KMAKEENV= ${WMAKEENV} 222 223# 224# buildworld 225# 226# Attempt to rebuild the entire system, with reasonable chance of 227# success, regardless of how old your existing system is. 228# 229_worldtmp: 230.if ${.CURDIR:C/[^,]//g} != "" 231# The m4 build of sendmail files doesn't like it if ',' is used 232# anywhere in the path of it's files. 233 @echo 234 @echo "*** Error: path to source tree contains a comma ','" 235 @echo 236 false 237.endif 238 @echo 239 @echo "--------------------------------------------------------------" 240 @echo ">>> Rebuilding the temporary build tree" 241 @echo "--------------------------------------------------------------" 242.if !defined(NOCLEAN) 243 rm -rf ${WORLDTMP} 244.else 245 rm -rf ${WORLDTMP}/legacy/usr/include 246 # XXX - These two can depend on any header file. 247 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c 248 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c 249.endif 250.for _dir in \ 251 usr/bin usr/games usr/include/c++/3.3 usr/include/sys usr/lib \ 252 usr/libexec usr/sbin usr/share/dict \ 253 usr/share/groff_font/devX100 \ 254 usr/share/groff_font/devX100-12 \ 255 usr/share/groff_font/devX75 \ 256 usr/share/groff_font/devX75-12 \ 257 usr/share/groff_font/devascii \ 258 usr/share/groff_font/devcp1047 \ 259 usr/share/groff_font/devdvi \ 260 usr/share/groff_font/devhtml \ 261 usr/share/groff_font/devkoi8-r \ 262 usr/share/groff_font/devlatin1 \ 263 usr/share/groff_font/devlbp \ 264 usr/share/groff_font/devlj4 \ 265 usr/share/groff_font/devps \ 266 usr/share/groff_font/devutf8 \ 267 usr/share/tmac/mdoc usr/share/tmac/mm 268 mkdir -p ${WORLDTMP}/legacy/${_dir} 269.endfor 270.for _dir in \ 271 lib usr/bin usr/include usr/lib/compat/aout usr/libdata/ldscripts \ 272 usr/libexec usr/sbin usr/share/misc \ 273 usr/share/snmp/defs usr/share/snmp/mibs 274 mkdir -p ${WORLDTMP}/${_dir} 275.endfor 276 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ 277 -p ${WORLDTMP}/usr/include >/dev/null 278 ln -sf ${.CURDIR}/sys ${WORLDTMP} 279_legacy: 280 @echo 281 @echo "--------------------------------------------------------------" 282 @echo ">>> stage 1.1: legacy release compatibility shims" 283 @echo "--------------------------------------------------------------" 284 ${_+_}cd ${.CURDIR}; ${BMAKE} legacy 285_bootstrap-tools: 286 @echo 287 @echo "--------------------------------------------------------------" 288 @echo ">>> stage 1.2: bootstrap tools" 289 @echo "--------------------------------------------------------------" 290 ${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools 291_cleanobj: 292.if !defined(NOCLEAN) 293 @echo 294 @echo "--------------------------------------------------------------" 295 @echo ">>> stage 2.1: cleaning up the object tree" 296 @echo "--------------------------------------------------------------" 297 ${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/} 298.endif 299_obj: 300 @echo 301 @echo "--------------------------------------------------------------" 302 @echo ">>> stage 2.2: rebuilding the object tree" 303 @echo "--------------------------------------------------------------" 304 ${_+_}cd ${.CURDIR}; ${WMAKE} par-obj 305_build-tools: 306 @echo 307 @echo "--------------------------------------------------------------" 308 @echo ">>> stage 2.3: build tools" 309 @echo "--------------------------------------------------------------" 310 ${_+_}cd ${.CURDIR}; ${TMAKE} build-tools 311_cross-tools: 312 @echo 313 @echo "--------------------------------------------------------------" 314 @echo ">>> stage 3: cross tools" 315 @echo "--------------------------------------------------------------" 316 ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools 317_includes: 318 @echo 319 @echo "--------------------------------------------------------------" 320 @echo ">>> stage 4.1: building includes" 321 @echo "--------------------------------------------------------------" 322 ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes 323_libraries: 324 @echo 325 @echo "--------------------------------------------------------------" 326 @echo ">>> stage 4.2: building libraries" 327 @echo "--------------------------------------------------------------" 328 ${_+_}cd ${.CURDIR}; \ 329 ${WMAKE} -DNOFSCHG -DNOHTML -DNOINFO -DNOLINT -DNOMAN -DNOPROFILE \ 330 libraries 331_depend: 332 @echo 333 @echo "--------------------------------------------------------------" 334 @echo ">>> stage 4.3: make dependencies" 335 @echo "--------------------------------------------------------------" 336 ${_+_}cd ${.CURDIR}; ${WMAKE} par-depend 337everything: 338 @echo 339 @echo "--------------------------------------------------------------" 340 @echo ">>> stage 4.4: building everything" 341 @echo "--------------------------------------------------------------" 342 ${_+_}cd ${.CURDIR}; ${WMAKE} par-all 343 344 345WMAKE_TGTS= 346.if !defined(SUBDIR_OVERRIDE) 347WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools 348.endif 349WMAKE_TGTS+= _cleanobj _obj _build-tools 350.if !defined(SUBDIR_OVERRIDE) 351WMAKE_TGTS+= _cross-tools 352.endif 353WMAKE_TGTS+= _includes _libraries _depend everything 354 355buildworld: ${WMAKE_TGTS} 356.ORDER: ${WMAKE_TGTS} 357 358TOOLCHAIN_TGTS= ${WMAKE_TGTS:N_depend:Neverything} 359toolchain: ${TOOLCHAIN_TGTS} 360kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries} 361 362# 363# Use this to add checks to installworld/installkernel targets. 364# 365SPECIAL_INSTALLCHECKS= 366 367# 368# The following install-time check will see if the installation will 369# change the type used for time_t, and if it will, the target makes 370# sure that the user is expecting to make that change. 371# 372.if ${TARGET_ARCH} == "sparc64" 373SPECIAL_INSTALLCHECKS+=sparc64_installcheck 374 375CUR_TIMET!= grep __time_t /usr/include/machine/_types.h | awk '{print $$2}' 376SRC_TIMET!= grep __time_t ${.CURDIR}/sys/sparc64/include/_types.h | \ 377 awk '{print $$2}' 378NEWSPARC_TIMETYPE?=${CUR_TIMET} 379 380sparc64_installcheck: 381.if ${CUR_TIMET} != ${SRC_TIMET} 382 @echo 383.if ${NEWSPARC_TIMETYPE} != ${SRC_TIMET} 384 @echo "*** ERROR: This target would change the type used for time_t!" 385.else 386 @echo "* Note: This installation changes the type used for time_t." 387.endif 388 @echo "* " 389 @echo "* This host has time_t defined as ${CUR_TIMET}," 390 @echo "* and this installation would change that to type ${SRC_TIMET}." 391.if ${NEWSPARC_TIMETYPE} != ${SRC_TIMET} 392 @echo "* " 393 @echo "* If that is *NOT* what you wanted, then you need to change the" 394 @echo "* typedef of __time_t in ${.CURDIR}/sys/sparc64/include/_types.h" 395 @echo "* from '${SRC_TIMET}' to '${CUR_TIMET}'. After that you *MUST*" 396 @echo "* do a complete cleanworld, buildworld, buildkernel before you" 397 @echo "* retry the 'make' command. Also read /usr/src/UPDATING.64BTT." 398 @echo "* " 399 @echo "* If that *is* what you want, then enter the commands:" 400 @echo " NEWSPARC_TIMETYPE=${SRC_TIMET}" 401 @echo " export NEWSPARC_TIMETYPE" 402 @echo "* and repeat your 'make' command." 403 @echo 404 false 405.endif 406 @echo 407.elif ${NEWSPARC_TIMETYPE} != ${SRC_TIMET} 408 @echo 409 @echo "*** ERROR: NEWSPARC_TIMETYPE is set to '${NEWSPARC_TIMETYPE}'" 410 @echo "*** but ${.CURDIR}/sys/sparc64/include/_types.h" 411 @echo "*** has __time_t defined as '${SRC_TIMET}'." 412 false 413.else 414 @# in sparc64_installcheck, all TIMETYPEs == '${CUR_TIMET}' 415.endif 416.endif 417 418# 419# installcheck 420# 421# Checks to be sure system is ready for installworld 422# 423CHECK_UIDS= 424CHECK_GIDS= 425.if !defined(NO_SENDMAIL) 426CHECK_UIDS+= smmsp 427CHECK_GIDS+= smmsp 428.endif 429.if !defined(NO_PF) 430CHECK_UIDS+= proxy 431CHECK_GIDS+= proxy authpf 432.endif 433installcheck: ${SPECIAL_INSTALLCHECKS} 434.for uid in ${CHECK_UIDS} 435 @if ! `id -u ${uid} >/dev/null 2>&1`; then \ 436 echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \ 437 false; \ 438 fi 439.endfor 440.for gid in ${CHECK_GIDS} 441 @if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \ 442 echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \ 443 false; \ 444 fi 445.endfor 446 447# 448# distributeworld 449# 450# Distributes everything compiled by a `buildworld'. 451# 452# installworld 453# 454# Installs everything compiled by a 'buildworld'. 455# 456distributeworld installworld: installcheck 457 mkdir -p ${INSTALLTMP} 458 for prog in [ awk cap_mkdb cat chflags chmod chown \ 459 date echo egrep find grep \ 460 ln make mkdir mtree mv pwd_mkdb rm sed sh sysctl \ 461 test true uname wc zic; do \ 462 cp `which $$prog` ${INSTALLTMP}; \ 463 done 464 ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//} 465 rm -rf ${INSTALLTMP} 466 467# 468# reinstall 469# 470# If you have a build server, you can NFS mount the source and obj directories 471# and do a 'make reinstall' on the *client* to install new binaries from the 472# most recent server build. 473# 474reinstall: ${SPECIAL_INSTALLCHECKS} 475 @echo "--------------------------------------------------------------" 476 @echo ">>> Making hierarchy" 477 @echo "--------------------------------------------------------------" 478 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy 479 @echo 480 @echo "--------------------------------------------------------------" 481 @echo ">>> Installing everything" 482 @echo "--------------------------------------------------------------" 483 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install 484 485redistribute: 486 @echo "--------------------------------------------------------------" 487 @echo ">>> Distributing everything" 488 @echo "--------------------------------------------------------------" 489 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute 490 491# 492# buildkernel and installkernel 493# 494# Which kernels to build and/or install is specified by setting 495# KERNCONF. If not defined a GENERIC kernel is built/installed. 496# Only the existing (depending TARGET) config files are used 497# for building kernels and only the first of these is designated 498# as the one being installed. 499# 500# Note that we have to use TARGET instead of TARGET_ARCH when 501# we're in kernel-land. Since only TARGET_ARCH is (expected) to 502# be set to cross-build, we have to make sure TARGET is set 503# properly. 504 505.if !defined(KERNCONF) && defined(KERNEL) 506KERNCONF= ${KERNEL} 507KERNWARN= yes 508.else 509KERNCONF?= GENERIC 510.endif 511INSTKERNNAME?= kernel 512 513KERNSRCDIR?= ${.CURDIR}/sys 514KRNLCONFDIR= ${KERNSRCDIR}/${TARGET}/conf 515KRNLOBJDIR= ${OBJTREE}${KERNSRCDIR} 516KERNCONFDIR?= ${KRNLCONFDIR} 517 518BUILDKERNELS= 519INSTALLKERNEL= 520.for _kernel in ${KERNCONF} 521.if exists(${KERNCONFDIR}/${_kernel}) 522BUILDKERNELS+= ${_kernel} 523.if empty(INSTALLKERNEL) 524INSTALLKERNEL= ${_kernel} 525.endif 526.endif 527.endfor 528 529# 530# buildkernel 531# 532# Builds all kernels defined by BUILDKERNELS. 533# 534buildkernel: 535.if empty(BUILDKERNELS) 536 @echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; 537 false 538.endif 539.if defined(KERNWARN) 540 @echo "--------------------------------------------------------------" 541 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF=" 542 @echo "--------------------------------------------------------------" 543 @sleep 3 544.endif 545 @echo 546.for _kernel in ${BUILDKERNELS} 547 @echo "--------------------------------------------------------------" 548 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`" 549 @echo "--------------------------------------------------------------" 550 @echo "===> ${_kernel}" 551 mkdir -p ${KRNLOBJDIR} 552.if !defined(NO_KERNELCONFIG) 553 @echo 554 @echo "--------------------------------------------------------------" 555 @echo ">>> stage 1: configuring the kernel" 556 @echo "--------------------------------------------------------------" 557 cd ${KRNLCONFDIR}; \ 558 PATH=${TMPPATH} \ 559 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \ 560 ${KERNCONFDIR}/${_kernel} 561.endif 562.if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN) 563 @echo 564 @echo "--------------------------------------------------------------" 565 @echo ">>> stage 2.1: cleaning up the object tree" 566 @echo "--------------------------------------------------------------" 567 cd ${KRNLOBJDIR}/${_kernel}; \ 568 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} ${CLEANDIR} 569.endif 570 @echo 571 @echo "--------------------------------------------------------------" 572 @echo ">>> stage 2.2: rebuilding the object tree" 573 @echo "--------------------------------------------------------------" 574 cd ${KRNLOBJDIR}/${_kernel}; \ 575 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} obj 576 @echo 577 @echo "--------------------------------------------------------------" 578 @echo ">>> stage 2.3: build tools" 579 @echo "--------------------------------------------------------------" 580 cd ${KRNLOBJDIR}/${_kernel}; \ 581 MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ 582 ${MAKE} -DNO_CPU_CFLAGS -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile 583# XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case. 584.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) 585.for target in obj depend all 586 cd ${.CURDIR}/sys/modules/aic7xxx/aicasm; \ 587 MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \ 588 ${MAKE} -DNO_CPU_CFLAGS ${target} 589.endfor 590.endif 591.if !defined(NO_KERNELDEPEND) 592 @echo 593 @echo "--------------------------------------------------------------" 594 @echo ">>> stage 3.1: making dependencies" 595 @echo "--------------------------------------------------------------" 596 cd ${KRNLOBJDIR}/${_kernel}; \ 597 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend -DNO_MODULES_OBJ 598.endif 599 @echo 600 @echo "--------------------------------------------------------------" 601 @echo ">>> stage 3.2: building everything" 602 @echo "--------------------------------------------------------------" 603 cd ${KRNLOBJDIR}/${_kernel}; \ 604 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all -DNO_MODULES_OBJ 605 @echo "--------------------------------------------------------------" 606 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`" 607 @echo "--------------------------------------------------------------" 608.endfor 609 610# 611# installkernel, etc. 612# 613# Install the kernel defined by INSTALLKERNEL 614# 615installkernel installkernel.debug \ 616reinstallkernel reinstallkernel.debug: ${SPECIAL_INSTALLCHECKS} 617.if empty(INSTALLKERNEL) 618 @echo "ERROR: No kernel \"${KERNCONF}\" to install." 619 false 620.endif 621 @echo "--------------------------------------------------------------" 622 @echo ">>> Making hierarchy" 623 @echo "--------------------------------------------------------------" 624 cd ${.CURDIR}; \ 625 ${CROSSENV} PATH=${TMPPATH} ${MAKE} -f Makefile.inc1 hierarchy 626 @echo 627 @echo "--------------------------------------------------------------" 628 @echo ">>> Installing kernel" 629 @echo "--------------------------------------------------------------" 630 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ 631 ${CROSSENV} PATH=${TMPPATH} \ 632 ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} 633 634# 635# update 636# 637# Update the source tree, by running sup and/or running cvs to update to the 638# latest copy. 639# 640update: 641.if defined(SUP_UPDATE) 642 @echo "--------------------------------------------------------------" 643 @echo ">>> Running ${SUP}" 644 @echo "--------------------------------------------------------------" 645.if defined(SUPFILE) 646 @${SUP} ${SUPFLAGS} ${SUPFILE} 647.endif 648.if defined(SUPFILE1) 649 @${SUP} ${SUPFLAGS} ${SUPFILE1} 650.endif 651.if defined(SUPFILE2) 652 @${SUP} ${SUPFLAGS} ${SUPFILE2} 653.endif 654.if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE) 655 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE} 656.endif 657.if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE) 658 @${SUP} ${SUPFLAGS} ${DOCSUPFILE} 659.endif 660.endif 661.if defined(CVS_UPDATE) 662 @echo "--------------------------------------------------------------" 663 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT} 664 @echo "--------------------------------------------------------------" 665 cd ${.CURDIR}; ${CVS} -R -q update -A -P -d 666.endif 667 668# 669# ------------------------------------------------------------------------ 670# 671# From here onwards are utility targets used by the 'make world' and 672# related targets. If your 'world' breaks, you may like to try to fix 673# the problem and manually run the following targets to attempt to 674# complete the build. Beware, this is *not* guaranteed to work, you 675# need to have a pretty good grip on the current state of the system 676# to attempt to manually finish it. If in doubt, 'make world' again. 677# 678 679# 680# legacy: Build compatibility shims for the next three targets 681# 682legacy: 683.for _tool in tools/build 684 ${_+_}@${ECHODIR} "===> ${_tool}"; \ 685 cd ${.CURDIR}/${_tool}; \ 686 ${MAKE} DIRPRFX=${_tool}/ obj; \ 687 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \ 688 ${MAKE} DIRPRFX=${_tool}/ depend; \ 689 ${MAKE} DIRPRFX=${_tool}/ all; \ 690 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install 691.endfor 692 693# 694# bootstrap-tools: Build tools needed for compatibility 695# 696.if !defined(NOGAMES) 697_strfile= games/fortune/strfile 698.endif 699 700.if !defined(NO_CXX) 701_gperf= gnu/usr.bin/gperf 702.if ${BOOTSTRAPPING} < 500113 703_groff= gnu/usr.bin/groff 704.else 705_groff= gnu/usr.bin/groff/tmac 706.endif 707.endif 708 709.if ${BOOTSTRAPPING} < 502102 710_lex= usr.bin/lex 711.endif 712 713.if ${BOOTSTRAPPING} < 450005 || \ 714 ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500034 715_uudecode= usr.bin/uudecode 716.endif 717 718.if ${BOOTSTRAPPING} < 430002 || \ 719 ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500019 720_xargs= usr.bin/xargs 721.endif 722 723.if ${BOOTSTRAPPING} < 430002 || \ 724 ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500018 725_yacc= usr.bin/yacc 726.endif 727 728.if !defined(NO_RESCUE) && \ 729 ${BOOTSTRAPPING} < 502128 730_crunchgen= usr.sbin/crunch/crunchgen 731.endif 732 733.if ${BOOTSTRAPPING} < 502128 734_gensnmptree= usr.sbin/bsnmpd/gensnmptree 735.endif 736 737.if ${BOOTSTRAPPING} < 500019 738_kbdcontrol= usr.sbin/kbdcontrol 739.endif 740 741bootstrap-tools: 742.for _tool in \ 743 ${_strfile} \ 744 ${_gperf} \ 745 ${_groff} \ 746 gnu/usr.bin/texinfo \ 747 usr.bin/colldef \ 748 ${_lex} \ 749 usr.bin/makewhatis \ 750 usr.bin/rpcgen \ 751 ${_uudecode} \ 752 ${_xargs} \ 753 usr.bin/xinstall \ 754 ${_yacc} \ 755 usr.sbin/config \ 756 ${_crunchgen} \ 757 ${_gensnmptree} \ 758 ${_kbdcontrol} 759 ${_+_}@${ECHODIR} "===> ${_tool}"; \ 760 cd ${.CURDIR}/${_tool}; \ 761 ${MAKE} DIRPRFX=${_tool}/ obj; \ 762 ${MAKE} DIRPRFX=${_tool}/ depend; \ 763 ${MAKE} DIRPRFX=${_tool}/ all; \ 764 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install 765.endfor 766 767# 768# build-tools: Build special purpose build tools 769# 770.if defined(MODULES_WITH_WORLD) && exists(${KERNSRCDIR}/modules) 771_aicasm= sys/modules/aic7xxx/aicasm 772.endif 773 774.if !defined(NOSHARE) 775_share= share/syscons/scrnmaps 776.endif 777 778.if !defined(NO_KERBEROS) && !defined(NOCRYPT) && !defined(NO_OPENSSL) 779_kerberos5_tools= kerberos5/tools 780.endif 781 782.if !defined(NO_RESCUE) 783_rescue= rescue/rescue 784.endif 785 786build-tools: 787.for _tool in \ 788 bin/csh \ 789 bin/sh \ 790 ${_rescue} \ 791 gnu/usr.bin/cc/cc_tools \ 792 lib/libncurses \ 793 ${_share} \ 794 ${_aicasm} \ 795 usr.bin/awk \ 796 lib/libmagic \ 797 usr.sbin/sysinstall 798 ${_+_}@${ECHODIR} "===> ${_tool}"; \ 799 cd ${.CURDIR}/${_tool}; \ 800 ${MAKE} DIRPRFX=${_tool}/ obj; \ 801 ${MAKE} DIRPRFX=${_tool}/ build-tools 802.endfor 803.for _tool in \ 804 ${_kerberos5_tools} 805 ${_+_}@${ECHODIR} "===> ${_tool}"; \ 806 cd ${.CURDIR}/${_tool}; \ 807 ${MAKE} DIRPRFX=${_tool}/ obj; \ 808 ${MAKE} DIRPRFX=${_tool}/ depend; \ 809 ${MAKE} DIRPRFX=${_tool}/ all 810.endfor 811 812# 813# cross-tools: Build cross-building tools 814# 815.if ${TARGET_ARCH} == "sparc64" && ${TARGET_ARCH} != ${MACHINE_ARCH} && \ 816 ${BOOTSTRAPPING} < 500037 817_elf2aout= usr.bin/elf2aout 818.endif 819 820.if ${TARGET_ARCH} == "i386" && ${TARGET_ARCH} != ${MACHINE_ARCH} 821_btxld= usr.sbin/btxld 822.endif 823 824.if (!defined(NO_RESCUE) || \ 825 defined(RELEASEDIR)) && \ 826 (${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 501101) 827_crunchide= usr.sbin/crunch/crunchide 828.endif 829 830.if ${TARGET_ARCH} == "alpha" && ${TARGET_ARCH} != ${MACHINE_ARCH} 831_elf2exe= usr.sbin/elf2exe 832.endif 833 834.if ${TARGET_ARCH} == "i386" && ${TARGET_ARCH} != ${MACHINE_ARCH} && \ 835 defined(RELEASEDIR) 836_kgzip= usr.sbin/kgzip 837.endif 838 839cross-tools: 840.for _tool in \ 841 gnu/usr.bin/binutils \ 842 gnu/usr.bin/cc \ 843 ${_elf2aout} \ 844 usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \ 845 ${_btxld} \ 846 ${_crunchide} \ 847 ${_elf2exe} \ 848 ${_kgzip} 849 ${_+_}@${ECHODIR} "===> ${_tool}"; \ 850 cd ${.CURDIR}/${_tool}; \ 851 ${MAKE} DIRPRFX=${_tool}/ obj; \ 852 ${MAKE} DIRPRFX=${_tool}/ depend; \ 853 ${MAKE} DIRPRFX=${_tool}/ all; \ 854 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install 855.endfor 856 857# 858# hierarchy - ensure that all the needed directories are present 859# 860hierarchy: 861 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs 862 863# 864# libraries - build all libraries, and install them under ${DESTDIR}. 865# 866# The list of libraries with dependents (${_prebuild_libs}) and their 867# interdependencies (__L) are built automatically by the 868# ${.CURDIR}/tools/make_libdeps.sh script. 869# 870libraries: 871 cd ${.CURDIR}; \ 872 ${MAKE} -f Makefile.inc1 _startup_libs; \ 873 ${MAKE} -f Makefile.inc1 _prebuild_libs; \ 874 ${MAKE} -f Makefile.inc1 _generic_libs; 875 876# These dependencies are not automatically generated: 877# 878# gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all 879# shared libraries for ELF. 880# 881_startup_libs= gnu/lib/csu gnu/lib/libgcc 882.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf) 883_startup_libs+= lib/csu/${MACHINE_ARCH}-elf 884.else 885_startup_libs+= lib/csu/${MACHINE_ARCH} 886.endif 887 888_prebuild_libs= 889 890_generic_libs= gnu/lib 891 892.if !defined(NO_KERBEROS) && !defined(NOCRYPT) && !defined(NO_OPENSSL) 893_prebuild_libs+= kerberos5/lib/libasn1 894_prebuild_libs+= kerberos5/lib/libgssapi 895_prebuild_libs+= kerberos5/lib/libkrb5 896_prebuild_libs+= kerberos5/lib/libroken 897_generic_libs+= kerberos5/lib 898.endif 899 900_prebuild_libs+= lib/libcom_err lib/libcrypt lib/libexpat \ 901 lib/libkvm lib/libmd \ 902 lib/libncurses lib/libnetgraph lib/libopie lib/libpam \ 903 lib/libradius \ 904 lib/libsbuf lib/libtacplus lib/libutil lib/libypclnt \ 905 lib/libz lib/msun 906 907lib/libopie__L lib/libtacplus__L: lib/libmd__L 908 909_generic_libs+= lib 910 911.if !defined(NOCRYPT) 912.if !defined(NO_OPENSSL) 913_prebuild_libs+= secure/lib/libcrypto secure/lib/libssl 914lib/libradius__L: secure/lib/libssl__L 915secure/lib/libssl__L: secure/lib/libcrypto__L 916.if !defined(NO_OPENSSH) 917_prebuild_libs+= secure/lib/libssh 918secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L 919.if !defined(NO_KERBEROS) 920secure/lib/libssh__L: kerberos5/lib/libgssapi__L kerberos5/lib/libkrb5__L \ 921 kerberos5/lib/libasn1__L lib/libcom_err__L lib/libmd__L \ 922 kerberos5/lib/libroken__L 923.endif 924.endif 925.endif 926_generic_libs+= secure/lib 927.endif 928 929.if defined(NOCRYPT) || defined(NO_OPENSSL) 930lib/libradius__L: lib/libmd__L 931.endif 932 933_generic_libs+= usr.bin/lex/lib 934 935.if ${MACHINE_ARCH} == "i386" 936_generic_libs+= usr.sbin/pcvt/keycap 937.endif 938 939.for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs} 940${_lib}__L: .PHONY 941.if exists(${.CURDIR}/${_lib}) 942 ${_+_}@${ECHODIR} "===> ${_lib}"; \ 943 cd ${.CURDIR}/${_lib}; \ 944 ${MAKE} DIRPRFX=${_lib}/ depend; \ 945 ${MAKE} DIRPRFX=${_lib}/ all; \ 946 ${MAKE} DIRPRFX=${_lib}/ install 947.endif 948.endfor 949 950# libpam is special: we need to build static PAM modules before 951# static PAM library, and dynamic PAM library before dynamic PAM 952# modules. 953lib/libpam__L: .PHONY 954 ${_+_}@${ECHODIR} "===> lib/libpam"; \ 955 cd ${.CURDIR}/lib/libpam; \ 956 ${MAKE} DIRPRFX=lib/libpam/ depend; \ 957 ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \ 958 ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install 959 960_startup_libs: ${_startup_libs:S/$/__L/} 961_prebuild_libs: ${_prebuild_libs:S/$/__L/} 962_generic_libs: ${_generic_libs:S/$/__L/} 963 964.for __target in all clean cleandepend cleandir depend includes obj 965.for entry in ${SUBDIR} 966${entry}.${__target}__D: .PHONY 967 ${_+_}@if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \ 968 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \ 969 edir=${entry}.${MACHINE_ARCH}; \ 970 cd ${.CURDIR}/$${edir}; \ 971 else \ 972 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \ 973 edir=${entry}; \ 974 cd ${.CURDIR}/$${edir}; \ 975 fi; \ 976 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/ 977.endfor 978par-${__target}: ${SUBDIR:S/$/.${__target}__D/} 979.endfor 980 981.include <bsd.subdir.mk> 982