summaryrefslogtreecommitdiffstats
path: root/core/cleanbuild.mk
diff options
context:
space:
mode:
authorYohann Roussel <yroussel@google.com>2015-01-16 09:48:24 +0100
committerYohann Roussel <yroussel@google.com>2015-01-16 09:48:24 +0100
commit83d5d040479e09a3dea6b7f88ca9a57c4ae984ac (patch)
tree3f5d15b4c25a923aa9ddb80c5542d3992a7ebbe5 /core/cleanbuild.mk
parent8b5ff260d9cd41f1ffba56ca37422d809145fdf0 (diff)
downloadbuild-83d5d040479e09a3dea6b7f88ca9a57c4ae984ac.zip
build-83d5d040479e09a3dea6b7f88ca9a57c4ae984ac.tar.gz
build-83d5d040479e09a3dea6b7f88ca9a57c4ae984ac.tar.bz2
Add clean targets removing jack and dex files
Those should help switching a tree from compiling with Jack back to legacy toolchain. Change-Id: I897a9a9923ed8147723b3ab6ad3f276e6b7094bf
Diffstat (limited to 'core/cleanbuild.mk')
-rw-r--r--core/cleanbuild.mk14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/cleanbuild.mk b/core/cleanbuild.mk
index cf980d8..58b1ee4 100644
--- a/core/cleanbuild.mk
+++ b/core/cleanbuild.mk
@@ -247,3 +247,17 @@ ifeq "$(force_installclean)" "true"
$(info *** Done with the cleaning, now starting the real build.)
endif
force_installclean :=
+
+.PHONY: clean-jack-files
+clean-jack-files: clean-dex-files
+ $(hide) find $(OUT_DIR) -name "*.jack" | xargs rm -f
+ $(hide) find $(OUT_DIR) -type d -name "jack" | xargs rm -rf
+ @echo "All jack files have been removed."
+
+.PHONY: clean-dex-files
+clean-dex-files:
+ $(hide) find $(OUT_DIR) -name "*.dex" | xargs rm -f
+ $(hide) for i in `find $(OUT_DIR) -name "*.jar" -o -name "*.apk"` ; do ((unzip -l $$i 2> /dev/null | \
+ grep -q "\.dex$$" && rm -f $$i) || continue ) ; done
+ @echo "All dex files and archives containing dex files have been removed."
+