diff options
author | Max Kellermann <max@duempel.org> | 2014-02-18 08:33:06 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-22 01:39:08 +0100 |
commit | 4dcf0b8ae0569beaf615fc19df2147bfb1597046 (patch) | |
tree | 99f489ff101a68db49752b2a2898967c5dfca287 /Makefile.am | |
parent | 9574d11dc80248753c7fee22f3621879067c285b (diff) | |
download | mpd-4dcf0b8ae0569beaf615fc19df2147bfb1597046.tar.gz mpd-4dcf0b8ae0569beaf615fc19df2147bfb1597046.tar.xz mpd-4dcf0b8ae0569beaf615fc19df2147bfb1597046.zip |
first Android release
Finally, MPD runs on Android. For some small value of "runs". Very
much work left, too much to describe.
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am index 7e05cd375..c02ca7ce7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,10 @@ AM_CPPFLAGS += -I$(srcdir)/src $(GLIB_CFLAGS) AM_CPPFLAGS += -DSYSTEM_CONFIG_FILE_LOCATION='"$(sysconfdir)/mpd.conf"' +if ANDROID +else bin_PROGRAMS = src/mpd +endif noinst_LIBRARIES = \ libmpd.a \ @@ -24,6 +27,8 @@ noinst_LIBRARIES = \ libmixer_plugins.a \ liboutput_plugins.a +libmpd_a_DEPENDENCIES = + libmpd_a_CPPFLAGS = $(AM_CPPFLAGS) \ $(LIBMPDCLIENT_CFLAGS) \ $(AVAHI_CFLAGS) \ @@ -238,9 +243,50 @@ UPNP_SOURCES = \ # if ANDROID -all-local: libmpd.so -libmpd.so: $(filter %.a,$(src_mpd_LDADD)) - $(AM_V_CXXLD)$(CXXLD) -Wl,-shared -o $@ $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) $(src_mpd_LDADD) $(LIBS) + +noinst_LIBRARIES += libmain.a +libmain_a_SOURCES = \ + src/Main.cxx src/Main.hxx +libmain_a_CPPFLAGS = $(AM_CPPFLAGS) -Iandroid/build/include + +all-local: android/build/bin/Main-debug.apk +clean-local: + rm -rf android/build + +libmpd.so: $(filter %.a,$(src_mpd_LDADD)) libmain.a + $(AM_V_CXXLD)$(CXXLD) -shared -Wl,--no-undefined,-shared,-Bsymbolic -llog -lz -o $@ $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) src/libmain_a-Main.o $(src_mpd_LDADD) $(LIBS) + +android/build/build.xml: android/AndroidManifest.xml + rm -rf android/build + mkdir -p android/build/include + ln -s $(srcdir)/android/AndroidManifest.xml $(srcdir)/android/custom_rules.xml $(srcdir)/android/src $(srcdir)/android/res android/build + $(ANDROID_SDK)/tools/android update project --path android/build --target android-9 + +android/build/bin/classes/org/musicpd/Bridge.class: android/src/Bridge.java android/build/build.xml + cd android/build && ant compile-jni-classes + +android/build/include/org_musicpd_Bridge.h: android/build/bin/classes/org/musicpd/Bridge.class + javah -classpath $(ANDROID_SDK)/platforms/android-17/android.jar:android/build/bin/classes -d $(@D) org.musicpd.Bridge + +libmpd_a_DEPENDENCIES += android/build/include/org_musicpd_Bridge.h + +android/build/libs/armeabi-v7a/libmpd.so: libmpd.so android/build/build.xml + mkdir -p $(@D) + rm -f $@ + strip -o $@ $< + +android/build/bin/Main-debug.apk: android/build/build.xml android/build/libs/armeabi-v7a/libmpd.so + cd android/build && ant nodeps debug + +android/build/bin/Main-release-unsigned.apk: android/build/build.xml android/build/libs/armeabi-v7a/libmpd.so + cd android/build && ant nodeps release + +android/build/bin/Main-release-unaligned.apk: android/build/bin/Main-release-unsigned.apk + jarsigner -digestalg SHA1 -sigalg MD5withRSA -storepass:env ANDROID_KEYSTORE_PASS -keystore $(ANDROID_KEYSTORE) -signedjar $@ $< $(ANDROID_KEY_ALIAS) + +android/build/bin/Main.apk: android/build/bin/Main-release-unaligned.apk + $(ANDROID_SDK)/tools/zipalign -f 4 $< $@ + endif # |