diff options
author | Alexey Neyman <stilor@att.net> | 2015-10-29 00:21:43 -0700 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2015-10-30 16:24:52 -0700 |
commit | aba43b63d31f94ec9598a3e0e5008f25a82b64fd (patch) | |
tree | 0c636ea5395fbec8110def21e638a5e92406cf7e /samples | |
parent | b36e00212458309335f939cda6ba92de94068dec (diff) | |
download | crosstool-ng-aba43b63d31f94ec9598a3e0e5008f25a82b64fd.tar.gz crosstool-ng-aba43b63d31f94ec9598a3e0e5008f25a82b64fd.tar.bz2 crosstool-ng-aba43b63d31f94ec9598a3e0e5008f25a82b64fd.zip |
Order the samples in build-all.
First, build cross samples (indicated by lack of comma in their names);
then, build canadian cross samples (and, when they are supported,
cross-native). While building canadian cross, set up the path to the
build-to-host cross if it was built previously.
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'samples')
-rw-r--r-- | samples/samples.mk | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/samples/samples.mk b/samples/samples.mk index b3542f6d..48f4a74c 100644 --- a/samples/samples.mk +++ b/samples/samples.mk @@ -171,6 +171,7 @@ $(CT_SAMPLES): config_files # $1: sample __comma = , prefix_dir = $(CT_PREFIX)/$(subst $(__comma),=,$(1)) +host_triplet = $(if $(findstring $(__comma),$(1)),$(firstword $(subst $(__comma), ,$(1)))) # Create the rule to build a sample # $1: sample name (target tuple, or host/target tuples separated by a comma) @@ -185,7 +186,10 @@ define build_sample $(SILENT)$(sed) -i -r -e 's:^.*(CT_LOG_PROGRESS_BAR).*$$:\1=y:;' .config $(SILENT)$(CONF) -s --oldconfig $(KCONFIG_TOP) @$(ECHO) ' BUILD $(1)' - $(SILENT)$(MAKE) -rf $(CT_NG) V=0 build + $(SILENT)if [ ! -z "$(call host_triplet,$(1))" -a -d "$(call prefix_dir,$(call host_triplet,$(1)))" ]; then \ + PATH="$$PATH:$(call prefix_dir,$(call host_triplet,$(1)))/bin"; \ + fi; \ + $(MAKE) -rf $(CT_NG) V=0 build @printf '\r' endef @@ -207,8 +211,14 @@ endif # MAKECMDGOALS != "" $(patsubst %,build-%,$(CT_SAMPLES)): build-%: config_files $(call build_sample,$*) -# Build al samples -build-all: $(patsubst %,build-%,$(CT_SAMPLES)) +# Cross samples (build==host) +CT_SAMPLES_CROSS = $(strip $(foreach s,$(CT_SAMPLES),$(if $(findstring $(__comma),$(s)),, $(s)))) +# Canadian cross (build!=host) +CT_SAMPLES_CANADIAN = $(strip $(foreach s,$(CT_SAMPLES),$(if $(findstring $(__comma),$(s)), $(s),))) + +# Build all samples; first, build simple cross as canadian configurations may depend on +# build-to-host cross being pre-built. +build-all: $(patsubst %,build-%,$(CT_SAMPLES_CROSS) $(CT_SAMPLES_CANADIAN)) # Build all samples, overiding the number of // jobs per sample build-all.%: |