Makefile.inc1 revision 45172
1# 2# $Id: Makefile.inc1,v 1.66 1999/03/31 06:38:13 obrien Exp $ 3# 4# Make command line options: 5# -DCLOBBER will remove /usr/include 6# -DMAKE_KERBEROS4 to build KerberosIV 7# -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir 8# -DNOCLEAN do not clean at all 9# -DNOTOOLS do not rebuild any tools first 10# -DNOCRYPT will prevent building of crypt versions 11# -DNOPROFILE do not build profiled libraries 12# -DNOSECURE do not go into secure subdir 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# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list 18 19# 20# The intended user-driven targets are: 21# buildworld - rebuild *everything*, including glue to help do upgrades 22# installworld- install everything built by "buildworld" 23# update - convenient way to update your source tree (eg: sup/cvs) 24# most - build user commands, no libraries or include files 25# installmost - install user commands, no libraries or include files 26# 27# Standard targets (not defined here) are documented in the makefiles in 28# /usr/share/mk. These include: 29# obj depend all install clean cleandepend cleanobj 30 31# Put initial settings here. 32SUBDIR= 33 34# We must do share/info early so that installation of info `dir' 35# entries works correctly. Do it first since it is less likely to 36# grow dependencies on include and lib than vice versa. 37.if exists(share/info) 38SUBDIR+= share/info 39.endif 40 41# We must do include and lib early so that the perl *.ph generation 42# works correctly as it uses the header files installed by this. 43.if exists(include) 44SUBDIR+= include 45.endif 46.if exists(lib) 47SUBDIR+= lib 48.endif 49 50.if exists(bin) 51SUBDIR+= bin 52.endif 53.if exists(games) && !defined(NOGAMES) 54SUBDIR+= games 55.endif 56.if exists(gnu) 57SUBDIR+= gnu 58.endif 59.if exists(kerberosIV) && exists(crypto) && !defined(NOCRYPT) && \ 60 defined(MAKE_KERBEROS4) 61SUBDIR+= kerberosIV 62.endif 63.if exists(libexec) 64SUBDIR+= libexec 65.endif 66.if exists(sbin) 67SUBDIR+= sbin 68.endif 69.if exists(share) && !defined(NOSHARE) 70SUBDIR+= share 71.endif 72.if exists(sys) 73SUBDIR+= sys 74.endif 75.if exists(usr.bin) 76SUBDIR+= usr.bin 77.endif 78.if exists(usr.sbin) 79SUBDIR+= usr.sbin 80.endif 81.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE) 82SUBDIR+= secure 83.endif 84 85# etc must be last for "distribute" to work 86.if exists(etc) 87SUBDIR+= etc 88.endif 89 90# These are last, since it is nice to at least get the base system 91# rebuilt before you do them. 92.if defined(LOCAL_DIRS) 93.for _DIR in ${LOCAL_DIRS} 94.if exists(${_DIR}) & exists(${_DIR}/Makefile) 95SUBDIR+= ${_DIR} 96.endif 97.endfor 98.endif 99 100OBJDIR= obj 101 102.if defined(NOCLEAN) 103CLEANDIR= 104.else 105.if defined(NOCLEANDIR) 106CLEANDIR= clean cleandepend 107.else 108CLEANDIR= cleandir 109.endif 110.endif 111 112.if !defined(NOCLEAN) 113_NODEPEND= true 114.endif 115.if defined(_NODEPEND) 116_DEPEND= cleandepend 117.else 118_DEPEND= depend 119.endif 120 121SUP?= cvsup 122SUPFLAGS?= -g -L 2 -P - 123 124# 125# While building tools for bootstrapping, we don't need to waste time on 126# shared or profiled libraries, shared linkage, or documentation, except 127# when the tools won't get cleaned we must use the defaults for shared 128# libraries and shared linkage (and this doesn't waste time). 129# XXX actually, we do need to waste time building shared libraries. 130# 131.if defined(NOCLEAN) 132MK_FLAGS= -DWORLD -DNOINFO -DNOMAN -DNOPROFILE 133.else 134MK_FLAGS= -DWORLD -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED 135.endif 136 137# 138# Define the location of the temporary installation directory. Note that 139# MAKEOBJDIRPREFIX normally isn't defined so if the current directory is 140# /usr/src, then the world temporary directory is /usr/obj/usr/src/tmp. 141# 142# During the transition from aout to elf format on i386, MAKEOBJDIRPREFIX 143# is set by the parent makefile (Makefile.inc0) to be /usr/obj/${OBJFORMAT} 144# in order to keep aout and elf format files apart. 145# 146.if defined(MAKEOBJDIRPREFIX) 147WORLDTMP= ${MAKEOBJDIRPREFIX}${.CURDIR}/tmp 148.else 149WORLDTMP= /usr/obj${.CURDIR}/tmp 150.endif 151 152# 153# Define the PATH to the build tools. 154# 155# If not building tools, the PATH always points to the installed binaries. 156# The NOTOOLS option assumes that in installed tools are good enough and that 157# the user's PATH will locate to appropriate tools. This option is required 158# for a cross-compiled build environment. 159# 160# If building tools, then the PATH includes the world temporary directories 161# so that the bootstrapped tools are used as soon as they are built. The 162# strict path is for use after all tools are supposed to have been 163# bootstrapped. It doesn't allow any of the installed tools to be used. 164# 165.if defined(NOTOOLS) 166# Default root of the tool tree 167TOOLROOT?= 168# Choose the PATH relative to the root of the tool tree 169PATH= ${TOOLROOT}/sbin:${TOOLROOT}/bin:${TOOLROOT}/usr/sbin:${TOOLROOT}/usr/bin 170.else 171TOOLROOT= ${WORLDTMP} 172.endif 173STRICTTMPPATH= ${TOOLROOT}/sbin:${TOOLROOT}/usr/sbin:${TOOLROOT}/bin:${TOOLROOT}/usr/bin 174TMPPATH= ${STRICTTMPPATH}:${PATH} 175 176# XXX COMPILER_PATH is needed for finding cc1, ld and as 177# XXX GCC_EXEC_PREFIX is for *crt.o. It is probably unnecessary now 178# that LIBRARY_PATH is set. We still can't use -nostdlib, since gcc 179# wouldn't link *crt.o or libgcc if it were used. 180# XXX LD_LIBRARY_PATH is for ld.so. It is also used by ld, although we don't 181# want that - all compile-time library paths should be resolved by gcc. 182# It fails for set[ug]id executables (are any used?). 183COMPILER_ENV= BISON_SIMPLE=${TOOLROOT}/usr/share/misc/bison.simple \ 184 COMPILER_PATH=${TOOLROOT}/usr/libexec:${TOOLROOT}/usr/bin \ 185 GCC_EXEC_PREFIX=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib/ \ 186 LD_LIBRARY_PATH=${TOOLROOT}${SHLIBDIR} \ 187 LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib 188 189BMAKEENV= PATH=${TMPPATH} ${COMPILER_ENV} NOEXTRADEPEND=t \ 190 OBJFORMAT_PATH=${TOOLROOT}/usr/libexec:/usr/libexec 191XMAKEENV= PATH=${STRICTTMPPATH} ${COMPILER_ENV} \ 192 PERL5LIB=${DESTDIR}/usr/libdata/perl/5.00502 \ 193 OBJFORMAT_PATH=${TOOLROOT}/usr/libexec \ 194 CFLAGS="-nostdinc ${CFLAGS}" # XXX -nostdlib 195 196# used to compile and install 'make' in temporary build tree 197MAKETMP= ${WORLDTMP}/make 198IBMAKE= ${BMAKEENV} MAKEOBJDIR=${MAKETMP} ${MAKE} DESTDIR=${WORLDTMP} 199 200.if defined(NOTOOLS) 201# bootstrap make 202BMAKE= ${BMAKEENV} ${MAKE} DESTDIR=${WORLDTMP} 203# cross make used for compilation 204XMAKE= ${XMAKEENV} ${MAKE} DESTDIR=${WORLDTMP} 205# cross make used for final installation 206IXMAKE= ${XMAKEENV} ${MAKE} 207.else 208# bootstrap make 209BMAKE= ${BMAKEENV} ${WORLDTMP}/usr/bin/make DESTDIR=${WORLDTMP} 210# cross make used for compilation 211XMAKE= ${XMAKEENV} ${WORLDTMP}/usr/bin/make DESTDIR=${WORLDTMP} 212# cross make used for final installation 213IXMAKE= ${XMAKEENV} ${WORLDTMP}/usr/bin/make 214.endif 215 216# 217# buildworld 218# 219# Attempt to rebuild the entire system, with reasonable chance of 220# success, regardless of how old your existing system is. 221# 222buildworld: check-objformat 223.if !defined(NOCLEAN) 224 @echo 225 @echo "--------------------------------------------------------------" 226 @echo ">>> Cleaning up the temporary ${OBJFORMAT} build tree" 227 @echo "--------------------------------------------------------------" 228 mkdir -p ${WORLDTMP} 229 -chflags -R noschg ${WORLDTMP}/ 230 rm -rf ${WORLDTMP} 231.endif 232.if !defined(NOTOOLS) 233 @echo 234 @echo "--------------------------------------------------------------" 235 @echo ">>> Making make" 236 @echo "--------------------------------------------------------------" 237 mkdir -p ${WORLDTMP}/usr/bin ${MAKETMP} 238 ( \ 239 cd ${.CURDIR}/usr.bin/make; \ 240 MAKEOBJDIRPREFIX=""; unset MAKEOBJDIRPREFIX; \ 241 ${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} all; \ 242 ${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} install; \ 243 ${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} clean \ 244 ) 245 @echo 246 @echo "--------------------------------------------------------------" 247 @echo ">>> Making mtree" 248 @echo "--------------------------------------------------------------" 249 mkdir -p ${WORLDTMP}/usr/sbin ${WORLDTMP}/mtree 250 ( \ 251 cd ${.CURDIR}/usr.sbin/mtree; \ 252 MAKEOBJDIRPREFIX=""; unset MAKEOBJDIRPREFIX; \ 253 export MAKEOBJDIR=${WORLDTMP}/mtree; \ 254 ${BMAKE} ${MK_FLAGS} all; \ 255 ${BMAKE} ${MK_FLAGS} -B install clean \ 256 ) 257.endif 258 @echo 259 @echo "--------------------------------------------------------------" 260 @echo ">>> Making hierarchy" 261 @echo "--------------------------------------------------------------" 262 mkdir -p ${WORLDTMP} 263 cd ${.CURDIR}; ${BMAKE} -f Makefile.inc1 hierarchy 264.if !defined(NOCLEAN) 265 @echo 266 @echo "--------------------------------------------------------------" 267 @echo ">>> Cleaning up the ${OBJFORMAT} obj tree" 268 @echo "--------------------------------------------------------------" 269 cd ${.CURDIR}; ${BMAKE} -f Makefile.inc1 ${CLEANDIR:S/^/par-/} 270.endif 271 @echo 272 @echo "--------------------------------------------------------------" 273 @echo ">>> Rebuilding the ${OBJFORMAT} obj tree" 274 @echo "--------------------------------------------------------------" 275 cd ${.CURDIR}; ${BMAKE} -f Makefile.inc1 par-${OBJDIR} 276.if !defined(NOTOOLS) 277 @echo 278 @echo "--------------------------------------------------------------" 279 @echo ">>> Rebuilding ${OBJFORMAT} bootstrap tools" 280 @echo "--------------------------------------------------------------" 281 cd ${.CURDIR}; ${BMAKE} -f Makefile.inc1 bootstrap 282 @echo 283 @echo "--------------------------------------------------------------" 284 @echo ">>> Rebuilding tools necessary to build the include files" 285 @echo "--------------------------------------------------------------" 286 cd ${.CURDIR}; ${BMAKE} -f Makefile.inc1 include-tools 287.endif 288 @echo 289 @echo "--------------------------------------------------------------" 290 @echo ">>> Rebuilding ${DESTDIR}/usr/include" 291 @echo "--------------------------------------------------------------" 292 cd ${.CURDIR}; SHARED=copies ${BMAKE} -f Makefile.inc1 includes 293 @echo 294 @echo "--------------------------------------------------------------" 295 @echo ">>> Rebuilding bootstrap libraries" 296 @echo "--------------------------------------------------------------" 297 cd ${.CURDIR}; ${BMAKE} -f Makefile.inc1 bootstrap-libraries 298.if !defined(NOTOOLS) 299 @echo 300 @echo "--------------------------------------------------------------" 301 @echo ">>> Rebuilding tools needed to build libraries" 302 @echo "--------------------------------------------------------------" 303 cd ${.CURDIR}; ${BMAKE} -f Makefile.inc1 lib-tools 304.endif 305.if !defined(NOTOOLS) 306 @echo 307 @echo "--------------------------------------------------------------" 308 @echo ">>> Rebuilding all other tools needed to build the ${OBJFORMAT} world" 309 @echo "--------------------------------------------------------------" 310 cd ${.CURDIR}; ${BMAKE} -f Makefile.inc1 build-tools 311.endif 312.if !defined(_NODEPEND) 313 @echo 314 @echo "--------------------------------------------------------------" 315 @echo ">>> Rebuilding dependencies" 316 @echo "--------------------------------------------------------------" 317 cd ${.CURDIR}; ${XMAKE} -f Makefile.inc1 par-depend 318.endif 319 @echo 320 @echo "--------------------------------------------------------------" 321 @echo ">>> Building ${OBJFORMAT} libraries" 322 @echo "--------------------------------------------------------------" 323 cd ${.CURDIR}; ${XMAKE} -DNOINFO -DNOMAN -f Makefile.inc1 libraries 324 @echo 325 @echo "--------------------------------------------------------------" 326 @echo ">>> Building everything.." 327 @echo "--------------------------------------------------------------" 328 cd ${.CURDIR}; ${XMAKE} -f Makefile.inc1 all 329 330everything: 331 @echo "--------------------------------------------------------------" 332 @echo ">>> Building everything.." 333 @echo "--------------------------------------------------------------" 334 cd ${.CURDIR}; ${XMAKE} -f Makefile.inc1 all 335 336# 337# installworld 338# 339# Installs everything compiled by a 'buildworld'. 340# 341installworld: 342 cd ${.CURDIR}; ${IXMAKE} -f Makefile.inc1 reinstall 343 344# 345# reinstall 346# 347# If you have a build server, you can NFS mount the source and obj directories 348# and do a 'make reinstall' on the *client* to install new binaries from the 349# most recent server build. 350# 351reinstall: 352 @echo "--------------------------------------------------------------" 353 @echo ">>> Making hierarchy" 354 @echo "--------------------------------------------------------------" 355 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy 356 @echo 357 @echo "--------------------------------------------------------------" 358 @echo ">>> Installing everything.." 359 @echo "--------------------------------------------------------------" 360 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install 361.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "aout" && !defined(DESTDIR) 362 @echo 363 @echo "--------------------------------------------------------------" 364 @echo ">>> Re-scanning the shared libraries.." 365 @echo "--------------------------------------------------------------" 366 -cd ${.CURDIR}; /sbin/ldconfig -R 367.endif 368 @echo 369 @echo "--------------------------------------------------------------" 370 @echo ">>> Rebuilding man page indexes" 371 @echo "--------------------------------------------------------------" 372 cd ${.CURDIR}/share/man; ${MAKE} makedb 373 374# 375# update 376# 377# Update the source tree, by running sup and/or running cvs to update to the 378# latest copy. 379# 380update: 381.if defined(SUP_UPDATE) 382 @echo "--------------------------------------------------------------" 383 @echo ">>> Running ${SUP}" 384 @echo "--------------------------------------------------------------" 385 @${SUP} ${SUPFLAGS} ${SUPFILE} 386.if defined(SUPFILE1) 387 @${SUP} ${SUPFLAGS} ${SUPFILE1} 388.endif 389.if defined(SUPFILE2) 390 @${SUP} ${SUPFLAGS} ${SUPFILE2} 391.endif 392.endif 393.if defined(CVS_UPDATE) 394 @echo "--------------------------------------------------------------" 395 @echo ">>> Updating /usr/src from cvs repository" ${CVSROOT} 396 @echo "--------------------------------------------------------------" 397 cd ${.CURDIR}; cvs -q update -P -d 398.endif 399 400# 401# most 402# 403# Build most of the user binaries on the existing system libs and includes. 404# 405most: 406 @echo "--------------------------------------------------------------" 407 @echo ">>> Building programs only" 408 @echo "--------------------------------------------------------------" 409 cd ${.CURDIR}/bin; ${MAKE} all 410 cd ${.CURDIR}/sbin; ${MAKE} all 411 cd ${.CURDIR}/libexec; ${MAKE} all 412 cd ${.CURDIR}/usr.bin; ${MAKE} all 413 cd ${.CURDIR}/usr.sbin; ${MAKE} all 414 cd ${.CURDIR}/gnu/libexec; ${MAKE} all 415 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} all 416 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} all 417#.if defined(MAKE_KERBEROS4) && !defined(NOCRYPT) 418# cd ${.CURDIR}/kerberosIV; ${MAKE} most 419#.endif 420#.if !defined(NOSECURE) && !defined(NOCRYPT) 421# cd ${.CURDIR}/secure; ${MAKE} most 422#.endif 423 424# 425# installmost 426# 427# Install the binaries built by the 'most' target. This does not include 428# libraries or include files. 429# 430installmost: 431 @echo "--------------------------------------------------------------" 432 @echo ">>> Installing programs only" 433 @echo "--------------------------------------------------------------" 434 cd ${.CURDIR}/bin; ${MAKE} install 435 cd ${.CURDIR}/sbin; ${MAKE} install 436 cd ${.CURDIR}/libexec; ${MAKE} install 437 cd ${.CURDIR}/usr.bin; ${MAKE} install 438 cd ${.CURDIR}/usr.sbin; ${MAKE} install 439 cd ${.CURDIR}/gnu/libexec; ${MAKE} install 440 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} install 441 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} install 442#.if defined(MAKE_KERBEROS4) && !defined(NOCRYPT) 443# cd ${.CURDIR}/kerberosIV; ${MAKE} installmost 444#.endif 445#.if !defined(NOSECURE) && !defined(NOCRYPT) 446# cd ${.CURDIR}/secure; ${MAKE} installmost 447#.endif 448 449# 450# ------------------------------------------------------------------------ 451# 452# From here onwards are utility targets used by the 'make world' and 453# related targets. If your 'world' breaks, you may like to try to fix 454# the problem and manually run the following targets to attempt to 455# complete the build. Beware, this is *not* guaranteed to work, you 456# need to have a pretty good grip on the current state of the system 457# to attempt to manually finish it. If in doubt, 'make world' again. 458# 459 460# 461# hierarchy - ensure that all the needed directories are present 462# 463hierarchy: 464 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs 465 466# 467# bootstrap - [re]build tools needed to run the actual build, this includes 468# tools needed by 'make depend', as some tools are needed to generate source 469# for the dependency information to be gathered from. 470# 471bootstrap: 472 cd ${.CURDIR}/usr.bin/make; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \ 473 ${MAKE} ${MK_FLAGS} all; \ 474 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR} 475 cd ${.CURDIR}/usr.bin/xinstall; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \ 476 ${MAKE} ${MK_FLAGS} all; \ 477 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR} 478 cd ${.CURDIR}/usr.bin/yacc; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \ 479 ${MAKE} ${MK_FLAGS} all; \ 480 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR} 481 cd ${.CURDIR}/usr.bin/lex; ${MAKE} bootstrap; \ 482 ${MAKE} ${MK_FLAGS} ${_DEPEND}; \ 483 ${MAKE} ${MK_FLAGS} -DNOLIB all; \ 484 ${MAKE} ${MK_FLAGS} -DNOLIB -B install ${CLEANDIR} 485 cd ${.CURDIR}/usr.bin/lex; ${MAKE} ${OBJDIR} 486 cd ${.CURDIR}/usr.sbin/mtree; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \ 487 ${MAKE} ${MK_FLAGS} all; \ 488 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR} 489 490# 491# include-tools - generally the same as 'bootstrap', except that it's for 492# things that are specifically needed to generate include files. 493# 494# XXX should be merged with bootstrap, it's not worth keeeping them separate. 495# Well, maybe it is now. We force 'cleandepend' here to avoid dependencies 496# on cleaned away headers in ${WORLDTMP}. 497# 498include-tools: 499.for d in usr.bin/compile_et usr.bin/rpcgen 500 cd ${.CURDIR}/$d; ${MAKE} cleandepend; \ 501 ${MAKE} ${MK_FLAGS} ${_DEPEND}; \ 502 ${MAKE} ${MK_FLAGS} all; \ 503 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR} 504.endfor 505 506# 507# includes - possibly generate and install the include files. 508# 509includes: 510.if defined(CLOBBER) 511 rm -rf ${DESTDIR}/usr/include/* 512 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ 513 -p ${DESTDIR}/usr/include 514.endif 515 cd ${.CURDIR}/include; ${MAKE} -B all install 516 cd ${.CURDIR}/gnu/include; ${MAKE} install 517 cd ${.CURDIR}/gnu/lib/libmp; ${MAKE} beforeinstall 518 cd ${.CURDIR}/gnu/lib/libobjc; ${MAKE} beforeinstall 519 cd ${.CURDIR}/gnu/lib/libreadline; ${MAKE} beforeinstall 520 cd ${.CURDIR}/gnu/lib/libregex; ${MAKE} beforeinstall 521 cd ${.CURDIR}/gnu/lib/libstdc++; ${MAKE} beforeinstall 522 cd ${.CURDIR}/gnu/lib/libg++; ${MAKE} beforeinstall 523 cd ${.CURDIR}/gnu/lib/libdialog; ${MAKE} beforeinstall 524 cd ${.CURDIR}/gnu/lib/libgmp; ${MAKE} beforeinstall 525.if exists(secure) && !defined(NOCRYPT) 526 cd ${.CURDIR}/secure/lib/libdes; ${MAKE} beforeinstall 527.endif 528.if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS4) 529 cd ${.CURDIR}/kerberosIV/lib/libacl; ${MAKE} beforeinstall 530 cd ${.CURDIR}/kerberosIV/lib/libkadm; ${MAKE} beforeinstall 531 cd ${.CURDIR}/kerberosIV/lib/libkafs; ${MAKE} beforeinstall 532 cd ${.CURDIR}/kerberosIV/lib/libkdb; ${MAKE} beforeinstall 533 cd ${.CURDIR}/kerberosIV/lib/libkrb; ${MAKE} beforeinstall 534 cd ${.CURDIR}/kerberosIV/lib/libtelnet; ${MAKE} beforeinstall 535.else 536 cd ${.CURDIR}/lib/libtelnet; ${MAKE} beforeinstall 537.endif 538.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}) 539 cd ${.CURDIR}/lib/csu/${MACHINE_ARCH}; ${MAKE} beforeinstall 540.endif 541 cd ${.CURDIR}/lib/libalias; ${MAKE} beforeinstall 542 cd ${.CURDIR}/lib/libatm; ${MAKE} beforeinstall 543 cd ${.CURDIR}/lib/libdevstat; ${MAKE} beforeinstall 544 cd ${.CURDIR}/lib/libc; ${MAKE} beforeinstall 545 cd ${.CURDIR}/lib/libcalendar; ${MAKE} beforeinstall 546 cd ${.CURDIR}/lib/libcam; ${MAKE} beforeinstall 547 cd ${.CURDIR}/lib/libcurses; ${MAKE} beforeinstall 548 cd ${.CURDIR}/lib/libdisk; ${MAKE} beforeinstall 549 cd ${.CURDIR}/lib/libedit; ${MAKE} beforeinstall 550 cd ${.CURDIR}/lib/libftpio; ${MAKE} beforeinstall 551 cd ${.CURDIR}/lib/libmd; ${MAKE} beforeinstall 552 cd ${.CURDIR}/lib/libmytinfo; ${MAKE} beforeinstall 553 cd ${.CURDIR}/lib/libncurses; ${MAKE} beforeinstall 554.if !defined(WANT_CSRG_LIBM) 555 cd ${.CURDIR}/lib/msun; ${MAKE} beforeinstall 556.endif 557 cd ${.CURDIR}/lib/libopie; ${MAKE} beforeinstall 558 cd ${.CURDIR}/lib/libpam/libpam; ${MAKE} beforeinstall 559 cd ${.CURDIR}/lib/libpcap; ${MAKE} beforeinstall 560 cd ${.CURDIR}/lib/libradius; ${MAKE} beforeinstall 561 cd ${.CURDIR}/lib/librpcsvc; ${MAKE} beforeinstall 562 cd ${.CURDIR}/lib/libskey; ${MAKE} beforeinstall 563 cd ${.CURDIR}/lib/libstand; ${MAKE} beforeinstall 564 cd ${.CURDIR}/lib/libtacplus; ${MAKE} beforeinstall 565 cd ${.CURDIR}/lib/libtermcap; ${MAKE} beforeinstall 566 cd ${.CURDIR}/lib/libcom_err; ${MAKE} beforeinstall 567 cd ${.CURDIR}/lib/libss; ${MAKE} -B hdrs beforeinstall 568 cd ${.CURDIR}/lib/libutil; ${MAKE} beforeinstall 569 cd ${.CURDIR}/lib/libvgl; ${MAKE} beforeinstall 570 cd ${.CURDIR}/lib/libz; ${MAKE} beforeinstall 571 cd ${.CURDIR}/usr.bin/f2c; ${MAKE} beforeinstall 572 cd ${.CURDIR}/usr.bin/lex; ${MAKE} beforeinstall 573 574# 575# Declare tools if they are not required on all architectures. 576# 577.if ${MACHINE_ARCH} == "i386" 578# aout tools: 579_aout_ar = usr.bin/ar 580_aout_as = gnu/usr.bin/as 581_aout_ld = gnu/usr.bin/ld 582_aout_nm = usr.bin/nm 583_aout_ranlib = usr.bin/ranlib 584_aout_size = usr.bin/size 585_aout_strip = usr.bin/strip 586# boot block/loader tools: 587_btxld = usr.sbin/btxld 588.endif 589 590# 591# lib-tools - build tools to compile and install the libraries. 592# 593# XXX gperf is required for cc 594# XXX a new ld and tsort is required for cc 595lib-tools: 596.for d in \ 597 gnu/usr.bin/gperf \ 598 ${_aout_ld} \ 599 usr.bin/tsort \ 600 ${_aout_as} \ 601 gnu/usr.bin/bison \ 602 gnu/usr.bin/cc 603 cd ${.CURDIR}/$d; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \ 604 ${MAKE} ${MK_FLAGS} all; \ 605 ${MAKE} ${MK_FLAGS} -B install; \ 606 ${MAKE} ${MK_FLAGS:S/-DNOPIC//} -B ${CLEANDIR} ${OBJDIR} 607.endfor 608 cd ${.CURDIR}/gnu/lib/libgcc; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \ 609 ${MAKE} ${MK_FLAGS} all; \ 610 ${MAKE} ${MK_FLAGS} -B install; \ 611 ${MAKE} ${MK_FLAGS:S/-DNOPIC//} -B ${CLEANDIR} ${OBJDIR} 612.for d in \ 613 ${_aout_ar} \ 614 usr.bin/env \ 615 usr.bin/lex/lib \ 616 usr.bin/mk_cmds \ 617 ${_aout_nm} \ 618 ${_aout_ranlib} \ 619 ${_aout_strip} \ 620 gnu/usr.bin/binutils \ 621 usr.bin/uudecode \ 622 usr.bin/objformat 623 cd ${.CURDIR}/$d; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \ 624 ${MAKE} ${MK_FLAGS} all; \ 625 ${MAKE} ${MK_FLAGS} -B install; \ 626 ${MAKE} ${MK_FLAGS:S/-DNOPIC//} -B ${CLEANDIR} ${OBJDIR} 627.endfor 628 629# 630# We have to know too much about ordering and subdirs in the lib trees: 631# 632# To satisfy shared library linkage when only the libraries being built 633# are visible: 634# 635# csu must be built before all shared libaries for ELF. 636# libcom_err must be built before libss. 637# libcrypt must be built before libskey and libkrb. 638# libdes must be built before libpam. 639# libkrb must be built before libpam. 640# libm must be built before libf2c, libg++ and libstdc++. 641# libmd must be built before libatm, libopie, libradius, libskey, 642# and libtacplus. 643# libmytinfo must be built before libdialog and libncurses. 644# libncurses must be built before libdialog. 645# libradius must be built before libpam. 646# libskey must be built before libpam. 647# libtacplus must be built before libpam. 648# libtermcap must be built before libcurses, libedit and libreadline. 649# 650# Some libraries are built conditionally and/or are in inconsistently 651# named directories: 652# 653.if exists(lib/csu/${MACHINE_ARCH}.pcc) 654_csu=lib/csu/${MACHINE_ARCH}.pcc 655.elif ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" 656_csu=lib/csu/i386-elf 657.else 658_csu=lib/csu/${MACHINE_ARCH} 659.endif 660 661.if !defined(NOSECURE) && !defined(NOCRYPT) 662_libcrypt= secure/lib/libcrypt lib/libcrypt 663_secure_lib= secure/lib 664.else 665_libcrypt= lib/libcrypt 666.endif 667 668.if !defined(NOCRYPT) && defined(MAKE_KERBEROS4) 669_kerberosIV_lib=kerberosIV/lib 670.endif 671 672.if defined(WANT_CSRG_LIBM) 673_libm= lib/libm 674.else 675_libm= lib/msun 676.endif 677 678.if !defined(NOPERL) 679_libperl= gnu/usr.bin/perl/libperl 680.endif 681 682# 683# bootstrap-libraries - build just enough libraries for the bootstrap 684# tools, and install them under ${WORLDTMP}. 685# 686# Build csu early so that some tools get linked to the new 687# version (too late for the main tools, however). Then build the 688# necessary prerequisite libraries (libtermcap just needs to be before 689# libcurses, and this only matters for the NOCLEAN case when NOPIC is 690# not set). 691# 692# This is mostly wrong. The build tools must run on the host system, 693# so they should use host libraries. We depend on the target being 694# similar enough to the host for new target libraries to work on the 695# host. 696# 697bootstrap-libraries: 698.for _lib in ${_csu} lib/libtermcap \ 699 gnu/lib/libregex gnu/lib/libreadline lib/libc \ 700 lib/libcrypt lib/libcurses lib/libedit ${_libm} \ 701 lib/libmd lib/libutil lib/libz usr.bin/lex/lib \ 702 ${_libperl} 703.if exists(${.CURDIR}/${_lib}) 704 cd ${.CURDIR}/${_lib}; \ 705 ${MAKE} ${MK_FLAGS} ${_DEPEND}; \ 706 ${MAKE} ${MK_FLAGS} all; \ 707 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR} 708.endif 709.endfor 710 711# 712# libraries - build all libraries, and install them under ${DESTDIR}. 713# 714# The ordering is not as special as for bootstrap-libraries. Build 715# the prerequisites first, then build almost everything else in 716# alphabetical order. 717# 718libraries: 719.for _lib in ${_csu} lib/libcom_err ${_libcrypt} ${_libm} lib/libmd \ 720 lib/libmytinfo lib/libncurses lib/libtermcap \ 721 lib/libradius lib/libskey lib/libtacplus \ 722 ${_secure_lib} ${_kerberosIV_lib} \ 723 gnu/lib gnu/usr.bin/cc/libgcc ${_libperl} lib usr.bin/lex/lib \ 724 usr.sbin/pcvt/keycap 725.if exists(${.CURDIR}/${_lib}) 726 cd ${.CURDIR}/${_lib}; ${MAKE} all; ${MAKE} -B install 727.endif 728.endfor 729 730# 731# Exclude unused tools from build-tools. 732# 733.if !defined(NOGAMES) && exists(${.CURDIR}/games) 734_adventure= games/adventure 735_caesar= games/caesar 736_hack= games/hack 737_phantasia= games/phantasia 738_strfile= games/fortune/strfile 739.endif 740.if !defined(NOPERL) 741_perl= gnu/usr.bin/perl/miniperl 742.endif 743.if !defined(NOSHARE) && exists(${.CURDIR}/share) 744_scrnmaps= share/syscons/scrnmaps 745.endif 746.if ${MACHINE_ARCH} == i386 747_kldlinux= sys/modules/linux 748.endif 749.if ${OBJFORMAT} == "aout" 750_netboot= sys/${MACHINE}/boot/netboot 751.endif 752 753BTMAKEFLAGS= ${MK_FLAGS} -D_BUILD_TOOLS 754 755# 756# build-tools - build and install any other tools needed to complete the 757# compile and install. 758# ifdef stale 759# bc and cpp are required to build groff. Otherwise, the order here is 760# mostly historical, i.e., bogus. 761# chmod is used to build gcc's tmpmultilib[2] at obscure times. 762# endif stale 763# XXX uname is a bug - the target should not depend on the host. 764# 765build-tools: 766.for d in \ 767 bin/cat \ 768 bin/chmod \ 769 bin/cp \ 770 bin/date \ 771 bin/dd \ 772 bin/echo \ 773 bin/expr \ 774 bin/hostname \ 775 bin/ln \ 776 bin/ls \ 777 bin/mkdir \ 778 bin/mv \ 779 bin/rm \ 780 bin/test \ 781 ${_caesar} \ 782 ${_strfile} \ 783 gnu/usr.bin/awk \ 784 gnu/usr.bin/bc \ 785 gnu/usr.bin/grep \ 786 gnu/usr.bin/groff \ 787 gnu/usr.bin/gzip \ 788 gnu/usr.bin/man/makewhatis \ 789 gnu/usr.bin/patch \ 790 ${_perl} \ 791 gnu/usr.bin/sort \ 792 gnu/usr.bin/texinfo \ 793 usr.bin/basename \ 794 usr.bin/cap_mkdb \ 795 usr.bin/chflags \ 796 usr.bin/cmp \ 797 usr.bin/col \ 798 usr.bin/colldef \ 799 usr.bin/cpp \ 800 usr.bin/expand \ 801 usr.bin/file2c \ 802 usr.bin/find \ 803 usr.bin/gencat \ 804 usr.bin/gensetdefs \ 805 usr.bin/id \ 806 usr.bin/join \ 807 usr.bin/lorder \ 808 usr.bin/m4 \ 809 usr.bin/mkdep \ 810 usr.bin/mklocale \ 811 usr.bin/paste \ 812 usr.bin/printf \ 813 usr.bin/sed \ 814 ${_aout_size} \ 815 usr.bin/soelim \ 816 usr.bin/symorder \ 817 usr.bin/touch \ 818 usr.bin/tr \ 819 usr.bin/true \ 820 usr.bin/uname \ 821 usr.bin/uuencode \ 822 usr.bin/vgrind \ 823 usr.bin/vi \ 824 usr.bin/wc \ 825 usr.bin/xargs \ 826 usr.bin/yacc \ 827 ${_btxld} \ 828 usr.sbin/chown \ 829 usr.sbin/mtree \ 830 usr.sbin/zic \ 831 bin/sh 832 cd ${.CURDIR}/$d; ${MAKE} ${BTMAKEFLAGS} ${_DEPEND}; \ 833 ${MAKE} ${BTMAKEFLAGS} all; \ 834 ${MAKE} ${BTMAKEFLAGS} -B install ${CLEANDIR} ${OBJDIR} 835.endfor 836.if !defined(NOGAMES) && exists(${.CURDIR}/games) 837 cd ${DESTDIR}/usr/games; cp -p caesar strfile ${DESTDIR}/usr/bin 838.endif 839.for d in \ 840 bin/sh \ 841 ${_adventure} \ 842 ${_hack} \ 843 ${_phantasia} \ 844 gnu/usr.bin/cc/cc_tools \ 845 lib/libmytinfo \ 846 ${_linux} \ 847 ${_kldlinux} \ 848 ${_scrnmaps} \ 849 ${_netboot} 850 cd ${.CURDIR}/$d; ${MAKE} ${BTMAKEFLAGS} build-tools 851.endfor 852 cd ${.CURDIR}/usr.bin/tn3270/tools; ${MAKE} ${BTMAKEFLAGS} all 853 854# 855# Build aout versions of things that provide legacy support when all the 856# rest of the world is elf. 857# 858legacy-build: 859.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "aout" 860 @echo 861 @echo "--------------------------------------------------------------" 862 @echo ">>> Making hierarchy" 863 @echo "--------------------------------------------------------------" 864 mkdir -p ${WORLDTMP} 865 cd ${.CURDIR}; ${XMAKE} -f Makefile.inc1 hierarchy 866 @echo 867 @echo "--------------------------------------------------------------" 868 @echo ">>> Rebuilding the ${OBJFORMAT} obj tree" 869 @echo "--------------------------------------------------------------" 870 cd ${.CURDIR}; ${XMAKE} -f Makefile.inc1 par-${OBJDIR} 871 @echo 872 @echo "--------------------------------------------------------------" 873 @echo ">>> Rebuilding ${DESTDIR}/usr/include" 874 @echo "--------------------------------------------------------------" 875 cd ${.CURDIR}; SHARED=copies ${XMAKE} -f Makefile.inc1 includes 876 @echo 877 @echo "--------------------------------------------------------------" 878 @echo ">>> Building legacy libraries" 879 @echo "--------------------------------------------------------------" 880 cd ${.CURDIR}; \ 881 ${XMAKE} -DNOINFO -DNOMAN -f Makefile.inc1 bootstrap-libraries 882 cd ${.CURDIR}; \ 883 ${XMAKE} -DNOINFO -DNOMAN -f Makefile.inc1 libraries 884 @echo 885 @echo "--------------------------------------------------------------" 886 @echo ">>> Building legacy rtld" 887 @echo "--------------------------------------------------------------" 888 cd ${.CURDIR}/libexec/rtld-aout; \ 889 ${XMAKE} -DNOMAN depend; ${XMAKE} -DNOMAN all; 890 @echo 891 @echo "--------------------------------------------------------------" 892 @echo ">>> Building legacy boot" 893 @echo "--------------------------------------------------------------" 894 cd ${.CURDIR}/sys/${MACHINE}/boot && \ 895 ${XMAKE} -DNOMAN -B obj depend; ${XMAKE} -DNOMAN all; 896.endif 897 898# 899# Install aout versions of things that provide legacy support when all the 900# rest of the world is elf. 901# 902legacy-install: 903.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "aout" 904 @echo 905 @echo "--------------------------------------------------------------" 906 @echo ">>> Installing legacy libraries" 907 @echo "--------------------------------------------------------------" 908 cd ${.CURDIR}/lib; ${MAKE} -B -DNOMAN -DNOINFO install 909 cd ${.CURDIR}/gnu/lib; ${MAKE} -B -DNOMAN -DNOINFO install 910 cd ${.CURDIR}/gnu/usr.bin/cc/libgcc; \ 911 ${MAKE} -B -DNOMAN -DNOINFO install 912 cd ${.CURDIR}/usr.bin/lex/lib; \ 913 ${MAKE} -B -DNOMAN -DNOINFO install 914 cd ${.CURDIR}/usr.sbin/pcvt/keycap; \ 915 ${MAKE} -B -DNOMAN -DNOINFO install 916.if exists(${.CURDIR}/secure/lib) && !defined(NOCRYPT) && !defined(NOSECURE) 917 cd ${.CURDIR}/secure/lib; ${MAKE} -B -DNOMAN -DNOINFO install 918.endif 919.if exists(${.CURDIR}/kerberosIV/lib) && !defined(NOCRYPT) && \ 920 defined(MAKE_KERBEROS4) 921 cd ${.CURDIR}/kerberosIV/lib; ${MAKE} -B -DNOMAN -DNOINFO install 922.endif 923 @echo 924 @echo "--------------------------------------------------------------" 925 @echo ">>> Installing legacy rtld" 926 @echo "--------------------------------------------------------------" 927 cd ${.CURDIR}/libexec/rtld-aout; ${MAKE} -DNOMAN install 928 @echo 929.if ${MACHINE_ARCH} == "i386" 930 @echo "--------------------------------------------------------------" 931 @echo ">>> Installing legacy boot" 932 @echo "--------------------------------------------------------------" 933 cd ${.CURDIR}/sys/${MACHINE}/boot && ${MAKE} -DNOMAN install 934.endif 935.endif 936 937 938# Get the object format that the tools see. 939# 940# 941.if exists(/usr/bin/objformat) 942__OBJFORMAT!= objformat 943.else 944__OBJFORMAT= ${OBJFORMAT} 945.endif 946 947# 948# Check if the local /etc/make.conf or /etc/make.conf.local have attempted 949# to override the OBJFORMAT without updating the environment for the tools 950# to see. 951# 952check-objformat : 953.if ${__OBJFORMAT} != ${OBJFORMAT} 954 @/bin/sh -c "echo \"It looks like you set OBJFORMAT=${OBJFORMAT} in /etc/make.conf. Don't do that!\" " 955 @/bin/sh -c "echo \"If you want to override the installed object format, you must set OBJFORMAT\" " 956 @/bin/sh -c "echo \"in your environment.\" " 957 @exit 1 958.endif 959.if !defined(REALLY_WANT_DEPRECIATED_AOUT) && ${OBJFORMAT} == "aout" 960 @echo "==== NOTICE: a.out buildworld is depreciated and disabled! =====" 961 @echo "Read: http://www.freebsd.org/~peter/elfday.html for information." 962 @echo "You need to complete a 'make aout-to-elf' to bring your system" 963 @echo "up to date with ELF tools. This requires a fair amount of disk" 964 @echo "space to complete. Alternatively, you can do a binary upgrade" 965 @echo "using the 3.0-RELEASE binaries from CD or ftp.freebsd.org in" 966 @echo "/pub/FreeBSD/3.0-RELEASE/bin/ to convert your userland to ELF." 967 @exit 1 968.endif 969 970 971.for __target in clean cleandepend cleandir depend obj 972.for entry in ${SUBDIR} 973${entry}.${__target}__D: .PHONY 974 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \ 975 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \ 976 edir=${entry}.${MACHINE_ARCH}; \ 977 cd ${.CURDIR}/$${edir}; \ 978 else \ 979 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \ 980 edir=${entry}; \ 981 cd ${.CURDIR}/$${edir}; \ 982 fi; \ 983 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/ 984.endfor 985par-${__target}: ${SUBDIR:S/$/.${__target}__D/} 986.endfor 987 988.include <bsd.subdir.mk> 989