Makefile revision 50479
12061Sjkh#
250479Speter# $FreeBSD: head/Makefile 50479 1999-08-28 01:35:59Z peter $
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).
1144918Sjkh# upgrade             - Upgrade a.out (2.2.x/3.0) system to the new ELF way
1238666Sjb# most                - Build user commands, no libraries or include files.
1338666Sjb# installmost         - Install user commands, no libraries or include files.
1438666Sjb# aout-to-elf         - Upgrade an system from a.out to elf format (see below).
1538666Sjb# aout-to-elf-build   - Build everything required to upgrade a system from
1638666Sjb#                       a.out to elf format (see below).
1738666Sjb# aout-to-elf-install - Install everything built by aout-to-elf-build (see
1838666Sjb#                       below).
1938978Sjb# move-aout-libs      - Move the a.out libraries into an aout sub-directory
2038978Sjb#                       of each elf library sub-directory.
2132427Sjb#
2238666Sjb# This makefile is simple by design. The FreeBSD make automatically reads
2338666Sjb# the /usr/share/mk/sys.mk unless the -m argument is specified on the 
2438666Sjb# command line. By keeping this makefile simple, it doesn't matter too
2538666Sjb# much how different the installed mk files are from those in the source
2638666Sjb# tree. This makefile executes a child make process, forcing it to use
2738666Sjb# the mk files from the source tree which are supposed to DTRT.
2817308Speter#
2938666Sjb# The user-driven targets (as listed above) are implemented in Makefile.inc0
3038666Sjb# and the private targets are in Makefile.inc1. These are kept separate
3138666Sjb# to help the bootstrap build from aout to elf format.
3219175Sbde#
3338666Sjb# For novices wanting to build from current sources, the simple instructions
3438666Sjb# are:
3538042Sbde#
3639726Sjb# 1.  Ensure that your /usr/obj directory has at least 260 Mb of free space.
3738666Sjb# 2.  `cd /usr/src'  (or to the directory containing your source tree).
3838666Sjb# 3.  `make world'
3938042Sbde#
4038666Sjb# Be warned, this will update your installed system, except for configuration
4149315Shoek# files in the /etc directory and for the kernel. You have to do those manually.
4217308Speter#
4338666Sjb# If at first you're a little nervous about having a `make world' update
4438666Sjb# your system, a `make buildworld' will build everything in the /usr/obj
4538666Sjb# tree without touching your installed system. To be of any further use
4638666Sjb# though, a `make installworld' is required.
4717308Speter#
4838666Sjb# The `make world' process always follows the installed object format.
4938666Sjb# This is set by creating /etc/objformat containing either OBJFORMAT=aout
5038666Sjb# or OBJFORMAT=elf. If this file does not exist, the object format defaults
5138666Sjb# to aout. This is expected to be changed to elf just prior to the release
5238666Sjb# or 3.0. If OBJFORMAT is set as an environment variable or in /etc/make.conf,
5338666Sjb# this overrides /etc/objformat.
5417308Speter#
5545108Sobrien# If -DWANT_AOUT is specified, a `make world' with OBJFORMAT=elf will
5642128Speter# update the legacy support for aout. This includes all libraries, ld.so
5742128Speter# and boot objects. This part of build should be regarded as
5838666Sjb# deprecated and you should _not_ expect to be able to do this past the
5938666Sjb# release of 3.1. You have exactly one major release to move entirely
6038666Sjb# to elf.
6117308Speter#
6238666Sjb# ----------------------------------------------------------------------------
6317308Speter#
6438666Sjb#           Upgrading an i386 system from a.out to elf format
6517308Speter#
6627910Sasami#
6743226Sjkh# The aout->elf transition build is performed by doing a `make upgrade' (or
6843226Sjkh# `make aout-to-elf') or in two steps by a `make aout-to-elf-build' followed
6943226Sjkh# by a `make aout-to-elf-install', depending on user preference.
7038666Sjb# You need to have at least 320 Mb of free space for the object tree.
7127910Sasami#
7238666Sjb# The upgrade process checks the installed release. If this is 3.0-CURRENT,
7338666Sjb# it is assumed that your kernel contains all the syscalls required by the
7438666Sjb# current sources.
7527910Sasami#
7638666Sjb# The upgrade procedure will stop and ask for confirmation to proceed
7738666Sjb# several times. On each occasion, you can type Ctrl-C to abort the
7843226Sjkh# upgrade.  Optionally, you can also start it with NOCONFIRM=yes and skip
7943226Sjkh# the confirmation steps.
8027910Sasami#
8138666Sjb# At the end of the upgrade procedure, /etc/objformat is created or
8238666Sjb# updated to contain OBJFORMAT=elf. From then on, you're elf by default.
8327910Sasami#
8438666Sjb# ----------------------------------------------------------------------------
8527910Sasami#
8617308Speter#
8738666Sjb# Define the user-driven targets. These are listed here in alphabetical
8838666Sjb# order, but that's not important.
8917308Speter#
9040495SbdeTGTS =	afterdistribute all buildworld checkdpadd clean cleandepend cleandir \
9140495Sbde	depend distribute everything hierarchy includes install installmost \
9240495Sbde	installworld lint maninstall mk most obj objlink regress rerelease \
9340495Sbde	tags update world
942061Sjkh
9517308Speter#
9638666Sjb# Handle the user-driven targets, using the source relative mk files.
9717308Speter#
9838666Sjb${TGTS} : upgrade_checks
9938666Sjb	@cd ${.CURDIR}; \
10044103Smsmith		${MAKE} -f Makefile.inc0 -m ${.CURDIR}/share/mk ${.TARGET}
1012302Spaul
10239206Sjkh# Set a reasonable default
10339206Sjkh.MAIN:	all
10439206Sjkh
10517308Speter#
10638666Sjb# Perform a few tests to determine if the installed tools are adequate
10738666Sjb# for building the world. These are for older systems (prior to 2.2.5).
10817308Speter#
10938666Sjb# From 2.2.5 onwards, the installed tools will pass these upgrade tests,
11038666Sjb# so the normal make world is capable of doing what is required to update
11138666Sjb# the system to current.
11217308Speter#
11338666Sjbupgrade_checks :
11444103Smsmith	@cd ${.CURDIR}; if `make -m ${.CURDIR}/share/mk test > /dev/null 2>&1`; then ok=1; else ${MAKE} -f Makefile.upgrade make; fi;
1152061Sjkh
11617308Speter#
11738666Sjb# A simple test target used as part of the test to see if make supports
11838666Sjb# the -m argument.
11917308Speter#
12038666Sjbtest	:
1213626Swollman
12217308Speter#
12338666Sjb# Define the upgrade targets. These are listed here in alphabetical
12438666Sjb# order, but that's not important.
12517308Speter#
12638978SjbUPGRADE =	aout-to-elf aout-to-elf-build aout-to-elf-install \
12738978Sjb		move-aout-libs
1283626Swollman
12917308Speter#
13038666Sjb# Handle the upgrade targets, using the source relative mk files.
13117308Speter#
13243226Sjkh
13343226Sjkhupgrade:	aout-to-elf
13443226Sjkh
13538666Sjb${UPGRADE} : upgrade_checks
13638666Sjb	@cd ${.CURDIR}; \
13744103Smsmith		${MAKE} -f Makefile.upgrade -m ${.CURDIR}/share/mk ${.TARGET}
138