summaryrefslogtreecommitdiff
path: root/standalone/android/Makefile
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-01-07 14:14:37 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-01-07 14:14:37 -0400
commit29a9c96ee51263876021301350d9334c60f4094a (patch)
treefec96f44ca0d49df8062e35ab527c9bbf0d6940c /standalone/android/Makefile
parent20fc023ec2876c59792cfb08e5773402c65cc6a5 (diff)
android binary compatability is so bad we have to build all utilities twice
Diffstat (limited to 'standalone/android/Makefile')
-rw-r--r--standalone/android/Makefile116
1 files changed, 15 insertions, 101 deletions
diff --git a/standalone/android/Makefile b/standalone/android/Makefile
index 020303374..f6ae8fdba 100644
--- a/standalone/android/Makefile
+++ b/standalone/android/Makefile
@@ -1,91 +1,24 @@
# Cross-compiles utilities needed for git-annex on Android,
# and builds the Android app.
-# Add Android cross-compiler to PATH (as installed by ghc-android)
-ANDROID_CROSS_COMPILER?=$(HOME)/.ghc/$(shell cat abiversion)/bin
-PATH:=$(ANDROID_CROSS_COMPILER):$(PATH)
+build:
+ ./buildapk 4
+ ./buildapk 5
-# Paths to the Android SDK and NDK.
-export ANDROID_SDK_ROOT?=$(HOME)/.android/adt-bundle-linux-x86/sdk
-export ANDROID_NDK_ROOT?=$(HOME)/.android/android-ndk
+# Targets below are used by buildapk, which sets
+# GIT_ANNEX_ANDROID_SOURCETREE
-# Where to store the source tree used to build utilities. This
-# directory will be created by `make source`.
-GIT_ANNEX_ANDROID_SOURCETREE?=$(HOME)/.android/git-annex-sourcetree
-
-GITTREE=$(GIT_ANNEX_ANDROID_SOURCETREE)/git/installed-tree
-
-VER=$(shell perl -e '$$_=<>;print m/\((.*?)\)/'<../../CHANGELOG)
-
-build: start
- if [ ! -e "$(GIT_ANNEX_ANDROID_SOURCETREE)" ]; then $(MAKE) source; fi
- $(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl/build-stamp
- $(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh/build-stamp
- $(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox/build-stamp
- $(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync/build-stamp
- $(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg/build-stamp
- $(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/git/build-stamp
- $(MAKE) $(GIT_ANNEX_ANDROID_SOURCETREE)/term/build-stamp
-
- perl -i -pe 's/(android:versionName=)"[^"]+"/$$1"'$(VER)'"/' $(GIT_ANNEX_ANDROID_SOURCETREE)/term/AndroidManifest.xml
-
- # Debug build because it does not need signing keys.
- cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && tools/build-debug
-
- # Install executables as pseudo-libraries so they will be
- # unpacked from the .apk.
- mkdir -p $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi
- cp $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox/busybox $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.busybox.so
- cp $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh/ssh $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.ssh.so
- cp $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh/ssh-keygen $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.ssh-keygen.so
- cp $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync/rsync $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.rsync.so
- cp $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg/g10/gpg $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.gpg.so
- cp $(GIT_ANNEX_ANDROID_SOURCETREE)/git/git $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git.so
- cp $(GIT_ANNEX_ANDROID_SOURCETREE)/git/git-shell $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-shell.so
- cp $(GIT_ANNEX_ANDROID_SOURCETREE)/git/git-upload-pack $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-upload-pack.so
- arm-linux-androideabi-strip --strip-unneeded --remove-section=.comment --remove-section=.note $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/*
- cp runshell $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.runshell.so
- cp start $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.start.so
-
- # remove git stuff we don't need to save space
- rm -rf $(GITTREE)/bin/git-cvsserver \
- $(GITTREE)/libexec/git-core/git-daemon \
- $(GITTREE)/libexec/git-core/git-show-index \
- $(GITTREE)/libexec/git-core/mergetools \
- $(GITTREE)/libexec/git-core/git-credential-* \
- $(GITTREE)/libexec/git-core/git-cvsserver \
- $(GITTREE)/libexec/git-core/git-cvsimport \
- $(GITTREE)/libexec/git-core/git-fast-import \
- $(GITTREE)/libexec/git-core/git-http-backend \
- $(GITTREE)/libexec/git-core/git-imap-send \
- $(GITTREE)/libexec/git-core/git-instaweb \
- $(GITTREE)/libexec/git-core/git-p4 \
- $(GITTREE)/libexec/git-core/git-remote-test* \
- $(GITTREE)/libexec/git-core/git-submodule \
- $(GITTREE)/libexec/git-core/git-svn \
- $(GITTREE)/libexec/git-core/git-web--browse
- # Most of git is in one multicall binary, but a few important
- # commands are still shell scripts. Those are put into
- # a tarball, along with a list of all the links that should be
- # set up.
- cd $(GITTREE) && mkdir -p links
- cd $(GITTREE) && find -samefile bin/git -not -wholename ./bin/git > links/git
- cd $(GITTREE) && find -samefile bin/git-shell -not -wholename ./bin/git-shell > links/git-shell
- cd $(GITTREE) && find -samefile bin/git-upload-pack -not -wholename ./bin/git-upload-pack > links/git-upload-pack
- cd $(GITTREE) && find -type f -not -samefile bin/git -not -samefile bin/git-shell -not -samefile bin/git-upload-pack|tar czf ../git.tar.gz -T -
- cp $(GIT_ANNEX_ANDROID_SOURCETREE)/git/git.tar.gz $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git.tar.gz.so
-
- git rev-parse HEAD > $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.version.so
- cp ../trustedkeys.gpg $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.trustedkeys.so
+source: $(GIT_ANNEX_ANDROID_SOURCETREE)
- set -e; \
- for v in 4.0 4.3 5.0; do \
- mkdir -p ../../tmp/$$v; \
- cp ../../tmp/androidtree/dist/build/git-annex/$$v/git-annex $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-annex.so; \
- arm-linux-androideabi-strip --strip-unneeded --remove-section=.comment --remove-section=.note $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-annex.so; \
- (cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && ant debug); \
- cp $(GIT_ANNEX_ANDROID_SOURCETREE)/term/bin/Term-debug.apk ../../tmp/$$v/git-annex.apk; \
- done
+$(GIT_ANNEX_ANDROID_SOURCETREE):
+ mkdir -p $(GIT_ANNEX_ANDROID_SOURCETREE)
+ git clone git://git.debian.org/git/d-i/busybox $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox
+ git clone git://git.kernel.org/pub/scm/git/git.git $(GIT_ANNEX_ANDROID_SOURCETREE)/git
+ git clone git://git.samba.org/rsync.git $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync
+ git clone git://git.gnupg.org/gnupg.git $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg
+ git clone git://git.openssl.org/openssl $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl
+ git clone git://github.com/CyanogenMod/android_external_openssh.git $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh
+ git clone git://github.com/jackpal/Android-Terminal-Emulator.git $(GIT_ANNEX_ANDROID_SOURCETREE)/term
$(GIT_ANNEX_ANDROID_SOURCETREE)/openssl/build-stamp:
cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl && CC=$$(which cc) ./Configure android
@@ -146,22 +79,3 @@ $(GIT_ANNEX_ANDROID_SOURCETREE)/term/build-stamp: term.patch icons
cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && perl -pi -e 's/Terminal Emulator/Git Annex/g' res/*/strings.xml
cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && echo y | tools/update.sh || true
touch $@
-
-source: $(GIT_ANNEX_ANDROID_SOURCETREE)
-
-$(GIT_ANNEX_ANDROID_SOURCETREE):
- mkdir -p $(GIT_ANNEX_ANDROID_SOURCETREE)
- git clone git://git.debian.org/git/d-i/busybox $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox
- git clone git://git.kernel.org/pub/scm/git/git.git $(GIT_ANNEX_ANDROID_SOURCETREE)/git
- git clone git://git.samba.org/rsync.git $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync
- git clone git://git.gnupg.org/gnupg.git $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg
- git clone git://git.openssl.org/openssl $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl
- git clone git://github.com/CyanogenMod/android_external_openssh.git $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh
- git clone git://github.com/jackpal/Android-Terminal-Emulator.git $(GIT_ANNEX_ANDROID_SOURCETREE)/term
-
-clean:
- rm -rf $(GITTREE)
- rm -f start
-
-reallyclean: clean
- rm -rf $(GIT_ANNEX_ANDROID_SOURCETREE)