Makefile.inc1 revision 54663
1# 2# $FreeBSD: head/Makefile.inc1 54663 1999-12-16 01:21:48Z billf $ 3# 4# Make command line options: 5# -DMAKE_KERBEROS4 to build KerberosIV 6# -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir 7# -DNOCLEAN do not clean at all 8# -DNOCRYPT will prevent building of crypt versions 9# -DNOPROFILE do not build profiled libraries 10# -DNOSECURE do not go into secure subdir 11# -DNOGAMES do not go into games subdir 12# -DNOSHARE do not go into share subdir 13# -DNOINFO do not make or install info files 14# -DNOLIBC_R do not build libc_r. 15# -DNO_FORTRAN do not build g77 and related libraries. 16# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list 17 18# 19# The intended user-driven targets are: 20# buildworld - rebuild *everything*, including glue to help do upgrades 21# installworld- install everything built by "buildworld" 22# update - convenient way to update your source tree (eg: sup/cvs) 23# most - build user commands, no libraries or include files 24# installmost - install user commands, no libraries or include files 25# 26# Standard targets (not defined here) are documented in the makefiles in 27# /usr/share/mk. These include: 28# obj depend all install clean cleandepend cleanobj 29 30# Put initial settings here. 31SUBDIR= 32 33# We must do share/info early so that installation of info `dir' 34# entries works correctly. Do it first since it is less likely to 35# grow dependencies on include and lib than vice versa. 36.if exists(${.CURDIR}/share/info) 37SUBDIR+= share/info 38.endif 39 40# We must do include and lib early so that the perl *.ph generation 41# works correctly as it uses the header files installed by this. 42.if exists(${.CURDIR}/include) 43SUBDIR+= include 44.endif 45.if exists(${.CURDIR}/lib) 46SUBDIR+= lib 47.endif 48 49.if exists(${.CURDIR}/bin) 50SUBDIR+= bin 51.endif 52.if exists(${.CURDIR}/games) && !defined(NOGAMES) 53SUBDIR+= games 54.endif 55.if exists(${.CURDIR}/gnu) 56SUBDIR+= gnu 57.endif 58.if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \ 59 !defined(NOCRYPT) && defined(MAKE_KERBEROS4) 60SUBDIR+= kerberosIV 61.endif 62.if exists(${.CURDIR}/libexec) 63SUBDIR+= libexec 64.endif 65.if exists(${.CURDIR}/sbin) 66SUBDIR+= sbin 67.endif 68.if exists(${.CURDIR}/share) && !defined(NOSHARE) 69SUBDIR+= share 70.endif 71.if exists(${.CURDIR}/sys) 72SUBDIR+= sys 73.endif 74.if exists(${.CURDIR}/usr.bin) 75SUBDIR+= usr.bin 76.endif 77.if exists(${.CURDIR}/usr.sbin) 78SUBDIR+= usr.sbin 79.endif 80.if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE) 81SUBDIR+= secure 82.endif 83 84# etc must be last for "distribute" to work 85.if exists(${.CURDIR}/etc) 86SUBDIR+= etc 87.endif 88 89# These are last, since it is nice to at least get the base system 90# rebuilt before you do them. 91.if defined(LOCAL_DIRS) 92.for _DIR in ${LOCAL_DIRS} 93.if exists(${.CURDIR}/${_DIR}) & exists(${.CURDIR}/${_DIR}/Makefile) 94SUBDIR+= ${_DIR} 95.endif 96.endfor 97.endif 98 99.if defined(NOCLEANDIR) 100CLEANDIR= clean cleandepend 101.else 102CLEANDIR= cleandir 103.endif 104 105SUP?= cvsup 106SUPFLAGS?= -g -L 2 -P - 107 108MAKEOBJDIRPREFIX?= /usr/obj 109BUILD_ARCH!= sysctl -n hw.machine_arch 110.if ${BUILD_ARCH} == ${MACHINE_ARCH} 111OBJTREE= ${MAKEOBJDIRPREFIX} 112.else 113OBJTREE= ${MAKEOBJDIRPREFIX}/${MACHINE_ARCH} 114.endif 115WORLDTMP= ${OBJTREE}${.CURDIR}/${BUILD_ARCH} 116STRICTTMPPATH= ${WORLDTMP}/bin:${WORLDTMP}/usr/bin 117TMPPATH= ${STRICTTMPPATH}:${PATH} 118 119# bootstrap/tools make 120BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \ 121 DESTDIR=${WORLDTMP} \ 122 INSTALL="sh ${.CURDIR}/tools/install.sh" \ 123 TARGET_ARCH=${MACHINE_ARCH} \ 124 MACHINE_ARCH=${BUILD_ARCH} \ 125 PATH=${TMPPATH} 126BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DNOMAN -DNOINFO \ 127 -DNO_FORTRAN -DNO_GDB 128 129CROSSENV= COMPILER_PATH=${WORLDTMP}/usr/libexec:${WORLDTMP}/usr/bin \ 130 LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib \ 131 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \ 132 PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.00503 \ 133 MAKEOBJDIRPREFIX=${OBJTREE} 134 135# cross make used for compilation 136XMAKEENV= ${CROSSENV} \ 137 DESTDIR=${WORLDTMP} \ 138 INSTALL="sh ${.CURDIR}/tools/install.sh" \ 139 PATH=${TMPPATH} 140XMAKE= ${XMAKEENV} ${MAKE} -f Makefile.inc1 141 142# cross make used for final installation 143IMAKEENV= ${CROSSENV} 144IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 145 146USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \ 147 usr/libexec/${OBJFORMAT} usr/share/misc 148 149.if ${MACHINE_ARCH} == "i386" && ${MACHINE} == "pc98" 150USRDIRS+= usr/libexec/aout 151.endif 152 153INCDIRS= arpa g++/std objc protocols readline rpc rpcsvc security ss 154 155# 156# buildworld 157# 158# Attempt to rebuild the entire system, with reasonable chance of 159# success, regardless of how old your existing system is. 160# 161buildworld: 162 @echo 163 @echo "--------------------------------------------------------------" 164 @echo ">>> Rebuilding the temporary build tree" 165 @echo "--------------------------------------------------------------" 166.if !defined(NOCLEAN) 167 rm -rf ${WORLDTMP} 168.endif 169.for _dir in ${USRDIRS} 170 mkdir -p ${WORLDTMP}/${_dir} 171.endfor 172.for _dir in ${INCDIRS} 173 mkdir -p ${WORLDTMP}/usr/include/${_dir} 174.endfor 175.if defined(NOCLEAN) 176 rm -f ${WORLDTMP}/sys 177.endif 178 ln -sf ${.CURDIR}/sys ${WORLDTMP}/sys 179 @echo 180 @echo "--------------------------------------------------------------" 181 @echo ">>> Rebuilding tools" 182 @echo "--------------------------------------------------------------" 183 cd ${.CURDIR}; ${BMAKE} tools 184.if !defined(NOCLEAN) 185 @echo 186 @echo "--------------------------------------------------------------" 187 @echo ">>> Cleaning up the object tree" 188 @echo "--------------------------------------------------------------" 189 cd ${.CURDIR}; ${XMAKE} ${CLEANDIR:S/^/par-/} 190.endif 191 @echo 192 @echo "--------------------------------------------------------------" 193 @echo ">>> Rebuilding the object tree" 194 @echo "--------------------------------------------------------------" 195 cd ${.CURDIR}; ${XMAKE} par-obj 196 @echo 197 @echo "--------------------------------------------------------------" 198 @echo ">>> Rebuilding ${WORLDTMP}/usr/include" 199 @echo "--------------------------------------------------------------" 200 cd ${.CURDIR}; ${XMAKE} includes 201 @echo 202 @echo "--------------------------------------------------------------" 203 @echo ">>> Building libraries" 204 @echo "--------------------------------------------------------------" 205 cd ${.CURDIR}; ${XMAKE} -DNOINFO -DNOMAN libraries 206 @echo 207 @echo "--------------------------------------------------------------" 208 @echo ">>> Rebuilding dependencies" 209 @echo "--------------------------------------------------------------" 210 cd ${.CURDIR}; ${XMAKE} par-depend 211 @echo 212 @echo "--------------------------------------------------------------" 213 @echo ">>> Building everything.." 214 @echo "--------------------------------------------------------------" 215 cd ${.CURDIR}; ${XMAKE} all 216 217everything: 218 @echo "--------------------------------------------------------------" 219 @echo ">>> Building everything.." 220 @echo "--------------------------------------------------------------" 221 cd ${.CURDIR}; ${XMAKE} all 222 223# 224# installworld 225# 226# Installs everything compiled by a 'buildworld'. 227# 228installworld: 229 cd ${.CURDIR}; ${IMAKE} reinstall 230 231# 232# reinstall 233# 234# If you have a build server, you can NFS mount the source and obj directories 235# and do a 'make reinstall' on the *client* to install new binaries from the 236# most recent server build. 237# 238reinstall: 239 @echo "--------------------------------------------------------------" 240 @echo ">>> Making hierarchy" 241 @echo "--------------------------------------------------------------" 242 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy 243 @echo 244 @echo "--------------------------------------------------------------" 245 @echo ">>> Installing everything.." 246 @echo "--------------------------------------------------------------" 247 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install 248.if !defined(NOMAN) 249 @echo 250 @echo "--------------------------------------------------------------" 251 @echo ">>> Rebuilding man page indices" 252 @echo "--------------------------------------------------------------" 253 cd ${.CURDIR}/share/man; ${MAKE} makedb 254.endif 255 256# 257# update 258# 259# Update the source tree, by running sup and/or running cvs to update to the 260# latest copy. 261# 262update: 263.if defined(SUP_UPDATE) 264 @echo "--------------------------------------------------------------" 265 @echo ">>> Running ${SUP}" 266 @echo "--------------------------------------------------------------" 267.if defined(SUPFILE) 268 @${SUP} ${SUPFLAGS} ${SUPFILE} 269.endif 270.if defined(SUPFILE1) 271 @${SUP} ${SUPFLAGS} ${SUPFILE1} 272.endif 273.if defined(SUPFILE2) 274 @${SUP} ${SUPFLAGS} ${SUPFILE2} 275.endif 276.if defined(PORTSSUPFILE) 277 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE} 278.endif 279.endif 280.if defined(CVS_UPDATE) 281 @echo "--------------------------------------------------------------" 282 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT} 283 @echo "--------------------------------------------------------------" 284 cd ${.CURDIR}; cvs -q update -P -d 285.endif 286 287# 288# most 289# 290# Build most of the user binaries on the existing system libs and includes. 291# 292most: 293 @echo "--------------------------------------------------------------" 294 @echo ">>> Building programs only" 295 @echo "--------------------------------------------------------------" 296 cd ${.CURDIR}/bin; ${MAKE} all 297 cd ${.CURDIR}/sbin; ${MAKE} all 298 cd ${.CURDIR}/libexec; ${MAKE} all 299 cd ${.CURDIR}/usr.bin; ${MAKE} all 300 cd ${.CURDIR}/usr.sbin; ${MAKE} all 301 cd ${.CURDIR}/gnu/libexec; ${MAKE} all 302 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} all 303 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} all 304 305# 306# installmost 307# 308# Install the binaries built by the 'most' target. This does not include 309# libraries or include files. 310# 311installmost: 312 @echo "--------------------------------------------------------------" 313 @echo ">>> Installing programs only" 314 @echo "--------------------------------------------------------------" 315 cd ${.CURDIR}/bin; ${MAKE} install 316 cd ${.CURDIR}/sbin; ${MAKE} install 317 cd ${.CURDIR}/libexec; ${MAKE} install 318 cd ${.CURDIR}/usr.bin; ${MAKE} install 319 cd ${.CURDIR}/usr.sbin; ${MAKE} install 320 cd ${.CURDIR}/gnu/libexec; ${MAKE} install 321 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} install 322 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} install 323 324# 325# ------------------------------------------------------------------------ 326# 327# From here onwards are utility targets used by the 'make world' and 328# related targets. If your 'world' breaks, you may like to try to fix 329# the problem and manually run the following targets to attempt to 330# complete the build. Beware, this is *not* guaranteed to work, you 331# need to have a pretty good grip on the current state of the system 332# to attempt to manually finish it. If in doubt, 'make world' again. 333# 334 335# 336# tools - Build tools needed to run the actual build. 337# 338.if exists(${.CURDIR}/games) && !defined(NOGAMES) 339_strfile= games/fortune/strfile 340.endif 341 342.if ${MACHINE_ARCH} == "i386" && ${MACHINE} == "pc98" 343_aout_tools= usr.bin/size usr.bin/strip gnu/usr.bin/as gnu/usr.bin/ld 344.endif 345 346tools:: 347.for _tool in ${_strfile} ${_aout_tools} usr.bin/gensetdefs \ 348 gnu/usr.bin/binutils usr.bin/objformat usr.bin/yacc usr.bin/colldef \ 349 gnu/usr.bin/bison gnu/usr.bin/cc 350 cd ${.CURDIR}/${_tool}; \ 351 ${MAKE} obj; \ 352 ${MAKE} depend; \ 353 ${MAKE} all; \ 354 ${MAKE} install 355.endfor 356 357# 358# hierarchy - ensure that all the needed directories are present 359# 360hierarchy: 361 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs 362 363# 364# includes - possibly generate and install the include files. 365# 366includes: 367 cd ${.CURDIR}/include; ${MAKE} SHARED=symlinks -B all install 368 cd ${.CURDIR}/gnu/include; ${MAKE} install 369 cd ${.CURDIR}/gnu/lib/libmp; ${MAKE} beforeinstall 370 cd ${.CURDIR}/gnu/lib/libobjc; ${MAKE} beforeinstall 371 cd ${.CURDIR}/gnu/lib/libreadline; ${MAKE} beforeinstall 372 cd ${.CURDIR}/gnu/lib/libregex; ${MAKE} beforeinstall 373 cd ${.CURDIR}/gnu/lib/libstdc++; ${MAKE} beforeinstall 374 cd ${.CURDIR}/gnu/lib/libdialog; ${MAKE} beforeinstall 375 cd ${.CURDIR}/gnu/lib/libgmp; ${MAKE} beforeinstall 376 cd ${.CURDIR}/gnu/usr.bin/cc/cc1plus; ${MAKE} beforeinstall 377.if exists(${.CURDIR}/secure) && !defined(NOCRYPT) 378 cd ${.CURDIR}/secure/lib/libdes; ${MAKE} beforeinstall 379.endif 380.if exists(${.CURDIR}/kerberosIV) && !defined(NOCRYPT) && \ 381 defined(MAKE_KERBEROS4) 382 cd ${.CURDIR}/kerberosIV/lib/libacl; ${MAKE} beforeinstall 383 cd ${.CURDIR}/kerberosIV/lib/libkadm; ${MAKE} beforeinstall 384 cd ${.CURDIR}/kerberosIV/lib/libkafs; ${MAKE} beforeinstall 385 cd ${.CURDIR}/kerberosIV/lib/libkdb; ${MAKE} beforeinstall 386 cd ${.CURDIR}/kerberosIV/lib/libkrb; ${MAKE} beforeinstall 387 cd ${.CURDIR}/kerberosIV/lib/libtelnet; ${MAKE} beforeinstall 388.else 389 cd ${.CURDIR}/lib/libtelnet; ${MAKE} beforeinstall 390.endif 391.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}) 392 cd ${.CURDIR}/lib/csu/${MACHINE_ARCH}; ${MAKE} beforeinstall 393.endif 394 cd ${.CURDIR}/lib/libalias; ${MAKE} beforeinstall 395 cd ${.CURDIR}/lib/libatm; ${MAKE} beforeinstall 396 cd ${.CURDIR}/lib/libdevstat; ${MAKE} beforeinstall 397 cd ${.CURDIR}/lib/libc; ${MAKE} beforeinstall 398 cd ${.CURDIR}/lib/libcalendar; ${MAKE} beforeinstall 399 cd ${.CURDIR}/lib/libcam; ${MAKE} beforeinstall 400 cd ${.CURDIR}/lib/libdisk; ${MAKE} beforeinstall 401 cd ${.CURDIR}/lib/libedit; ${MAKE} beforeinstall 402 cd ${.CURDIR}/lib/libftpio; ${MAKE} beforeinstall 403 cd ${.CURDIR}/lib/libkvm; ${MAKE} beforeinstall 404 cd ${.CURDIR}/lib/libmd; ${MAKE} beforeinstall 405.if !defined(WANT_CSRG_LIBM) 406 cd ${.CURDIR}/lib/msun; ${MAKE} beforeinstall 407.endif 408 cd ${.CURDIR}/lib/libncp; ${MAKE} beforeinstall 409 cd ${.CURDIR}/lib/libncurses; ${MAKE} beforeinstall 410 cd ${.CURDIR}/lib/libnetgraph; ${MAKE} beforeinstall 411 cd ${.CURDIR}/lib/libopie; ${MAKE} beforeinstall 412 cd ${.CURDIR}/lib/libpam/libpam; ${MAKE} beforeinstall 413 cd ${.CURDIR}/lib/libpcap; ${MAKE} beforeinstall 414 cd ${.CURDIR}/lib/libradius; ${MAKE} beforeinstall 415 cd ${.CURDIR}/lib/librpcsvc; ${MAKE} beforeinstall 416 cd ${.CURDIR}/lib/libskey; ${MAKE} beforeinstall 417 cd ${.CURDIR}/lib/libstand; ${MAKE} beforeinstall 418 cd ${.CURDIR}/lib/libtacplus; ${MAKE} beforeinstall 419 cd ${.CURDIR}/lib/libcom_err; ${MAKE} beforeinstall 420 cd ${.CURDIR}/lib/libss; ${MAKE} -B hdrs beforeinstall 421 cd ${.CURDIR}/lib/libutil; ${MAKE} beforeinstall 422 cd ${.CURDIR}/lib/libvgl; ${MAKE} beforeinstall 423 cd ${.CURDIR}/lib/libwrap; ${MAKE} beforeinstall 424 cd ${.CURDIR}/lib/libz; ${MAKE} beforeinstall 425 cd ${.CURDIR}/usr.bin/lex; ${MAKE} beforeinstall 426 427# 428# libraries - build all libraries, and install them under ${DESTDIR}. 429# 430# The following dependencies exist between the libraries: 431# 432# lib*: csu 433# libatm: libmd 434# libcrypt: libmd 435# libdialog: libncurses 436# libedit: libncurses 437# libg++: libm 438# libkrb: libcrypt 439# libopie: libmd 440# libpam: libcom_err libcrypt libdes libgcc_pic libkrb libradius libskey \ 441# libtacplus libutil 442# libradius: libmd 443# libreadline: libncurses 444# libskey: libcrypt libmd 445# libss: libcom_err 446# libstc++: libm 447# libtacplus: libmd 448# 449# Across directories this comes down to (rougly): 450# 451# gnu/lib: lib/libm lib/libncurses 452# kerberosIV/lib: lib/libcrypt 453# lib/libpam: secure/lib/libdes kerberosIV/lib/libkrb gnu/lib/libgcc 454# secure/lib: lib/libmd 455# 456.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}.pcc) 457_csu= lib/csu/${MACHINE_ARCH}.pcc 458.elif ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" 459_csu= lib/csu/i386-elf 460.else 461_csu= lib/csu/${MACHINE_ARCH} 462.endif 463 464.if !defined(NOSECURE) && !defined(NOCRYPT) 465_secure_lib= secure/lib 466.endif 467 468.if !defined(NOCRYPT) && defined(MAKE_KERBEROS4) 469_kerberosIV_lib= kerberosIV/lib 470.endif 471 472.if defined(WANT_CSRG_LIBM) 473_libm= lib/libm 474.else 475_libm= lib/msun 476.endif 477 478.if !defined(NOPERL) 479_libperl= gnu/usr.bin/perl/libperl 480.endif 481 482libraries: 483.for _lib in ${_csu} lib/libmd lib/libcrypt ${_secure_lib} ${_kerberosIV_lib} \ 484 gnu/lib/libgcc lib/libcom_err ${_libm} lib/libncurses lib/libradius \ 485 lib/libskey lib/libtacplus lib/libutil lib gnu/lib ${_libperl} \ 486 usr.bin/lex/lib usr.sbin/pcvt/keycap 487.if exists(${.CURDIR}/${_lib}) 488 cd ${.CURDIR}/${_lib}; \ 489 ${MAKE} depend; \ 490 ${MAKE} all; \ 491 ${MAKE} install 492.endif 493.endfor 494 495.for __target in clean cleandepend cleandir depend obj 496.for entry in ${SUBDIR} 497${entry}.${__target}__D: .PHONY 498 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \ 499 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \ 500 edir=${entry}.${MACHINE_ARCH}; \ 501 cd ${.CURDIR}/$${edir}; \ 502 else \ 503 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \ 504 edir=${entry}; \ 505 cd ${.CURDIR}/$${edir}; \ 506 fi; \ 507 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/ 508.endfor 509par-${__target}: ${SUBDIR:S/$/.${__target}__D/} 510.endfor 511 512.include <bsd.subdir.mk> 513