summaryrefslogtreecommitdiff
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2015-10-22 00:07:48 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2015-10-22 00:07:48 +0000
commit7f1636b75ed221017d47562ee8ea263bf901065d (patch)
treec9b6d8752184782fbc047d5f12f20784c505552b /Makefile.inc1
parentb4244a2779c270b87072d0691546d23ea543f855 (diff)
downloadsrc-test2-7f1636b75ed221017d47562ee8ea263bf901065d.tar.gz
src-test2-7f1636b75ed221017d47562ee8ea263bf901065d.zip
Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir". It will use the 'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly setup a WORLDTMP to use. Then it will build 'everything' only in the listed SUBDIR_OVERRIDE directories. It is still required to list custom library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something that contains libraries outside of the normal area (such as SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib) Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit obscure failures due to missing libraries, includes, or cross compiler. SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to work as it did before although its usefulness is questionable. With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with -DNO_CLEAN only takes a few minutes to start building the target directories. This is still much better than building unneeded things via 'everything' when testing small subset changes. A BUILDFAST or SKIPWORLDTMP might make sense for this as well. - Add in '_worldtmp' as we still need to create WORLDTMP as later targets, such as '_libraries' and '_includes' use it. This probably was avoiding calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but -DNO_CLEAN can be used for that. - '_legacy' must be included since '_build-tools' uses -legacy. The SUBDIR_OVERRIDE change came in r95509, while -legacy being part of build-tools came in r113136. - 'bootstrap-tools' is still skipped as this feature is not for upgrades. - Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes. The original change for SUBDIR_OVERRIDE in r95509 kept '_includes' and '_libraries' as building everything possible as the SUBDIR_OVERRIDE could need anything from them. However in r96462 the real 'includes' target was changed from manual sub-makes to just recursing 'includes' on SUBDIR, thus not all includes have been installed into WORLDTMP since then when combined with 'buildworld'. This is not done unless calling 'make buildworld' as it would be unexpected to have it go into all directories when doing 'make SUBDIR_OVERRIDE=mydir includes'. - Also need to build the cross-compiler so it is used with --sysroot. If this is burdensome then telling the build to use the local compiler as an external compiler (thus using a proper --sysroot to WORLDTMP) is possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc. - Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld since it won't contain anything related to SUBDIR_OVERRIDE. Testing of the lib32 build can be done with 'make build32'. - Document these changes in build.7 Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=289725
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc126
1 files changed, 17 insertions, 9 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 368bc4fe7860..8594f43f58f1 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -30,6 +30,8 @@
# BUILDENV_SHELL= shell to launch for the buildenv target (def:/bin/sh)
# WORLD_FLAGS= additional flags to pass to make(1) during buildworld
# KERNEL_FLAGS= additional flags to pass to make(1) during buildkernel
+# SUBDIR_OVERRIDE="list of dirs" to build rather than everything.
+# All libraries and includes, and some build tools will still build.
#
# The intended user-driven targets are:
@@ -59,7 +61,7 @@
# system here would require fine-grained ordering of all components based
# on their dependencies.
SRCDIR?= ${.CURDIR}
-.if defined(SUBDIR_OVERRIDE)
+.if !empty(SUBDIR_OVERRIDE)
SUBDIR= ${SUBDIR_OVERRIDE}
.else
SUBDIR= lib libexec
@@ -123,7 +125,7 @@ SUBDIR+=.WAIT
.endif
SUBDIR+=etc
-.endif # defined(SUBDIR_OVERRIDE)
+.endif # !empty(SUBDIR_OVERRIDE)
.if defined(NOCLEAN)
NO_CLEAN= ${NOCLEAN}
@@ -631,8 +633,16 @@ _includes:
@echo "--------------------------------------------------------------"
@echo ">>> stage 4.1: building includes"
@echo "--------------------------------------------------------------"
+# Special handling for SUBDIR_OVERRIDE in buildworld as they most likely need
+# headers from default SUBDIR. Do SUBDIR_OVERRIDE includes last.
+ ${_+_}cd ${.CURDIR}; ${WMAKE} SUBDIR_OVERRIDE= SHARED=symlinks \
+ buildincludes
+ ${_+_}cd ${.CURDIR}; ${WMAKE} SUBDIR_OVERRIDE= SHARED=symlinks \
+ installincludes
+.if !empty(SUBDIR_OVERRIDE) && make(buildworld)
${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks buildincludes
${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks installincludes
+.endif
_libraries:
@echo
@echo "--------------------------------------------------------------"
@@ -727,15 +737,13 @@ distribute32 install32: .MAKE .PHONY
.endif
WMAKE_TGTS=
-.if !defined(SUBDIR_OVERRIDE)
-WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools
-.endif
-WMAKE_TGTS+= _cleanobj _obj _build-tools
-.if !defined(SUBDIR_OVERRIDE)
-WMAKE_TGTS+= _cross-tools
+WMAKE_TGTS+= _worldtmp _legacy
+.if empty(SUBDIR_OVERRIDE)
+WMAKE_TGTS+= _bootstrap-tools
.endif
+WMAKE_TGTS+= _cleanobj _obj _build-tools _cross-tools
WMAKE_TGTS+= _includes _libraries _depend everything
-.if defined(LIB32TMP) && ${MK_LIB32} != "no"
+.if defined(LIB32TMP) && ${MK_LIB32} != "no" && empty(SUBDIR_OVERRIDE)
WMAKE_TGTS+= build32
.endif