X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosdroid%2FMakefile.am;h=686aeabfc5c6f39dae60a7ca5b33af2d13ccc365;hp=daa649631ce8b8e9757e7b1f2c3e163aaf1d3642;hb=297eb795b24ec31f6599f48bc8c3769557a7ec6f;hpb=795fba09a3ca273cd2daeeb7d9fed6bae6fa6a86 diff --git a/altosdroid/Makefile.am b/altosdroid/Makefile.am index daa64963..686aeabf 100644 --- a/altosdroid/Makefile.am +++ b/altosdroid/Makefile.am @@ -1,5 +1,8 @@ if ANDROID -all_target=bin/AltosDroid-debug.apk bin/AltosDroid-release-unsigned.apk +all_target=bin/AltosDroid-debug.apk +if ANDROID_RELEASE +all_target+=bin/AltosDroid-release.apk +endif else all_target= endif @@ -11,10 +14,16 @@ DX=$(SDK)/platform-tools/dx ADB=$(SDK)/platform-tools/adb AAPT=$(SDK)/platform-tools/aapt APKBUILDER=$(SDK)/tools/apkbuilder -ZIPALIGN=$(SDK)/tools/zipalign +ZIPALIGN_A=$(SDK)/tools/zipalign +ZIPALIGN_B=$(shell ls $(SDK)/build-tools/*/zipalign | tail -1) -SRC_DIR=src/org/altusmetrum/AltosDroid +JAVA_SRC_DIR=src/org/altusmetrum/AltosDroid EXT_LIBDIR=libs +DRAWABLE_DIR=res/drawable +LAYOUT_DIR=res/layout +MENU_DIR=res/menu +VALUES_DIR=res/values +XML_DIR=res/xml ALTOSLIB_SRCDIR=../altoslib ALTOSLIB_JAR=altoslib_$(ALTOSLIB_VERSION).jar @@ -28,26 +37,44 @@ SUPPORT_V4=$(EXT_LIBDIR)/$(SUPPORT_V4_JAR) GOOGLE_PLAY_SERVICES_LIB_SRCDIR=$(SDK)/extras/google/google_play_services/libproject GOOGLE_PLAY_SERVICES_LIB=google-play-services_lib -SRC=$(SRC_DIR)/*.java +JAVA_SRC=$(JAVA_SRC_DIR)/*.java $(JAVA_SRC_DIR)/BuildInfo.java + +DRAWABLES=\ + $(DRAWABLE_DIR)/redled.png \ + $(DRAWABLE_DIR)/greenled.png \ + $(DRAWABLE_DIR)/grayled.png + +LAYOUTS=$(LAYOUT_DIR)/*.xml +MENUS=$(MENU_DIR)/*.xml +VALUES=$(VALUES_DIR)/*.xml +XMLS=$(XML_DIR)/*.xml AndroidManifest.xml + +RES=$(LAYOUTS) $(MENUS) $(VALUES) $(XMLS) + +SRC=$(JAVA_SRC) $(DRAWABLES) $(RES) all: $(all_target) -$(EXT_LIBDIR): - mkdir -p $(EXT_LIBDIR) +.NOTPARALLEL: -$(ALTOSLIB): $(EXT_LIBDIR) $(ALTOSLIB_SRCDIR)/$(ALTOSLIB_JAR) +$(ALTOSLIB): $(ALTOSLIB_SRCDIR)/$(ALTOSLIB_JAR) + mkdir -p $(EXT_LIBDIR) cd $(EXT_LIBDIR) && ln -sf $(shell echo $(EXT_LIBDIR) | sed 's|[^/]\+|..|g')/$(ALTOSLIB_SRCDIR)/$(ALTOSLIB_JAR) . -$(SUPPORT_V4): $(EXT_LIBDIR) $(SUPPORT_V4_SRCDIR)/$(SUPPORT_V4_JAR) +$(SUPPORT_V4): $(SUPPORT_V4_SRCDIR)/$(SUPPORT_V4_JAR) + mkdir -p $(EXT_LIBDIR) cd $(EXT_LIBDIR) && ln -sf $(SUPPORT_V4_SRCDIR)/$(SUPPORT_V4_JAR) . $(GOOGLE_PLAY_SERVICES_LIB): $(GOOGLE_PLAY_SERVICES_LIB_SRCDIR)/$(GOOGLE_PLAY_SERVICES_LIB) cp -a $(GOOGLE_PLAY_SERVICES_LIB_SRCDIR)/$(GOOGLE_PLAY_SERVICES_LIB) . cd $(GOOGLE_PLAY_SERVICES_LIB) && $(SDK)/tools/android update project --target $(SDK_TARGET) --path . -$(SRC_DIR)/BuildInfo.java: $(SRC) +$(JAVA_SRC_DIR)/BuildInfo.java: $(filter-out $(JAVA_SRC_DIR)/BuildInfo.java,$(shell echo $(JAVA_SRC))) ./buildinfo.sh +$(DRAWABLE_DIR)/%.png: ../icon/%.png + cd $(DRAWABLE_DIR) && ln -sf $(shell echo $(DRAWABLE_DIR) | sed 's|[^/]\+|..|g')/$< . + if ANDROID install-release: bin/AltosDroid-release.apk $(ADB) install -r bin/AltosDroid-release.apk @@ -61,22 +88,35 @@ bin/AltosDroid-debug.apk: $(SRC) $(ALTOSLIB) $(SUPPORT_V4) $(GOOGLE_PLAY_SERVICE bin/AltosDroid-release-unsigned.apk: $(SRC) $(ALTOSLIB) $(SUPPORT_V4) $(GOOGLE_PLAY_SERVICES_LIB) ant release -sign: - jarsigner -keystore release.keystore \ +bin/AltosDroid-release.apk: bin/AltosDroid-release-unsigned.apk + jarsigner -sigalg SHA1withDSA -digestalg SHA1 \ + -keystore ~/altusmetrumllc/google-play-release.keystore \ + -storepass:file ~/altusmetrumllc/google-play-passphrase \ -signedjar bin/AltosDroid-release-signed.apk \ bin/AltosDroid-release-unsigned.apk AltosDroid - $(SDK)/tools/zipalign -f 4 \ - bin/AltosDroid-release-signed.apk \ - bin/AltosDroid-release.apk - -clean: $(GOOGLE_PLAY_SERVICES_LIB) + if [ -f $(ZIPALIGN_A) ]; then \ + $(ZIPALIGN_A) -f 4 \ + bin/AltosDroid-release-signed.apk \ + bin/AltosDroid-release.apk; \ + else \ + $(ZIPALIGN_B) -f 4 \ + bin/AltosDroid-release-signed.apk \ + bin/AltosDroid-release.apk; \ + fi + +release: bin/AltosDroid-release.apk + +clean-local: $(GOOGLE_PLAY_SERVICES_LIB) ant clean + rm -f $(JAVA_SRC_DIR)/BuildInfo.java + rm -f $(DRAWABLES) rm -rf $(EXT_LIBDIR) rm -rf $(GOOGLE_PLAY_SERVICES_LIB) else -clean: +clean-local: endif +clean: clean-local