2010-12-11 21:29:50 +00:00
|
|
|
PREFIX=/usr
|
2011-02-08 19:11:49 +00:00
|
|
|
GHCFLAGS=-O2 -Wall -ignore-package monads-fd
|
2011-01-07 06:15:23 +00:00
|
|
|
GHCMAKE=ghc $(GHCFLAGS) --make
|
2010-10-19 18:39:40 +00:00
|
|
|
|
2010-12-30 20:52:24 +00:00
|
|
|
bins=git-annex git-annex-shell
|
|
|
|
mans=git-annex.1 git-annex-shell.1
|
|
|
|
|
|
|
|
all: $(bins) $(mans) docs
|
2010-11-10 14:49:35 +00:00
|
|
|
|
2011-01-20 00:02:48 +00:00
|
|
|
SysConfig.hs: configure.hs TestConfig.hs
|
2010-12-11 21:29:50 +00:00
|
|
|
$(GHCMAKE) configure
|
2010-11-18 17:30:42 +00:00
|
|
|
./configure
|
|
|
|
|
2011-03-15 03:00:23 +00:00
|
|
|
Touch.hs: Touch.hsc
|
|
|
|
hsc2hs $<
|
|
|
|
|
|
|
|
$(bins): SysConfig.hs Touch.hs
|
2010-12-30 20:52:24 +00:00
|
|
|
$(GHCMAKE) $@
|
|
|
|
|
2011-01-25 22:54:27 +00:00
|
|
|
git-annex.1: doc/git-annex.mdwn
|
2010-12-12 17:15:16 +00:00
|
|
|
./mdwn2man git-annex 1 doc/git-annex.mdwn > git-annex.1
|
2011-01-25 22:54:27 +00:00
|
|
|
git-annex-shell.1: doc/git-annex-shell.mdwn
|
|
|
|
./mdwn2man git-annex-shell 1 doc/git-annex-shell.mdwn > git-annex-shell.1
|
2010-10-10 04:18:16 +00:00
|
|
|
|
2010-12-12 17:15:16 +00:00
|
|
|
install: all
|
2010-12-11 21:29:50 +00:00
|
|
|
install -d $(DESTDIR)$(PREFIX)/bin
|
2010-12-30 20:52:24 +00:00
|
|
|
install $(bins) $(DESTDIR)$(PREFIX)/bin
|
2010-12-12 17:15:16 +00:00
|
|
|
install -d $(DESTDIR)$(PREFIX)/share/man/man1
|
2010-12-30 20:52:24 +00:00
|
|
|
install -m 0644 $(mans) $(DESTDIR)$(PREFIX)/share/man/man1
|
2010-12-12 17:15:16 +00: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 20:41:24 +00:00
|
|
|
|
2011-01-07 06:15:23 +00:00
|
|
|
test: $(bins)
|
2010-12-11 21:37:24 +00:00
|
|
|
$(GHCMAKE) test
|
|
|
|
./test
|
|
|
|
|
2011-01-07 06:15:23 +00:00
|
|
|
testcoverage: $(bins)
|
2011-01-05 01:05:31 +00:00
|
|
|
rm -f test.tix test
|
|
|
|
ghc -odir build/test -hidir build/test $(GHCFLAGS) --make -fhpc test
|
|
|
|
./test
|
2011-01-07 01:39:26 +00:00
|
|
|
@echo ""
|
2011-01-05 01:07:58 +00:00
|
|
|
@hpc report test --exclude=Main --exclude=QC
|
|
|
|
@hpc markup test --exclude=Main --exclude=QC --destdir=.hpc >/dev/null
|
2011-01-05 01:05:31 +00:00
|
|
|
|
2010-10-19 18:39:40 +00:00
|
|
|
# If ikiwiki is available, build static html docs suitable for being
|
|
|
|
# shipped in the software package.
|
2010-10-19 18:37:19 +00:00
|
|
|
ifeq ($(shell which ikiwiki),)
|
2010-11-02 00:27:30 +00:00
|
|
|
IKIWIKI=@echo "** ikiwiki not found, skipping building docs" >&2; true
|
2010-10-19 18:37:19 +00:00
|
|
|
else
|
|
|
|
IKIWIKI=ikiwiki
|
|
|
|
endif
|
|
|
|
|
2010-12-30 20:52:24 +00:00
|
|
|
docs: $(mans)
|
2010-10-19 18:39:40 +00:00
|
|
|
$(IKIWIKI) doc html -v --wikiname git-annex --plugin=goodstuff \
|
2010-10-19 23:28:29 +00:00
|
|
|
--no-usedirs --disable-plugin=openid --plugin=sidebar \
|
2010-10-22 19:12:48 +00:00
|
|
|
--underlaydir=/dev/null --disable-plugin=shortcut \
|
2010-12-03 01:37:55 +00:00
|
|
|
--disable-plugin=smiley \
|
|
|
|
--exclude='news/.*'
|
2010-10-10 04:18:16 +00:00
|
|
|
|
2010-10-19 19:59:40 +00:00
|
|
|
clean:
|
2011-03-15 03:00:23 +00:00
|
|
|
rm -rf build $(bins) $(mans) test configure Touch.hs SysConfig.hs *.tix .hpc
|
2010-10-19 19:59:40 +00:00
|
|
|
rm -rf doc/.ikiwiki html
|
2011-01-07 06:15:23 +00:00
|
|
|
find . \( -name \*.o -or -name \*.hi \) -exec rm {} \;
|
2010-10-19 19:59:40 +00:00
|
|
|
|
2010-12-30 20:52:24 +00:00
|
|
|
.PHONY: $(bins) test install
|