2010-12-11 17:29:50 -04:00
|
|
|
PREFIX=/usr
|
2011-04-05 14:00:51 -04:00
|
|
|
IGNORE=-ignore-package monads-fd
|
2011-04-29 13:12:26 -04:00
|
|
|
GHCFLAGS=-O2 -Wall $(IGNORE) -fspec-constr-count=5
|
2011-11-09 21:36:11 -04:00
|
|
|
|
2011-04-05 14:00:51 -04:00
|
|
|
ifdef PROFILE
|
2011-04-21 11:23:44 -04:00
|
|
|
GHCFLAGS=-prof -auto-all -rtsopts -caf-all -fforce-recomp $(IGNORE)
|
2011-04-05 14:00:51 -04:00
|
|
|
endif
|
2011-11-09 21:36:11 -04:00
|
|
|
|
2011-01-07 02:15:23 -04:00
|
|
|
GHCMAKE=ghc $(GHCFLAGS) --make
|
2010-10-19 14:39:40 -04:00
|
|
|
|
add git-union-merge
This is a new git subcommand, that does a generic union merge operation
between two refs, storing the result in a branch. It operates efficiently
without touching the working tree. It does need to write out a temporary
index file, and may need to write out some other temp files as well.
This could be useful for anything that stores data in a branch,
and needs to merge changes into that branch without actually checking the
branch out. Since conflict handling can't be done without a working copy,
the merge type is always a union merge, which is fine for data stored in
log format (as git-annex does), or in non-conflicting files
(as pristine-tar does).
This probably belongs in git proper, but it will live in git-annex for now.
---
Plan is to move .git-annex/ to a git-annex branch, and use git-union-merge
to handle merging changes when pulling from remotes.
Some preliminary benchmarking using real .git-annex/ data indicates
that it's quite fast, except for the "git add" call, which is as slow
as "git add" tends to be with a big index.
2011-06-20 19:44:45 -04:00
|
|
|
bins=git-annex git-annex-shell git-union-merge
|
|
|
|
mans=git-annex.1 git-annex-shell.1 git-union-merge.1
|
2011-08-20 16:11:42 -04:00
|
|
|
sources=Build/SysConfig.hs Utility/StatFS.hs Utility/Touch.hs Remote/S3.hs
|
2010-12-30 16:52:24 -04:00
|
|
|
|
2011-11-09 21:36:11 -04:00
|
|
|
all=$(bins) $(mans) docs
|
|
|
|
|
2011-11-10 03:10:17 -04:00
|
|
|
# Am I typing :make in vim? Do a fast build.
|
2011-11-09 21:36:11 -04:00
|
|
|
ifdef VIM
|
2011-11-10 03:10:17 -04:00
|
|
|
all=fast
|
2011-11-09 21:36:11 -04:00
|
|
|
endif
|
|
|
|
|
|
|
|
all: $(all)
|
2010-11-10 10:49:35 -04:00
|
|
|
|
2011-11-10 03:10:17 -04:00
|
|
|
# Disables optimisation. Not for production use.
|
|
|
|
fast: GHCFLAGS=-Wall $(IGNORE)
|
|
|
|
fast: $(bins)
|
|
|
|
|
2011-08-20 16:11:42 -04:00
|
|
|
Build/SysConfig.hs: configure.hs Build/TestConfig.hs
|
2010-12-11 17:29:50 -04:00
|
|
|
$(GHCMAKE) configure
|
2010-11-18 13:30:42 -04:00
|
|
|
./configure
|
|
|
|
|
2011-03-22 15:39:36 -04:00
|
|
|
%.hs: %.hsc
|
2011-03-14 23:00:23 -04:00
|
|
|
hsc2hs $<
|
2011-03-15 21:34:13 -04:00
|
|
|
perl -i -pe 's/^{-# INCLUDE.*//' $@
|
2011-03-14 23:00:23 -04:00
|
|
|
|
2011-06-30 14:55:03 -04:00
|
|
|
Remote/S3.hs:
|
2011-03-30 01:32:05 -04:00
|
|
|
@ln -sf S3real.hs Remote/S3.hs
|
2011-06-30 14:55:03 -04:00
|
|
|
|
|
|
|
Remote/S3.o: Remote/S3.hs
|
2011-03-30 01:32:05 -04:00
|
|
|
@if ! $(GHCMAKE) Remote/S3.hs; then \
|
|
|
|
ln -sf S3stub.hs Remote/S3.hs; \
|
|
|
|
echo "** building without S3 support"; \
|
|
|
|
fi
|
|
|
|
|
2011-09-06 15:35:13 -04:00
|
|
|
sources: $(sources)
|
|
|
|
|
2011-09-07 10:21:19 -04:00
|
|
|
$(bins): sources Remote/S3.o
|
2010-12-30 16:52:24 -04:00
|
|
|
$(GHCMAKE) $@
|
|
|
|
|
2011-01-25 18:54:27 -04:00
|
|
|
git-annex.1: doc/git-annex.mdwn
|
2010-12-12 13:15:16 -04:00
|
|
|
./mdwn2man git-annex 1 doc/git-annex.mdwn > git-annex.1
|
2011-01-25 18:54:27 -04:00
|
|
|
git-annex-shell.1: doc/git-annex-shell.mdwn
|
|
|
|
./mdwn2man git-annex-shell 1 doc/git-annex-shell.mdwn > git-annex-shell.1
|
add git-union-merge
This is a new git subcommand, that does a generic union merge operation
between two refs, storing the result in a branch. It operates efficiently
without touching the working tree. It does need to write out a temporary
index file, and may need to write out some other temp files as well.
This could be useful for anything that stores data in a branch,
and needs to merge changes into that branch without actually checking the
branch out. Since conflict handling can't be done without a working copy,
the merge type is always a union merge, which is fine for data stored in
log format (as git-annex does), or in non-conflicting files
(as pristine-tar does).
This probably belongs in git proper, but it will live in git-annex for now.
---
Plan is to move .git-annex/ to a git-annex branch, and use git-union-merge
to handle merging changes when pulling from remotes.
Some preliminary benchmarking using real .git-annex/ data indicates
that it's quite fast, except for the "git add" call, which is as slow
as "git add" tends to be with a big index.
2011-06-20 19:44:45 -04:00
|
|
|
git-union-merge.1: doc/git-union-merge.mdwn
|
|
|
|
./mdwn2man git-union-merge 1 doc/git-union-merge.mdwn > git-union-merge.1
|
2010-10-10 00:18:16 -04:00
|
|
|
|
2010-12-12 13:15:16 -04:00
|
|
|
install: all
|
2010-12-11 17:29:50 -04:00
|
|
|
install -d $(DESTDIR)$(PREFIX)/bin
|
2010-12-30 16:52:24 -04:00
|
|
|
install $(bins) $(DESTDIR)$(PREFIX)/bin
|
2010-12-12 13:15:16 -04:00
|
|
|
install -d $(DESTDIR)$(PREFIX)/share/man/man1
|
2010-12-30 16:52:24 -04:00
|
|
|
install -m 0644 $(mans) $(DESTDIR)$(PREFIX)/share/man/man1
|
2010-12-12 13:15:16 -04:00
|
|
|
install -d $(DESTDIR)$(PREFIX)/share/doc/git-annex
|
|
|
|
if [ -d html ]; then \
|
|
|
|
rsync -a --delete html/ $(DESTDIR)$(PREFIX)/share/doc/git-annex/html/; \
|
|
|
|
fi
|
2010-10-16 16:41:24 -04:00
|
|
|
|
2011-01-07 02:15:23 -04:00
|
|
|
test: $(bins)
|
2011-06-22 20:42:00 -04:00
|
|
|
@if ! $(GHCMAKE) -O0 test; then \
|
2011-04-25 12:43:22 -04:00
|
|
|
echo "** not running test suite" >&2; \
|
|
|
|
else \
|
2011-08-27 12:34:02 -04:00
|
|
|
if ! ./test; then \
|
|
|
|
echo "** test suite failed!" >&2; \
|
2011-10-06 11:12:03 -04:00
|
|
|
exit 1; \
|
2011-08-27 12:34:02 -04:00
|
|
|
fi; \
|
2011-04-25 12:43:22 -04:00
|
|
|
fi
|
2010-12-11 17:37:24 -04:00
|
|
|
|
2011-01-07 02:15:23 -04:00
|
|
|
testcoverage: $(bins)
|
2011-01-04 21:05:31 -04:00
|
|
|
rm -f test.tix test
|
|
|
|
ghc -odir build/test -hidir build/test $(GHCFLAGS) --make -fhpc test
|
|
|
|
./test
|
2011-01-06 21:39:26 -04:00
|
|
|
@echo ""
|
2011-01-04 21:07:58 -04:00
|
|
|
@hpc report test --exclude=Main --exclude=QC
|
|
|
|
@hpc markup test --exclude=Main --exclude=QC --destdir=.hpc >/dev/null
|
2011-01-04 21:05:31 -04:00
|
|
|
|
2010-10-19 14:39:40 -04:00
|
|
|
# If ikiwiki is available, build static html docs suitable for being
|
|
|
|
# shipped in the software package.
|
2010-10-19 14:37:19 -04:00
|
|
|
ifeq ($(shell which ikiwiki),)
|
2010-11-01 20:27:30 -04:00
|
|
|
IKIWIKI=@echo "** ikiwiki not found, skipping building docs" >&2; true
|
2010-10-19 14:37:19 -04:00
|
|
|
else
|
|
|
|
IKIWIKI=ikiwiki
|
|
|
|
endif
|
|
|
|
|
2010-12-30 16:52:24 -04:00
|
|
|
docs: $(mans)
|
2010-10-19 14:39:40 -04:00
|
|
|
$(IKIWIKI) doc html -v --wikiname git-annex --plugin=goodstuff \
|
2010-10-19 19:28:29 -04:00
|
|
|
--no-usedirs --disable-plugin=openid --plugin=sidebar \
|
2010-10-22 15:12:48 -04:00
|
|
|
--underlaydir=/dev/null --disable-plugin=shortcut \
|
2010-12-02 21:37:55 -04:00
|
|
|
--disable-plugin=smiley \
|
2011-03-28 12:09:47 -04:00
|
|
|
--plugin=comments --set comments_pagespec="*" \
|
2010-12-02 21:37:55 -04:00
|
|
|
--exclude='news/.*'
|
2010-10-10 00:18:16 -04:00
|
|
|
|
2010-10-19 15:59:40 -04:00
|
|
|
clean:
|
2011-08-20 16:11:42 -04:00
|
|
|
rm -rf build $(bins) $(mans) test configure *.tix .hpc $(sources)
|
2011-06-30 15:37:35 -04:00
|
|
|
rm -rf doc/.ikiwiki html dist
|
2011-01-07 02:15:23 -04:00
|
|
|
find . \( -name \*.o -or -name \*.hi \) -exec rm {} \;
|
2010-10-19 15:59:40 -04:00
|
|
|
|
2011-07-02 14:53:55 -04:00
|
|
|
# Workaround for cabal sdist not running Setup hooks, so I cannot
|
|
|
|
# generate a file list there.
|
|
|
|
sdist: clean
|
|
|
|
@if [ ! -e git-annex.cabal.orig ]; then cp git-annex.cabal git-annex.cabal.orig; fi
|
2011-07-07 19:49:24 -04:00
|
|
|
@sed -e "s!\(Extra-Source-Files: \).*!\1$(shell find . -name .git -prune -or -not -name \\*.orig -not -type d -print | perl -ne 'print unless length >= 100')!i" < git-annex.cabal.orig > git-annex.cabal
|
2011-07-02 14:53:55 -04:00
|
|
|
@cabal sdist
|
|
|
|
@mv git-annex.cabal.orig git-annex.cabal
|
|
|
|
|
2010-12-30 16:52:24 -04:00
|
|
|
.PHONY: $(bins) test install
|