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