1# 2# $Id: Makefile,v 1.162 1998/03/12 13:19:59 bde Exp $ 3# 4# While porting to the another architecture include the bootstrap instead 5# of the normal build. 6# 7.if exists(${.CURDIR}/Makefile.${MACHINE}) 8.include "${.CURDIR}/Makefile.${MACHINE}" 9.else 10# 11# Make command line options: 12# -DCLOBBER will remove /usr/include 13# -DMAKE_KERBEROS4 to build KerberosIV 14# -DALLLANG to build documentation for all languages 15# (where available -- see share/doc/Makefile) 16# 17# -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir 18# -DNOCLEAN do not clean at all 19# -DNOTOOLS do not rebuild any tools first 20# -DNOCRYPT will prevent building of crypt versions 21# -DNOLKM do not build loadable kernel modules 22# -DNOOBJDIR do not run ``${MAKE} obj'' 23# -DNOPROFILE do not build profiled libraries 24# -DNOSECURE do not go into secure subdir 25# -DNOGAMES do not go into games subdir 26# -DNOSHARE do not go into share subdir 27# -DNOINFO do not make or install info files 28# -DNOLIBC_R do not build libc_r. 29# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list 30 31# 32# The intended user-driven targets are: 33# buildworld - rebuild *everything*, including glue to help do upgrades 34# installworld- install everything built by "buildworld" 35# world - buildworld + installworld 36# update - convenient way to update your source tree (eg: sup/cvs) 37# most - build user commands, no libraries or include files 38# installmost - install user commands, no libraries or include files 39# 40# Standard targets (not defined here) are documented in the makefiles in 41# /usr/share/mk. These include: 42# obj depend all install clean cleandepend cleanobj 43 44.if (!make(world)) && (!make(buildworld)) && (!make(installworld)) 45.MAKEFLAGS:= -m ${.CURDIR}/share/mk ${.MAKEFLAGS} 46.endif 47 48# Put initial settings here. 49SUBDIR= 50 51# We must do share/info early so that installation of info `dir' 52# entries works correctly. Do it first since it is less likely to 53# grow dependencies on include and lib than vice versa. 54.if exists(share/info) 55SUBDIR+= share/info 56.endif 57 58# We must do include and lib early so that the perl *.ph generation 59# works correctly as it uses the header files installed by this. 60.if exists(include) 61SUBDIR+= include 62.endif 63.if exists(lib) 64SUBDIR+= lib 65.endif 66 67.if exists(bin) 68SUBDIR+= bin 69.endif 70.if exists(games) && !defined(NOGAMES) 71SUBDIR+= games 72.endif 73.if exists(gnu) 74SUBDIR+= gnu 75.endif 76.if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS4) 77SUBDIR+= kerberosIV 78.endif 79.if exists(libexec) 80SUBDIR+= libexec 81.endif 82.if exists(sbin) 83SUBDIR+= sbin 84.endif 85.if exists(share) && !defined(NOSHARE) 86SUBDIR+= share 87.endif 88.if exists(sys) 89SUBDIR+= sys 90.endif 91.if exists(usr.bin) 92SUBDIR+= usr.bin 93.endif 94.if exists(usr.sbin) 95SUBDIR+= usr.sbin 96.endif 97.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE) 98SUBDIR+= secure 99.endif 100.if exists(lkm) && !defined(NOLKM) 101SUBDIR+= lkm 102.endif 103 104# etc must be last for "distribute" to work 105.if exists(etc) && make(distribute) 106SUBDIR+= etc 107.endif 108 109# These are last, since it is nice to at least get the base system 110# rebuilt before you do them. 111.if defined(LOCAL_DIRS) 112.for _DIR in ${LOCAL_DIRS} 113.if exists(${_DIR}) & exists(${_DIR}/Makefile) 114SUBDIR+= ${_DIR} 115.endif 116.endfor 117.endif 118 119# Handle -DNOOBJDIR, -DNOCLEAN and -DNOCLEANDIR 120.if defined(NOOBJDIR) 121OBJDIR= 122.else 123OBJDIR= obj 124.endif 125 126.if defined(NOCLEAN) 127CLEANDIR= 128.else 129.if defined(NOCLEANDIR) 130CLEANDIR= clean 131.else 132CLEANDIR= cleandir 133.endif 134.endif 135 136SUP?= sup 137SUPFLAGS?= -v 138 139# 140# While building tools for bootstrapping, we don't need to waste time on 141# shared or profiled libraries, shared linkage, or documentation. 142# 143MK_FLAGS= -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED 144 145# 146# world 147# 148# Attempt to rebuild and reinstall *everything*, with reasonable chance of 149# success, regardless of how old your existing system is. 150# 151# >> Beware, it overwrites the local build environment! << 152# 153world: 154 @echo "--------------------------------------------------------------" 155 @echo "make world started on `LC_TIME=C date`" 156 @echo "--------------------------------------------------------------" 157.if target(pre-world) 158 @echo 159 @echo "--------------------------------------------------------------" 160 @echo " Making 'pre-world' target" 161 @echo "--------------------------------------------------------------" 162 cd ${.CURDIR} && ${MAKE} pre-world 163.endif 164 cd ${.CURDIR} && ${MAKE} buildworld 165 cd ${.CURDIR} && ${MAKE} -B installworld 166.if target(post-world) 167 @echo 168 @echo "--------------------------------------------------------------" 169 @echo " Making 'post-world' target" 170 @echo "--------------------------------------------------------------" 171 cd ${.CURDIR} && ${MAKE} post-world 172.endif 173 @echo 174 @echo "--------------------------------------------------------------" 175 @echo "make world completed on `LC_TIME=C date`" 176 @echo "--------------------------------------------------------------" 177 178.if defined(MAKEOBJDIRPREFIX) 179WORLDTMP= ${MAKEOBJDIRPREFIX}${.CURDIR}/tmp 180.else 181WORLDTMP= /usr/obj${.CURDIR}/tmp 182.endif 183STRICTTMPPATH= ${WORLDTMP}/sbin:${WORLDTMP}/usr/sbin:${WORLDTMP}/bin:${WORLDTMP}/usr/bin 184TMPPATH= ${STRICTTMPPATH}:${PATH} 185 186# XXX COMPILER_PATH is needed for finding cc1, ld and as 187# XXX GCC_EXEC_PREFIX is for *crt.o. It is probably unnecssary now 188# tbat LIBRARY_PATH is set. We still can't use -nostdlib, since gcc 189# wouldn't link *crt.o or libgcc if it were used. 190# XXX LD_LIBRARY_PATH is for ld.so. It is also used by ld, although we don't 191# want that - all compile-time library paths should be resolved by gcc. 192# It fails for set[ug]id executables (are any used?). 193COMPILER_ENV= BISON_SIMPLE=${WORLDTMP}/usr/share/misc/bison.simple \ 194 COMPILER_PATH=${WORLDTMP}/usr/libexec:${WORLDTMP}/usr/bin \ 195 GCC_EXEC_PREFIX=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib/ \ 196 LD_LIBRARY_PATH=${WORLDTMP}${SHLIBDIR} \ 197 LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib 198 199BMAKEENV= PATH=${TMPPATH} ${COMPILER_ENV} NOEXTRADEPEND=t 200XMAKEENV= PATH=${STRICTTMPPATH} ${COMPILER_ENV} \ 201 CC='cc -nostdinc' # XXX -nostdlib 202 203# used to compile and install 'make' in temporary build tree 204IBMAKE= ${BMAKEENV} ${MAKE} DESTDIR=${WORLDTMP} 205# bootstrap make 206BMAKE= ${BMAKEENV} ${WORLDTMP}/usr/bin/${MAKE} DESTDIR=${WORLDTMP} 207# cross make used for compilation 208XMAKE= ${XMAKEENV} ${WORLDTMP}/usr/bin/${MAKE} DESTDIR=${WORLDTMP} 209# cross make used for final installation 210IXMAKE= ${XMAKEENV} ${WORLDTMP}/usr/bin/${MAKE} 211 212# 213# buildworld 214# 215# Attempt to rebuild the entire system, with reasonable chance of 216# success, regardless of how old your existing system is. 217# 218buildworld: 219.if !defined(NOCLEAN) 220 @echo 221 @echo "--------------------------------------------------------------" 222 @echo " Cleaning up the temporary build tree" 223 @echo "--------------------------------------------------------------" 224 mkdir -p ${WORLDTMP} 225 chflags -R noschg ${WORLDTMP}/ 226 rm -rf ${WORLDTMP} 227.endif 228.if !defined(NOTOOLS) 229 @echo 230 @echo "--------------------------------------------------------------" 231 @echo " Making make" 232 @echo "--------------------------------------------------------------" 233 mkdir -p ${WORLDTMP}/usr/bin 234.if !defined(NOCLEAN) || !defined(NOOBJDIR) 235 cd ${.CURDIR}/usr.bin/make && \ 236 ${IBMAKE} -I${.CURDIR}/share/mk ${CLEANDIR} ${OBJDIR} 237.endif 238 cd ${.CURDIR}/usr.bin/make && \ 239 ${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} depend && \ 240 ${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} all && \ 241 ${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} install && \ 242 ${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} clean cleandepend 243.endif 244 @echo 245 @echo "--------------------------------------------------------------" 246 @echo " Making hierarchy" 247 @echo "--------------------------------------------------------------" 248 cd ${.CURDIR} && ${BMAKE} hierarchy 249.if !defined(NOCLEAN) 250 @echo 251 @echo "--------------------------------------------------------------" 252 @echo " Cleaning up the obj tree" 253 @echo "--------------------------------------------------------------" 254 cd ${.CURDIR} && ${BMAKE} par-${CLEANDIR} 255.endif 256.if !defined(NOOBJDIR) 257 @echo 258 @echo "--------------------------------------------------------------" 259 @echo " Rebuilding the obj tree" 260 @echo "--------------------------------------------------------------" 261 cd ${.CURDIR} && ${BMAKE} par-${OBJDIR} 262.endif 263.if !defined(NOTOOLS) 264 @echo 265 @echo "--------------------------------------------------------------" 266 @echo " Rebuilding bootstrap tools" 267 @echo "--------------------------------------------------------------" 268 cd ${.CURDIR} && ${BMAKE} bootstrap 269 @echo 270 @echo "--------------------------------------------------------------" 271 @echo " Rebuilding tools necessary to build the include files" 272 @echo "--------------------------------------------------------------" 273 cd ${.CURDIR} && ${BMAKE} include-tools 274.endif 275 @echo 276 @echo "--------------------------------------------------------------" 277 @echo " Rebuilding ${DESTDIR}/usr/include" 278 @echo "--------------------------------------------------------------" 279 cd ${.CURDIR} && SHARED=symlinks ${BMAKE} includes 280.if !defined(NOTOOLS) 281 @echo 282 @echo "--------------------------------------------------------------" 283 @echo " Rebuilding tools needed to build the libraries" 284 @echo "--------------------------------------------------------------" 285 cd ${.CURDIR} && ${BMAKE} lib-tools 286.endif 287 @echo 288 @echo "--------------------------------------------------------------" 289 @echo " Rebuilding ${DESTDIR}/usr/lib" 290 @echo "--------------------------------------------------------------" 291 cd ${.CURDIR} && ${BMAKE} libraries 292.if !defined(NOTOOLS) 293 @echo 294 @echo "--------------------------------------------------------------" 295 @echo " Rebuilding all other tools needed to build the world" 296 @echo "--------------------------------------------------------------" 297 cd ${.CURDIR} && ${BMAKE} build-tools 298.endif 299 @echo 300 @echo "--------------------------------------------------------------" 301 @echo " Rebuilding dependencies" 302 @echo "--------------------------------------------------------------" 303 cd ${.CURDIR} && ${XMAKE} par-depend 304 @echo 305 @echo "--------------------------------------------------------------" 306 @echo " Building everything.." 307 @echo "--------------------------------------------------------------" 308 cd ${.CURDIR} && ${XMAKE} all 309 310# 311# installworld 312# 313# Installs everything compiled by a 'buildworld'. 314# 315installworld: 316 cd ${.CURDIR} && ${IXMAKE} reinstall 317 318# 319# reinstall 320# 321# If you have a build server, you can NFS mount the source and obj directories 322# and do a 'make reinstall' on the *client* to install new binaries from the 323# most recent server build. 324# 325reinstall: 326 @echo "--------------------------------------------------------------" 327 @echo " Making hierarchy" 328 @echo "--------------------------------------------------------------" 329 cd ${.CURDIR} && ${MAKE} hierarchy 330 @echo 331 @echo "--------------------------------------------------------------" 332 @echo " Installing everything.." 333 @echo "--------------------------------------------------------------" 334 cd ${.CURDIR} && ${MAKE} install 335 @echo 336 @echo "--------------------------------------------------------------" 337 @echo " Re-scanning the shared libraries.." 338 @echo "--------------------------------------------------------------" 339 cd ${.CURDIR} && ldconfig -R 340 @echo 341 @echo "--------------------------------------------------------------" 342 @echo " Rebuilding man page indexes" 343 @echo "--------------------------------------------------------------" 344 cd ${.CURDIR}/share/man && ${MAKE} makedb 345 346# 347# update 348# 349# Update the source tree, by running sup and/or running cvs to update to the 350# latest copy. 351# 352update: 353.if defined(SUP_UPDATE) 354 @echo "--------------------------------------------------------------" 355 @echo "Running sup" 356 @echo "--------------------------------------------------------------" 357 @${SUP} ${SUPFLAGS} ${SUPFILE} 358.if defined(SUPFILE1) 359 @${SUP} ${SUPFLAGS} ${SUPFILE1} 360.endif 361.if defined(SUPFILE2) 362 @${SUP} ${SUPFLAGS} ${SUPFILE2} 363.endif 364.endif 365.if defined(CVS_UPDATE) 366 @echo "--------------------------------------------------------------" 367 @echo "Updating /usr/src from cvs repository" ${CVSROOT} 368 @echo "--------------------------------------------------------------" 369 cd ${.CURDIR} && cvs -q update -P -d 370.endif 371 372# 373# most 374# 375# Build most of the user binaries on the existing system libs and includes. 376# 377most: 378 @echo "--------------------------------------------------------------" 379 @echo " Building programs only" 380 @echo "--------------------------------------------------------------" 381 cd ${.CURDIR}/bin && ${MAKE} all 382 cd ${.CURDIR}/sbin && ${MAKE} all 383 cd ${.CURDIR}/libexec && ${MAKE} all 384 cd ${.CURDIR}/usr.bin && ${MAKE} all 385 cd ${.CURDIR}/usr.sbin && ${MAKE} all 386 cd ${.CURDIR}/gnu/libexec && ${MAKE} all 387 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} all 388 cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} all 389#.if defined(MAKE_KERBEROS4) && !defined(NOCRYPT) 390# cd ${.CURDIR}/kerberosIV && ${MAKE} most 391#.endif 392#.if !defined(NOSECURE) && !defined(NOCRYPT) 393# cd ${.CURDIR}/secure && ${MAKE} most 394#.endif 395 396# 397# installmost 398# 399# Install the binaries built by the 'most' target. This does not include 400# libraries or include files. 401# 402installmost: 403 @echo "--------------------------------------------------------------" 404 @echo " Installing programs only" 405 @echo "--------------------------------------------------------------" 406 cd ${.CURDIR}/bin && ${MAKE} install 407 cd ${.CURDIR}/sbin && ${MAKE} install 408 cd ${.CURDIR}/libexec && ${MAKE} install 409 cd ${.CURDIR}/usr.bin && ${MAKE} install 410 cd ${.CURDIR}/usr.sbin && ${MAKE} install 411 cd ${.CURDIR}/gnu/libexec && ${MAKE} install 412 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} install 413 cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} install 414#.if defined(MAKE_KERBEROS4) && !defined(NOCRYPT) 415# cd ${.CURDIR}/kerberosIV && ${MAKE} installmost 416#.endif 417#.if !defined(NOSECURE) && !defined(NOCRYPT) 418# cd ${.CURDIR}/secure && ${MAKE} installmost 419#.endif 420 421# 422# ------------------------------------------------------------------------ 423# 424# From here onwards are utility targets used by the 'make world' and 425# related targets. If your 'world' breaks, you may like to try to fix 426# the problem and manually run the following targets to attempt to 427# complete the build. Beware, this is *not* guaranteed to work, you 428# need to have a pretty good grip on the current state of the system 429# to attempt to manually finish it. If in doubt, 'make world' again. 430# 431 432# 433# heirarchy - ensure that all the needed directories are present 434# 435hierarchy: 436 cd ${.CURDIR}/etc && ${MAKE} distrib-dirs 437 438# 439# bootstrap - [re]build tools needed to run the actual build, this includes 440# tools needed by 'make depend', as some tools are needed to generate source 441# for the dependency information to be gathered from. 442# 443bootstrap: 444.if defined(DESTDIR) 445 rm -f ${DESTDIR}/usr/src/sys 446 ln -s ${.CURDIR}/sys ${DESTDIR}/usr/src 447 cd ${.CURDIR}/include && find -dx . | cpio -dump ${DESTDIR}/usr/include 448 cd ${.CURDIR}/include && make symlinks 449.endif 450 cd ${.CURDIR}/usr.bin/make && ${MAKE} ${MK_FLAGS} depend && \ 451 ${MAKE} ${MK_FLAGS} all && \ 452 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR} 453 cd ${.CURDIR}/usr.bin/xinstall && ${MAKE} ${MK_FLAGS} depend && \ 454 ${MAKE} ${MK_FLAGS} all && \ 455 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR} 456 cd ${.CURDIR}/usr.bin/lex && ${MAKE} bootstrap && \ 457 ${MAKE} ${MK_FLAGS} depend && \ 458 ${MAKE} ${MK_FLAGS} -DNOLIB all && \ 459 ${MAKE} ${MK_FLAGS} -DNOLIB -B install ${CLEANDIR} 460.if !defined(NOOBJDIR) 461 cd ${.CURDIR}/usr.bin/lex && ${MAKE} ${OBJDIR} 462.endif 463 464# 465# include-tools - generally the same as 'bootstrap', except that it's for 466# things that are specifically needed to generate include files. 467# 468# XXX should be merged with bootstrap, it's not worth keeeping them separate. 469# Well, maybe it is now. We force 'cleandepend' here to avoid dependencies 470# on cleaned away headers in ${WORLDTMP}. 471# 472include-tools: 473.for d in usr.bin/compile_et usr.bin/rpcgen 474 cd ${.CURDIR}/$d && ${MAKE} cleandepend && \ 475 ${MAKE} ${MK_FLAGS} depend && \ 476 ${MAKE} ${MK_FLAGS} all && \ 477 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR} 478.endfor 479 480# 481# includes - possibly generate and install the include files. 482# 483includes: 484.if defined(CLOBBER) 485 rm -rf ${DESTDIR}/usr/include/* 486 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ 487 -p ${DESTDIR}/usr/include 488.endif 489 cd ${.CURDIR}/include && ${MAKE} -B all install 490 cd ${.CURDIR}/gnu/include && ${MAKE} install 491 cd ${.CURDIR}/gnu/lib/libmp && ${MAKE} beforeinstall 492 cd ${.CURDIR}/gnu/lib/libobjc && ${MAKE} beforeinstall 493 cd ${.CURDIR}/gnu/lib/libreadline && ${MAKE} beforeinstall 494 cd ${.CURDIR}/gnu/lib/libregex && ${MAKE} beforeinstall 495 cd ${.CURDIR}/gnu/lib/libstdc++ && ${MAKE} beforeinstall 496 cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall 497 cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall 498 cd ${.CURDIR}/gnu/lib/libgmp && ${MAKE} beforeinstall 499.if exists(secure) && !defined(NOCRYPT) 500 cd ${.CURDIR}/secure/lib/libdes && ${MAKE} beforeinstall 501.endif 502.if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS4) 503 cd ${.CURDIR}/kerberosIV/lib/libacl && ${MAKE} beforeinstall 504 cd ${.CURDIR}/kerberosIV/lib/libkadm && ${MAKE} beforeinstall 505 cd ${.CURDIR}/kerberosIV/lib/libkafs && ${MAKE} beforeinstall 506 cd ${.CURDIR}/kerberosIV/lib/libkdb && ${MAKE} beforeinstall 507 cd ${.CURDIR}/kerberosIV/lib/libkrb && ${MAKE} beforeinstall 508 cd ${.CURDIR}/kerberosIV/lib/libtelnet && ${MAKE} beforeinstall 509.else 510 cd ${.CURDIR}/lib/libtelnet && ${MAKE} beforeinstall 511.endif 512.if exists(${.CURDIR}/lib/csu/${MACHINE}) 513 cd ${.CURDIR}/lib/csu/${MACHINE} && ${MAKE} beforeinstall 514.endif 515 cd ${.CURDIR}/lib/libalias && ${MAKE} beforeinstall 516 cd ${.CURDIR}/lib/libc && ${MAKE} beforeinstall 517 cd ${.CURDIR}/lib/libcurses && ${MAKE} beforeinstall 518 cd ${.CURDIR}/lib/libdisk && ${MAKE} beforeinstall 519 cd ${.CURDIR}/lib/libedit && ${MAKE} beforeinstall 520 cd ${.CURDIR}/lib/libftpio && ${MAKE} beforeinstall 521 cd ${.CURDIR}/lib/libmd && ${MAKE} beforeinstall 522 cd ${.CURDIR}/lib/libmytinfo && ${MAKE} beforeinstall 523 cd ${.CURDIR}/lib/libncurses && ${MAKE} beforeinstall 524.if !defined(WANT_CSRG_LIBM) 525 cd ${.CURDIR}/lib/msun && ${MAKE} beforeinstall 526.endif 527 cd ${.CURDIR}/lib/libopie && ${MAKE} beforeinstall 528 cd ${.CURDIR}/lib/libpcap && ${MAKE} beforeinstall 529 cd ${.CURDIR}/lib/librpcsvc && ${MAKE} beforeinstall 530 cd ${.CURDIR}/lib/libskey && ${MAKE} beforeinstall 531.if !defined(NOTCL) && exists (${.CURDIR}/contrib/tcl) && \ 532 exists(${.CURDIR}/usr.bin/tclsh) && exists (${.CURDIR}/lib/libtcl) 533 cd ${.CURDIR}/lib/libtcl && ${MAKE} installhdrs 534.endif 535 cd ${.CURDIR}/lib/libtermcap && ${MAKE} beforeinstall 536 cd ${.CURDIR}/lib/libcom_err && ${MAKE} beforeinstall 537 cd ${.CURDIR}/lib/libss && ${MAKE} -B hdrs beforeinstall 538 cd ${.CURDIR}/lib/libscsi && ${MAKE} beforeinstall 539 cd ${.CURDIR}/lib/libutil && ${MAKE} beforeinstall 540 cd ${.CURDIR}/lib/libvgl && ${MAKE} beforeinstall 541 cd ${.CURDIR}/lib/libz && ${MAKE} beforeinstall 542 cd ${.CURDIR}/usr.bin/f2c && ${MAKE} beforeinstall 543 cd ${.CURDIR}/usr.bin/lex && ${MAKE} beforeinstall 544 545# 546# lib-tools - build tools to compile and install the libraries. 547# 548# XXX gperf is required for cc 549# XXX a new ld and tsort is required for cc 550lib-tools: 551.for d in \ 552 gnu/usr.bin/gperf \ 553 gnu/usr.bin/ld \ 554 usr.bin/tsort \ 555 gnu/usr.bin/as \ 556 gnu/usr.bin/bison \ 557 gnu/usr.bin/cc \ 558 usr.bin/ar \ 559 usr.bin/lex/lib \ 560 usr.bin/mk_cmds \ 561 usr.bin/nm \ 562 usr.bin/ranlib \ 563 usr.bin/uudecode 564 cd ${.CURDIR}/$d && ${MAKE} ${MK_FLAGS} depend && \ 565 ${MAKE} ${MK_FLAGS} all && \ 566 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR} 567.endfor 568 569# 570# libraries - build and install the libraries 571# 572 573# We have to know too much about botches in the lib tree: 574.if exists(csu/${MACHINE}.pcc) 575_csu=csu/${MACHINE}.pcc 576.else 577_csu=csu/${MACHINE} 578.endif 579 580.if defined(WANT_CSRG_LIBM) 581_libm= libm 582.else 583_libm= msun 584.endif 585 586libraries: 587# 588# Build csu early so that some tools get linked to the new version (too 589# late for the main tools, however). 590# 591# To satisfy shared library or ELF linkage when only the libraries being 592# built are visible: 593# 594# libcom_err must be built before libss. 595# libcrypt and libmd must be built before libskey. 596# libm must be built before libtcl. 597# libmytinfo must be built before libdialog and libncurses. 598# libncurses must be built before libdialog. 599# libtermcap must be built before libcurses, libedit and libreadline. 600# 601.for _lib in ${_csu} libcom_err libcrypt ${_libm} libmytinfo \ 602 libncurses libtermcap 603.if exists(${.CURDIR}/lib/${_lib}) 604 cd ${.CURDIR}/lib/${_lib} && \ 605 ${MAKE} ${MK_FLAGS:S/-DNOPIC//} depend && \ 606 ${MAKE} ${MK_FLAGS:S/-DNOPIC//} all && \ 607 ${MAKE} ${MK_FLAGS:S/-DNOPIC//} -B install 608.endif 609.endfor 610.for _lib in gnu/lib lib usr.bin/lex/lib usr.sbin/pcvt/keycap 611.if exists(${.CURDIR}/${_lib}) 612 cd ${.CURDIR}/${_lib} && \ 613 ${MAKE} ${MK_FLAGS} depend && \ 614 ${MAKE} ${MK_FLAGS} all && \ 615 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR} 616.endif 617.endfor 618.if exists(${.CURDIR}/secure/lib) && !defined(NOCRYPT) && !defined(NOSECURE) 619 cd ${.CURDIR}/secure/lib && ${MAKE} ${MK_FLAGS} depend && \ 620 ${MAKE} ${MK_FLAGS} all && \ 621 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR} 622.endif 623.if exists(${.CURDIR}/kerberosIV/lib) && !defined(NOCRYPT) && \ 624 defined(MAKE_KERBEROS4) 625 cd ${.CURDIR}/kerberosIV/lib && ${MAKE} ${MK_FLAGS} depend && \ 626 ${MAKE} ${MK_FLAGS} all && \ 627 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR} 628.endif 629 630# 631# build-tools - build and install any other tools needed to complete the 632# compile and install. 633# ifdef stale 634# bc and cpp are required to build groff. Otherwise, the order here is 635# mostly historical, i.e., bogus. 636# chmod is used to build gcc's tmpmultilib[2] at obscure times. 637# endif stale 638# XXX uname is a bug - the target should not depend on the host. 639# 640build-tools: 641.for d in \ 642 bin/cat \ 643 bin/chmod \ 644 bin/cp \ 645 bin/date \ 646 bin/dd \ 647 bin/echo \ 648 bin/expr \ 649 bin/hostname \ 650 bin/ln \ 651 bin/ls \ 652 bin/mkdir \ 653 bin/mv \ 654 bin/rm \ 655 bin/sh \ 656 bin/test \ 657 gnu/usr.bin/awk \ 658 gnu/usr.bin/bc \ 659 gnu/usr.bin/grep \ 660 gnu/usr.bin/groff \ 661 gnu/usr.bin/gzip \ 662 gnu/usr.bin/man/makewhatis \ 663 gnu/usr.bin/sort \ 664 gnu/usr.bin/texinfo \ 665 share/info \ 666 usr.bin/basename \ 667 usr.bin/cap_mkdb \ 668 usr.bin/chflags \ 669 usr.bin/cmp \ 670 usr.bin/col \ 671 usr.bin/cpp \ 672 usr.bin/expand \ 673 usr.bin/file2c \ 674 usr.bin/find \ 675 usr.bin/gencat \ 676 usr.bin/lorder \ 677 usr.bin/m4 \ 678 usr.bin/mkdep \ 679 usr.bin/paste \ 680 usr.bin/sed \ 681 usr.bin/size \ 682 usr.bin/soelim \ 683 usr.bin/strip \ 684 usr.bin/symorder \ 685 usr.bin/touch \ 686 usr.bin/tr \ 687 usr.bin/true \ 688 usr.bin/uname \ 689 usr.bin/uuencode \ 690 usr.bin/vgrind \ 691 usr.bin/vi \ 692 usr.bin/wc \ 693 usr.bin/yacc \ 694 usr.sbin/chown \ 695 usr.sbin/mtree \ 696 usr.sbin/zic 697 cd ${.CURDIR}/$d && ${MAKE} ${MK_FLAGS} depend && \ 698 ${MAKE} ${MK_FLAGS} all && \ 699 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR} 700.endfor 701 702.for __target in clean cleandir obj depend 703.for entry in ${SUBDIR} 704${entry}.${__target}__D: .PHONY 705 if test -d ${.CURDIR}/${entry}.${MACHINE}; then \ 706 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE}"; \ 707 edir=${entry}.${MACHINE}; \ 708 cd ${.CURDIR}/$${edir}; \ 709 else \ 710 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \ 711 edir=${entry}; \ 712 cd ${.CURDIR}/$${edir}; \ 713 fi; \ 714 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/ 715.endfor 716par-${__target}: ${SUBDIR:S/$/.${__target}__D/} 717.endfor 718 719.endif 720 721.include <bsd.subdir.mk> 722