summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 23 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 4d3542f13..3f3ed350a 100644
--- a/Makefile
+++ b/Makefile
@@ -2,8 +2,7 @@ mans=git-annex.1 git-annex-shell.1
all=git-annex $(mans) docs
GHC?=ghc
-GHCMAKE=$(GHC) $(GHCFLAGS) --make
-PREFIX=/usr
+PREFIX?=/usr
CABAL?=cabal # set to "./Setup" if you lack a cabal program
# Am I typing :make in vim? Do a fast build.
@@ -28,8 +27,15 @@ git-annex.1: doc/git-annex.mdwn
git-annex-shell.1: doc/git-annex-shell.mdwn
./Build/mdwn2man git-annex-shell 1 doc/git-annex-shell.mdwn > git-annex-shell.1
+# These are not built normally.
git-union-merge.1: doc/git-union-merge.mdwn
./Build/mdwn2man git-union-merge 1 doc/git-union-merge.mdwn > git-union-merge.1
+git-recover-repository.1: doc/git-recover-repository.mdwn
+ ./Build/mdwn2man git-recover-repository 1 doc/git-recover-repository.mdwn > git-recover-repository.1
+git-union-merge:
+ $(GHC) --make -threaded $@
+git-recover-repository:
+ $(GHC) --make -threaded $@
install-mans: $(mans)
install -d $(DESTDIR)$(PREFIX)/share/man/man1
@@ -75,8 +81,10 @@ clean:
rm -rf tmp dist git-annex $(mans) configure *.tix .hpc \
doc/.ikiwiki html dist tags Build/SysConfig.hs build-stamp \
Setup Build/InstallDesktopFile Build/EvilSplicer \
- Build/Standalone Build/OSXMkLibs
- find -name \*.o -or -name \*.hi -exec rm {} \;
+ Build/Standalone Build/OSXMkLibs \
+ git-union-merge git-recover-repository
+ find -name \*.o -exec rm {} \;
+ find -name \*.hi -exec rm {} \;
Build/InstallDesktopFile: Build/InstallDesktopFile.hs
$(GHC) --make $@
@@ -159,12 +167,12 @@ osxapp: Build/Standalone Build/OSXMkLibs
rm -f tmp/git-annex.dmg.bz2
bzip2 --fast tmp/git-annex.dmg
-ANDROID_FLAGS?=
+ANDROID_FLAGS?=-f-XMPP
# Cross compile for Android.
# Uses https://github.com/neurocyte/ghc-android
android: Build/EvilSplicer
echo "Running native build, to get TH splices.."
- if [ ! -e dist/setup/setup ]; then $(CABAL) configure -f"-Production $(ANDROID_FLAGS)" -O0; fi
+ if [ ! -e dist/setup/setup ]; then $(CABAL) configure -f-Production -O0 $(ANDROID_FLAGS); fi
mkdir -p tmp
if ! $(CABAL) build --ghc-options=-ddump-splices 2> tmp/dump-splices; then tail tmp/dump-splices >&2; exit 1; fi
echo "Setting up Android build tree.."
@@ -181,14 +189,16 @@ android: Build/EvilSplicer
sed -i 's/GHC-Options: \(.*\)-Wall/GHC-Options: \1-Wall -fno-warn-unused-imports /i' tmp/androidtree/git-annex.cabal
# Cabal cannot cross compile with custom build type, so workaround.
sed -i 's/Build-type: Custom/Build-type: Simple/' tmp/androidtree/git-annex.cabal
+# Build just once, but link twice, for 2 different versions of Android.
+ mkdir -p tmp/androidtree/dist/build/git-annex/4.0 tmp/androidtree/dist/build/git-annex/4.3
if [ ! -e tmp/androidtree/dist/setup/setup ]; then \
- cd tmp/androidtree && $$HOME/.ghc/android-14/arm-linux-androideabi-4.7/arm-linux-androideabi/bin/cabal configure -f"Android $(ANDROID_FLAGS)"; \
+ cd tmp/androidtree && $$HOME/.ghc/$(shell cat standalone/android/abiversion)/arm-linux-androideabi/bin/cabal configure -fAndroid $(ANDROID_FLAGS); \
fi
- cd tmp/androidtree && $(CABAL) build
-
-adb:
- ANDROID_FLAGS="-Production" $(MAKE) android
- adb push tmp/androidtree/dist/build/git-annex/git-annex /data/data/ga.androidterm/bin/git-annex
+ cd tmp/androidtree && $$HOME/.ghc/$(shell cat standalone/android/abiversion)/arm-linux-androideabi/bin/cabal build \
+ && mv dist/build/git-annex/git-annex dist/build/git-annex/4.0/git-annex
+ cd tmp/androidtree && $$HOME/.ghc/$(shell cat standalone/android/abiversion)/arm-linux-androideabi/bin/cabal build \
+ --ghc-options=-optl-z --ghc-options=-optlnocopyreloc \
+ && mv dist/build/git-annex/git-annex dist/build/git-annex/4.3/git-annex
androidapp:
$(MAKE) android
@@ -213,4 +223,4 @@ hdevtools:
hdevtools --stop-server || true
hdevtools check git-annex.hs -g -cpp -g -i -g -idist/build/git-annex/git-annex-tmp -g -i. -g -idist/build/autogen -g -Idist/build/autogen -g -Idist/build/git-annex/git-annex-tmp -g -IUtility -g -DWITH_TESTSUITE -g -DWITH_S3 -g -DWITH_ASSISTANT -g -DWITH_INOTIFY -g -DWITH_DBUS -g -DWITH_PAIRING -g -DWITH_XMPP -g -optP-include -g -optPdist/build/autogen/cabal_macros.h -g -odir -g dist/build/git-annex/git-annex-tmp -g -hidir -g dist/build/git-annex/git-annex-tmp -g -stubdir -g dist/build/git-annex/git-annex-tmp -g -threaded -g -Wall -g -XHaskell98 -g -XPackageImports
-.PHONY: git-annex tags build-stamp
+.PHONY: git-annex git-union-merge git-recover-repository tags build-stamp