From 276321e6d84a6ee634fd4ec9f0e9a1c3edc7d030 Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Wed, 2 Feb 2011 22:13:51 +0000 Subject: Change the way java files are compiled (do them all at once) in order to speed up builds. There is now an intermediate jar file to help (although that's not strictly necessary), so for rebuilds of single java files this may be a bit slower git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29196 a1c6a512-1295-4272-9138-f99709370657 --- android/android.make | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/android/android.make b/android/android.make index ab59888b79..a5d07b1655 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 +.PHONY: apk classes clean dex dirs libs jar $(BUILDDIR)/$(BINARY): $$(OBJ) $(VOICESPEEXLIB) $(FIRMLIB) $(SKINLIB) $(call PRINTS,LD $(BINARY))$(CC) -o $@ $^ $(LDOPTS) $(GLOBAL_LDOPTS) @@ -48,6 +48,7 @@ LIBS := $(BINLIB_DIR)/$(BINARY) $(BINLIB_DIR)/libmisc.so TEMP_APK := $(BUILDDIR)/bin/_rockbox.apk TEMP_APK2 := $(BUILDDIR)/bin/__rockbox.apk DEX := $(BUILDDIR)/bin/classes.dex +JAR := $(BUILDDIR)/bin/classes.jar AP_ := $(BUILDDIR)/bin/resources.ap_ APK := $(BUILDDIR)/rockbox.apk @@ -78,13 +79,23 @@ $(BUILDDIR)/bin/$(PACKAGE_PATH)/%.class: $(ANDROID_DIR)/src/$(PACKAGE_PATH)/%.ja $(JAVAC_OPTS) \ -sourcepath $(ANDROID_DIR)/src $< -$(DEX): $(R_OBJ) $(JAVA_OBJ) - $(call PRINTS,DX $(subst $(BUILDDIR)/,,$@))$(DX) --dex --output=$@ $(BUILDDIR)/bin +$(JAR): $(JAVA_SRC) $(R_JAVA) + $(call PRINTS,JAVAC $(subst $(ROOTDIR)/,,$?))javac -d $(BUILDDIR)/bin \ + $(JAVAC_OPTS) \ + -sourcepath $(ANDROID_DIR)/src:$(ANDROID_DIR)/gen $? + $(call PRINTS,JAR $(subst $(BUILDDIR)/,,$@))jar cf $(JAR) -C $(BUILDDIR)/bin org -classes: $(R_OBJ) $(JAVA_OBJ) +jar: $(JAR) + +$(DEX): $(JAR) + @echo "Checking for deleted class files" && $(foreach obj,$(JAVA_OBJ) $(R_OBJ), \ + (test -f $(obj) || (echo "$(obj) is missing. Run 'make classes' to fix." && false)) && ) true + $(call PRINTS,DX $(subst $(BUILDDIR)/,,$@))$(DX) --dex --output=$@ $< dex: $(DEX) +classes: $(R_OBJ) $(JAVA_OBJ) + $(BINLIB_DIR)/$(BINARY): $(BUILDDIR)/$(BINARY) $(call PRINTS,CP $(BINARY))cp $^ $@ -- cgit v1.2.3