summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Beattie <mike@ethernal.org>2013-03-07 20:48:16 +1300
committerMike Beattie <mike@ethernal.org>2013-03-07 20:48:16 +1300
commit6ff45bef719bafd2c827e479186c8fadf6f779aa (patch)
treef64841b0f5509555871f16d69fa072c526e7a8eb
parent795fba09a3ca273cd2daeeb7d9fed6bae6fa6a86 (diff)
altosdroid: Symlink red/green/gray LEDs via build system
Signed-off-by: Mike Beattie <mike@ethernal.org>
-rw-r--r--altosdroid/.gitignore1
-rw-r--r--altosdroid/Makefile.am18
2 files changed, 16 insertions, 3 deletions
diff --git a/altosdroid/.gitignore b/altosdroid/.gitignore
index 56d0776d..7f0858ea 100644
--- a/altosdroid/.gitignore
+++ b/altosdroid/.gitignore
@@ -4,3 +4,4 @@ gen
libs
google-play-services_lib
src/org/altusmetrum/AltosDroid/BuildInfo.java
+res/drawable/*led.png
diff --git a/altosdroid/Makefile.am b/altosdroid/Makefile.am
index daa64963..d21cacd8 100644
--- a/altosdroid/Makefile.am
+++ b/altosdroid/Makefile.am
@@ -13,8 +13,9 @@ AAPT=$(SDK)/platform-tools/aapt
APKBUILDER=$(SDK)/tools/apkbuilder
ZIPALIGN=$(SDK)/tools/zipalign
-SRC_DIR=src/org/altusmetrum/AltosDroid
+JAVA_SRC_DIR=src/org/altusmetrum/AltosDroid
EXT_LIBDIR=libs
+DRAWABLE_DIR=res/drawable
ALTOSLIB_SRCDIR=../altoslib
ALTOSLIB_JAR=altoslib_$(ALTOSLIB_VERSION).jar
@@ -28,7 +29,14 @@ 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
+
+DRAWABLES=\
+ $(DRAWABLE_DIR)/redled.png \
+ $(DRAWABLE_DIR)/greenled.png \
+ $(DRAWABLE_DIR)/grayled.png
+
+SRC=$(JAVA_SRC) $(DRAWABLES)
all: $(all_target)
@@ -45,9 +53,12 @@ $(GOOGLE_PLAY_SERVICES_LIB): $(GOOGLE_PLAY_SERVICES_LIB_SRCDIR)/$(GOOGLE_PLAY_SE
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: $(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
@@ -72,6 +83,7 @@ sign:
clean: $(GOOGLE_PLAY_SERVICES_LIB)
ant clean
rm -rf $(EXT_LIBDIR)
+ rm -f $(DRAWABLES)
rm -rf $(GOOGLE_PLAY_SERVICES_LIB)
else