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