summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2016-04-20 06:16:23 (GMT)
committerAlexey Neyman <stilor@att.net>2016-08-23 18:00:27 (GMT)
commit017ff08d6107e3b8a3c0f777d6610bc11d8b1278 (patch)
treed2328185370d00a2492030eccbf89154785235ba
parent7d8f85e6af9c3567c93d1decf1d54b14abea8eb6 (diff)
build-all: Remove successful build trees.
I am running out of space when running build-all for all samples. Signed-off-by: Alexey Neyman <stilor@att.net>
-rw-r--r--samples/samples.mk4
1 files changed, 3 insertions, 1 deletions
diff --git a/samples/samples.mk b/samples/samples.mk
index 643e595..bf51135 100644
--- a/samples/samples.mk
+++ b/samples/samples.mk
@@ -186,6 +186,7 @@ $(CT_SAMPLES): config_files
__comma = ,
prefix_dir = $(CT_PREFIX)/$(subst $(__comma),=,$(1))
host_triplet = $(if $(findstring $(__comma),$(1)),$(firstword $(subst $(__comma), ,$(1))))
+target_triplet = $(if $(findstring $(__comma),$(1)),$(word 2,$(subst $(__comma), ,$(1))),$(1))
# Create the rule to build a sample
# $1: sample name (target tuple, or host/target tuples separated by a comma)
@@ -212,7 +213,8 @@ define build_sample
fi; \
printf '\r %-5s %s\n' $$status '$(1)'; \
mkdir -p .build-all/$$status/$(1); \
- bzip2 < build.log > .build-all/$$status/$(1)/build.log.bz2
+ bzip2 < build.log > .build-all/$$status/$(1)/build.log.bz2; \
+ [ "$$status" = PASS -a -z "$(CT_PRESERVE_PASSED_BUILDS)" ] && rm -rf .build/$(call target_triplet,$(1)) || :
endef
# ----------------------------------------------------------