diff options
-rw-r--r-- | ct-ng.in | 6 | ||||
-rw-r--r-- | samples/samples.mk | 2 | ||||
-rw-r--r-- | scripts/crosstool-NG.sh.in | 10 |
3 files changed, 15 insertions, 3 deletions
@@ -104,6 +104,7 @@ help-tail:: @echo 'See "man 1 $(notdir $(CT_NG))" for some help as well' help-build:: + @echo ' source - Download sources for currently configured toolchain' @echo ' build[.#] - Build the currently configured toolchain' help-clean:: @@ -143,11 +144,14 @@ show-tuple: .config.2 $(SILENT)$(bash) $(CT_LIB_DIR)/scripts/showTuple.sh # Actual build +source: .config.2 + $(SILENT)CT_SOURCE=y $(CT_LIB_DIR)/scripts/crosstool-NG.sh + build: .config.2 $(SILENT)$(CT_LIB_DIR)/scripts/crosstool-NG.sh build.%: - $(SILENT)$(MAKE) -rf $(CT_NG) $(shell echo "$(@)" |$(sed) -r -e 's|^([^.]+)\.([[:digit:]]+)$$|\1 CT_JOBS=\2|;') + $(SILENT)$(MAKE) -rf $(CT_NG) build CT_JOBS=$* PHONY += version version: diff --git a/samples/samples.mk b/samples/samples.mk index e154e5ca..4545d5c3 100644 --- a/samples/samples.mk +++ b/samples/samples.mk @@ -204,5 +204,5 @@ build-all: $(patsubst %,build-%,$(CT_SAMPLES)) # Build all samples, overiding the number of // jobs per sample build-all.%: - $(SILENT)$(MAKE) -rf $(CT_NG) V=$(V) $(shell echo "$(@)" |$(sed) -r -e 's|^([^.]+)\.([[:digit:]]+)$$|\1 CT_JOBS=\2|;') + $(SILENT)$(MAKE) -rf $(CT_NG) build-all CT_JOBS=$* diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in index ab654da7..a3514cb9 100644 --- a/scripts/crosstool-NG.sh.in +++ b/scripts/crosstool-NG.sh.in @@ -516,7 +516,12 @@ if [ -z "${CT_RESTART}" ]; then # And help make go faster JOBSFLAGS= # Override the configured jobs with what's been given on the command line - [ -n "${CT_JOBS}" ] && CT_PARALLEL_JOBS="${CT_JOBS}" + if [ -n "${CT_JOBS}" ]; then + if [ ! -z "`echo "${CT_JOBS}" | sed 's/[0-9]//g'`" ]; then + CT_Abort "Number of parallel jobs must be integer." + fi + CT_PARALLEL_JOBS="${CT_JOBS}" + fi # Use the number of processors+1 when automatically setting the number of # parallel jobs. Fall back to 1 if the host doesn't use GLIBC. AUTO_JOBS=$((`getconf _NPROCESSORS_ONLN 2> /dev/null || echo 0` + 1)) @@ -524,6 +529,9 @@ if [ -z "${CT_RESTART}" ]; then [ ${CT_PARALLEL_JOBS} -gt 0 ] && JOBSFLAGS="${JOBSFLAGS} -j${CT_PARALLEL_JOBS}" JOBSFLAGS="${JOBSFLAGS} -l${CT_LOAD}" + # Override 'download only' option + [ -n "${CT_SOURCE}" ] && CT_ONLY_DOWNLOAD=y + # Now that we've set up $PATH and $CT_CFLAGS_FOR_HOST, sanity test that gcc # is runnable so that the user can troubleshoot problems if not. CT_DoStep DEBUG "Checking that we can run gcc -v" |