From 017ff08d6107e3b8a3c0f777d6610bc11d8b1278 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Tue, 19 Apr 2016 23:16:23 -0700 Subject: build-all: Remove successful build trees. I am running out of space when running build-all for all samples. Signed-off-by: Alexey Neyman 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 # ---------------------------------------------------------- -- cgit v0.10.2-6-g49f6