From 54cca9f2ba0065fe34013bf712c181601a53c912 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Wed, 15 Aug 2007 14:59:37 +0000 Subject: Add the possibility to force the number of // jobs without reconfiguring. diff --git a/ct-ng.in b/ct-ng.in index bb39ba0..30b225e 100644 --- a/ct-ng.in +++ b/ct-ng.in @@ -41,7 +41,7 @@ help-samples:: help-build:: @echo - @echo 'Build actions:' + @echo 'Build actions (#: force number of // jobs):' help-clean:: @echo @@ -65,32 +65,39 @@ help-tail:: # End help system help-build:: - @echo ' build - Build the toolchain' + @echo ' build[.#] - Build the toolchain' help-clean:: - @echo ' clean - Remove generated files' - @echo ' distclean - Remove generated files, configuration and build directories' + @echo ' clean - Remove generated files' + @echo ' distclean - Remove generated files, configuration and build directories' include $(CT_LIB_DIR)/kconfig/kconfig.mk +include $(CT_LIB_DIR)/steps.mk include $(CT_LIB_DIR)/samples/samples.mk include $(CT_LIB_DIR)/tools/tools.mk -include $(CT_LIB_DIR)/steps.mk help-distrib:: - @echo ' tarball - Build a tarball of the configured toolchain' + @echo ' tarball - Build a tarball of the configured toolchain' help-env:: - @echo ' STOP - Stop the build just after this step' - @echo ' RESTART - Restart the build just before this step' + @echo ' STOP - Stop the build just after this step' + @echo ' RESTART - Restart the build just before this step' .config: @echo 'You must run either one of "$(CT_NG) config" or "$(CT_NG) menuconfig" first' @false # Actual build +ifeq ($(CT_JOBS),) +CT_JOBS:=1 +endif +export CT_JOBS build:: .config @$(CT_LIB_DIR)/scripts/crosstool.sh +build.%:: + @$(CT_NG) $(shell echo "$(@)" |sed -r -e 's|^([^.]+)\.([[:digit:]]+)$$|\1 CT_JOBS=\2|;') + PHONY += tarball #tarball: # @$(CT_LIB_DIR)/scripts/tarball.sh diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk index 8bd44bc..9522264 100644 --- a/kconfig/kconfig.mk +++ b/kconfig/kconfig.mk @@ -74,11 +74,11 @@ extractconfig:: $(obj)/conf $(CONFIG_FILES) # Help text used by make help help-config:: - @echo ' config - Update current config using a line-oriented program' - @echo ' menuconfig - Update current config using a menu based program' - @echo ' oldconfig - Update current config using a provided .config as base' - @echo ' extractconfig - Create a new config using options extracted from a' - @echo ' build log piped into stdin' + @echo ' config - Update current config using a line-oriented program' + @echo ' menuconfig - Update current config using a menu based program' + @echo ' oldconfig - Update current config using a provided .config as base' + @echo ' extractconfig - Create a new config using options extracted from a' + @echo ' build log piped into stdin' # Cheesy build diff --git a/samples/samples.mk b/samples/samples.mk index 221e82a..05a0547 100644 --- a/samples/samples.mk +++ b/samples/samples.mk @@ -7,15 +7,15 @@ CT_LIB_SAMPLES := $(filter-out $(CT_TOP_SAMPLES),$(patsubst $(CT_LIB_DIR)/sample CT_SAMPLES := $(CT_TOP_SAMPLES) $(CT_LIB_SAMPLES) help-config:: - @echo ' saveconfig - Save current config as a preconfigured target' + @echo ' saveconfig - Save current config as a preconfigured target' help-samples:: @$(CT_LIB_DIR)/scripts/showSamples.sh $(CT_SAMPLES) help-build:: - @echo ' regtest - Regtest-build all samples' - @echo ' regtest-local - Regtest-build all local samples' - @echo ' regtest-global - Regtest-build all global samples' + @echo ' regtest[.#] - Regtest-build all samples' + @echo ' regtest-local[.#] - Regtest-build all local samples' + @echo ' regtest-global[.#] - Regtest-build all global samples' # How we do build one sample PHONY += $(CT_SAMPLES) @@ -39,6 +39,9 @@ regtest-local: $(patsubst %,regtest_%,$(CT_TOP_SAMPLES)) regtest-global: $(patsubst %,regtest_%,$(CT_LIB_SAMPLES)) +regtest.% regtest-local.% regtest-global.%: + @$(CT_NG) $(shell echo "$(@)" |sed -r -e 's|^([^.]+)\.([[:digit:]]+)$$|\1 CT_JOBS=\2|;') + # One regtest per sample # We could use a simple rule like: 'regtest: $(CT_SAMPLES)', but that doesn't # work because we want to save the samples as well. diff --git a/scripts/crosstool.sh b/scripts/crosstool.sh index 60ffbea..5802266 100755 --- a/scripts/crosstool.sh +++ b/scripts/crosstool.sh @@ -319,6 +319,9 @@ if [ -z "${CT_RESTART}" ]; then CT_CFLAGS_FOR_HOST= [ "${CT_USE_PIPES}" = "y" ] && CT_CFLAGS_FOR_HOST="${CT_CFLAGS_FOR_HOST} -pipe" + # Override the configured jobs with what's been given on the command line + [ -n "${CT_JOBS}" ] && CT_PARALLEL_JOBS="${CT_JOBS}" + # And help make go faster PARALLELMFLAGS= [ ${CT_PARALLEL_JOBS} -ne 0 ] && PARALLELMFLAGS="${PARALLELMFLAGS} -j${CT_PARALLEL_JOBS}" diff --git a/steps.mk b/steps.mk index 33d2dad..f685263 100644 --- a/steps.mk +++ b/steps.mk @@ -25,7 +25,7 @@ $(patsubst %,%+,$(CT_STEPS)): @$(CT_NG) RESTART=$(patsubst %+,%,$@) build help-build:: - @echo ' liststeps - List all build steps' + @echo ' liststeps - List all build steps' liststeps: @echo 'Available build steps, in order:' diff --git a/tools/tools.mk b/tools/tools.mk index 72416b8..9c4d692 100644 --- a/tools/tools.mk +++ b/tools/tools.mk @@ -25,7 +25,7 @@ $(CONFIG_GUESS_DEST): @chmod u+rwx,go+rx-w $@ help-distrib:: - @echo ' updatetools - Update the config tools' + @echo ' updatetools - Update the config tools' distclean:: @[ $(CT_TOP_DIR) = $(CT_LIB_DIR) ] || rm -rf $(CT_TOP_DIR)/tools -- cgit v0.10.2-6-g49f6