Makefile (253003) | Makefile (253616) |
---|---|
1# | 1# |
2# $FreeBSD: head/Makefile 253003 2013-07-07 20:44:04Z alfred $ | 2# $FreeBSD: head/Makefile 253616 2013-07-24 17:55:08Z sjg $ |
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 --- 114 unchanged lines hidden (view full) --- 125MAKEOBJDIRPREFIX?= /usr/obj 126_MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} \ 127 ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \ 128 -f /dev/null -V MAKEOBJDIRPREFIX dummy 129.if !empty(_MAKEOBJDIRPREFIX) 130.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\ 131 (in make.conf(5)) or command-line variable. 132.endif | 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 --- 114 unchanged lines hidden (view full) --- 125MAKEOBJDIRPREFIX?= /usr/obj 126_MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} \ 127 ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \ 128 -f /dev/null -V MAKEOBJDIRPREFIX dummy 129.if !empty(_MAKEOBJDIRPREFIX) 130.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\ 131 (in make.conf(5)) or command-line variable. 132.endif |
133MAKEPATH= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE} 134BINMAKE= \ 135 `if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \ | 133 134# We often need to use the tree's version of make to build it. 135# Choices add to complexity though. 136# We cannot blindly use a make which may not be the one we want 137# so be exlicit - until all choice is removed. 138.if !defined(WITHOUT_BMAKE) 139WANT_MAKE= bmake 140.else 141WANT_MAKE= fmake 142.endif 143MYMAKE= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}/${WANT_MAKE} 144.if defined(.PARSEDIR) 145HAVE_MAKE= bmake 146.else 147HAVE_MAKE= fmake 148.endif 149.if exists(${MYMAKE}) 150SUB_MAKE:= ${MYMAKE} -m ${.CURDIR}/share/mk 151.elif ${WANT_MAKE} != ${HAVE_MAKE} || ${WANT_MAKE} != "bmake" 152# It may not exist yet but we may cause it to. 153# In the case of fmake, upgrade_checks may cause a newer version to be built. 154SUB_MAKE= `test -x ${MYMAKE} && echo ${MYMAKE} || echo ${MAKE}` \ |
136 -m ${.CURDIR}/share/mk | 155 -m ${.CURDIR}/share/mk |
137_MAKE= PATH=${PATH} ${BINMAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} | 156.else 157SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk 158.endif |
138 | 159 |
160_MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} 161 |
|
139# Guess machine architecture from machine type, and vice versa. 140.if !defined(TARGET_ARCH) && defined(TARGET) 141_TARGET_ARCH= ${TARGET:S/pc98/i386/} 142.elif !defined(TARGET) && defined(TARGET_ARCH) && \ 143 ${TARGET_ARCH} != ${MACHINE_ARCH} 144_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/} 145.endif 146# Legacy names, for another transition period mips:mips(n32|64)?eb -> mips:mips\1 --- 139 unchanged lines hidden (view full) --- 286# Short hand for `make buildkernel installkernel' 287# 288kernel: buildkernel installkernel 289 290# 291# Perform a few tests to determine if the installed tools are adequate 292# for building the world. 293# | 162# Guess machine architecture from machine type, and vice versa. 163.if !defined(TARGET_ARCH) && defined(TARGET) 164_TARGET_ARCH= ${TARGET:S/pc98/i386/} 165.elif !defined(TARGET) && defined(TARGET_ARCH) && \ 166 ${TARGET_ARCH} != ${MACHINE_ARCH} 167_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/} 168.endif 169# Legacy names, for another transition period mips:mips(n32|64)?eb -> mips:mips\1 --- 139 unchanged lines hidden (view full) --- 309# Short hand for `make buildkernel installkernel' 310# 311kernel: buildkernel installkernel 312 313# 314# Perform a few tests to determine if the installed tools are adequate 315# for building the world. 316# |
317# Note: if we ever need to care about the version of bmake, simply testing 318# MAKE_VERSION against a required version should suffice. 319# |
|
294upgrade_checks: | 320upgrade_checks: |
295.if !defined(.PARSEDIR) 296.if !defined(WITHOUT_BMAKE) 297 (cd ${.CURDIR} && ${MAKE} bmake) 298.else | 321.if ${HAVE_MAKE} != ${WANT_MAKE} 322 @(cd ${.CURDIR} && ${MAKE} ${WANT_MAKE:S,^f,,}) 323.elif ${WANT_MAKE} == "fmake" |
299 @if ! (cd ${.CURDIR}/tools/build/make_check && \ 300 PATH=${PATH} ${BINMAKE} obj >/dev/null 2>&1 && \ 301 PATH=${PATH} ${BINMAKE} >/dev/null 2>&1); \ 302 then \ 303 (cd ${.CURDIR} && ${MAKE} make); \ 304 fi 305.endif | 324 @if ! (cd ${.CURDIR}/tools/build/make_check && \ 325 PATH=${PATH} ${BINMAKE} obj >/dev/null 2>&1 && \ 326 PATH=${PATH} ${BINMAKE} >/dev/null 2>&1); \ 327 then \ 328 (cd ${.CURDIR} && ${MAKE} make); \ 329 fi 330.endif |
306.endif | |
307 308# 309# Upgrade make(1) to the current version using the installed 310# headers, libraries and tools. Also, allow the location of 311# the system bsdmake-like utility to be overridden. 312# | 331 332# 333# Upgrade make(1) to the current version using the installed 334# headers, libraries and tools. Also, allow the location of 335# the system bsdmake-like utility to be overridden. 336# |
313MMAKEENV= MAKEOBJDIRPREFIX=${MAKEPATH} \ | 337MMAKEENV= MAKEOBJDIRPREFIX=${MYMAKE:H} \ |
314 DESTDIR= \ 315 INSTALL="sh ${.CURDIR}/tools/install.sh" 316MMAKE= ${MMAKEENV} ${MAKE} \ 317 -D_UPGRADING \ 318 -DNOMAN -DNO_MAN -DNOSHARED -DNO_SHARED \ 319 -DNO_CPU_CFLAGS -DNO_WERROR 320 321make bmake: .PHONY 322 @echo 323 @echo "--------------------------------------------------------------" 324 @echo ">>> Building an up-to-date make(1)" 325 @echo "--------------------------------------------------------------" 326 ${_+_}@cd ${.CURDIR}/usr.bin/${.TARGET}; \ 327 ${MMAKE} obj && \ 328 ${MMAKE} depend && \ 329 ${MMAKE} all && \ | 338 DESTDIR= \ 339 INSTALL="sh ${.CURDIR}/tools/install.sh" 340MMAKE= ${MMAKEENV} ${MAKE} \ 341 -D_UPGRADING \ 342 -DNOMAN -DNO_MAN -DNOSHARED -DNO_SHARED \ 343 -DNO_CPU_CFLAGS -DNO_WERROR 344 345make bmake: .PHONY 346 @echo 347 @echo "--------------------------------------------------------------" 348 @echo ">>> Building an up-to-date make(1)" 349 @echo "--------------------------------------------------------------" 350 ${_+_}@cd ${.CURDIR}/usr.bin/${.TARGET}; \ 351 ${MMAKE} obj && \ 352 ${MMAKE} depend && \ 353 ${MMAKE} all && \ |
330 ${MMAKE} install DESTDIR=${MAKEPATH} BINDIR= | 354 ${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR= PROGNAME=${MYMAKE:T} |
331 332tinderbox: 333 @cd ${.CURDIR} && ${MAKE} DOING_TINDERBOX=YES universe 334 335toolchains: 336 @cd ${.CURDIR} && ${MAKE} UNIVERSE_TARGET=toolchain universe 337 338kernel-toolchains: --- 33 unchanged lines hidden (view full) --- 372 373.if defined(DOING_TINDERBOX) 374FAILFILE=${.CURDIR}/_.tinderbox.failed 375MAKEFAIL=tee -a ${FAILFILE} 376.else 377MAKEFAIL=cat 378.endif 379 | 355 356tinderbox: 357 @cd ${.CURDIR} && ${MAKE} DOING_TINDERBOX=YES universe 358 359toolchains: 360 @cd ${.CURDIR} && ${MAKE} UNIVERSE_TARGET=toolchain universe 361 362kernel-toolchains: --- 33 unchanged lines hidden (view full) --- 396 397.if defined(DOING_TINDERBOX) 398FAILFILE=${.CURDIR}/_.tinderbox.failed 399MAKEFAIL=tee -a ${FAILFILE} 400.else 401MAKEFAIL=cat 402.endif 403 |
380universe: universe_prologue upgrade_checks | 404universe_prologue: upgrade_checks 405universe: universe_prologue |
381universe_prologue: 382 @echo "--------------------------------------------------------------" 383 @echo ">>> make universe started on ${STARTTIME}" 384 @echo "--------------------------------------------------------------" 385.if defined(DOING_TINDERBOX) 386 @rm -f ${FAILFILE} 387.endif 388.for target in ${TARGETS} 389universe: universe_${target} | 406universe_prologue: 407 @echo "--------------------------------------------------------------" 408 @echo ">>> make universe started on ${STARTTIME}" 409 @echo "--------------------------------------------------------------" 410.if defined(DOING_TINDERBOX) 411 @rm -f ${FAILFILE} 412.endif 413.for target in ${TARGETS} 414universe: universe_${target} |
390.ORDER: universe_prologue upgrade_checks universe_${target} universe_epilogue | 415universe_epilogue: universe_${target} |
391universe_${target}: universe_${target}_prologue | 416universe_${target}: universe_${target}_prologue |
392universe_${target}_prologue: | 417universe_${target}_prologue: universe_prologue |
393 @echo ">> ${target} started on `LC_ALL=C date`" 394.if !defined(MAKE_JUST_KERNELS) 395.for target_arch in ${TARGET_ARCHES_${target}} 396universe_${target}: universe_${target}_${target_arch} 397universe_${target}_${target_arch}: universe_${target}_prologue 398 @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`" 399 @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ | 418 @echo ">> ${target} started on `LC_ALL=C date`" 419.if !defined(MAKE_JUST_KERNELS) 420.for target_arch in ${TARGET_ARCHES_${target}} 421universe_${target}: universe_${target}_${target_arch} 422universe_${target}_${target_arch}: universe_${target}_prologue 423 @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`" 424 @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ |
400 ${MAKE} ${JFLAG} ${UNIVERSE_TARGET} \ | 425 ${SUB_MAKE} ${JFLAG} ${UNIVERSE_TARGET} \ |
401 TARGET=${target} \ 402 TARGET_ARCH=${target_arch} \ 403 > _.${target}.${target_arch}.${UNIVERSE_TARGET} 2>&1 || \ 404 (echo "${target}.${target_arch} ${UNIVERSE_TARGET} failed," \ 405 "check _.${target}.${target_arch}.${UNIVERSE_TARGET} for details" | \ 406 ${MAKEFAIL})) 407 @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} completed on `LC_ALL=C date`" 408.endfor --- 4 unchanged lines hidden (view full) --- 413.for target_arch in ${TARGET_ARCHES_${target}} 414universe_${target}_kernels: universe_${target}_${target_arch} 415.endfor 416.endif 417universe_${target}: universe_${target}_kernels 418universe_${target}_kernels: universe_${target}_prologue 419.if exists(${KERNSRCDIR}/${target}/conf/NOTES) 420 @(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \ | 426 TARGET=${target} \ 427 TARGET_ARCH=${target_arch} \ 428 > _.${target}.${target_arch}.${UNIVERSE_TARGET} 2>&1 || \ 429 (echo "${target}.${target_arch} ${UNIVERSE_TARGET} failed," \ 430 "check _.${target}.${target_arch}.${UNIVERSE_TARGET} for details" | \ 431 ${MAKEFAIL})) 432 @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} completed on `LC_ALL=C date`" 433.endfor --- 4 unchanged lines hidden (view full) --- 438.for target_arch in ${TARGET_ARCHES_${target}} 439universe_${target}_kernels: universe_${target}_${target_arch} 440.endfor 441.endif 442universe_${target}: universe_${target}_kernels 443universe_${target}_kernels: universe_${target}_prologue 444.if exists(${KERNSRCDIR}/${target}/conf/NOTES) 445 @(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \ |
421 ${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ | 446 ${SUB_MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ |
422 (echo "${target} 'make LINT' failed," \ 423 "check _.${target}.makeLINT for details"| ${MAKEFAIL})) 424.endif | 447 (echo "${target} 'make LINT' failed," \ 448 "check _.${target}.makeLINT for details"| ${MAKEFAIL})) 449.endif |
425 @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} TARGET=${target} \ | 450 @cd ${.CURDIR} && ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \ |
426 universe_kernels 427.endif 428 @echo ">> ${target} completed on `LC_ALL=C date`" 429.endfor 430universe_kernels: universe_kernconfs 431.if !defined(TARGET) 432TARGET!= uname -m 433.endif --- 6 unchanged lines hidden (view full) --- 440 config -m ${KERNSRCDIR}/${TARGET}/conf/${kernel} 2> /dev/null | \ 441 grep -v WARNING: | cut -f 2 442.if empty(TARGET_ARCH_${kernel}) 443.error "Target architecture for ${TARGET}/conf/${kernel} unknown. config(8) likely too old." 444.endif 445universe_kernconfs: universe_kernconf_${TARGET}_${kernel} 446universe_kernconf_${TARGET}_${kernel}: 447 @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ | 451 universe_kernels 452.endif 453 @echo ">> ${target} completed on `LC_ALL=C date`" 454.endfor 455universe_kernels: universe_kernconfs 456.if !defined(TARGET) 457TARGET!= uname -m 458.endif --- 6 unchanged lines hidden (view full) --- 465 config -m ${KERNSRCDIR}/${TARGET}/conf/${kernel} 2> /dev/null | \ 466 grep -v WARNING: | cut -f 2 467.if empty(TARGET_ARCH_${kernel}) 468.error "Target architecture for ${TARGET}/conf/${kernel} unknown. config(8) likely too old." 469.endif 470universe_kernconfs: universe_kernconf_${TARGET}_${kernel} 471universe_kernconf_${TARGET}_${kernel}: 472 @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ |
448 ${MAKE} ${JFLAG} buildkernel \ | 473 ${SUB_MAKE} ${JFLAG} buildkernel \ |
449 TARGET=${TARGET} \ 450 TARGET_ARCH=${TARGET_ARCH_${kernel}} \ 451 KERNCONF=${kernel} \ 452 > _.${TARGET}.${kernel} 2>&1 || \ 453 (echo "${TARGET} ${kernel} kernel failed," \ 454 "check _.${TARGET}.${kernel} for details"| ${MAKEFAIL})) 455.endfor 456universe: universe_epilogue --- 16 unchanged lines hidden --- | 474 TARGET=${TARGET} \ 475 TARGET_ARCH=${TARGET_ARCH_${kernel}} \ 476 KERNCONF=${kernel} \ 477 > _.${TARGET}.${kernel} 2>&1 || \ 478 (echo "${TARGET} ${kernel} kernel failed," \ 479 "check _.${TARGET}.${kernel} for details"| ${MAKEFAIL})) 480.endfor 481universe: universe_epilogue --- 16 unchanged lines hidden --- |