summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-05-21 00:13:31 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-05-21 00:13:31 -0400
commit3270f8a28ba180f06076fbf244a6fb31dbdfdbed (patch)
treea0c15ce7e18df15f82972f294a1dabedea47cf41
parent2115f39810df87050097173ff9ab7820c2ffbb1a (diff)
Teach the Makefile to create the .apk (unsigned)
-rw-r--r--.gitignore2
-rw-r--r--Makefile43
-rw-r--r--res/drawable-hdpi/minak.pngbin6213 -> 6538 bytes
-rw-r--r--res/drawable-mdpi/minak.pngbin3925 -> 4019 bytes
-rw-r--r--res/drawable-xhdpi/minak.pngbin9112 -> 9588 bytes
-rw-r--r--res/drawable-xxhdpi/minak.pngbin14978 -> 15850 bytes
-rw-r--r--res/drawable-xxxhdpi/minak.pngbin21843 -> 23201 bytes
7 files changed, 35 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore
index f708b53..5469675 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,8 @@
/.settings
/bin
/gen
+/build.xml
+/local.properties
*~
.nfs*
diff --git a/Makefile b/Makefile
index 2d24a2f..b413171 100644
--- a/Makefile
+++ b/Makefile
@@ -1,32 +1,55 @@
+# Programs #####################################################################
+
+# Usage: $(call SVG2PNG,in-file,out-file[,width,height,background-color])
# SVG2PNG: Each is buggy in their own way
# ImageMagick: doesn't support transparency
-#SVG2PNG = convert $1 -format png $(if $3,-resize $3x)$(if $4,$4) $(if $5,-bacground $5) $2
+#SVG2PNG = convert $1 -format png $(if $3,-resize $3x)$(if $4,$4) $(if $5,-background $5) $2
# librsvg: doesn't support <style> element
#SVG2PNG = rsvg-convert $1 -o $2 $(if $3,-w $3) $(if $4,-h $4) $(if $5,--background-color=$5)
# Inkscape: messes up gradients
-_SVG2PNG = inkscape $1 --export-png $2 $(if $3,-w $3) $(if $4,-h $4) $(if $5,-b '$5')
+SVG2PNG = inkscape $1 --export-png $2 $(if $3,-w $3) $(if $4,-h $4) $(if $5,-b '$5')
+
+ANDROID = android
+ANT = ant
+MKDIRS = mkdir -p
+RM = rm -f
-# Hacky thing to also run it through pngcrush
-SVG2PNG = { $(call _SVG2PNG,$1,$2.tmp.png,$3) && pngcrush $2.tmp.png $2 && rm $2.tmp.png; } || { rm $2.tmp.png; false; }
+################################################################################
icons = minak
densities = mdpi hdpi xhdpi xxhdpi xxxhdpi
-all: $(addsuffix $(addsuffix .png,$(icons)),$(addprefix res/drawable-,$(addsuffix /,$(densities))))
+resources = $(addsuffix $(addsuffix .png,$(icons)),$(addprefix res/drawable-,$(addsuffix /,$(densities))))
+
+all: bin/minak-release-unsigned.apk
+
+bin/minak-release-unsigned.apk: $(resources) build.xml
+ $(ANT) release
+
+build.xml:
+ $(ANDROID) update project -p .
res/drawable-mdpi/%.png: res/drawable/%.svg
- mkdir -p $(@D)
+ $(MKDIRS) $(@D)
$(call SVG2PNG,$<,$@,48)
res/drawable-hdpi/%.png: res/drawable/%.svg
- mkdir -p $(@D)
+ $(MKDIRS) $(@D)
$(call SVG2PNG,$<,$@,72)
res/drawable-xhdpi/%.png: res/drawable/%.svg
- mkdir -p $(@D)
+ $(MKDIRS) $(@D)
$(call SVG2PNG,$<,$@,96)
res/drawable-xxhdpi/%.png: res/drawable/%.svg
- mkdir -p $(@D)
+ $(MKDIRS) $(@D)
$(call SVG2PNG,$<,$@,144)
res/drawable-xxxhdpi/%.png: res/drawable/%.svg
- mkdir -p $(@D)
+ $(MKDIRS) $(@D)
$(call SVG2PNG,$<,$@,192)
+clean: PHONY
+ $(RM) -r bin gen build.xml
+distclean: clean PHONY
+ $(RM) local.properties
+maintainerclean: distclean PHONY
+ $(RM) -- $(resources)
+
.DELETE_ON_ERROR:
+.PHONY: PHONY
diff --git a/res/drawable-hdpi/minak.png b/res/drawable-hdpi/minak.png
index d045266..6f37351 100644
--- a/res/drawable-hdpi/minak.png
+++ b/res/drawable-hdpi/minak.png
Binary files differ
diff --git a/res/drawable-mdpi/minak.png b/res/drawable-mdpi/minak.png
index 468620d..0c50a08 100644
--- a/res/drawable-mdpi/minak.png
+++ b/res/drawable-mdpi/minak.png
Binary files differ
diff --git a/res/drawable-xhdpi/minak.png b/res/drawable-xhdpi/minak.png
index 906e11c..bc54b6f 100644
--- a/res/drawable-xhdpi/minak.png
+++ b/res/drawable-xhdpi/minak.png
Binary files differ
diff --git a/res/drawable-xxhdpi/minak.png b/res/drawable-xxhdpi/minak.png
index 6dc30bb..1c5ca0a 100644
--- a/res/drawable-xxhdpi/minak.png
+++ b/res/drawable-xxhdpi/minak.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/minak.png b/res/drawable-xxxhdpi/minak.png
index 85f1f90..cdc8147 100644
--- a/res/drawable-xxxhdpi/minak.png
+++ b/res/drawable-xxxhdpi/minak.png
Binary files differ