Deleted Added
full compact
Makefile (122204) Makefile (123311)
1#
1#
2# $FreeBSD: head/Makefile 122204 2003-11-07 08:36:55Z kris $
2# $FreeBSD: head/Makefile 123311 2003-12-09 02:08:19Z peter $
3#
4# The user-driven targets are:
5#
6# universe - *Really* build *everything* (buildworld and
7# all kernels on all architectures).
8# buildworld - Rebuild *everything*, including glue to help do
9# upgrades.
10# installworld - Install everything built by "buildworld".
11# world - buildworld + installworld.
12# buildkernel - Rebuild the kernel and the kernel-modules.
13# installkernel - Install the kernel and the kernel-modules.
14# installkernel.debug
15# reinstallkernel - Reinstall the kernel and the kernel-modules.
16# reinstallkernel.debug
17# kernel - buildkernel + installkernel.
18# update - Convenient way to update your source tree (cvs).
19#
20# This makefile is simple by design. The FreeBSD make automatically reads
21# the /usr/share/mk/sys.mk unless the -m argument is specified on the
22# command line. By keeping this makefile simple, it doesn't matter too
23# much how different the installed mk files are from those in the source
24# tree. This makefile executes a child make process, forcing it to use
25# the mk files from the source tree which are supposed to DTRT.
26#
27# The user-driven targets (as listed above) are implemented in Makefile.inc1.
28#
29# If you want to build your system from source be sure that /usr/obj has
30# at least 400MB of diskspace available.
31#
32# For individuals wanting to build from the sources currently on their
33# system, the simple instructions are:
34#
35# 1. `cd /usr/src' (or to the directory containing your source tree).
36# 2. `make world'
37#
38# For individuals wanting to upgrade their sources (even if only a
39# delta of a few days):
40#
41# 1. `cd /usr/src' (or to the directory containing your source tree).
42# 2. `make buildworld'
43# 3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
44# 4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
45# 5. `reboot' (in single user mode: boot -s from the loader prompt).
46# 6. `mergemaster -p'
47# 7. `make installworld'
48# 8. `mergemaster'
49# 9. `reboot'
50#
51# See src/UPDATING `COMMON ITEMS' for more complete information.
52#
53# If TARGET_ARCH=arch (e.g. ia64, sparc64, ...) is specified you can
54# cross build world for other architectures using the buildworld target,
55# and once the world is built you can cross build a kernel using the
56# buildkernel target.
57#
58# Define the user-driven targets. These are listed here in alphabetical
59# order, but that's not important.
60#
3#
4# The user-driven targets are:
5#
6# universe - *Really* build *everything* (buildworld and
7# all kernels on all architectures).
8# buildworld - Rebuild *everything*, including glue to help do
9# upgrades.
10# installworld - Install everything built by "buildworld".
11# world - buildworld + installworld.
12# buildkernel - Rebuild the kernel and the kernel-modules.
13# installkernel - Install the kernel and the kernel-modules.
14# installkernel.debug
15# reinstallkernel - Reinstall the kernel and the kernel-modules.
16# reinstallkernel.debug
17# kernel - buildkernel + installkernel.
18# update - Convenient way to update your source tree (cvs).
19#
20# This makefile is simple by design. The FreeBSD make automatically reads
21# the /usr/share/mk/sys.mk unless the -m argument is specified on the
22# command line. By keeping this makefile simple, it doesn't matter too
23# much how different the installed mk files are from those in the source
24# tree. This makefile executes a child make process, forcing it to use
25# the mk files from the source tree which are supposed to DTRT.
26#
27# The user-driven targets (as listed above) are implemented in Makefile.inc1.
28#
29# If you want to build your system from source be sure that /usr/obj has
30# at least 400MB of diskspace available.
31#
32# For individuals wanting to build from the sources currently on their
33# system, the simple instructions are:
34#
35# 1. `cd /usr/src' (or to the directory containing your source tree).
36# 2. `make world'
37#
38# For individuals wanting to upgrade their sources (even if only a
39# delta of a few days):
40#
41# 1. `cd /usr/src' (or to the directory containing your source tree).
42# 2. `make buildworld'
43# 3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
44# 4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
45# 5. `reboot' (in single user mode: boot -s from the loader prompt).
46# 6. `mergemaster -p'
47# 7. `make installworld'
48# 8. `mergemaster'
49# 9. `reboot'
50#
51# See src/UPDATING `COMMON ITEMS' for more complete information.
52#
53# If TARGET_ARCH=arch (e.g. ia64, sparc64, ...) is specified you can
54# cross build world for other architectures using the buildworld target,
55# and once the world is built you can cross build a kernel using the
56# buildkernel target.
57#
58# Define the user-driven targets. These are listed here in alphabetical
59# order, but that's not important.
60#
61# Targets that begin with underscore are internal targets intended for
62# developer convenience only. They are intentionally not documented and
63# completely subject to change without notice.
64#
61TGTS= all all-man buildkernel buildworld checkdpadd clean \
62 cleandepend cleandir depend distribute distributeworld everything \
63 hierarchy install installcheck installkernel installkernel.debug\
64 reinstallkernel reinstallkernel.debug installworld \
65 libraries lint maninstall \
65TGTS= all all-man buildkernel buildworld checkdpadd clean \
66 cleandepend cleandir depend distribute distributeworld everything \
67 hierarchy install installcheck installkernel installkernel.debug\
68 reinstallkernel reinstallkernel.debug installworld \
69 libraries lint maninstall \
66 obj objlink regress rerelease tags update
70 obj objlink regress rerelease tags update \
71 _worldtmp _legacy _bootstrap-tools _cleanobj _obj \
72 _build-tools _cross-tools _includes _libraries _depend
67
68BITGTS= files includes
69BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/}
70TGTS+= ${BITGTS}
71
72.ORDER: buildworld installworld
73.ORDER: buildworld distributeworld
74.ORDER: buildworld buildkernel
75.ORDER: buildkernel installkernel
76.ORDER: buildkernel installkernel.debug
77.ORDER: buildkernel reinstallkernel
78.ORDER: buildkernel reinstallkernel.debug
79
80PATH= /sbin:/bin:/usr/sbin:/usr/bin
81MAKEOBJDIRPREFIX?= /usr/obj
82MAKEPATH= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}
83BINMAKE= \
84 `if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \
85 -m ${.CURDIR}/share/mk
86_MAKE= PATH=${PATH} ${BINMAKE} -f Makefile.inc1
87
88#
89# Make sure we have an up-to-date make(1). Only world and buildworld
90# should do this as those are the initial targets used for upgrades.
91# The user can define ALWAYS_CHECK_MAKE to have this check performed
92# for all targets.
93#
94.if defined(ALWAYS_CHECK_MAKE)
95${TGTS}: upgrade_checks
96.else
97buildworld: upgrade_checks
98.endif
99
100#
101# Handle the user-driven targets, using the source relative mk files.
102#
103
104${TGTS}:
105 @cd ${.CURDIR}; \
106 ${_MAKE} ${.TARGET}
107
108# Set a reasonable default
109.MAIN: all
110
111STARTTIME!= LC_ALL=C date
112#
113# world
114#
115# Attempt to rebuild and reinstall *everything*, with reasonable chance of
116# success, regardless of how old your existing system is.
117#
118world: upgrade_checks
119 @echo "--------------------------------------------------------------"
120 @echo ">>> make world started on ${STARTTIME}"
121 @echo "--------------------------------------------------------------"
122.if target(pre-world)
123 @echo
124 @echo "--------------------------------------------------------------"
125 @echo ">>> Making 'pre-world' target"
126 @echo "--------------------------------------------------------------"
127 @cd ${.CURDIR}; ${_MAKE} pre-world
128.endif
129 @cd ${.CURDIR}; ${_MAKE} buildworld
130 @cd ${.CURDIR}; ${_MAKE} -B installworld
131.if target(post-world)
132 @echo
133 @echo "--------------------------------------------------------------"
134 @echo ">>> Making 'post-world' target"
135 @echo "--------------------------------------------------------------"
136 @cd ${.CURDIR}; ${_MAKE} post-world
137.endif
138 @echo
139 @echo "--------------------------------------------------------------"
140 @echo ">>> make world completed on `LC_ALL=C date`"
141 @echo " (started ${STARTTIME})"
142 @echo "--------------------------------------------------------------"
143
144#
145# kernel
146#
147# Short hand for `make buildkernel installkernel'
148#
149kernel: buildkernel installkernel
150
151#
152# Perform a few tests to determine if the installed tools are adequate
153# for building the world.
154#
155upgrade_checks:
156 @if ! (cd ${.CURDIR}/tools/regression/usr.bin/make && \
157 PATH=${PATH} ${BINMAKE} >/dev/null 2>&1); \
158 then \
159 (cd ${.CURDIR} && make make); \
160 fi
161
162#
163# Upgrade make(1) to the current version using the installed
164# headers, libraries and tools.
165#
166MMAKEENV= MAKEOBJDIRPREFIX=${MAKEPATH} \
167 DESTDIR= \
168 INSTALL="sh ${.CURDIR}/tools/install.sh"
169MMAKE= ${MMAKEENV} make \
170 -D_UPGRADING \
171 -DNOMAN -DNOSHARED \
172 -DNO_CPU_CFLAGS -DNO_WERROR
173
174make: .PHONY
175 @echo
176 @echo "--------------------------------------------------------------"
177 @echo ">>> Building an up-to-date make(1)"
178 @echo "--------------------------------------------------------------"
179 @cd ${.CURDIR}/usr.bin/make; \
180 ${MMAKE} obj && \
181 ${MMAKE} depend && \
182 ${MMAKE} all && \
183 ${MMAKE} install DESTDIR=${MAKEPATH} BINDIR=
184
185#
186# universe
187#
188# Attempt to rebuild *everything* for all supported architectures,
189# with reasonable chance of success, regardless of how old your
190# existing system is.
191#
192i386_mach= pc98
193universe:
194 @echo "--------------------------------------------------------------"
195 @echo ">>> make universe started on ${STARTTIME}"
196 @echo "--------------------------------------------------------------"
197.for arch in i386 sparc64 alpha ia64
198.for mach in ${arch} ${${arch}_mach}
199 @echo ">> ${mach} started on `LC_ALL=C date`"
200 -cd ${.CURDIR} && ${MAKE} buildworld \
201 TARGET_ARCH=${arch} TARGET=${mach} \
202 __MAKE_CONF=/dev/null \
203 > _.${mach}.buildworld 2>&1
204 @echo ">> ${mach} buildworld completed on `LC_ALL=C date`"
205.if exists(${.CURDIR}/sys/${mach}/conf/NOTES)
206 -cd ${.CURDIR}/sys/${mach}/conf && ${MAKE} LINT \
207 > ${.CURDIR}/_.${mach}.makeLINT 2>&1
208.endif
209 cd ${.CURDIR} && ${MAKE} buildkernels TARGET_ARCH=${arch} TARGET=${mach}
210 @echo ">> ${mach} completed on `LC_ALL=C date`"
211.endfor
212.endfor
213 @echo "--------------------------------------------------------------"
214 @echo ">>> make universe completed on `LC_ALL=C date`"
215 @echo " (started ${STARTTIME})"
216 @echo "--------------------------------------------------------------"
217
218KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \
219 find [A-Z]*[A-Z] -type f -maxdepth 0 ! -name NOTES
220
221buildkernels:
222.for kernel in ${KERNCONFS}
223 -cd ${.CURDIR} && ${MAKE} buildkernel \
224 KERNCONF=${kernel} \
225 __MAKE_CONF=/dev/null \
226 > _.${TARGET}.${kernel} 2>&1
227.endfor
73
74BITGTS= files includes
75BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/}
76TGTS+= ${BITGTS}
77
78.ORDER: buildworld installworld
79.ORDER: buildworld distributeworld
80.ORDER: buildworld buildkernel
81.ORDER: buildkernel installkernel
82.ORDER: buildkernel installkernel.debug
83.ORDER: buildkernel reinstallkernel
84.ORDER: buildkernel reinstallkernel.debug
85
86PATH= /sbin:/bin:/usr/sbin:/usr/bin
87MAKEOBJDIRPREFIX?= /usr/obj
88MAKEPATH= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}
89BINMAKE= \
90 `if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \
91 -m ${.CURDIR}/share/mk
92_MAKE= PATH=${PATH} ${BINMAKE} -f Makefile.inc1
93
94#
95# Make sure we have an up-to-date make(1). Only world and buildworld
96# should do this as those are the initial targets used for upgrades.
97# The user can define ALWAYS_CHECK_MAKE to have this check performed
98# for all targets.
99#
100.if defined(ALWAYS_CHECK_MAKE)
101${TGTS}: upgrade_checks
102.else
103buildworld: upgrade_checks
104.endif
105
106#
107# Handle the user-driven targets, using the source relative mk files.
108#
109
110${TGTS}:
111 @cd ${.CURDIR}; \
112 ${_MAKE} ${.TARGET}
113
114# Set a reasonable default
115.MAIN: all
116
117STARTTIME!= LC_ALL=C date
118#
119# world
120#
121# Attempt to rebuild and reinstall *everything*, with reasonable chance of
122# success, regardless of how old your existing system is.
123#
124world: upgrade_checks
125 @echo "--------------------------------------------------------------"
126 @echo ">>> make world started on ${STARTTIME}"
127 @echo "--------------------------------------------------------------"
128.if target(pre-world)
129 @echo
130 @echo "--------------------------------------------------------------"
131 @echo ">>> Making 'pre-world' target"
132 @echo "--------------------------------------------------------------"
133 @cd ${.CURDIR}; ${_MAKE} pre-world
134.endif
135 @cd ${.CURDIR}; ${_MAKE} buildworld
136 @cd ${.CURDIR}; ${_MAKE} -B installworld
137.if target(post-world)
138 @echo
139 @echo "--------------------------------------------------------------"
140 @echo ">>> Making 'post-world' target"
141 @echo "--------------------------------------------------------------"
142 @cd ${.CURDIR}; ${_MAKE} post-world
143.endif
144 @echo
145 @echo "--------------------------------------------------------------"
146 @echo ">>> make world completed on `LC_ALL=C date`"
147 @echo " (started ${STARTTIME})"
148 @echo "--------------------------------------------------------------"
149
150#
151# kernel
152#
153# Short hand for `make buildkernel installkernel'
154#
155kernel: buildkernel installkernel
156
157#
158# Perform a few tests to determine if the installed tools are adequate
159# for building the world.
160#
161upgrade_checks:
162 @if ! (cd ${.CURDIR}/tools/regression/usr.bin/make && \
163 PATH=${PATH} ${BINMAKE} >/dev/null 2>&1); \
164 then \
165 (cd ${.CURDIR} && make make); \
166 fi
167
168#
169# Upgrade make(1) to the current version using the installed
170# headers, libraries and tools.
171#
172MMAKEENV= MAKEOBJDIRPREFIX=${MAKEPATH} \
173 DESTDIR= \
174 INSTALL="sh ${.CURDIR}/tools/install.sh"
175MMAKE= ${MMAKEENV} make \
176 -D_UPGRADING \
177 -DNOMAN -DNOSHARED \
178 -DNO_CPU_CFLAGS -DNO_WERROR
179
180make: .PHONY
181 @echo
182 @echo "--------------------------------------------------------------"
183 @echo ">>> Building an up-to-date make(1)"
184 @echo "--------------------------------------------------------------"
185 @cd ${.CURDIR}/usr.bin/make; \
186 ${MMAKE} obj && \
187 ${MMAKE} depend && \
188 ${MMAKE} all && \
189 ${MMAKE} install DESTDIR=${MAKEPATH} BINDIR=
190
191#
192# universe
193#
194# Attempt to rebuild *everything* for all supported architectures,
195# with reasonable chance of success, regardless of how old your
196# existing system is.
197#
198i386_mach= pc98
199universe:
200 @echo "--------------------------------------------------------------"
201 @echo ">>> make universe started on ${STARTTIME}"
202 @echo "--------------------------------------------------------------"
203.for arch in i386 sparc64 alpha ia64
204.for mach in ${arch} ${${arch}_mach}
205 @echo ">> ${mach} started on `LC_ALL=C date`"
206 -cd ${.CURDIR} && ${MAKE} buildworld \
207 TARGET_ARCH=${arch} TARGET=${mach} \
208 __MAKE_CONF=/dev/null \
209 > _.${mach}.buildworld 2>&1
210 @echo ">> ${mach} buildworld completed on `LC_ALL=C date`"
211.if exists(${.CURDIR}/sys/${mach}/conf/NOTES)
212 -cd ${.CURDIR}/sys/${mach}/conf && ${MAKE} LINT \
213 > ${.CURDIR}/_.${mach}.makeLINT 2>&1
214.endif
215 cd ${.CURDIR} && ${MAKE} buildkernels TARGET_ARCH=${arch} TARGET=${mach}
216 @echo ">> ${mach} completed on `LC_ALL=C date`"
217.endfor
218.endfor
219 @echo "--------------------------------------------------------------"
220 @echo ">>> make universe completed on `LC_ALL=C date`"
221 @echo " (started ${STARTTIME})"
222 @echo "--------------------------------------------------------------"
223
224KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \
225 find [A-Z]*[A-Z] -type f -maxdepth 0 ! -name NOTES
226
227buildkernels:
228.for kernel in ${KERNCONFS}
229 -cd ${.CURDIR} && ${MAKE} buildkernel \
230 KERNCONF=${kernel} \
231 __MAKE_CONF=/dev/null \
232 > _.${TARGET}.${kernel} 2>&1
233.endfor