1 HPROGS = hbal hscan hail hspace
2 HALLPROGS = $(HPROGS) test
3 HSRCS := $(wildcard Ganeti/HTools/*.hs) $(wildcard Ganeti/*.hs)
6 DOCS = README.html NEWS.html
8 HFLAGS = -O2 -Wall -Werror -fwarn-monomorphism-restriction -fwarn-tabs
11 HPCEXCL = --exclude Main --exclude Ganeti.HTools.QC
17 $(HALLPROGS): %: %.hs Ganeti/HTools/Version.hs $(HSRCS) Makefile
18 ghc --make $(HFLAGS) $(HEXTRA) $@
20 test: HEXTRA=-fhpc -Wwarn
25 doc: $(DOCS) Ganeti/HTools/Version.hs
27 mkdir -p $(HDDIR)/Ganeti/HTools
28 cp hscolour.css $(HDDIR)/Ganeti/HTools
29 for file in $(HSRCS); do \
30 HsColour -css -anchor \
31 $$file > $(HDDIR)/Ganeti/HTools/`basename $$file .hs`.html ; \
33 haddock --odir $(HDDIR) --html --ignore-all-exports \
34 -t ganeti-htools -p haddock-prologue \
35 --source-module="%{MODULE/.//}.html" \
36 --source-entity="%{MODULE/.//}.html#%{NAME}" \
37 $(filter-out Ganeti/HTools/ExtLoader.hs,$(HSRCS))
41 rm -f $(DOCS) TAGS version Ganeti/HTools/Version.hs
45 rm -f *.o *.prof *.ps *.stat *.aux *.hi
46 rm -f Ganeti/HTools/Version.hs
47 cd Ganeti && rm -f *.o *.prof *.ps *.stat *.aux *.hi
48 cd Ganeti/HTools && rm -f *.o *.prof *.ps *.stat *.aux *.hi
55 if test -d .git; then \
57 elif test ! -f $@ ; then \
58 echo "Cannot auto-generate $@ file"; exit 1; \
61 Ganeti/HTools/Version.hs: Ganeti/HTools/Version.hs.in version
62 sed -e "s/%ver%/$$(cat version)/" < $< > $@
64 dist: regen-version Ganeti/HTools/Version.hs doc
66 VN=$$(cat version|sed 's/^v//') ; \
67 PFX="ganeti-htools-$$VN" ; \
69 rm -f $$ANAME $$ANAME.gz ; \
70 git archive --format=tar --prefix=$$PFX/ HEAD > $$ANAME ; \
71 tar -r -f $$ANAME --owner root --group root \
72 --transform="s,^,$$PFX/," version apidoc $(DOCS) ; \
74 TMPDIR=$$(mktemp -d) ; \
75 tar xzf $$ANAME.gz -C $$TMPDIR; \
76 (cd $$TMPDIR/$$PFX; make; make clean; make check); \
78 tar tzvf $$ANAME.gz ; \
79 sha1sum $$ANAME.gz ; \
80 echo "Archive $$ANAME.gz created."
87 hpc markup --destdir=coverage test $(HPCEXCL)
89 hpc report test $(HPCEXCL)
93 find -name '*.hs' | xargs hasktags -e
95 .PHONY : all doc maintainer-clean clean dist check tags regen-version