git-annex/Makefile

82 lines
2.2 KiB
Makefile
Raw Normal View History

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-06 21:41:13 -04:00
GHCFLAGS=-O2 -Wall $(IGNORE)
2011-04-05 14:00:51 -04:00
ifdef PROFILE
GHCFLAGS=-prof -auto-all -rtsopts -caf-all -fforce-recomp $(IGNORE)
2011-04-05 14:00:51 -04:00
endif
GHCMAKE=ghc $(GHCFLAGS) --make
2010-10-19 14:39:40 -04:00
bins=git-annex git-annex-shell
mans=git-annex.1 git-annex-shell.1
all: $(bins) $(mans) docs
2011-01-19 20:02:48 -04:00
SysConfig.hs: configure.hs TestConfig.hs
2010-12-11 17:29:50 -04:00
$(GHCMAKE) configure
./configure
2011-03-22 15:39:36 -04:00
%.hs: %.hsc
hsc2hs $<
perl -i -pe 's/^{-# INCLUDE.*//' $@
Remote/S3.o:
@ln -sf S3real.hs Remote/S3.hs
@if ! $(GHCMAKE) Remote/S3.hs; then \
ln -sf S3stub.hs Remote/S3.hs; \
echo "** building without S3 support"; \
fi
$(bins): SysConfig.hs Touch.hs StatFS.hs Remote/S3.o
$(GHCMAKE) $@
2011-01-25 18:54:27 -04:00
git-annex.1: doc/git-annex.mdwn
./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
2010-10-10 00:18:16 -04:00
install: all
2010-12-11 17:29:50 -04:00
install -d $(DESTDIR)$(PREFIX)/bin
install $(bins) $(DESTDIR)$(PREFIX)/bin
install -d $(DESTDIR)$(PREFIX)/share/man/man1
install -m 0644 $(mans) $(DESTDIR)$(PREFIX)/share/man/man1
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
test: $(bins)
2010-12-11 17:37:24 -04:00
$(GHCMAKE) test
./test
testcoverage: $(bins)
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
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),)
IKIWIKI=@echo "** ikiwiki not found, skipping building docs" >&2; true
2010-10-19 14:37:19 -04:00
else
IKIWIKI=ikiwiki
endif
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 \
--disable-plugin=smiley \
2011-03-28 12:09:47 -04:00
--plugin=comments --set comments_pagespec="*" \
--exclude='news/.*'
2010-10-10 00:18:16 -04:00
2010-10-19 15:59:40 -04:00
clean:
rm -rf build $(bins) $(mans) test configure *.tix .hpc \
StatFS.hs Touch.hs SysConfig.hs Remote/S3.hs
2010-10-19 15:59:40 -04:00
rm -rf doc/.ikiwiki html
find . \( -name \*.o -or -name \*.hi \) -exec rm {} \;
2010-10-19 15:59:40 -04:00
.PHONY: $(bins) test install