From 0464b2c793052e1066f0c89f1d4b69f4dc0fd0ce Mon Sep 17 00:00:00 2001
From: "Robert P. Goldman" <rpgoldman@sift.net>
Date: Mon, 23 Mar 2015 22:45:27 -0500
Subject: [PATCH] Add version numbering to manual.

Horrible perl snippet to pull version number into texinfo. Open for
tastier version.
---
 .gitignore       |  1 +
 doc/Makefile     | 11 +++++++----
 doc/asdf.texinfo |  8 ++++++--
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/.gitignore b/.gitignore
index bb3f8f23..b17f0de9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,6 +23,7 @@ doc/asdf.vr
 doc/asdf.vrs
 doc/asdf.t2d/
 doc/asdf.dvi
+doc/version.texinfo
 *.tmp
 
 LICENSE
diff --git a/doc/Makefile b/doc/Makefile
index 7e23982a..632804cf 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -12,16 +12,19 @@ intermediate = asdf.cps asdf.log asdf.vr asdf.aux asdf.fn asdf.toc asdf.vrs \
 
 all:	asdf.html asdf.info asdf.pdf manual-html
 
-manual-html: asdf.texinfo
+version.texinfo: ../version.lisp-expr
+	head -n 1 $^ | perl -ne 'm|\"(.*)\"|; print "\@set VERSION $$1\n"' > $@
+
+manual-html: asdf.texinfo version.texinfo
 	makeinfo --html asdf.texinfo
 
-asdf.html: asdf.texinfo
+asdf.html: asdf.texinfo version.texinfo
 	makeinfo --html --no-split --no-headers -o asdf.html asdf.texinfo
 
-asdf.info: asdf.texinfo
+asdf.info: asdf.texinfo version.texinfo
 	makeinfo asdf.texinfo
 
-asdf.pdf: asdf.texinfo
+asdf.pdf: asdf.texinfo version.texinfo
 	texi2pdf asdf.texinfo
 
 website: all
diff --git a/doc/asdf.texinfo b/doc/asdf.texinfo
index 5af04230..0467a332 100644
--- a/doc/asdf.texinfo
+++ b/doc/asdf.texinfo
@@ -63,11 +63,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 @end copying
 
-
+@include version.texinfo
 
 @titlepage
 @title ASDF: Another System Definition Facility
-
+@subtitle Manual for Version @value{VERSION}
 @c The following two commands start the copyright page.
 @page
 @vskip 0pt plus 1filll
@@ -83,6 +83,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 @node Top, Introduction, (dir), (dir)
 @top ASDF: Another System Definition Facility
+@ifnottex
+Manual for Version @value{VERSION}
+@end ifnottex
+
 
 @insertcopying
 
-- 
GitLab