Fix dist archive generation
authorIustin Pop <iustin@google.com>
Mon, 14 Feb 2011 10:47:28 +0000 (11:47 +0100)
committerIustin Pop <iustin@google.com>
Thu, 17 Feb 2011 15:16:44 +0000 (16:16 +0100)
As reported in issue 140, the timestamps of the generated files can be
older than the commit timestamp, leading to needless rebuilds of man
pages and such. Furthermore, with the man pages not built, it
currently fails, as there is no dependency on them.

Therefore, we change the ‘dist’ rule so that it forces a
maintainer-clean and then explicitly rebuilds the needed targets, so
that we have up-to-date timestamps.

Last, we also ship the HTML versions of the man pages.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

Makefile

index 6dcbe43..c02decb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -54,6 +54,7 @@ doc: $(DOCS) Ganeti/HTools/Version.hs
 maintainer-clean:
        rm -rf $(HDDIR)
        rm -f $(DOCS) TAGS version Ganeti/HTools/Version.hs
+       rm -f $(MANS) $(MANHTML)
 
 clean:
        rm -f $(HALLPROGS)
@@ -76,7 +77,10 @@ version:
 Ganeti/HTools/Version.hs: Ganeti/HTools/Version.hs.in version
        sed -e "s/%ver%/$$(cat version)/" < $< > $@
 
-dist: regen-version Ganeti/HTools/Version.hs doc
+dist:
+       $(MAKE) maintainer-clean
+       $(MAKE) regen-version Ganeti/HTools/Version.hs doc
+       $(MAKE) man
        set -e ; \
        VN=$$(sed 's/^v//' < version) ; \
        PFX="ganeti-htools-$$VN" ; \
@@ -84,7 +88,8 @@ dist: regen-version Ganeti/HTools/Version.hs doc
        rm -f $$ANAME $$ANAME.gz ; \
        git archive --format=tar --prefix=$$PFX/ HEAD > $$ANAME ; \
        tar -r -f $$ANAME --owner root --group root \
-           --transform="s,^,$$PFX/,S" version apidoc $(DOCS) $(MANS); \
+           --transform="s,^,$$PFX/,S" version apidoc \
+           $(DOCS) $(MANS) $(MANHTML); \
        gzip -v9 $$ANAME ; \
        TMPDIR=$$(mktemp -d) ; \
        tar xzf $$ANAME.gz -C $$TMPDIR; \