From 1a5c0f9895701ae38840a2f57b693fd2d418af00 Mon Sep 17 00:00:00 2001
From: Alessandro Rubini <rubini@gnudd.com>
Date: Sat, 12 Oct 2013 14:59:52 +0200
Subject: [PATCH] doc: generate release value from git version

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
---
 doc/Makefile     | 4 +++-
 doc/wrs-build.in | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/doc/Makefile b/doc/Makefile
index 0b9c78ab5..06cdeb907 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -18,9 +18,11 @@ ALL    = $(INFO) $(HTML) $(TXT) $(PDF)
 
 MAKEINFO ?= makeinfo
 
+RELEASE=$(shell git describe --always --dirty)
+
 %.texi: %.in
 	@rm -f $@
-	sed -f ./infofilter $< > $@
+	sed s/__RELEASE_GIT_ID__/$(RELEASE)/ $< | sed -f ./infofilter > $@
 	emacs -batch --no-site-file -l fixinfo $@
 	chmod -w $@
 
diff --git a/doc/wrs-build.in b/doc/wrs-build.in
index 936b0a76c..e67d905bf 100644
--- a/doc/wrs-build.in
+++ b/doc/wrs-build.in
@@ -36,12 +36,14 @@
 @setchapternewpage off
 
 @set update-month July 2013
+@c the release name below is substituted at build time
+@set release __RELEASE_GIT_ID__
 
 @finalout
 
 @titlepage
 @title White Rabbit Switch: software build scripts
-@subtitle @value{update-month}
+@subtitle @value{update-month} (@value{release})
 @subtitle How to rebuild the whole software package from sources
 @author Alessandro Rubini, Benoit Rat, Federico Vaga et al.
 @end titlepage
-- 
GitLab