Fix the makefile dist rule
[ganeti-local] / Makefile
index 67096d4..bfa94e0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-HPROGS = hbal hn1
+HPROGS = hbal hn1 hscan
 HSRCS := $(wildcard Ganeti/HTools/*.hs)
 HDDIR = apidoc
 
@@ -8,7 +8,7 @@ DOCS = README.html NEWS.html
 
 all: $(HPROGS)
 
-hn1 hbal: % : %.hs Ganeti/HTools/Version.hs $(HSRCS) Makefile
+$(HPROGS): %: %.hs Ganeti/HTools/Version.hs $(HSRCS) Makefile
        ghc --make -O2 -W $@
 
 $(DOCS) : %.html : %
@@ -29,7 +29,7 @@ doc: $(DOCS)
                $(HSRCS)
 
 clean:
-       rm -f hbal hn1
+       rm -f $(HPROGS)
        rm -f *.o *.prof *.ps *.stat *.aux *.hi
        cd Ganeti/HTools && rm -f *.o *.prof *.ps *.stat *.aux *.hi
        rm -f $(DOCS) TAGS Ganeti/HTools/Version.hs
@@ -41,13 +41,13 @@ version:
 Ganeti/HTools/Version.hs: Ganeti/HTools/Version.hs.in version
        sed -e "s/%ver%/$$(cat version)/" < $< > $@
 
-dist: version doc
+dist: Ganeti/HTools/Version.hs version doc
        VN=$$(cat version|sed 's/^v//') ; \
        ANAME="htools-$$VN.tar" ; \
        rm -f $$ANAME $$ANAME.gz ; \
        git archive --format=tar --prefix=htools-$$VN/ HEAD > $$ANAME ; \
        tar -r -f $$ANAME --owner root --group root \
-           --transform="s,^,htools-$$VN/," version ; \
+           --transform="s,^,htools-$$VN/," version apidoc $(DOCS) ; \
        gzip -v9 $$ANAME ; \
        tar tzvf $$ANAME.gz