Add computation of the failure reason in hspace
[ganeti-local] / Makefile
index be3c899..40d0963 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
-HPROGS = hbal hn1 hscan hail test
+HPROGS = hbal hscan hail hspace
+HALLPROGS = $(HPROGS) test
 HSRCS := $(wildcard Ganeti/HTools/*.hs)
 HDDIR = apidoc
 
@@ -13,14 +14,16 @@ HPCEXCL = --exclude Main --exclude Ganeti.HTools.QC
 
 all: $(HPROGS)
 
-$(HPROGS): %: %.hs Ganeti/HTools/Version.hs $(HSRCS) Makefile
+$(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 \
@@ -28,7 +31,7 @@ doc: $(DOCS)
                $$file > $(HDDIR)/Ganeti/HTools/`basename $$file .hs`.html ; \
        done
        haddock --odir $(HDDIR) --html --ignore-all-exports \
-               -t htools -p haddock-prologue \
+               -t ganeti-htools -p haddock-prologue \
                --source-module="%{MODULE/.//}.html" \
                --source-entity="%{MODULE/.//}.html#%{NAME}" \
                $(HSRCS)
@@ -38,7 +41,7 @@ maintainer-clean:
        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
 
@@ -50,17 +53,17 @@ Ganeti/HTools/Version.hs: Ganeti/HTools/Version.hs.in version
 
 dist: Ganeti/HTools/Version.hs version doc
        VN=$$(cat version|sed 's/^v//') ; \
-       ANAME="htools-$$VN.tar" ; \
+       PFX="ganeti-htools-$$VN" ; \
+       ANAME="$$PFX.tar" ; \
        rm -f $$ANAME $$ANAME.gz ; \
-       git archive --format=tar --prefix=htools-$$VN/ HEAD > $$ANAME ; \
+       git archive --format=tar --prefix=$$PFX/ HEAD > $$ANAME ; \
        tar -r -f $$ANAME --owner root --group root \
-           --transform="s,^,htools-$$VN/," version apidoc $(DOCS) ; \
+           --transform="s,^,$$PFX/," version apidoc $(DOCS) ; \
        gzip -v9 $$ANAME ; \
        tar tzvf $$ANAME.gz
 
-check:
-       rm -f *.tix *.mix test
-       $(MAKE) HEXTRA=-fhpc test
+check: test
+       rm -f *.tix *.mix
        ./test
 ifeq ($(T),markup)
        mkdir -p coverage