diff options
author | Thomas Martitz <kugel@rockbox.org> | 2010-09-02 03:40:02 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2010-09-02 03:40:02 +0000 |
commit | 4e982d30a15f04ac841b9e9669fa2dab5eef900b (patch) | |
tree | 9eac804d7f9db9c622ddf285f139147be33178bf /android/android.make | |
parent | bd7af68ccde0065014f4faacb3f839825b79aa3c (diff) | |
download | rockbox-4e982d30a15f04ac841b9e9669fa2dab5eef900b.tar.gz rockbox-4e982d30a15f04ac841b9e9669fa2dab5eef900b.zip |
Extend android.make so that it can generate a debug signed apk.
'make && make apk && adb install -r bin/Rockbox.apk' should work now.
You should now be able to develop without eclipse.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27980 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'android/android.make')
-rw-r--r-- | android/android.make | 77 |
1 files changed, 74 insertions, 3 deletions
diff --git a/android/android.make b/android/android.make index e87ba39793..a6a7e675be 100644 --- a/android/android.make +++ b/android/android.make | |||
@@ -7,10 +7,81 @@ | |||
7 | # $Id$ | 7 | # $Id$ |
8 | # | 8 | # |
9 | 9 | ||
10 | # pretty empty here: android port has no additional .c files to compile, | 10 | .SECONDEXPANSION: # $$(JAVA_OBJ) is not populated until after this |
11 | # but a different rule for the final librockbox.so | ||
12 | |||
13 | .SECONDEXPANSION: # $$(OBJ) is not populated until after this | 11 | .SECONDEXPANSION: # $$(OBJ) is not populated until after this |
14 | 12 | ||
13 | |||
15 | $(BUILDDIR)/$(BINARY): $$(OBJ) $(VOICESPEEXLIB) $(FIRMLIB) $(SKINLIB) | 14 | $(BUILDDIR)/$(BINARY): $$(OBJ) $(VOICESPEEXLIB) $(FIRMLIB) $(SKINLIB) |
16 | $(call PRINTS,LD $(BINARY))$(CC) -o $@ $^ $(LDOPTS) $(GLOBAL_LDOPTS) | 15 | $(call PRINTS,LD $(BINARY))$(CC) -o $@ $^ $(LDOPTS) $(GLOBAL_LDOPTS) |
16 | |||
17 | PACKAGE=org.rockbox | ||
18 | PACKAGE_PATH=org/rockbox | ||
19 | ANDROID_DIR=$(ROOTDIR)/android | ||
20 | |||
21 | |||
22 | java2class = $(addsuffix .class,$(basename $(subst $(ANDROID_DIR),$(BUILDDIR),$(1)))) | ||
23 | |||
24 | ANDROID_PLATFORM_VERSION=8 | ||
25 | |||
26 | ANDROID_PLATFORM=$(ANDROID_SDK_PATH)/platforms/android-$(ANDROID_PLATFORM_VERSION) | ||
27 | AAPT=$(ANDROID_PLATFORM)/tools/aapt | ||
28 | DX=$(ANDROID_PLATFORM)/tools/dx | ||
29 | APKBUILDER=$(ANDROID_SDK_PATH)/tools/apkbuilder | ||
30 | ZIPALIGN=$(ANDROID_SDK_PATH)/tools/zipalign | ||
31 | |||
32 | |||
33 | MANIFEST := $(ANDROID_DIR)/AndroidManifest.xml | ||
34 | |||
35 | R_JAVA := $(BUILDDIR)/gen/$(PACKAGE_PATH)/R.java | ||
36 | R_OBJ := $(BUILDDIR)/bin/$(PACKAGE_PATH)/R.class | ||
37 | |||
38 | JAVA_SRC := $(wildcard $(ANDROID_DIR)/src/$(PACKAGE_PATH)/*.java) | ||
39 | JAVA_OBJ := $(call java2class,$(subst /src/,/bin/,$(JAVA_SRC))) | ||
40 | |||
41 | LIBS := $(BUILDDIR)/libs/armeabi/$(BINARY) $(BUILDDIR)/libs/armeabi/libmisc.so | ||
42 | TEMP_APK := $(BUILDDIR)/bin/_Rockbox.apk | ||
43 | APK := $(BUILDDIR)/bin/Rockbox.apk | ||
44 | |||
45 | $(R_JAVA): $(MANIFEST) | ||
46 | $(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_ | ||
47 | |||
48 | $(BUILDDIR)/bin/$(PACKAGE_PATH)/R.class: $(R_JAVA) | ||
49 | $(call PRINTS,JAVAC $(subst $(BUILDDIR)/,,$<))javac -d $(BUILDDIR)/bin \ | ||
50 | -classpath $(ANDROID_PLATFORM)/android.jar:$(BUILDDIR)/bin -sourcepath \ | ||
51 | $(ANDROID_DIR)/gen:$(ANDROID_DIR)/src $< | ||
52 | |||
53 | $(BUILDDIR)/bin/$(PACKAGE_PATH)/%.class: $(ANDROID_DIR)/src/$(PACKAGE_PATH)/%.java | ||
54 | $(call PRINTS,JAVAC $(subst $(BUILDDIR)/,,$<))javac -d $(BUILDDIR)/bin \ | ||
55 | -classpath $(ANDROID_PLATFORM)/android.jar:$(BUILDDIR)/bin -sourcepath \ | ||
56 | $(ANDROID_DIR)/gen:$(ANDROID_DIR)/src $< | ||
57 | |||
58 | classes: $(R_OBJ) $(JAVA_OBJ) | ||
59 | |||
60 | $(BUILDDIR)/bin/classes.dex: classes | ||
61 | $(call PRINTS,DX $(subst $(BUILDDIR)/,,$@))$(DX) --dex --output=$@ $(BUILDDIR)/bin | ||
62 | |||
63 | dex: $(BUILDDIR)/bin/classes.dex | ||
64 | |||
65 | $(BUILDDIR)/libs/armeabi/$(BINARY): $(BUILDDIR)/$(BINARY) | ||
66 | $(call PRINTS,CP $(BINARY))cp $^ $@ | ||
67 | |||
68 | $(BUILDDIR)/_rockbox.zip: zip | ||
69 | $(SILENT)mv $(BUILDDIR)/rockbox.zip $@ | ||
70 | |||
71 | $(BUILDDIR)/libs/armeabi/libmisc.so: $(BUILDDIR)/_rockbox.zip | ||
72 | $(call PRINTS,CP rockbox.zip)cp $^ $@ | ||
73 | |||
74 | libs: $(LIBS) | ||
75 | |||
76 | $(TEMP_APK): libs dex | ||
77 | $(call PRINTS,APK $(subst $(BUILDDIR)/,,$@))$(APKBUILDER) $@ \ | ||
78 | -u -z $(BUILDDIR)/bin/resources.ap_ -f $(BUILDDIR)/bin/classes.dex -nf $(BUILDDIR)/libs | ||
79 | |||
80 | $(APK): $(TEMP_APK) | ||
81 | $(SILENT)rm -f $@ | ||
82 | $(call PRINTS,SIGN $(subst $(BUILDDIR)/,,$@))jarsigner \ | ||
83 | -keystore "$(HOME)/.android/debug.keystore" -storepass "android" \ | ||
84 | -keypass "android" -signedjar bin/__Rockbox.apk $^ "androiddebugkey" | ||
85 | $(SILENT)$(ZIPALIGN) -v 4 bin/__Rockbox.apk $@ > /dev/null | ||
86 | |||
87 | apk: $(APK) | ||