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