Makefile revision 104385
12061Sjkh# 250479Speter# $FreeBSD: head/Makefile 104370 2002-10-02 13:52:36Z phk $ 32061Sjkh# 438666Sjb# The user-driven targets are: 532427Sjb# 6103985Sphk# universe - *Really* build *everything*: Buildworld and 7103985Sphk# all kernels on all architectures. 838666Sjb# buildworld - Rebuild *everything*, including glue to help do 938666Sjb# upgrades. 1038666Sjb# installworld - Install everything built by "buildworld". 1138666Sjb# world - buildworld + installworld. 1264049Salex# buildkernel - Rebuild the kernel and the kernel-modules. 1364049Salex# installkernel - Install the kernel and the kernel-modules. 1466071Smarkm# reinstallkernel - Reinstall the kernel and the kernel-modules. 1573504Sobrien# kernel - buildkernel + installkernel. 1638666Sjb# update - Convenient way to update your source tree (cvs). 1744918Sjkh# upgrade - Upgrade a.out (2.2.x/3.0) system to the new ELF way 1838666Sjb# most - Build user commands, no libraries or include files. 1938666Sjb# installmost - Install user commands, no libraries or include files. 2038666Sjb# aout-to-elf - Upgrade an system from a.out to elf format (see below). 2138666Sjb# aout-to-elf-build - Build everything required to upgrade a system from 2238666Sjb# a.out to elf format (see below). 2338666Sjb# aout-to-elf-install - Install everything built by aout-to-elf-build (see 2438666Sjb# below). 2538978Sjb# move-aout-libs - Move the a.out libraries into an aout sub-directory 2638978Sjb# of each elf library sub-directory. 2732427Sjb# 2838666Sjb# This makefile is simple by design. The FreeBSD make automatically reads 2938666Sjb# the /usr/share/mk/sys.mk unless the -m argument is specified on the 3038666Sjb# command line. By keeping this makefile simple, it doesn't matter too 3138666Sjb# much how different the installed mk files are from those in the source 3238666Sjb# tree. This makefile executes a child make process, forcing it to use 3338666Sjb# the mk files from the source tree which are supposed to DTRT. 3417308Speter# 3591606Skeramida# The user-driven targets (as listed above) are implemented in Makefile.inc1. 3619175Sbde# 3796205Sjwd# If you want to build your system from source be sure that /usr/obj has 3896205Sjwd# at least 400MB of diskspace available. 3938042Sbde# 4096205Sjwd# For individuals wanting to build from the sources currently on their 4196205Sjwd# system, the simple instructions are: 4238042Sbde# 4396205Sjwd# 1. `cd /usr/src' (or to the directory containing your source tree). 4496205Sjwd# 2. `make world' 4517308Speter# 4696205Sjwd# For individuals wanting to upgrade their sources (even if only a 4796205Sjwd# delta of a few days): 4817308Speter# 4996205Sjwd# 1. `cd /usr/src' (or to the directory containing your source tree). 5096205Sjwd# 2. `make buildworld' 5196205Sjwd# 3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC). 5296205Sjwd# 4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC). 5396205Sjwd# 5. `reboot' (in single user mode: boot -s from the loader prompt). 5496205Sjwd# 6. `mergemaster -p' 5596205Sjwd# 7. `make installworld' 5696205Sjwd# 8. `mergemaster' 5796205Sjwd# 9. `reboot' 5896205Sjwd# 5996205Sjwd# See src/UPDATING `COMMON ITEMS' for more complete information. 6096205Sjwd# 6198775Sdillon# If TARGET_ARCH=arch (e.g. ia64, sparc64, ...) is specified you can 6298723Sdillon# cross build world for other architectures using the buildworld target, 6398723Sdillon# and once the world is built you can cross build a kernel using the 6498723Sdillon# buildkernel target. 6598723Sdillon# 6638666Sjb# ---------------------------------------------------------------------------- 6717308Speter# 6838666Sjb# Upgrading an i386 system from a.out to elf format 6917308Speter# 7027910Sasami# 7143226Sjkh# The aout->elf transition build is performed by doing a `make upgrade' (or 7243226Sjkh# `make aout-to-elf') or in two steps by a `make aout-to-elf-build' followed 7343226Sjkh# by a `make aout-to-elf-install', depending on user preference. 7438666Sjb# You need to have at least 320 Mb of free space for the object tree. 7527910Sasami# 7638666Sjb# The upgrade process checks the installed release. If this is 3.0-CURRENT, 7738666Sjb# it is assumed that your kernel contains all the syscalls required by the 7838666Sjb# current sources. 7927910Sasami# 8038666Sjb# The upgrade procedure will stop and ask for confirmation to proceed 8138666Sjb# several times. On each occasion, you can type Ctrl-C to abort the 8243226Sjkh# upgrade. Optionally, you can also start it with NOCONFIRM=yes and skip 8343226Sjkh# the confirmation steps. 8427910Sasami# 8538666Sjb# ---------------------------------------------------------------------------- 8627910Sasami# 8717308Speter# 8838666Sjb# Define the user-driven targets. These are listed here in alphabetical 8938666Sjb# order, but that's not important. 9017308Speter# 9195509SruTGTS= all all-man buildkernel buildworld checkdpadd clean \ 9295793Sru cleandepend cleandir depend distribute distributeworld everything \ 9397252Sru hierarchy install installcheck installkernel \ 9496164Sru reinstallkernel installmost installworld libraries lint maninstall \ 9595146Sgshapiro mk most obj objlink regress rerelease tags update 962061Sjkh 9797769SruBITGTS= files includes 9897252SruBITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/} 9997252Sru 10095730Sru.ORDER: buildworld installworld 10195793Sru.ORDER: buildworld distributeworld 10295730Sru.ORDER: buildkernel installkernel 10395730Sru.ORDER: buildkernel reinstallkernel 10495730Sru 10555026SmarcelPATH= /sbin:/bin:/usr/sbin:/usr/bin 10655026SmarcelMAKE= PATH=${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1 10754324Smarcel 10817308Speter# 10938666Sjb# Handle the user-driven targets, using the source relative mk files. 11017308Speter# 11197252Sru${TGTS} ${BITGTS}: upgrade_checks 11238666Sjb @cd ${.CURDIR}; \ 11354324Smarcel ${MAKE} ${.TARGET} 1142302Spaul 11539206Sjkh# Set a reasonable default 11639206Sjkh.MAIN: all 11739206Sjkh 11873349SruSTARTTIME!= LC_ALL=C date 11917308Speter# 12054324Smarcel# world 12154324Smarcel# 12254324Smarcel# Attempt to rebuild and reinstall *everything*, with reasonable chance of 12354324Smarcel# success, regardless of how old your existing system is. 12454324Smarcel# 12554324Smarcelworld: upgrade_checks 12654324Smarcel @echo "--------------------------------------------------------------" 127103436Speter @echo ">>> elf make world started on ${STARTTIME}" 12854324Smarcel @echo "--------------------------------------------------------------" 12954324Smarcel.if target(pre-world) 13054324Smarcel @echo 13154324Smarcel @echo "--------------------------------------------------------------" 13254324Smarcel @echo ">>> Making 'pre-world' target" 13354324Smarcel @echo "--------------------------------------------------------------" 13454324Smarcel @cd ${.CURDIR}; ${MAKE} pre-world 13554324Smarcel.endif 13654324Smarcel @cd ${.CURDIR}; ${MAKE} buildworld 13754324Smarcel @cd ${.CURDIR}; ${MAKE} -B installworld 13854324Smarcel.if target(post-world) 13954324Smarcel @echo 14054324Smarcel @echo "--------------------------------------------------------------" 14154324Smarcel @echo ">>> Making 'post-world' target" 14254324Smarcel @echo "--------------------------------------------------------------" 14354324Smarcel @cd ${.CURDIR}; ${MAKE} post-world 14454324Smarcel.endif 14554324Smarcel @echo 14654324Smarcel @echo "--------------------------------------------------------------" 147103436Speter @printf ">>> elf make world completed on `LC_ALL=C date`\n (started ${STARTTIME})\n" 14854324Smarcel @echo "--------------------------------------------------------------" 14954324Smarcel 15054324Smarcel# 15195730Sru# kernel 15295730Sru# 15395730Sru# Short hand for `make buildkernel installkernel' 15495730Sru# 15595730Srukernel: buildkernel installkernel 15695730Sru 15795730Sru# 15838666Sjb# Perform a few tests to determine if the installed tools are adequate 15938666Sjb# for building the world. These are for older systems (prior to 2.2.5). 16017308Speter# 16138666Sjb# From 2.2.5 onwards, the installed tools will pass these upgrade tests, 16238666Sjb# so the normal make world is capable of doing what is required to update 16338666Sjb# the system to current. 16417308Speter# 16555678Smarcelupgrade_checks: 16655678Smarcel @cd ${.CURDIR}; \ 167100402Sru if ! make -m ${.CURDIR}/share/mk -Dnotdef test >/dev/null 2>&1; then \ 168100402Sru make make; \ 169100402Sru fi 17090395Sru @cd ${.CURDIR}; \ 171100402Sru if make -V .CURDIR:C/.// 2>&1 >/dev/null | \ 172100402Sru grep -q "Unknown modifier 'C'"; then \ 173100402Sru make make; \ 174100402Sru fi 1752061Sjkh 17617308Speter# 17738666Sjb# A simple test target used as part of the test to see if make supports 178100401Sru# the -m argument. Also test that make will only evaluate a conditional 179100401Sru# as far as is necessary to determine its value. 18017308Speter# 18155678Smarceltest: 182100401Sru.if defined(notdef) 183100401Sru.undef notdef 184100401Sru.if defined(notdef) && ${notdef:U} 185100401Sru.endif 186100401Sru.endif 1873626Swollman 18817308Speter# 18955678Smarcel# Upgrade the installed make to the current version using the installed 19055678Smarcel# headers, libraries and build tools. This is required on installed versions 19155678Smarcel# prior to 2.2.5 in which the installed make doesn't support the -m argument. 19255678Smarcel# 19355678Smarcelmake: 19455678Smarcel @echo 19555678Smarcel @echo "--------------------------------------------------------------" 19655678Smarcel @echo " Upgrading the installed make" 19755678Smarcel @echo "--------------------------------------------------------------" 19855678Smarcel @cd ${.CURDIR}/usr.bin/make; \ 199102692Speter make obj && make -D_UPGRADING depend && \ 200102692Speter make -D_UPGRADING all && make install 20155678Smarcel 20255678Smarcel# 20338666Sjb# Define the upgrade targets. These are listed here in alphabetical 20438666Sjb# order, but that's not important. 20517308Speter# 20655678SmarcelUPGRADE= aout-to-elf aout-to-elf-build aout-to-elf-install \ 20738978Sjb move-aout-libs 2083626Swollman 20917308Speter# 21038666Sjb# Handle the upgrade targets, using the source relative mk files. 21117308Speter# 21243226Sjkh 21343226Sjkhupgrade: aout-to-elf 21443226Sjkh 21538666Sjb${UPGRADE} : upgrade_checks 21638666Sjb @cd ${.CURDIR}; \ 21744103Smsmith ${MAKE} -f Makefile.upgrade -m ${.CURDIR}/share/mk ${.TARGET} 218103985Sphk 219103985Sphk 220103985Sphkuniverse: 221103985Sphk @echo "--------------------------------------------------------------" 222103985Sphk @echo ">>> make universe started on ${STARTTIME}" 223103985Sphk @echo "--------------------------------------------------------------" 224104370Sphk.for arch in i386 sparc64 alpha ia64 225103985Sphk @printf ">> ${arch} started on `LC_ALL=C date`\n" 226103985Sphk -cd ${.CURDIR} && make ${JFLAG} buildworld TARGET_ARCH=${arch} \ 227103985Sphk __MAKE_CONF=/dev/null \ 228103985Sphk > _.${arch}.buildworld 2>&1 229103985Sphk @printf ">> ${arch} buildworld ended on `LC_ALL=C date`\n" 230104277Sphk.if exists(${.CURDIR}/sys/${arch}/conf/NOTES) 231104277Sphk -cd ${.CURDIR}/sys/${arch}/conf && make LINT \ 232103985Sphk > _.${arch}.makeLINT 2>&1 233103985Sphk.endif 234103985Sphk cd ${.CURDIR} && make buildkernels TARGET_ARCH=${arch} JFLAG="${JFLAG}" 235103985Sphk @printf ">> ${arch} ended on `LC_ALL=C date`\n" 236103985Sphk.endfor 237104370Sphk -cd ${.CURDIR} && make buildworld TARGET=pc98 TARGET_ARCH=i386 \ 238104370Sphk __MAKE_CONF=/dev/null \ 239104370Sphk > _.pc98.buildworld 2>&1 240103985Sphk @echo "--------------------------------------------------------------" 241103985Sphk @printf ">>> make universe completed on `LC_ALL=C date`\n (started ${STARTTIME})\n" 242103985Sphk @echo "--------------------------------------------------------------" 243103985Sphk 244103985SphkKERNCONFS != echo ${.CURDIR}/sys/${TARGET_ARCH}/conf/[A-Z]* 245103985SphkKERNCONF2 = ${KERNCONFS:T:N*[a-z]*:NCVS:NNOTES} 246103985Sphk 247103985Sphkbuildkernels: 248103985Sphk.for kernel in ${KERNCONF2} 249103985Sphk.if exists(${.CURDIR}/sys/${TARGET_ARCH}/conf/${kernel}) 250103985Sphk -cd ${.CURDIR} && make ${JFLAG} buildkernel \ 251103985Sphk TARGET_ARCH=${TARGET_ARCH} KERNCONF=${kernel} \ 252103985Sphk __MAKE_CONF=/dev/null \ 253103985Sphk > _.${TARGET_ARCH}.${kernel} 2>&1 254103985Sphk.endif 255103985Sphk.endfor 256103985Sphk 257