1#
| 1#
|
2# $FreeBSD: head/Makefile 218206 2011-02-02 23:59:24Z imp $
| 2# $FreeBSD: head/Makefile 218524 2011-02-10 18:54:52Z jhb $
|
3# 4# The user-driven targets are: 5# 6# universe - *Really* build *everything* (buildworld and 7# all kernels on all architectures). 8# tinderbox - Same as universe, but presents a list of failed build 9# targets and exits with an error if there were any. 10# buildworld - Rebuild *everything*, including glue to help do 11# upgrades. 12# installworld - Install everything built by "buildworld". 13# world - buildworld + installworld, no kernel. 14# buildkernel - Rebuild the kernel and the kernel-modules. 15# installkernel - Install the kernel and the kernel-modules. 16# installkernel.debug 17# reinstallkernel - Reinstall the kernel and the kernel-modules. 18# reinstallkernel.debug 19# kernel - buildkernel + installkernel. 20# kernel-toolchain - Builds the subset of world necessary to build a kernel 21# doxygen - Build API documentation of the kernel, needs doxygen. 22# update - Convenient way to update your source tree (cvs). 23# check-old - List obsolete directories/files/libraries. 24# check-old-dirs - List obsolete directories. 25# check-old-files - List obsolete files. 26# check-old-libs - List obsolete libraries. 27# delete-old - Delete obsolete directories/files/libraries. 28# delete-old-dirs - Delete obsolete directories. 29# delete-old-files - Delete obsolete files. 30# delete-old-libs - Delete obsolete libraries. 31# targets - Print a list of supported TARGET/TARGET_ARCH pairs 32# for world and kernel targets.
| 3# 4# The user-driven targets are: 5# 6# universe - *Really* build *everything* (buildworld and 7# all kernels on all architectures). 8# tinderbox - Same as universe, but presents a list of failed build 9# targets and exits with an error if there were any. 10# buildworld - Rebuild *everything*, including glue to help do 11# upgrades. 12# installworld - Install everything built by "buildworld". 13# world - buildworld + installworld, no kernel. 14# buildkernel - Rebuild the kernel and the kernel-modules. 15# installkernel - Install the kernel and the kernel-modules. 16# installkernel.debug 17# reinstallkernel - Reinstall the kernel and the kernel-modules. 18# reinstallkernel.debug 19# kernel - buildkernel + installkernel. 20# kernel-toolchain - Builds the subset of world necessary to build a kernel 21# doxygen - Build API documentation of the kernel, needs doxygen. 22# update - Convenient way to update your source tree (cvs). 23# check-old - List obsolete directories/files/libraries. 24# check-old-dirs - List obsolete directories. 25# check-old-files - List obsolete files. 26# check-old-libs - List obsolete libraries. 27# delete-old - Delete obsolete directories/files/libraries. 28# delete-old-dirs - Delete obsolete directories. 29# delete-old-files - Delete obsolete files. 30# delete-old-libs - Delete obsolete libraries. 31# targets - Print a list of supported TARGET/TARGET_ARCH pairs 32# for world and kernel targets.
|
| 33# toolchains - Build a toolchain for all world and kernel targets.
|
33# 34# This makefile is simple by design. The FreeBSD make automatically reads 35# the /usr/share/mk/sys.mk unless the -m argument is specified on the 36# command line. By keeping this makefile simple, it doesn't matter too 37# much how different the installed mk files are from those in the source 38# tree. This makefile executes a child make process, forcing it to use 39# the mk files from the source tree which are supposed to DTRT. 40# 41# Most of the user-driven targets (as listed above) are implemented in 42# Makefile.inc1. The exceptions are universe, tinderbox and targets. 43# 44# If you want to build your system from source be sure that /usr/obj has 45# at least 1GB of diskspace available. A complete 'universe' build requires 46# about 15GB of space. 47# 48# For individuals wanting to build from the sources currently on their 49# system, the simple instructions are: 50# 51# 1. `cd /usr/src' (or to the directory containing your source tree). 52# 2. Define `HISTORICAL_MAKE_WORLD' variable (see README). 53# 3. `make world' 54# 55# For individuals wanting to upgrade their sources (even if only a 56# delta of a few days): 57# 58# 1. `cd /usr/src' (or to the directory containing your source tree). 59# 2. `make buildworld' 60# 3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC). 61# 4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC). 62# [steps 3. & 4. can be combined by using the "kernel" target] 63# 5. `reboot' (in single user mode: boot -s from the loader prompt). 64# 6. `mergemaster -p' 65# 7. `make installworld' 66# 8. `make delete-old' 67# 9. `mergemaster' (you may wish to use -U or -ai). 68# 10. `reboot' 69# 11. `make delete-old-libs' (in case no 3rd party program uses them anymore) 70# 71# See src/UPDATING `COMMON ITEMS' for more complete information. 72# 73# If TARGET=machine (e.g. ia64, sparc64, ...) is specified you can 74# cross build world for other machine types using the buildworld target, 75# and once the world is built you can cross build a kernel using the 76# buildkernel target. 77# 78# Define the user-driven targets. These are listed here in alphabetical 79# order, but that's not important. 80# 81# Targets that begin with underscore are internal targets intended for 82# developer convenience only. They are intentionally not documented and 83# completely subject to change without notice. 84# 85# For more information, see the build(7) manual page. 86# 87TGTS= all all-man buildenv buildenvvars buildkernel buildworld \ 88 check-old check-old-dirs check-old-files check-old-libs \ 89 checkdpadd clean cleandepend cleandir \ 90 delete-old delete-old-dirs delete-old-files delete-old-libs \ 91 depend distribute distributeworld distrib-dirs distribution doxygen \ 92 everything hierarchy install installcheck installkernel \ 93 installkernel.debug reinstallkernel reinstallkernel.debug \ 94 installworld kernel-toolchain libraries lint maninstall \ 95 obj objlink regress rerelease showconfig tags toolchain update \ 96 _worldtmp _legacy _bootstrap-tools _cleanobj _obj \ 97 _build-tools _cross-tools _includes _libraries _depend \ 98 build32 builddtb distribute32 install32 xdev xdev-build xdev-install \ 99 100TGTS+= ${SUBDIR_TARGETS} 101 102BITGTS= files includes 103BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/} 104TGTS+= ${BITGTS} 105 106.ORDER: buildworld installworld 107.ORDER: buildworld distributeworld 108.ORDER: buildworld buildkernel 109.ORDER: buildkernel installkernel 110.ORDER: buildkernel installkernel.debug 111.ORDER: buildkernel reinstallkernel 112.ORDER: buildkernel reinstallkernel.debug 113 114PATH= /sbin:/bin:/usr/sbin:/usr/bin 115MAKEOBJDIRPREFIX?= /usr/obj 116_MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} \ 117 ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \ 118 -f /dev/null -V MAKEOBJDIRPREFIX dummy 119.if !empty(_MAKEOBJDIRPREFIX) 120.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\ 121 (in make.conf(5)) or command-line variable. 122.endif 123MAKEPATH= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE} 124BINMAKE= \ 125 `if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \ 126 -m ${.CURDIR}/share/mk 127_MAKE= PATH=${PATH} ${BINMAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} 128 129# Guess machine architecture from machine type, and vice versa. 130.if !defined(TARGET_ARCH) && defined(TARGET) 131_TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun4v/sparc64/:S/mips/mipsel/} 132.elif !defined(TARGET) && defined(TARGET_ARCH) && \ 133 ${TARGET_ARCH} != ${MACHINE_ARCH} 134_TARGET= ${TARGET_ARCH:C/mips.*e[lb]/mips/:C/armeb/arm/} 135.endif 136# Legacy names, for a transition period mips:mips -> mipsel:mips 137.if defined(TARGET) && defined(TARGET_ARCH) && \ 138 ${TARGET_ARCH} == "mips" && ${TARGET} == "mips" 139.warning "TARGET_ARCH of mips is deprecated in favor of mipsel or mipseb" 140.if defined(TARGET_BIG_ENDIAN) 141_TARGET_ARCH=mipseb 142.else 143_TARGET_ARCH=mipsel 144.endif 145.endif 146# arm with TARGET_BIG_ENDIAN -> armeb 147.if defined(TARGET_ARCH) && ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN) 148.warning "TARGET_ARCH of arm with TARGET_BIG_ENDIAN is deprecated. use armeb" 149_TARGET_ARCH=armeb 150.endif 151.if defined(TARGET) && !defined(_TARGET) 152_TARGET=${TARGET} 153.endif 154.if defined(TARGET_ARCH) && !defined(_TARGET_ARCH) 155_TARGET_ARCH=${TARGET_ARCH} 156.endif 157# Otherwise, default to current machine type and architecture. 158_TARGET?= ${MACHINE} 159_TARGET_ARCH?= ${MACHINE_ARCH} 160 161# 162# Make sure we have an up-to-date make(1). Only world and buildworld 163# should do this as those are the initial targets used for upgrades. 164# The user can define ALWAYS_CHECK_MAKE to have this check performed 165# for all targets. 166# 167.if defined(ALWAYS_CHECK_MAKE) 168${TGTS}: upgrade_checks 169.else 170buildworld: upgrade_checks 171.endif 172 173# 174# This 'cleanworld' target is not included in TGTS, because it is not a 175# recursive target. All of the work for it is done right here. It is 176# expected that BW_CANONICALOBJDIR == the CANONICALOBJDIR as would be 177# created by bsd.obj.mk, except that we don't want to .include that file 178# in this makefile. 179# 180# In the following, the first 'rm' in a series will usually remove all 181# files and directories. If it does not, then there are probably some 182# files with chflags set, so this unsets them and tries the 'rm' a 183# second time. There are situations where this target will be cleaning 184# some directories via more than one method, but that duplication is 185# needed to correctly handle all the possible situations. 186# 187BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} 188cleanworld: 189.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR} 190.if exists(${BW_CANONICALOBJDIR}/) 191 -rm -rf ${BW_CANONICALOBJDIR}/* 192 -chflags -R 0 ${BW_CANONICALOBJDIR} 193 rm -rf ${BW_CANONICALOBJDIR}/* 194.endif 195 # To be safe in this case, fall back to a 'make cleandir' 196 ${_+_}@cd ${.CURDIR}; ${_MAKE} cleandir 197.else 198 -rm -rf ${.OBJDIR}/* 199 -chflags -R 0 ${.OBJDIR} 200 rm -rf ${.OBJDIR}/* 201.endif 202 203# 204# Handle the user-driven targets, using the source relative mk files. 205# 206 207${TGTS}: 208 ${_+_}@cd ${.CURDIR}; ${_MAKE} ${.TARGET} 209 210# Set a reasonable default 211.MAIN: all 212 213STARTTIME!= LC_ALL=C date 214CHECK_TIME!= find ${.CURDIR}/sys/sys/param.h -mtime -0 215.if !empty(CHECK_TIME) 216.error check your date/time: ${STARTTIME} 217.endif 218 219.if defined(HISTORICAL_MAKE_WORLD) || defined(DESTDIR) 220# 221# world 222# 223# Attempt to rebuild and reinstall everything. This target is not to be 224# used for upgrading an existing FreeBSD system, because the kernel is 225# not included. One can argue that this target doesn't build everything 226# then. 227# 228world: upgrade_checks 229 @echo "--------------------------------------------------------------" 230 @echo ">>> make world started on ${STARTTIME}" 231 @echo "--------------------------------------------------------------" 232.if target(pre-world) 233 @echo 234 @echo "--------------------------------------------------------------" 235 @echo ">>> Making 'pre-world' target" 236 @echo "--------------------------------------------------------------" 237 ${_+_}@cd ${.CURDIR}; ${_MAKE} pre-world 238.endif 239 ${_+_}@cd ${.CURDIR}; ${_MAKE} buildworld 240 ${_+_}@cd ${.CURDIR}; ${_MAKE} -B installworld 241.if target(post-world) 242 @echo 243 @echo "--------------------------------------------------------------" 244 @echo ">>> Making 'post-world' target" 245 @echo "--------------------------------------------------------------" 246 ${_+_}@cd ${.CURDIR}; ${_MAKE} post-world 247.endif 248 @echo 249 @echo "--------------------------------------------------------------" 250 @echo ">>> make world completed on `LC_ALL=C date`" 251 @echo " (started ${STARTTIME})" 252 @echo "--------------------------------------------------------------" 253.else 254world: 255 @echo "WARNING: make world will overwrite your existing FreeBSD" 256 @echo "installation without also building and installing a new" 257 @echo "kernel. This can be dangerous. Please read the handbook," 258 @echo "'Rebuilding world', for how to upgrade your system." 259 @echo "Define DESTDIR to where you want to install FreeBSD," 260 @echo "including /, to override this warning and proceed as usual." 261 @echo "" 262 @echo "Bailing out now..." 263 @false 264.endif 265 266# 267# kernel 268# 269# Short hand for `make buildkernel installkernel' 270# 271kernel: buildkernel installkernel 272 273# 274# Perform a few tests to determine if the installed tools are adequate 275# for building the world. 276# 277upgrade_checks: 278 @if ! (cd ${.CURDIR}/tools/build/make_check && \ 279 PATH=${PATH} ${BINMAKE} obj >/dev/null 2>&1 && \ 280 PATH=${PATH} ${BINMAKE} >/dev/null 2>&1); \ 281 then \ 282 (cd ${.CURDIR} && ${MAKE} make); \ 283 fi 284 285# 286# Upgrade make(1) to the current version using the installed 287# headers, libraries and tools. Also, allow the location of 288# the system bsdmake-like utility to be overridden. 289# 290MMAKEENV= MAKEOBJDIRPREFIX=${MAKEPATH} \ 291 DESTDIR= \ 292 INSTALL="sh ${.CURDIR}/tools/install.sh" 293MMAKE= ${MMAKEENV} ${MAKE} \ 294 -D_UPGRADING \ 295 -DNOMAN -DNO_MAN -DNOSHARED -DNO_SHARED \ 296 -DNO_CPU_CFLAGS -DNO_WERROR 297 298make: .PHONY 299 @echo 300 @echo "--------------------------------------------------------------" 301 @echo ">>> Building an up-to-date make(1)" 302 @echo "--------------------------------------------------------------" 303 ${_+_}@cd ${.CURDIR}/usr.bin/make; \ 304 ${MMAKE} obj && \ 305 ${MMAKE} depend && \ 306 ${MMAKE} all && \ 307 ${MMAKE} install DESTDIR=${MAKEPATH} BINDIR= 308 309tinderbox:
| 34# 35# This makefile is simple by design. The FreeBSD make automatically reads 36# the /usr/share/mk/sys.mk unless the -m argument is specified on the 37# command line. By keeping this makefile simple, it doesn't matter too 38# much how different the installed mk files are from those in the source 39# tree. This makefile executes a child make process, forcing it to use 40# the mk files from the source tree which are supposed to DTRT. 41# 42# Most of the user-driven targets (as listed above) are implemented in 43# Makefile.inc1. The exceptions are universe, tinderbox and targets. 44# 45# If you want to build your system from source be sure that /usr/obj has 46# at least 1GB of diskspace available. A complete 'universe' build requires 47# about 15GB of space. 48# 49# For individuals wanting to build from the sources currently on their 50# system, the simple instructions are: 51# 52# 1. `cd /usr/src' (or to the directory containing your source tree). 53# 2. Define `HISTORICAL_MAKE_WORLD' variable (see README). 54# 3. `make world' 55# 56# For individuals wanting to upgrade their sources (even if only a 57# delta of a few days): 58# 59# 1. `cd /usr/src' (or to the directory containing your source tree). 60# 2. `make buildworld' 61# 3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC). 62# 4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC). 63# [steps 3. & 4. can be combined by using the "kernel" target] 64# 5. `reboot' (in single user mode: boot -s from the loader prompt). 65# 6. `mergemaster -p' 66# 7. `make installworld' 67# 8. `make delete-old' 68# 9. `mergemaster' (you may wish to use -U or -ai). 69# 10. `reboot' 70# 11. `make delete-old-libs' (in case no 3rd party program uses them anymore) 71# 72# See src/UPDATING `COMMON ITEMS' for more complete information. 73# 74# If TARGET=machine (e.g. ia64, sparc64, ...) is specified you can 75# cross build world for other machine types using the buildworld target, 76# and once the world is built you can cross build a kernel using the 77# buildkernel target. 78# 79# Define the user-driven targets. These are listed here in alphabetical 80# order, but that's not important. 81# 82# Targets that begin with underscore are internal targets intended for 83# developer convenience only. They are intentionally not documented and 84# completely subject to change without notice. 85# 86# For more information, see the build(7) manual page. 87# 88TGTS= all all-man buildenv buildenvvars buildkernel buildworld \ 89 check-old check-old-dirs check-old-files check-old-libs \ 90 checkdpadd clean cleandepend cleandir \ 91 delete-old delete-old-dirs delete-old-files delete-old-libs \ 92 depend distribute distributeworld distrib-dirs distribution doxygen \ 93 everything hierarchy install installcheck installkernel \ 94 installkernel.debug reinstallkernel reinstallkernel.debug \ 95 installworld kernel-toolchain libraries lint maninstall \ 96 obj objlink regress rerelease showconfig tags toolchain update \ 97 _worldtmp _legacy _bootstrap-tools _cleanobj _obj \ 98 _build-tools _cross-tools _includes _libraries _depend \ 99 build32 builddtb distribute32 install32 xdev xdev-build xdev-install \ 100 101TGTS+= ${SUBDIR_TARGETS} 102 103BITGTS= files includes 104BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/} 105TGTS+= ${BITGTS} 106 107.ORDER: buildworld installworld 108.ORDER: buildworld distributeworld 109.ORDER: buildworld buildkernel 110.ORDER: buildkernel installkernel 111.ORDER: buildkernel installkernel.debug 112.ORDER: buildkernel reinstallkernel 113.ORDER: buildkernel reinstallkernel.debug 114 115PATH= /sbin:/bin:/usr/sbin:/usr/bin 116MAKEOBJDIRPREFIX?= /usr/obj 117_MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} \ 118 ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \ 119 -f /dev/null -V MAKEOBJDIRPREFIX dummy 120.if !empty(_MAKEOBJDIRPREFIX) 121.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\ 122 (in make.conf(5)) or command-line variable. 123.endif 124MAKEPATH= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE} 125BINMAKE= \ 126 `if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \ 127 -m ${.CURDIR}/share/mk 128_MAKE= PATH=${PATH} ${BINMAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} 129 130# Guess machine architecture from machine type, and vice versa. 131.if !defined(TARGET_ARCH) && defined(TARGET) 132_TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun4v/sparc64/:S/mips/mipsel/} 133.elif !defined(TARGET) && defined(TARGET_ARCH) && \ 134 ${TARGET_ARCH} != ${MACHINE_ARCH} 135_TARGET= ${TARGET_ARCH:C/mips.*e[lb]/mips/:C/armeb/arm/} 136.endif 137# Legacy names, for a transition period mips:mips -> mipsel:mips 138.if defined(TARGET) && defined(TARGET_ARCH) && \ 139 ${TARGET_ARCH} == "mips" && ${TARGET} == "mips" 140.warning "TARGET_ARCH of mips is deprecated in favor of mipsel or mipseb" 141.if defined(TARGET_BIG_ENDIAN) 142_TARGET_ARCH=mipseb 143.else 144_TARGET_ARCH=mipsel 145.endif 146.endif 147# arm with TARGET_BIG_ENDIAN -> armeb 148.if defined(TARGET_ARCH) && ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN) 149.warning "TARGET_ARCH of arm with TARGET_BIG_ENDIAN is deprecated. use armeb" 150_TARGET_ARCH=armeb 151.endif 152.if defined(TARGET) && !defined(_TARGET) 153_TARGET=${TARGET} 154.endif 155.if defined(TARGET_ARCH) && !defined(_TARGET_ARCH) 156_TARGET_ARCH=${TARGET_ARCH} 157.endif 158# Otherwise, default to current machine type and architecture. 159_TARGET?= ${MACHINE} 160_TARGET_ARCH?= ${MACHINE_ARCH} 161 162# 163# Make sure we have an up-to-date make(1). Only world and buildworld 164# should do this as those are the initial targets used for upgrades. 165# The user can define ALWAYS_CHECK_MAKE to have this check performed 166# for all targets. 167# 168.if defined(ALWAYS_CHECK_MAKE) 169${TGTS}: upgrade_checks 170.else 171buildworld: upgrade_checks 172.endif 173 174# 175# This 'cleanworld' target is not included in TGTS, because it is not a 176# recursive target. All of the work for it is done right here. It is 177# expected that BW_CANONICALOBJDIR == the CANONICALOBJDIR as would be 178# created by bsd.obj.mk, except that we don't want to .include that file 179# in this makefile. 180# 181# In the following, the first 'rm' in a series will usually remove all 182# files and directories. If it does not, then there are probably some 183# files with chflags set, so this unsets them and tries the 'rm' a 184# second time. There are situations where this target will be cleaning 185# some directories via more than one method, but that duplication is 186# needed to correctly handle all the possible situations. 187# 188BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} 189cleanworld: 190.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR} 191.if exists(${BW_CANONICALOBJDIR}/) 192 -rm -rf ${BW_CANONICALOBJDIR}/* 193 -chflags -R 0 ${BW_CANONICALOBJDIR} 194 rm -rf ${BW_CANONICALOBJDIR}/* 195.endif 196 # To be safe in this case, fall back to a 'make cleandir' 197 ${_+_}@cd ${.CURDIR}; ${_MAKE} cleandir 198.else 199 -rm -rf ${.OBJDIR}/* 200 -chflags -R 0 ${.OBJDIR} 201 rm -rf ${.OBJDIR}/* 202.endif 203 204# 205# Handle the user-driven targets, using the source relative mk files. 206# 207 208${TGTS}: 209 ${_+_}@cd ${.CURDIR}; ${_MAKE} ${.TARGET} 210 211# Set a reasonable default 212.MAIN: all 213 214STARTTIME!= LC_ALL=C date 215CHECK_TIME!= find ${.CURDIR}/sys/sys/param.h -mtime -0 216.if !empty(CHECK_TIME) 217.error check your date/time: ${STARTTIME} 218.endif 219 220.if defined(HISTORICAL_MAKE_WORLD) || defined(DESTDIR) 221# 222# world 223# 224# Attempt to rebuild and reinstall everything. This target is not to be 225# used for upgrading an existing FreeBSD system, because the kernel is 226# not included. One can argue that this target doesn't build everything 227# then. 228# 229world: upgrade_checks 230 @echo "--------------------------------------------------------------" 231 @echo ">>> make world started on ${STARTTIME}" 232 @echo "--------------------------------------------------------------" 233.if target(pre-world) 234 @echo 235 @echo "--------------------------------------------------------------" 236 @echo ">>> Making 'pre-world' target" 237 @echo "--------------------------------------------------------------" 238 ${_+_}@cd ${.CURDIR}; ${_MAKE} pre-world 239.endif 240 ${_+_}@cd ${.CURDIR}; ${_MAKE} buildworld 241 ${_+_}@cd ${.CURDIR}; ${_MAKE} -B installworld 242.if target(post-world) 243 @echo 244 @echo "--------------------------------------------------------------" 245 @echo ">>> Making 'post-world' target" 246 @echo "--------------------------------------------------------------" 247 ${_+_}@cd ${.CURDIR}; ${_MAKE} post-world 248.endif 249 @echo 250 @echo "--------------------------------------------------------------" 251 @echo ">>> make world completed on `LC_ALL=C date`" 252 @echo " (started ${STARTTIME})" 253 @echo "--------------------------------------------------------------" 254.else 255world: 256 @echo "WARNING: make world will overwrite your existing FreeBSD" 257 @echo "installation without also building and installing a new" 258 @echo "kernel. This can be dangerous. Please read the handbook," 259 @echo "'Rebuilding world', for how to upgrade your system." 260 @echo "Define DESTDIR to where you want to install FreeBSD," 261 @echo "including /, to override this warning and proceed as usual." 262 @echo "" 263 @echo "Bailing out now..." 264 @false 265.endif 266 267# 268# kernel 269# 270# Short hand for `make buildkernel installkernel' 271# 272kernel: buildkernel installkernel 273 274# 275# Perform a few tests to determine if the installed tools are adequate 276# for building the world. 277# 278upgrade_checks: 279 @if ! (cd ${.CURDIR}/tools/build/make_check && \ 280 PATH=${PATH} ${BINMAKE} obj >/dev/null 2>&1 && \ 281 PATH=${PATH} ${BINMAKE} >/dev/null 2>&1); \ 282 then \ 283 (cd ${.CURDIR} && ${MAKE} make); \ 284 fi 285 286# 287# Upgrade make(1) to the current version using the installed 288# headers, libraries and tools. Also, allow the location of 289# the system bsdmake-like utility to be overridden. 290# 291MMAKEENV= MAKEOBJDIRPREFIX=${MAKEPATH} \ 292 DESTDIR= \ 293 INSTALL="sh ${.CURDIR}/tools/install.sh" 294MMAKE= ${MMAKEENV} ${MAKE} \ 295 -D_UPGRADING \ 296 -DNOMAN -DNO_MAN -DNOSHARED -DNO_SHARED \ 297 -DNO_CPU_CFLAGS -DNO_WERROR 298 299make: .PHONY 300 @echo 301 @echo "--------------------------------------------------------------" 302 @echo ">>> Building an up-to-date make(1)" 303 @echo "--------------------------------------------------------------" 304 ${_+_}@cd ${.CURDIR}/usr.bin/make; \ 305 ${MMAKE} obj && \ 306 ${MMAKE} depend && \ 307 ${MMAKE} all && \ 308 ${MMAKE} install DESTDIR=${MAKEPATH} BINDIR= 309 310tinderbox:
|
310 @cd ${.CURDIR} && \ 311 DOING_TINDERBOX=YES ${MAKE} JFLAG=${JFLAG} universe
| 311 @cd ${.CURDIR} && ${MAKE} DOING_TINDERBOX=YES universe
|
312
| 312
|
| 313toolchains: 314 @cd ${.CURDIR} && ${MAKE} UNIVERSE_TARGET=toolchain universe 315
|
313# 314# universe 315# 316# Attempt to rebuild *everything* for all supported architectures, 317# with a reasonable chance of success, regardless of how old your 318# existing system is. 319# 320.if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets) 321TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v 322TARGET_ARCHES_arm?= arm armeb 323TARGET_ARCHES_mips?= mipsel mipseb mips64el mips64eb 324TARGET_ARCHES_powerpc?= powerpc powerpc64 325TARGET_ARCHES_pc98?= i386 326TARGET_ARCHES_sun4v?= sparc64 327.for target in ${TARGETS} 328TARGET_ARCHES_${target}?= ${target} 329.endfor 330
| 316# 317# universe 318# 319# Attempt to rebuild *everything* for all supported architectures, 320# with a reasonable chance of success, regardless of how old your 321# existing system is. 322# 323.if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets) 324TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v 325TARGET_ARCHES_arm?= arm armeb 326TARGET_ARCHES_mips?= mipsel mipseb mips64el mips64eb 327TARGET_ARCHES_powerpc?= powerpc powerpc64 328TARGET_ARCHES_pc98?= i386 329TARGET_ARCHES_sun4v?= sparc64 330.for target in ${TARGETS} 331TARGET_ARCHES_${target}?= ${target} 332.endfor 333
|
| 334.if defined(UNIVERSE_TARGET) 335MAKE_JUST_WORLDS= YES 336.else 337UNIVERSE_TARGET?= buildworld 338.endif 339
|
331targets: 332 @echo "Supported TARGET/TARGET_ARCH pairs for world and kernel targets" 333.for target in ${TARGETS} 334.for target_arch in ${TARGET_ARCHES_${target}} 335 @echo " ${target}/${target_arch}" 336.endfor 337.endfor 338 339.if defined(DOING_TINDERBOX) 340FAILFILE=${.CURDIR}/_.tinderbox.failed 341MAKEFAIL=tee -a ${FAILFILE} 342.else 343MAKEFAIL=cat 344.endif 345 346universe: universe_prologue 347universe_prologue: 348 @echo "--------------------------------------------------------------" 349 @echo ">>> make universe started on ${STARTTIME}" 350 @echo "--------------------------------------------------------------" 351.if defined(DOING_TINDERBOX) 352 @rm -f ${FAILFILE} 353.endif 354.for target in ${TARGETS} 355universe: universe_${target} 356.ORDER: universe_prologue universe_${target} universe_epilogue 357universe_${target}: universe_${target}_prologue 358universe_${target}_prologue: 359 @echo ">> ${target} started on `LC_ALL=C date`" 360.if !defined(MAKE_JUST_KERNELS) 361.for target_arch in ${TARGET_ARCHES_${target}} 362universe_${target}: universe_${target}_${target_arch} 363universe_${target}_${target_arch}: universe_${target}_prologue
| 340targets: 341 @echo "Supported TARGET/TARGET_ARCH pairs for world and kernel targets" 342.for target in ${TARGETS} 343.for target_arch in ${TARGET_ARCHES_${target}} 344 @echo " ${target}/${target_arch}" 345.endfor 346.endfor 347 348.if defined(DOING_TINDERBOX) 349FAILFILE=${.CURDIR}/_.tinderbox.failed 350MAKEFAIL=tee -a ${FAILFILE} 351.else 352MAKEFAIL=cat 353.endif 354 355universe: universe_prologue 356universe_prologue: 357 @echo "--------------------------------------------------------------" 358 @echo ">>> make universe started on ${STARTTIME}" 359 @echo "--------------------------------------------------------------" 360.if defined(DOING_TINDERBOX) 361 @rm -f ${FAILFILE} 362.endif 363.for target in ${TARGETS} 364universe: universe_${target} 365.ORDER: universe_prologue universe_${target} universe_epilogue 366universe_${target}: universe_${target}_prologue 367universe_${target}_prologue: 368 @echo ">> ${target} started on `LC_ALL=C date`" 369.if !defined(MAKE_JUST_KERNELS) 370.for target_arch in ${TARGET_ARCHES_${target}} 371universe_${target}: universe_${target}_${target_arch} 372universe_${target}_${target_arch}: universe_${target}_prologue
|
364 @echo ">> ${target}.${target_arch} buildworld started on `LC_ALL=C date`"
| 373 @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`"
|
365 @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
| 374 @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
|
366 ${MAKE} ${JFLAG} buildworld \
| 375 ${MAKE} ${JFLAG} ${UNIVERSE_TARGET} \
|
367 TARGET=${target} \ 368 TARGET_ARCH=${target_arch} \
| 376 TARGET=${target} \ 377 TARGET_ARCH=${target_arch} \
|
369 > _.${target}.${target_arch}.buildworld 2>&1 || \ 370 (echo "${target}.${target_arch} world failed," \ 371 "check _.${target}.${target_arch}.buildworld for details" | \
| 378 > _.${target}.${target_arch}.${UNIVERSE_TARGET} 2>&1 || \ 379 (echo "${target}.${target_arch} ${UNIVERSE_TARGET} failed," \ 380 "check _.${target}.${target_arch}.${UNIVERSE_TARGET} for details" | \
|
372 ${MAKEFAIL}))
| 381 ${MAKEFAIL}))
|
373 @echo ">> ${target}.${target_arch} buildworld completed on `LC_ALL=C date`"
| 382 @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} completed on `LC_ALL=C date`"
|
374.endfor 375.endif 376.if !defined(MAKE_JUST_WORLDS) 377.if exists(${.CURDIR}/sys/${target}/conf/NOTES) 378 @(cd ${.CURDIR}/sys/${target}/conf && env __MAKE_CONF=/dev/null \ 379 ${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ 380 (echo "${target} 'make LINT' failed," \ 381 "check _.${target}.makeLINT for details"| ${MAKEFAIL})) 382.endif 383 @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} TARGET=${target} \ 384 universe_kernels 385.endif 386 @echo ">> ${target} completed on `LC_ALL=C date`" 387.endfor 388universe_kernels: universe_kernconfs 389.if !defined(TARGET) 390TARGET!= uname -m 391.endif 392KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \ 393 find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ 394 ! -name DEFAULTS ! -name NOTES 395universe_kernconfs: 396.for kernel in ${KERNCONFS} 397TARGET_ARCH_${kernel}!= cd ${.CURDIR}/sys/${TARGET}/conf && \ 398 config -m ${.CURDIR}/sys/${TARGET}/conf/${kernel} 2> /dev/null | \ 399 grep -v WARNING: | cut -f 2 400.if empty(TARGET_ARCH_${kernel}) 401.error "Target architecture for ${TARGET}/conf/${kernel} unknown. config(8) likely too old." 402.endif 403universe_kernconfs: universe_kernconf_${TARGET}_${kernel} 404universe_kernconf_${TARGET}_${kernel}: 405 @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ 406 ${MAKE} ${JFLAG} buildkernel \ 407 TARGET=${TARGET} \ 408 TARGET_ARCH=${TARGET_ARCH_${kernel}} \ 409 KERNCONF=${kernel} \ 410 > _.${TARGET}.${kernel} 2>&1 || \ 411 (echo "${TARGET} ${kernel} kernel failed," \ 412 "check _.${TARGET}.${kernel} for details"| ${MAKEFAIL})) 413.endfor 414universe: universe_epilogue 415universe_epilogue: 416 @echo "--------------------------------------------------------------" 417 @echo ">>> make universe completed on `LC_ALL=C date`" 418 @echo " (started ${STARTTIME})" 419 @echo "--------------------------------------------------------------" 420.if defined(DOING_TINDERBOX) 421 @if [ -e ${FAILFILE} ] ; then \ 422 echo "Tinderbox failed:" ;\ 423 cat ${FAILFILE} ;\ 424 exit 1 ;\ 425 fi 426.endif 427.endif
| 383.endfor 384.endif 385.if !defined(MAKE_JUST_WORLDS) 386.if exists(${.CURDIR}/sys/${target}/conf/NOTES) 387 @(cd ${.CURDIR}/sys/${target}/conf && env __MAKE_CONF=/dev/null \ 388 ${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ 389 (echo "${target} 'make LINT' failed," \ 390 "check _.${target}.makeLINT for details"| ${MAKEFAIL})) 391.endif 392 @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} TARGET=${target} \ 393 universe_kernels 394.endif 395 @echo ">> ${target} completed on `LC_ALL=C date`" 396.endfor 397universe_kernels: universe_kernconfs 398.if !defined(TARGET) 399TARGET!= uname -m 400.endif 401KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \ 402 find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ 403 ! -name DEFAULTS ! -name NOTES 404universe_kernconfs: 405.for kernel in ${KERNCONFS} 406TARGET_ARCH_${kernel}!= cd ${.CURDIR}/sys/${TARGET}/conf && \ 407 config -m ${.CURDIR}/sys/${TARGET}/conf/${kernel} 2> /dev/null | \ 408 grep -v WARNING: | cut -f 2 409.if empty(TARGET_ARCH_${kernel}) 410.error "Target architecture for ${TARGET}/conf/${kernel} unknown. config(8) likely too old." 411.endif 412universe_kernconfs: universe_kernconf_${TARGET}_${kernel} 413universe_kernconf_${TARGET}_${kernel}: 414 @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ 415 ${MAKE} ${JFLAG} buildkernel \ 416 TARGET=${TARGET} \ 417 TARGET_ARCH=${TARGET_ARCH_${kernel}} \ 418 KERNCONF=${kernel} \ 419 > _.${TARGET}.${kernel} 2>&1 || \ 420 (echo "${TARGET} ${kernel} kernel failed," \ 421 "check _.${TARGET}.${kernel} for details"| ${MAKEFAIL})) 422.endfor 423universe: universe_epilogue 424universe_epilogue: 425 @echo "--------------------------------------------------------------" 426 @echo ">>> make universe completed on `LC_ALL=C date`" 427 @echo " (started ${STARTTIME})" 428 @echo "--------------------------------------------------------------" 429.if defined(DOING_TINDERBOX) 430 @if [ -e ${FAILFILE} ] ; then \ 431 echo "Tinderbox failed:" ;\ 432 cat ${FAILFILE} ;\ 433 exit 1 ;\ 434 fi 435.endif 436.endif
|