Makefile revision 90395
12061Sjkh# 250479Speter# $FreeBSD: head/Makefile 90395 2002-02-08 09:48:34Z ru $ 32061Sjkh# 438666Sjb# The user-driven targets are: 532427Sjb# 638666Sjb# buildworld - Rebuild *everything*, including glue to help do 738666Sjb# upgrades. 838666Sjb# installworld - Install everything built by "buildworld". 938666Sjb# world - buildworld + installworld. 1064049Salex# buildkernel - Rebuild the kernel and the kernel-modules. 1164049Salex# installkernel - Install the kernel and the kernel-modules. 1266071Smarkm# reinstallkernel - Reinstall the kernel and the kernel-modules. 1373504Sobrien# kernel - buildkernel + installkernel. 1438666Sjb# update - Convenient way to update your source tree (cvs). 1544918Sjkh# upgrade - Upgrade a.out (2.2.x/3.0) system to the new ELF way 1638666Sjb# most - Build user commands, no libraries or include files. 1738666Sjb# installmost - Install user commands, no libraries or include files. 1838666Sjb# aout-to-elf - Upgrade an system from a.out to elf format (see below). 1938666Sjb# aout-to-elf-build - Build everything required to upgrade a system from 2038666Sjb# a.out to elf format (see below). 2138666Sjb# aout-to-elf-install - Install everything built by aout-to-elf-build (see 2238666Sjb# below). 2338978Sjb# move-aout-libs - Move the a.out libraries into an aout sub-directory 2438978Sjb# of each elf library sub-directory. 2532427Sjb# 2638666Sjb# This makefile is simple by design. The FreeBSD make automatically reads 2738666Sjb# the /usr/share/mk/sys.mk unless the -m argument is specified on the 2838666Sjb# command line. By keeping this makefile simple, it doesn't matter too 2938666Sjb# much how different the installed mk files are from those in the source 3038666Sjb# tree. This makefile executes a child make process, forcing it to use 3138666Sjb# the mk files from the source tree which are supposed to DTRT. 3217308Speter# 3338666Sjb# The user-driven targets (as listed above) are implemented in Makefile.inc0 3438666Sjb# and the private targets are in Makefile.inc1. These are kept separate 3538666Sjb# to help the bootstrap build from aout to elf format. 3619175Sbde# 3738666Sjb# For novices wanting to build from current sources, the simple instructions 3838666Sjb# are: 3938042Sbde# 4039726Sjb# 1. Ensure that your /usr/obj directory has at least 260 Mb of free space. 4138666Sjb# 2. `cd /usr/src' (or to the directory containing your source tree). 4238666Sjb# 3. `make world' 4338042Sbde# 4438666Sjb# Be warned, this will update your installed system, except for configuration 4549315Shoek# files in the /etc directory and for the kernel. You have to do those manually. 4617308Speter# 4738666Sjb# If at first you're a little nervous about having a `make world' update 4838666Sjb# your system, a `make buildworld' will build everything in the /usr/obj 4938666Sjb# tree without touching your installed system. To be of any further use 5038666Sjb# though, a `make installworld' is required. 5117308Speter# 5245108Sobrien# If -DWANT_AOUT is specified, a `make world' with OBJFORMAT=elf will 5342128Speter# update the legacy support for aout. This includes all libraries, ld.so 5442128Speter# and boot objects. This part of build should be regarded as 5538666Sjb# deprecated and you should _not_ expect to be able to do this past the 5651361Sjb# release of 4.0. You have exactly one major release to move entirely 5738666Sjb# to elf. 5817308Speter# 5938666Sjb# ---------------------------------------------------------------------------- 6017308Speter# 6138666Sjb# Upgrading an i386 system from a.out to elf format 6217308Speter# 6327910Sasami# 6443226Sjkh# The aout->elf transition build is performed by doing a `make upgrade' (or 6543226Sjkh# `make aout-to-elf') or in two steps by a `make aout-to-elf-build' followed 6643226Sjkh# by a `make aout-to-elf-install', depending on user preference. 6738666Sjb# You need to have at least 320 Mb of free space for the object tree. 6827910Sasami# 6938666Sjb# The upgrade process checks the installed release. If this is 3.0-CURRENT, 7038666Sjb# it is assumed that your kernel contains all the syscalls required by the 7138666Sjb# current sources. 7227910Sasami# 7338666Sjb# The upgrade procedure will stop and ask for confirmation to proceed 7438666Sjb# several times. On each occasion, you can type Ctrl-C to abort the 7543226Sjkh# upgrade. Optionally, you can also start it with NOCONFIRM=yes and skip 7643226Sjkh# the confirmation steps. 7727910Sasami# 7838666Sjb# At the end of the upgrade procedure, /etc/objformat is created or 7938666Sjb# updated to contain OBJFORMAT=elf. From then on, you're elf by default. 8027910Sasami# 8138666Sjb# ---------------------------------------------------------------------------- 8227910Sasami# 8317308Speter# 8438666Sjb# Define the user-driven targets. These are listed here in alphabetical 8538666Sjb# order, but that's not important. 8617308Speter# 8774842SruTGTS= afterdistribute all all-man buildkernel buildworld checkdpadd clean \ 8868987Smarcel cleandepend cleandir depend distribute distribworld everything \ 8969496Sjkh hierarchy includes install installkernel kernel reinstallkernel \ 9069496Sjkh installmost installworld libraries lint maninstall mk most obj \ 9169496Sjkh objlink regress rerelease tags update 922061Sjkh 9355026SmarcelPATH= /sbin:/bin:/usr/sbin:/usr/bin 9455026SmarcelMAKE= PATH=${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1 9554324Smarcel 9617308Speter# 9738666Sjb# Handle the user-driven targets, using the source relative mk files. 9817308Speter# 9955678Smarcel${TGTS}: upgrade_checks 10038666Sjb @cd ${.CURDIR}; \ 10154324Smarcel ${MAKE} ${.TARGET} 1022302Spaul 10339206Sjkh# Set a reasonable default 10439206Sjkh.MAIN: all 10539206Sjkh 10673349SruSTARTTIME!= LC_ALL=C date 10717308Speter# 10854324Smarcel# world 10954324Smarcel# 11054324Smarcel# Attempt to rebuild and reinstall *everything*, with reasonable chance of 11154324Smarcel# success, regardless of how old your existing system is. 11254324Smarcel# 11354324Smarcelworld: upgrade_checks 11454324Smarcel @echo "--------------------------------------------------------------" 11569659Sobrien @echo ">>> ${OBJFORMAT} make world started on ${STARTTIME}" 11654324Smarcel @echo "--------------------------------------------------------------" 11754324Smarcel.if target(pre-world) 11854324Smarcel @echo 11954324Smarcel @echo "--------------------------------------------------------------" 12054324Smarcel @echo ">>> Making 'pre-world' target" 12154324Smarcel @echo "--------------------------------------------------------------" 12254324Smarcel @cd ${.CURDIR}; ${MAKE} pre-world 12354324Smarcel.endif 12454324Smarcel @cd ${.CURDIR}; ${MAKE} buildworld 12554324Smarcel @cd ${.CURDIR}; ${MAKE} -B installworld 12654324Smarcel.if target(post-world) 12754324Smarcel @echo 12854324Smarcel @echo "--------------------------------------------------------------" 12954324Smarcel @echo ">>> Making 'post-world' target" 13054324Smarcel @echo "--------------------------------------------------------------" 13154324Smarcel @cd ${.CURDIR}; ${MAKE} post-world 13254324Smarcel.endif 13354324Smarcel @echo 13454324Smarcel @echo "--------------------------------------------------------------" 13573504Sobrien @printf ">>> ${OBJFORMAT} make world completed on `LC_ALL=C date`\n (started ${STARTTIME})\n" 13654324Smarcel @echo "--------------------------------------------------------------" 13754324Smarcel 13854324Smarcel# 13938666Sjb# Perform a few tests to determine if the installed tools are adequate 14038666Sjb# for building the world. These are for older systems (prior to 2.2.5). 14117308Speter# 14238666Sjb# From 2.2.5 onwards, the installed tools will pass these upgrade tests, 14338666Sjb# so the normal make world is capable of doing what is required to update 14438666Sjb# the system to current. 14517308Speter# 14655678Smarcelupgrade_checks: 14755678Smarcel @cd ${.CURDIR}; \ 14855678Smarcel if ! make -m ${.CURDIR}/share/mk test > /dev/null 2>&1; then \ 14955678Smarcel make make; \ 15055678Smarcel fi 15190395Sru @cd ${.CURDIR}; \ 15290395Sru if make -V .CURDIR:C/.// 2>&1 >/dev/null | \ 15390395Sru grep -q "Unknown modifier 'C'"; then \ 15490395Sru make make; \ 15590395Sru fi 1562061Sjkh 15717308Speter# 15838666Sjb# A simple test target used as part of the test to see if make supports 15938666Sjb# the -m argument. 16017308Speter# 16155678Smarceltest: 1623626Swollman 16317308Speter# 16455678Smarcel# Upgrade the installed make to the current version using the installed 16555678Smarcel# headers, libraries and build tools. This is required on installed versions 16655678Smarcel# prior to 2.2.5 in which the installed make doesn't support the -m argument. 16755678Smarcel# 16855678Smarcelmake: 16955678Smarcel @echo 17055678Smarcel @echo "--------------------------------------------------------------" 17155678Smarcel @echo " Upgrading the installed make" 17255678Smarcel @echo "--------------------------------------------------------------" 17355678Smarcel @cd ${.CURDIR}/usr.bin/make; \ 17455678Smarcel make obj && make depend && make all && make install 17555678Smarcel 17655678Smarcel# 17738666Sjb# Define the upgrade targets. These are listed here in alphabetical 17838666Sjb# order, but that's not important. 17917308Speter# 18055678SmarcelUPGRADE= aout-to-elf aout-to-elf-build aout-to-elf-install \ 18138978Sjb move-aout-libs 1823626Swollman 18317308Speter# 18438666Sjb# Handle the upgrade targets, using the source relative mk files. 18517308Speter# 18643226Sjkh 18743226Sjkhupgrade: aout-to-elf 18843226Sjkh 18938666Sjb${UPGRADE} : upgrade_checks 19038666Sjb @cd ${.CURDIR}; \ 19144103Smsmith ${MAKE} -f Makefile.upgrade -m ${.CURDIR}/share/mk ${.TARGET} 192