summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2015-10-29 07:21:43 (GMT)
committerAlexey Neyman <stilor@att.net>2015-10-30 23:24:52 (GMT)
commitaba43b63d31f94ec9598a3e0e5008f25a82b64fd (patch)
tree0c636ea5395fbec8110def21e638a5e92406cf7e /samples
parentb36e00212458309335f939cda6ba92de94068dec (diff)
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.mk16
1 files changed, 13 insertions, 3 deletions
diff --git a/samples/samples.mk b/samples/samples.mk
index b3542f6..48f4a74 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.%: