Deleted Added
full compact
Makefile (64049) Makefile (66071)
1#
1#
2# $FreeBSD: head/Makefile 64049 2000-07-31 09:26:59Z alex $
2# $FreeBSD: head/Makefile 66071 2000-09-19 11:15:40Z markm $
3#
4# The user-driven targets are:
5#
6# buildworld - Rebuild *everything*, including glue to help do
7# upgrades.
8# installworld - Install everything built by "buildworld".
9# world - buildworld + installworld.
10# buildkernel - Rebuild the kernel and the kernel-modules.
11# installkernel - Install the kernel and the kernel-modules.
3#
4# The user-driven targets are:
5#
6# buildworld - Rebuild *everything*, including glue to help do
7# upgrades.
8# installworld - Install everything built by "buildworld".
9# world - buildworld + installworld.
10# buildkernel - Rebuild the kernel and the kernel-modules.
11# installkernel - Install the kernel and the kernel-modules.
12# reinstallkernel - Reinstall the kernel and the kernel-modules.
12# update - Convenient way to update your source tree (cvs).
13# upgrade - Upgrade a.out (2.2.x/3.0) system to the new ELF way
14# most - Build user commands, no libraries or include files.
15# installmost - Install user commands, no libraries or include files.
16# aout-to-elf - Upgrade an system from a.out to elf format (see below).
17# aout-to-elf-build - Build everything required to upgrade a system from
18# a.out to elf format (see below).
19# aout-to-elf-install - Install everything built by aout-to-elf-build (see
20# below).
21# move-aout-libs - Move the a.out libraries into an aout sub-directory
22# of each elf library sub-directory.
23#
24# This makefile is simple by design. The FreeBSD make automatically reads
25# the /usr/share/mk/sys.mk unless the -m argument is specified on the
26# command line. By keeping this makefile simple, it doesn't matter too
27# much how different the installed mk files are from those in the source
28# tree. This makefile executes a child make process, forcing it to use
29# the mk files from the source tree which are supposed to DTRT.
30#
31# The user-driven targets (as listed above) are implemented in Makefile.inc0
32# and the private targets are in Makefile.inc1. These are kept separate
33# to help the bootstrap build from aout to elf format.
34#
35# For novices wanting to build from current sources, the simple instructions
36# are:
37#
38# 1. Ensure that your /usr/obj directory has at least 260 Mb of free space.
39# 2. `cd /usr/src' (or to the directory containing your source tree).
40# 3. `make world'
41#
42# Be warned, this will update your installed system, except for configuration
43# files in the /etc directory and for the kernel. You have to do those manually.
44#
45# If at first you're a little nervous about having a `make world' update
46# your system, a `make buildworld' will build everything in the /usr/obj
47# tree without touching your installed system. To be of any further use
48# though, a `make installworld' is required.
49#
50# If -DWANT_AOUT is specified, a `make world' with OBJFORMAT=elf will
51# update the legacy support for aout. This includes all libraries, ld.so
52# and boot objects. This part of build should be regarded as
53# deprecated and you should _not_ expect to be able to do this past the
54# release of 4.0. You have exactly one major release to move entirely
55# to elf.
56#
57# ----------------------------------------------------------------------------
58#
59# Upgrading an i386 system from a.out to elf format
60#
61#
62# The aout->elf transition build is performed by doing a `make upgrade' (or
63# `make aout-to-elf') or in two steps by a `make aout-to-elf-build' followed
64# by a `make aout-to-elf-install', depending on user preference.
65# You need to have at least 320 Mb of free space for the object tree.
66#
67# The upgrade process checks the installed release. If this is 3.0-CURRENT,
68# it is assumed that your kernel contains all the syscalls required by the
69# current sources.
70#
71# The upgrade procedure will stop and ask for confirmation to proceed
72# several times. On each occasion, you can type Ctrl-C to abort the
73# upgrade. Optionally, you can also start it with NOCONFIRM=yes and skip
74# the confirmation steps.
75#
76# At the end of the upgrade procedure, /etc/objformat is created or
77# updated to contain OBJFORMAT=elf. From then on, you're elf by default.
78#
79# ----------------------------------------------------------------------------
80#
81#
82# Define the user-driven targets. These are listed here in alphabetical
83# order, but that's not important.
84#
85TGTS= afterdistribute all buildkernel buildworld checkdpadd clean \
86 cleandepend cleandir depend distribute everything hierarchy includes \
13# update - Convenient way to update your source tree (cvs).
14# upgrade - Upgrade a.out (2.2.x/3.0) system to the new ELF way
15# most - Build user commands, no libraries or include files.
16# installmost - Install user commands, no libraries or include files.
17# aout-to-elf - Upgrade an system from a.out to elf format (see below).
18# aout-to-elf-build - Build everything required to upgrade a system from
19# a.out to elf format (see below).
20# aout-to-elf-install - Install everything built by aout-to-elf-build (see
21# below).
22# move-aout-libs - Move the a.out libraries into an aout sub-directory
23# of each elf library sub-directory.
24#
25# This makefile is simple by design. The FreeBSD make automatically reads
26# the /usr/share/mk/sys.mk unless the -m argument is specified on the
27# command line. By keeping this makefile simple, it doesn't matter too
28# much how different the installed mk files are from those in the source
29# tree. This makefile executes a child make process, forcing it to use
30# the mk files from the source tree which are supposed to DTRT.
31#
32# The user-driven targets (as listed above) are implemented in Makefile.inc0
33# and the private targets are in Makefile.inc1. These are kept separate
34# to help the bootstrap build from aout to elf format.
35#
36# For novices wanting to build from current sources, the simple instructions
37# are:
38#
39# 1. Ensure that your /usr/obj directory has at least 260 Mb of free space.
40# 2. `cd /usr/src' (or to the directory containing your source tree).
41# 3. `make world'
42#
43# Be warned, this will update your installed system, except for configuration
44# files in the /etc directory and for the kernel. You have to do those manually.
45#
46# If at first you're a little nervous about having a `make world' update
47# your system, a `make buildworld' will build everything in the /usr/obj
48# tree without touching your installed system. To be of any further use
49# though, a `make installworld' is required.
50#
51# If -DWANT_AOUT is specified, a `make world' with OBJFORMAT=elf will
52# update the legacy support for aout. This includes all libraries, ld.so
53# and boot objects. This part of build should be regarded as
54# deprecated and you should _not_ expect to be able to do this past the
55# release of 4.0. You have exactly one major release to move entirely
56# to elf.
57#
58# ----------------------------------------------------------------------------
59#
60# Upgrading an i386 system from a.out to elf format
61#
62#
63# The aout->elf transition build is performed by doing a `make upgrade' (or
64# `make aout-to-elf') or in two steps by a `make aout-to-elf-build' followed
65# by a `make aout-to-elf-install', depending on user preference.
66# You need to have at least 320 Mb of free space for the object tree.
67#
68# The upgrade process checks the installed release. If this is 3.0-CURRENT,
69# it is assumed that your kernel contains all the syscalls required by the
70# current sources.
71#
72# The upgrade procedure will stop and ask for confirmation to proceed
73# several times. On each occasion, you can type Ctrl-C to abort the
74# upgrade. Optionally, you can also start it with NOCONFIRM=yes and skip
75# the confirmation steps.
76#
77# At the end of the upgrade procedure, /etc/objformat is created or
78# updated to contain OBJFORMAT=elf. From then on, you're elf by default.
79#
80# ----------------------------------------------------------------------------
81#
82#
83# Define the user-driven targets. These are listed here in alphabetical
84# order, but that's not important.
85#
86TGTS= afterdistribute all buildkernel buildworld checkdpadd clean \
87 cleandepend cleandir depend distribute everything hierarchy includes \
87 install installkernel installmost installworld libraries lint \
88 maninstall mk most obj objlink regress rerelease tags update
88 install installkernel reinstallkernel installmost installworld \
89 libraries lint maninstall mk most obj objlink regress rerelease \
90 tags update
89
90PATH= /sbin:/bin:/usr/sbin:/usr/bin
91MAKE= PATH=${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1
92
93#
94# Handle the user-driven targets, using the source relative mk files.
95#
96${TGTS}: upgrade_checks
97 @cd ${.CURDIR}; \
98 ${MAKE} ${.TARGET}
99
100# Set a reasonable default
101.MAIN: all
102
103STARTTIME!= LC_TIME=C date
104#
105# world
106#
107# Attempt to rebuild and reinstall *everything*, with reasonable chance of
108# success, regardless of how old your existing system is.
109#
110world: upgrade_checks
111 @echo "--------------------------------------------------------------"
112 @echo ">>> ${OBJFORMAT} make world started on ${STARTTIME}"
113 @echo "--------------------------------------------------------------"
114.if target(pre-world)
115 @echo
116 @echo "--------------------------------------------------------------"
117 @echo ">>> Making 'pre-world' target"
118 @echo "--------------------------------------------------------------"
119 @cd ${.CURDIR}; ${MAKE} pre-world
120.endif
121 @cd ${.CURDIR}; ${MAKE} buildworld
122 @cd ${.CURDIR}; ${MAKE} -B installworld
123.if target(post-world)
124 @echo
125 @echo "--------------------------------------------------------------"
126 @echo ">>> Making 'post-world' target"
127 @echo "--------------------------------------------------------------"
128 @cd ${.CURDIR}; ${MAKE} post-world
129.endif
130 @echo
131 @echo "--------------------------------------------------------------"
132 @echo ">>> ${OBJFORMAT} make world started on ${STARTTIME}"
133 @echo ">>> ${OBJFORMAT} make world completed on `LC_TIME=C date`"
134 @echo "--------------------------------------------------------------"
135
136#
137# Perform a few tests to determine if the installed tools are adequate
138# for building the world. These are for older systems (prior to 2.2.5).
139#
140# From 2.2.5 onwards, the installed tools will pass these upgrade tests,
141# so the normal make world is capable of doing what is required to update
142# the system to current.
143#
144upgrade_checks:
145 @cd ${.CURDIR}; \
146 if ! make -m ${.CURDIR}/share/mk test > /dev/null 2>&1; then \
147 make make; \
148 fi
149
150#
151# A simple test target used as part of the test to see if make supports
152# the -m argument.
153#
154test:
155
156#
157# Upgrade the installed make to the current version using the installed
158# headers, libraries and build tools. This is required on installed versions
159# prior to 2.2.5 in which the installed make doesn't support the -m argument.
160#
161make:
162 @echo
163 @echo "--------------------------------------------------------------"
164 @echo " Upgrading the installed make"
165 @echo "--------------------------------------------------------------"
166 @cd ${.CURDIR}/usr.bin/make; \
167 make obj && make depend && make all && make install
168
169#
170# Define the upgrade targets. These are listed here in alphabetical
171# order, but that's not important.
172#
173UPGRADE= aout-to-elf aout-to-elf-build aout-to-elf-install \
174 move-aout-libs
175
176#
177# Handle the upgrade targets, using the source relative mk files.
178#
179
180upgrade: aout-to-elf
181
182${UPGRADE} : upgrade_checks
183 @cd ${.CURDIR}; \
184 ${MAKE} -f Makefile.upgrade -m ${.CURDIR}/share/mk ${.TARGET}
91
92PATH= /sbin:/bin:/usr/sbin:/usr/bin
93MAKE= PATH=${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1
94
95#
96# Handle the user-driven targets, using the source relative mk files.
97#
98${TGTS}: upgrade_checks
99 @cd ${.CURDIR}; \
100 ${MAKE} ${.TARGET}
101
102# Set a reasonable default
103.MAIN: all
104
105STARTTIME!= LC_TIME=C date
106#
107# world
108#
109# Attempt to rebuild and reinstall *everything*, with reasonable chance of
110# success, regardless of how old your existing system is.
111#
112world: upgrade_checks
113 @echo "--------------------------------------------------------------"
114 @echo ">>> ${OBJFORMAT} make world started on ${STARTTIME}"
115 @echo "--------------------------------------------------------------"
116.if target(pre-world)
117 @echo
118 @echo "--------------------------------------------------------------"
119 @echo ">>> Making 'pre-world' target"
120 @echo "--------------------------------------------------------------"
121 @cd ${.CURDIR}; ${MAKE} pre-world
122.endif
123 @cd ${.CURDIR}; ${MAKE} buildworld
124 @cd ${.CURDIR}; ${MAKE} -B installworld
125.if target(post-world)
126 @echo
127 @echo "--------------------------------------------------------------"
128 @echo ">>> Making 'post-world' target"
129 @echo "--------------------------------------------------------------"
130 @cd ${.CURDIR}; ${MAKE} post-world
131.endif
132 @echo
133 @echo "--------------------------------------------------------------"
134 @echo ">>> ${OBJFORMAT} make world started on ${STARTTIME}"
135 @echo ">>> ${OBJFORMAT} make world completed on `LC_TIME=C date`"
136 @echo "--------------------------------------------------------------"
137
138#
139# Perform a few tests to determine if the installed tools are adequate
140# for building the world. These are for older systems (prior to 2.2.5).
141#
142# From 2.2.5 onwards, the installed tools will pass these upgrade tests,
143# so the normal make world is capable of doing what is required to update
144# the system to current.
145#
146upgrade_checks:
147 @cd ${.CURDIR}; \
148 if ! make -m ${.CURDIR}/share/mk test > /dev/null 2>&1; then \
149 make make; \
150 fi
151
152#
153# A simple test target used as part of the test to see if make supports
154# the -m argument.
155#
156test:
157
158#
159# Upgrade the installed make to the current version using the installed
160# headers, libraries and build tools. This is required on installed versions
161# prior to 2.2.5 in which the installed make doesn't support the -m argument.
162#
163make:
164 @echo
165 @echo "--------------------------------------------------------------"
166 @echo " Upgrading the installed make"
167 @echo "--------------------------------------------------------------"
168 @cd ${.CURDIR}/usr.bin/make; \
169 make obj && make depend && make all && make install
170
171#
172# Define the upgrade targets. These are listed here in alphabetical
173# order, but that's not important.
174#
175UPGRADE= aout-to-elf aout-to-elf-build aout-to-elf-install \
176 move-aout-libs
177
178#
179# Handle the upgrade targets, using the source relative mk files.
180#
181
182upgrade: aout-to-elf
183
184${UPGRADE} : upgrade_checks
185 @cd ${.CURDIR}; \
186 ${MAKE} -f Makefile.upgrade -m ${.CURDIR}/share/mk ${.TARGET}