Makefile revision 68428
1238104Sdes# 2238104Sdes# $FreeBSD: head/Makefile 68428 2000-11-07 08:47:11Z jkh $ 3238104Sdes# 4238104Sdes# The user-driven targets are: 5238104Sdes# 6238104Sdes# buildworld - Rebuild *everything*, including glue to help do 7238104Sdes# upgrades. 8238104Sdes# installworld - Install everything built by "buildworld". 9238104Sdes# world - buildworld + installworld. 10238104Sdes# buildkernel - Rebuild the kernel and the kernel-modules. 11238104Sdes# installkernel - Install the kernel and the kernel-modules. 12238104Sdes# reinstallkernel - Reinstall the kernel and the kernel-modules. 13238104Sdes# update - Convenient way to update your source tree (cvs). 14238104Sdes# upgrade - Upgrade a.out (2.2.x/3.0) system to the new ELF way 15238104Sdes# most - Build user commands, no libraries or include files. 16238104Sdes# installmost - Install user commands, no libraries or include files. 17238104Sdes# aout-to-elf - Upgrade an system from a.out to elf format (see below). 18238104Sdes# aout-to-elf-build - Build everything required to upgrade a system from 19238104Sdes# a.out to elf format (see below). 20238104Sdes# aout-to-elf-install - Install everything built by aout-to-elf-build (see 21238104Sdes# below). 22238104Sdes# move-aout-libs - Move the a.out libraries into an aout sub-directory 23238104Sdes# of each elf library sub-directory. 24238104Sdes# 25238104Sdes# This makefile is simple by design. The FreeBSD make automatically reads 26238104Sdes# the /usr/share/mk/sys.mk unless the -m argument is specified on the 27238104Sdes# command line. By keeping this makefile simple, it doesn't matter too 28238104Sdes# much how different the installed mk files are from those in the source 29238104Sdes# tree. This makefile executes a child make process, forcing it to use 30238104Sdes# the mk files from the source tree which are supposed to DTRT. 31238104Sdes# 32238104Sdes# The user-driven targets (as listed above) are implemented in Makefile.inc0 33238104Sdes# and the private targets are in Makefile.inc1. These are kept separate 34238104Sdes# to help the bootstrap build from aout to elf format. 35238104Sdes# 36238104Sdes# For novices wanting to build from current sources, the simple instructions 37238104Sdes# are: 38238104Sdes# 39238104Sdes# 1. Ensure that your /usr/obj directory has at least 260 Mb of free space. 40238104Sdes# 2. `cd /usr/src' (or to the directory containing your source tree). 41238104Sdes# 3. `make world' 42238104Sdes# 43238104Sdes# Be warned, this will update your installed system, except for configuration 44238104Sdes# files in the /etc directory and for the kernel. You have to do those manually. 45238104Sdes# 46238104Sdes# If at first you're a little nervous about having a `make world' update 47238104Sdes# your system, a `make buildworld' will build everything in the /usr/obj 48238104Sdes# tree without touching your installed system. To be of any further use 49238104Sdes# though, a `make installworld' is required. 50238104Sdes# 51238104Sdes# If -DWANT_AOUT is specified, a `make world' with OBJFORMAT=elf will 52238104Sdes# update the legacy support for aout. This includes all libraries, ld.so 53238104Sdes# and boot objects. This part of build should be regarded as 54238104Sdes# deprecated and you should _not_ expect to be able to do this past the 55238104Sdes# release of 4.0. You have exactly one major release to move entirely 56238104Sdes# to elf. 57238104Sdes# 58238104Sdes# ---------------------------------------------------------------------------- 59238104Sdes# 60238104Sdes# Upgrading an i386 system from a.out to elf format 61238104Sdes# 62238104Sdes# 63238104Sdes# The aout->elf transition build is performed by doing a `make upgrade' (or 64238104Sdes# `make aout-to-elf') or in two steps by a `make aout-to-elf-build' followed 65238104Sdes# by a `make aout-to-elf-install', depending on user preference. 66238104Sdes# You need to have at least 320 Mb of free space for the object tree. 67238104Sdes# 68238104Sdes# The upgrade process checks the installed release. If this is 3.0-CURRENT, 69238104Sdes# it is assumed that your kernel contains all the syscalls required by the 70238104Sdes# current sources. 71238104Sdes# 72238104Sdes# The upgrade procedure will stop and ask for confirmation to proceed 73238104Sdes# several times. On each occasion, you can type Ctrl-C to abort the 74238104Sdes# upgrade. Optionally, you can also start it with NOCONFIRM=yes and skip 75238104Sdes# the confirmation steps. 76238104Sdes# 77238104Sdes# At the end of the upgrade procedure, /etc/objformat is created or 78238104Sdes# updated to contain OBJFORMAT=elf. From then on, you're elf by default. 79238104Sdes# 80238104Sdes# ---------------------------------------------------------------------------- 81238104Sdes# 82238104Sdes# 83238104Sdes# Define the user-driven targets. These are listed here in alphabetical 84238104Sdes# order, but that's not important. 85238104Sdes# 86238104SdesTGTS= afterdistribute all buildkernel buildworld checkdpadd clean \ 87238104Sdes cleandepend cleandir depend distribute everything hierarchy includes \ 88238104Sdes install installkernel reinstallkernel installmost installworld \ 89238104Sdes libraries lint maninstall mk most obj objlink regress rerelease \ 90238104Sdes tags update 91238104Sdes 92238104SdesPATH= /sbin:/bin:/usr/sbin:/usr/bin 93238104SdesMAKE= PATH=${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1 94238104Sdes 95238104Sdes# 96238104Sdes# Handle the user-driven targets, using the source relative mk files. 97238104Sdes# 98238104Sdes${TGTS}: upgrade_checks 99238104Sdes @cd ${.CURDIR}; \ 100238104Sdes ${MAKE} ${.TARGET} 101238104Sdes 102238104Sdes# Set a reasonable default 103238104Sdes.MAIN: all 104238104Sdes 105238104Sdes# 106238104Sdes# world 107238104Sdes# 108238104Sdes# Attempt to rebuild and reinstall *everything*, with reasonable chance of 109238104Sdes# success, regardless of how old your existing system is. 110238104Sdes# 111238104Sdesworld: upgrade_checks 112238104Sdes @echo "--------------------------------------------------------------" 113238104Sdes @echo ">>> ${OBJFORMAT} make world started on `LC_TIME=C date`" 114238104Sdes @echo "--------------------------------------------------------------" 115238104Sdes.if target(pre-world) 116238104Sdes @echo 117238104Sdes @echo "--------------------------------------------------------------" 118238104Sdes @echo ">>> Making 'pre-world' target" 119238104Sdes @echo "--------------------------------------------------------------" 120238104Sdes @cd ${.CURDIR}; ${MAKE} pre-world 121238104Sdes.endif 122238104Sdes @cd ${.CURDIR}; ${MAKE} buildworld 123238104Sdes @cd ${.CURDIR}; ${MAKE} -B installworld 124238104Sdes.if target(post-world) 125238104Sdes @echo 126238104Sdes @echo "--------------------------------------------------------------" 127238104Sdes @echo ">>> Making 'post-world' target" 128238104Sdes @echo "--------------------------------------------------------------" 129238104Sdes @cd ${.CURDIR}; ${MAKE} post-world 130238104Sdes.endif 131238104Sdes @echo 132238104Sdes @echo "--------------------------------------------------------------" 133238104Sdes @echo ">>> ${OBJFORMAT} make world completed on `LC_TIME=C date`" 134238104Sdes @echo "--------------------------------------------------------------" 135238104Sdes 136238104Sdes# 137238104Sdes# Perform a few tests to determine if the installed tools are adequate 138238104Sdes# for building the world. These are for older systems (prior to 2.2.5). 139238104Sdes# 140238104Sdes# From 2.2.5 onwards, the installed tools will pass these upgrade tests, 141238104Sdes# so the normal make world is capable of doing what is required to update 142238104Sdes# the system to current. 143238104Sdes# 144238104Sdesupgrade_checks: 145238104Sdes @cd ${.CURDIR}; \ 146238104Sdes if ! make -m ${.CURDIR}/share/mk test > /dev/null 2>&1; then \ 147238104Sdes make make; \ 148238104Sdes fi 149238104Sdes 150238104Sdes# 151238104Sdes# A simple test target used as part of the test to see if make supports 152238104Sdes# the -m argument. 153238104Sdes# 154238104Sdestest: 155238104Sdes 156238104Sdes# 157238104Sdes# Upgrade the installed make to the current version using the installed 158238104Sdes# headers, libraries and build tools. This is required on installed versions 159238104Sdes# prior to 2.2.5 in which the installed make doesn't support the -m argument. 160238104Sdes# 161238104Sdesmake: 162238104Sdes @echo 163238104Sdes @echo "--------------------------------------------------------------" 164238104Sdes @echo " Upgrading the installed make" 165238104Sdes @echo "--------------------------------------------------------------" 166238104Sdes @cd ${.CURDIR}/usr.bin/make; \ 167238104Sdes make obj && make depend && make all && make install 168238104Sdes 169238104Sdes# 170238104Sdes# Define the upgrade targets. These are listed here in alphabetical 171238104Sdes# order, but that's not important. 172238104Sdes# 173238104SdesUPGRADE= aout-to-elf aout-to-elf-build aout-to-elf-install \ 174238104Sdes move-aout-libs 175238104Sdes 176238104Sdes# 177238104Sdes# Handle the upgrade targets, using the source relative mk files. 178238104Sdes# 179238104Sdes 180238104Sdesupgrade: aout-to-elf 181238104Sdes 182238104Sdes${UPGRADE} : upgrade_checks 183238104Sdes @cd ${.CURDIR}; \ 184238104Sdes ${MAKE} -f Makefile.upgrade -m ${.CURDIR}/share/mk ${.TARGET} 185238104Sdes