Add the possibility to force the number of // jobs without reconfiguring.

This commit is contained in:
Yann E. MORIN" 2007-08-15 14:59:37 +00:00
parent 46e19208cd
commit 54cca9f2ba
6 changed files with 32 additions and 19 deletions

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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}"

View File

@ -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:'

View File

@ -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