Makefile revision 38752
12061Sjkh# 238719Sjb# $Id: Makefile,v 1.211 1998/08/31 01:08:08 jb Exp $ 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. 1038666Sjb# update - Convenient way to update your source tree (cvs). 1138666Sjb# most - Build user commands, no libraries or include files. 1238666Sjb# installmost - Install user commands, no libraries or include files. 1338666Sjb# aout-to-elf - Upgrade an system from a.out to elf format (see below). 1438666Sjb# aout-to-elf-build - Build everything required to upgrade a system from 1538666Sjb# a.out to elf format (see below). 1638666Sjb# aout-to-elf-install - Install everything built by aout-to-elf-build (see 1738666Sjb# below). 1832427Sjb# 1938666Sjb# This makefile is simple by design. The FreeBSD make automatically reads 2038666Sjb# the /usr/share/mk/sys.mk unless the -m argument is specified on the 2138666Sjb# command line. By keeping this makefile simple, it doesn't matter too 2238666Sjb# much how different the installed mk files are from those in the source 2338666Sjb# tree. This makefile executes a child make process, forcing it to use 2438666Sjb# the mk files from the source tree which are supposed to DTRT. 2517308Speter# 2638666Sjb# The user-driven targets (as listed above) are implemented in Makefile.inc0 2738666Sjb# and the private targets are in Makefile.inc1. These are kept separate 2838666Sjb# to help the bootstrap build from aout to elf format. 2919175Sbde# 3038666Sjb# For novices wanting to build from current sources, the simple instructions 3138666Sjb# are: 3238042Sbde# 3338666Sjb# 1. Ensure that your /usr/obj directory has at least 165 Mb of free space. 3438666Sjb# 2. `cd /usr/src' (or to the directory containing your source tree). 3538666Sjb# 3. `make world' 3638042Sbde# 3738666Sjb# Be warned, this will update your installed system, except for configuration 3838666Sjb# files in the /etc directory. You have to do those manually. 3917308Speter# 4038666Sjb# If at first you're a little nervous about having a `make world' update 4138666Sjb# your system, a `make buildworld' will build everything in the /usr/obj 4238666Sjb# tree without touching your installed system. To be of any further use 4338666Sjb# though, a `make installworld' is required. 4417308Speter# 4538666Sjb# The `make world' process always follows the installed object format. 4638666Sjb# This is set by creating /etc/objformat containing either OBJFORMAT=aout 4738666Sjb# or OBJFORMAT=elf. If this file does not exist, the object format defaults 4838666Sjb# to aout. This is expected to be changed to elf just prior to the release 4938666Sjb# or 3.0. If OBJFORMAT is set as an environment variable or in /etc/make.conf, 5038666Sjb# this overrides /etc/objformat. 5117308Speter# 5238666Sjb# Unless -DNOAOUT is specified, a `make world' with OBJFORMAT=elf will 5338666Sjb# update the legacy support for aout. This includes all libraries, ld.so, 5438666Sjb# lkms 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 5638666Sjb# release of 3.1. 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# 6438666Sjb# The aout->elf transition build is performed by doing a `make aout-to-elf' 6538666Sjb# or a `make aout-to-elf-build' followed by a `make aout-to-elf-install'. 6638666Sjb# You need to have at least 320 Mb of free space for the object tree. 6727910Sasami# 6838666Sjb# The upgrade process checks the installed release. If this is 3.0-CURRENT, 6938666Sjb# it is assumed that your kernel contains all the syscalls required by the 7038666Sjb# current sources. 7127910Sasami# 7238666Sjb# For installed systems where `uname -r' reports something other than 7338666Sjb# 3.0-CURRENT, the upgrade process expects to build a kernel using the 7438666Sjb# kernel configuration file sys/i386/conf/GENERICupgrade. This file is 7538666Sjb# defaulted to the GENERIC kernel configuration file on the assumption that 7638666Sjb# it will be suitable for most systems. Before performing the upgrade, 7738666Sjb# replace sys/i386/conf/GENERICupgrade with your own version if your 7838666Sjb# hardware requires a different configuration. 7917308Speter# 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 8238666Sjb# upgrade. 8327910Sasami# 8438666Sjb# At the end of the upgrade procedure, /etc/objformat is created or 8538666Sjb# updated to contain OBJFORMAT=elf. From then on, you're elf by default. 8627910Sasami# 8738666Sjb# ---------------------------------------------------------------------------- 8827910Sasami# 8917308Speter# 9038666Sjb# Define the user-driven targets. These are listed here in alphabetical 9138666Sjb# order, but that's not important. 9217308Speter# 9338719SjbTGTS = all buildworld clean cleandepend cleanobj depend everything \ 9438719Sjb includes installmost install installworld most obj update world 952061Sjkh 9617308Speter# 9738666Sjb# Handle the user-driven targets, using the source relative mk files. 9817308Speter# 9938666Sjb${TGTS} : upgrade_checks 10038666Sjb @cd ${.CURDIR}; \ 10138666Sjb make -f Makefile.inc0 -m ${.CURDIR}/share/mk ${.TARGET} 1022302Spaul 10317308Speter# 10438666Sjb# Perform a few tests to determine if the installed tools are adequate 10538666Sjb# for building the world. These are for older systems (prior to 2.2.5). 10617308Speter# 10738666Sjb# From 2.2.5 onwards, the installed tools will pass these upgrade tests, 10838666Sjb# so the normal make world is capable of doing what is required to update 10938666Sjb# the system to current. 11017308Speter# 11138666Sjbupgrade_checks : 11238666Sjb @cd ${.CURDIR}; if `make -m ${.CURDIR}/share/mk test > /dev/null 2>&1`; then ok=1; else make -f Makefile.upgrade make; fi; 1132061Sjkh 11417308Speter# 11538666Sjb# A simple test target used as part of the test to see if make supports 11638666Sjb# the -m argument. 11717308Speter# 11838666Sjbtest : 1193626Swollman 12017308Speter# 12138666Sjb# Define the upgrade targets. These are listed here in alphabetical 12238666Sjb# order, but that's not important. 12317308Speter# 12438666SjbUPGRADE = aout-to-elf aout-to-elf-build aout-to-elf-install 1253626Swollman 12617308Speter# 12738666Sjb# Handle the upgrade targets, using the source relative mk files. 12817308Speter# 12938666Sjb${UPGRADE} : upgrade_checks 13038666Sjb @cd ${.CURDIR}; \ 13138666Sjb make -f Makefile.upgrade -m ${.CURDIR}/share/mk ${.TARGET} 132