Makefile revision 39726
1246117Skib# 2246117Skib# $Id: Makefile,v 1.218 1998/09/15 05:10:17 jkh Exp $ 3246117Skib# 4246117Skib# The user-driven targets are: 5246117Skib# 6246117Skib# buildworld - Rebuild *everything*, including glue to help do 7246117Skib# upgrades. 8246117Skib# installworld - Install everything built by "buildworld". 9246117Skib# world - buildworld + installworld. 10246117Skib# update - Convenient way to update your source tree (cvs). 11246117Skib# most - Build user commands, no libraries or include files. 12246117Skib# installmost - Install user commands, no libraries or include files. 13246117Skib# aout-to-elf - Upgrade an system from a.out to elf format (see below). 14246117Skib# aout-to-elf-build - Build everything required to upgrade a system from 15246117Skib# a.out to elf format (see below). 16246117Skib# aout-to-elf-install - Install everything built by aout-to-elf-build (see 17246117Skib# below). 18246117Skib# move-aout-libs - Move the a.out libraries into an aout sub-directory 19246117Skib# of each elf library sub-directory. 20246117Skib# 21246117Skib# This makefile is simple by design. The FreeBSD make automatically reads 22246117Skib# the /usr/share/mk/sys.mk unless the -m argument is specified on the 23246117Skib# command line. By keeping this makefile simple, it doesn't matter too 24246117Skib# much how different the installed mk files are from those in the source 25246117Skib# tree. This makefile executes a child make process, forcing it to use 26246117Skib# the mk files from the source tree which are supposed to DTRT. 27246117Skib# 28246117Skib# The user-driven targets (as listed above) are implemented in Makefile.inc0 29246117Skib# and the private targets are in Makefile.inc1. These are kept separate 30246117Skib# to help the bootstrap build from aout to elf format. 31246117Skib# 32246117Skib# For novices wanting to build from current sources, the simple instructions 33246117Skib# are: 34246117Skib# 35246117Skib# 1. Ensure that your /usr/obj directory has at least 260 Mb of free space. 36246117Skib# 2. `cd /usr/src' (or to the directory containing your source tree). 37246117Skib# 3. `make world' 38246117Skib# 39246117Skib# Be warned, this will update your installed system, except for configuration 40246117Skib# files in the /etc directory. You have to do those manually. 41246117Skib# 42246117Skib# If at first you're a little nervous about having a `make world' update 43246117Skib# your system, a `make buildworld' will build everything in the /usr/obj 44246117Skib# tree without touching your installed system. To be of any further use 45246117Skib# though, a `make installworld' is required. 46246117Skib# 47246117Skib# The `make world' process always follows the installed object format. 48246117Skib# This is set by creating /etc/objformat containing either OBJFORMAT=aout 49# or OBJFORMAT=elf. If this file does not exist, the object format defaults 50# to aout. This is expected to be changed to elf just prior to the release 51# or 3.0. If OBJFORMAT is set as an environment variable or in /etc/make.conf, 52# this overrides /etc/objformat. 53# 54# Unless -DNOAOUT is specified, a `make world' with OBJFORMAT=elf will 55# update the legacy support for aout. This includes all libraries, ld.so, 56# lkms and boot objects. This part of build should be regarded as 57# deprecated and you should _not_ expect to be able to do this past the 58# release of 3.1. You have exactly one major release to move entirely 59# to elf. 60# 61# ---------------------------------------------------------------------------- 62# 63# Upgrading an i386 system from a.out to elf format 64# 65# 66# The aout->elf transition build is performed by doing a `make aout-to-elf' 67# or a `make aout-to-elf-build' followed by a `make aout-to-elf-install'. 68# You need to have at least 320 Mb of free space for the object tree. 69# 70# The upgrade process checks the installed release. If this is 3.0-CURRENT, 71# it is assumed that your kernel contains all the syscalls required by the 72# current sources. 73# 74# For installed systems where `uname -r' reports something other than 75# 3.0-CURRENT, the upgrade process expects to build a kernel using the 76# kernel configuration file sys/i386/conf/GENERICupgrade. This file is 77# defaulted to the GENERIC kernel configuration file on the assumption that 78# it will be suitable for most systems. Before performing the upgrade, 79# replace sys/i386/conf/GENERICupgrade with your own version if your 80# hardware requires a different configuration. 81# 82# The upgrade procedure will stop and ask for confirmation to proceed 83# several times. On each occasion, you can type Ctrl-C to abort the 84# upgrade. 85# 86# At the end of the upgrade procedure, /etc/objformat is created or 87# updated to contain OBJFORMAT=elf. From then on, you're elf by default. 88# 89# ---------------------------------------------------------------------------- 90# 91# 92# Define the user-driven targets. These are listed here in alphabetical 93# order, but that's not important. 94# 95TGTS = afterdistribute all buildworld clean cleandepend cleanobj depend \ 96 distribute everything hierarchy includes installmost install \ 97 installworld most obj rerelease update world 98 99# 100# Handle the user-driven targets, using the source relative mk files. 101# 102${TGTS} : upgrade_checks 103 @cd ${.CURDIR}; \ 104 make -f Makefile.inc0 -m ${.CURDIR}/share/mk ${.TARGET} 105 106# Set a reasonable default 107.MAIN: all 108 109# 110# Perform a few tests to determine if the installed tools are adequate 111# for building the world. These are for older systems (prior to 2.2.5). 112# 113# From 2.2.5 onwards, the installed tools will pass these upgrade tests, 114# so the normal make world is capable of doing what is required to update 115# the system to current. 116# 117upgrade_checks : 118 @cd ${.CURDIR}; if `make -m ${.CURDIR}/share/mk test > /dev/null 2>&1`; then ok=1; else make -f Makefile.upgrade make; fi; 119 120# 121# A simple test target used as part of the test to see if make supports 122# the -m argument. 123# 124test : 125 126# 127# Define the upgrade targets. These are listed here in alphabetical 128# order, but that's not important. 129# 130UPGRADE = aout-to-elf aout-to-elf-build aout-to-elf-install \ 131 move-aout-libs 132 133# 134# Handle the upgrade targets, using the source relative mk files. 135# 136${UPGRADE} : upgrade_checks 137 @cd ${.CURDIR}; \ 138 make -f Makefile.upgrade -m ${.CURDIR}/share/mk ${.TARGET} 139