# HG changeset patch # User "Yann E. MORIN" # Date 1187189977 0 # Node ID d647d0e6021ea92b0c93ac433deaef4f01f1fc9a # Parent 44623d725a82d7ebe0595ada61ba2fcce4bb7ad1 Add the possibility to force the number of // jobs without reconfiguring. diff -r 44623d725a82 -r d647d0e6021e ct-ng.in --- a/ct-ng.in Wed Aug 15 14:35:11 2007 +0000 +++ b/ct-ng.in Wed Aug 15 14:59:37 2007 +0000 @@ -41,7 +41,7 @@ help-build:: @echo - @echo 'Build actions:' + @echo 'Build actions (#: force number of // jobs):' help-clean:: @echo @@ -65,32 +65,39 @@ # 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 -r 44623d725a82 -r d647d0e6021e kconfig/kconfig.mk --- a/kconfig/kconfig.mk Wed Aug 15 14:35:11 2007 +0000 +++ b/kconfig/kconfig.mk Wed Aug 15 14:59:37 2007 +0000 @@ -74,11 +74,11 @@ # 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 -r 44623d725a82 -r d647d0e6021e samples/samples.mk --- a/samples/samples.mk Wed Aug 15 14:35:11 2007 +0000 +++ b/samples/samples.mk Wed Aug 15 14:59:37 2007 +0000 @@ -7,15 +7,15 @@ 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-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 -r 44623d725a82 -r d647d0e6021e scripts/crosstool.sh --- a/scripts/crosstool.sh Wed Aug 15 14:35:11 2007 +0000 +++ b/scripts/crosstool.sh Wed Aug 15 14:59:37 2007 +0000 @@ -319,6 +319,9 @@ 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 -r 44623d725a82 -r d647d0e6021e steps.mk --- a/steps.mk Wed Aug 15 14:35:11 2007 +0000 +++ b/steps.mk Wed Aug 15 14:59:37 2007 +0000 @@ -25,7 +25,7 @@ @$(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 -r 44623d725a82 -r d647d0e6021e tools/tools.mk --- a/tools/tools.mk Wed Aug 15 14:35:11 2007 +0000 +++ b/tools/tools.mk Wed Aug 15 14:59:37 2007 +0000 @@ -25,7 +25,7 @@ @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