HPROGS = hbal hn1 hscan hail
+HALLPROGS = $(HPROGS) test
HSRCS := $(wildcard Ganeti/HTools/*.hs)
HDDIR = apidoc
DOCS = README.html NEWS.html
+HFLAGS = -O2 -W -fwarn-monomorphism-restriction -fwarn-tabs
+HEXTRA =
+
+HPCEXCL = --exclude Main --exclude Ganeti.HTools.QC
+
# Haskell rules
all: $(HPROGS)
-$(HPROGS): %: %.hs Ganeti/HTools/Version.hs $(HSRCS) Makefile
- ghc --make -O2 -W $@
+$(HALLPROGS): %: %.hs Ganeti/HTools/Version.hs $(HSRCS) Makefile
+ ghc --make $(HFLAGS) $(HEXTRA) $@
+
+test: HEXTRA=-fhpc
$(DOCS) : %.html : %
rst2html $< $@
-doc: $(DOCS)
- rm -rf $(HDDIR)
+doc: $(DOCS) Ganeti/HTools/Version.hs
+ rm -rf $(HDDIR)/*
mkdir -p $(HDDIR)/Ganeti/HTools
cp hscolour.css $(HDDIR)/Ganeti/HTools
for file in $(HSRCS); do \
rm -f $(DOCS) TAGS version Ganeti/HTools/Version.hs
clean:
- rm -f $(HPROGS)
+ rm -f $(HALLPROGS)
rm -f *.o *.prof *.ps *.stat *.aux *.hi
cd Ganeti/HTools && rm -f *.o *.prof *.ps *.stat *.aux *.hi
gzip -v9 $$ANAME ; \
tar tzvf $$ANAME.gz
-.PHONY : all doc maintainer-clean clean dist
+check: test
+ rm -f *.tix *.mix
+ ./test
+ifeq ($(T),markup)
+ mkdir -p coverage
+ hpc markup --destdir=coverage test $(HPCEXCL)
+else
+ hpc report test $(HPCEXCL)
+endif
+
+.PHONY : all doc maintainer-clean clean dist check