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