Revision 84a12e40 Makefile.am

b/Makefile.am
66 66
	$(docpng) \
67 67
	$(maninput) \
68 68
	doc/install-quick.rst \
69
	doc/news.rst
69
	doc/news.rst \
70
	vcs-version
70 71

  
71 72
maintainer-clean-local:
72 73
	rm -rf $(BUILDTIME_DIRS)
......
501 502
man/%.html: man/%.html.in $(REPLACE_VARS_SED)
502 503
	sed -f $(REPLACE_VARS_SED) < $< > $@
503 504

  
504
lib/_autoconf.py: Makefile stamp-directories
505
vcs-version:
506
	if test -d .git; then \
507
	  git describe > $@; \
508
	elif test ! -f $@ ; then \
509
	  echo "Cannot auto-generate $@ file"; exit 1; \
510
	fi
511

  
512
.PHONY: regen-vcs-version
513
regen-vcs-version:
505 514
	set -e; \
515
	cd $(srcdir); \
516
	if test -d .git; then \
517
	  rm -f vcs-version; \
518
	  $(MAKE) vcs-version; \
519
	fi
520

  
521
lib/_autoconf.py: Makefile stamp-directories vcs-version
522
	set -e; \
523
	VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
506 524
	{ echo '# This file is automatically generated, do not edit!'; \
507 525
	  echo '#'; \
508 526
	  echo ''; \
......
547 565
	  echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
548 566
	  echo "MASTERD_USER = '$(MASTERD_USER)'"; \
549 567
	  echo "RAPI_USER = '$(RAPI_USER)'"; \
568
	  echo "VCS_VERSION = '$$VCSVER'"; \
550 569
	} > $@
551 570

  
552 571
$(REPLACE_VARS_SED): Makefile
......
620 639
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
621 640
	$(PYLINT) $(LINT_OPTS) $(lint_python_code)
622 641

  
623
# a dist hook rule for catching revision control directories
642
# a dist hook rule for updating the vcs-version file; this is
643
# hardcoded due to where it needs to build the file...
644
dist-hook:
645
	$(MAKE) regen-vcs-version && \
646
	rm -f $(top_distdir)/vcs-version && \
647
	cp -p $(srcdir)/vcs-version $(top_distdir)
648

  
649
# a distcheck hook rule for catching revision control directories
624 650
distcheck-hook:
625 651
	if find $(top_distdir) -name .svn -or -name .git | grep .; then \
626 652
		echo "Found revision control files in final archive." 1>&2; \

Also available in: Unified diff