Skip to content
Snippets Groups Projects
Commit f6c68f9d authored by Iustin Pop's avatar Iustin Pop
Browse files

Only update the version file on make dist


Since on regular compiles the version information is not critical, it's
better to only update it on make dist; furthermore, there it is indeed
needed to regenerate it automatically, without requiring the use of make
maintainerclean beforehand.

This patch simply adds a new phony target that forces regeneration as a
prerequisite for the dist rule.

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 66dac8e0
No related branches found
No related tags found
No related merge requests found
......@@ -46,13 +46,13 @@ clean:
cd Ganeti && rm -f *.o *.prof *.ps *.stat *.aux *.hi
cd Ganeti/HTools && rm -f *.o *.prof *.ps *.stat *.aux *.hi
.PHONY: version
regen-version:
rm -f version
$(MAKE) version
version:
set -e; \
if test -d .git; then \
git describe > $@.tmp; \
cmp -s $@ $@.tmp || mv $@.tmp $@; \
rm -f $@.tmp; \
git describe > $@; \
elif test ! -f $@ ; then \
echo "Cannot auto-generate $@ file"; exit 1; \
fi
......@@ -60,7 +60,7 @@ version:
Ganeti/HTools/Version.hs: Ganeti/HTools/Version.hs.in version
sed -e "s/%ver%/$$(cat version)/" < $< > $@
dist: Ganeti/HTools/Version.hs version doc
dist: regen-version Ganeti/HTools/Version.hs doc
VN=$$(cat version|sed 's/^v//') ; \
PFX="ganeti-htools-$$VN" ; \
ANAME="$$PFX.tar" ; \
......@@ -84,4 +84,4 @@ endif
tags:
find -name '*.hs' | xargs hasktags -e
.PHONY : all doc maintainer-clean clean dist check tags
.PHONY : all doc maintainer-clean clean dist check tags regen-version
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment