From a9944012946fc28d28ba4fc95c2841e428acb65a Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sun, 12 Sep 2010 16:35:02 +0000 Subject: [PATCH] Extend make clean for android zu also cleanup the compiled java classes and apks (and everything else generated during build process). This also seems to fix a problem with make apk on some machines. Thanks to Dustin Skoracki for helping to investigate. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28062 a1c6a512-1295-4272-9138-f99709370657 --- android/android.make | 24 +++++++++++++++--------- tools/root.make | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/android/android.make b/android/android.make index 22b80fba54..a2ed996fa4 100644 --- a/android/android.make +++ b/android/android.make @@ -9,7 +9,7 @@ .SECONDEXPANSION: # $$(JAVA_OBJ) is not populated until after this .SECONDEXPANSION: # $$(OBJ) is not populated until after this - +.PHONY: apk classes clean dex dirs libs $(BUILDDIR)/$(BINARY): $$(OBJ) $(VOICESPEEXLIB) $(FIRMLIB) $(SKINLIB) $(call PRINTS,LD $(BINARY))$(CC) -o $@ $^ $(LDOPTS) $(GLOBAL_LDOPTS) @@ -42,7 +42,9 @@ JAVA_OBJ := $(call java2class,$(subst /src/,/bin/,$(JAVA_SRC))) LIBS := $(BINLIB_DIR)/$(BINARY) $(BINLIB_DIR)/libmisc.so TEMP_APK := $(BUILDDIR)/bin/_Rockbox.apk TEMP_APK2 := $(BUILDDIR)/bin/__Rockbox.apk -APK := $(BUILDDIR)/bin/Rockbox.apk +DEX := $(BUILDDIR)/bin/classes.dex +AP_ := $(BUILDDIR)/bin/resources.ap_ +APK := $(BUILDDIR)/bin/Rockbox.apk _DIRS := $(BUILDDIR)/___/$(PACKAGE_PATH) DIRS := $(subst ___,bin,$(_DIRS)) @@ -50,8 +52,8 @@ DIRS += $(subst ___,gen,$(_DIRS)) DIRS += $(subst ___,data,$(_DIRS)) DIRS += $(BUILDDIR)/libs/armeabi -$(R_JAVA): $(MANIFEST) - $(call PRINTS,AAPT $(subst $(BUILDDIR)/,,$<))$(AAPT) package -f -m -J $(BUILDDIR)/gen -M $(MANIFEST) -S $(ANDROID_DIR)/res -I $(ANDROID_PLATFORM)/android.jar -F $(BUILDDIR)/bin/resources.ap_ +$(R_JAVA) $(AP_): $(MANIFEST) + $(call PRINTS,AAPT $(subst $(BUILDDIR)/,,$@))$(AAPT) package -f -m -J $(BUILDDIR)/gen -M $(MANIFEST) -S $(ANDROID_DIR)/res -I $(ANDROID_PLATFORM)/android.jar -F $(AP_) $(BUILDDIR)/bin/$(PACKAGE_PATH)/R.class: $(R_JAVA) $(call PRINTS,JAVAC $(subst $(ROOTDIR)/,,$<))javac -d $(BUILDDIR)/bin \ @@ -63,12 +65,12 @@ $(BUILDDIR)/bin/$(PACKAGE_PATH)/%.class: $(ANDROID_DIR)/src/$(PACKAGE_PATH)/%.ja -classpath $(ANDROID_PLATFORM)/android.jar:$(BUILDDIR)/bin -sourcepath \ $(ANDROID_DIR)/gen:$(ANDROID_DIR)/src $< -classes: $(R_OBJ) $(JAVA_OBJ) - -$(BUILDDIR)/bin/classes.dex: classes +$(DEX): $(R_OBJ) $(JAVA_OBJ) $(call PRINTS,DX $(subst $(BUILDDIR)/,,$@))$(DX) --dex --output=$@ $(BUILDDIR)/bin -dex: $(BUILDDIR)/bin/classes.dex +classes: $(R_OBJ) $(JAVA_OBJ) + +dex: $(DEX) $(BINLIB_DIR)/$(BINARY): $(BUILDDIR)/$(BINARY) $(call PRINTS,CP $(BINARY))cp $^ $@ @@ -83,7 +85,7 @@ libs: $(LIBS) $(TEMP_APK): libs dex $(call PRINTS,APK $(subst $(BUILDDIR)/,,$@))$(APKBUILDER) $@ \ - -u -z $(BUILDDIR)/bin/resources.ap_ -f $(BUILDDIR)/bin/classes.dex -nf $(BUILDDIR)/libs + -u -z $(AP_) -f $(DEX) -nf $(BUILDDIR)/libs $(APK): $(TEMP_APK) $(SILENT)rm -f $@ @@ -97,3 +99,7 @@ dirs: $(SILENT)mkdir -p $(DIRS) apk: dirs $(APK) + +clean:: + $(SILENT)rm -f $(BUILDDIR)/bin/$(PACKAGE_PATH)/*.class $(R_JAVA) $(TEMP_APK) $(TEMP_APK2) $(APK) $(DEX) $(BUILDDIR)/_rockbox.zip $(AP_) $(LIBS) + diff --git a/tools/root.make b/tools/root.make index 3d19e6287e..401599aeb5 100644 --- a/tools/root.make +++ b/tools/root.make @@ -136,7 +136,7 @@ tools: $(TOOLS) veryclean: clean $(SILENT)rm -rf $(TOOLS) -clean: +clean:: $(SILENT)echo Cleaning build directory $(SILENT)rm -rf rockbox.zip rockbox.7z rockbox.tar rockbox.tar.gz \ rockbox.tar.bz2 TAGS apps firmware tools comsim sim lang lib \