Browse Source

doc/Makefile: Auto-generate org-version.tex for orgcard

* doc/Makefile: Add rule to generate org-version.tex.
* doc/orgcard.tex: Include org-version.tex rather than explicitly
setting version and year.

This removes the only instance in the repo where the Org version is
hardcoded.
Kyle Meyer 1 year ago
parent
commit
a8d007db15
4 changed files with 12 additions and 5 deletions
  1. 1 0
      .gitignore
  2. 9 2
      doc/Makefile
  3. 1 3
      doc/orgcard.tex
  4. 1 0
      mk/targets.mk

+ 1 - 0
.gitignore

@@ -33,6 +33,7 @@ org
 org-loaddefs.el
 org-version.el
 doc/org-version.inc
+doc/org-version.tex
 org-*.tar*
 orgplus-*.tar*
 org-*.zip

+ 9 - 2
doc/Makefile

@@ -33,13 +33,20 @@ org-version.inc:	org.texi
 	@echo "@set VERSION $(ORGVERSION) ($(GITVERSION))" >> org-version.inc
 	@echo "@set DATE $(DATE)" >> org-version.inc
 
+org-version.tex:	orgcard.tex
+	@echo "org-version: $(ORGVERSION) ($(GITVERSION))"
+	@echo "% automatically generated, do not edit"  > org-version.tex
+	@echo "\def\orgversionnumber{$(ORGVERSION)}" >> org-version.tex
+	@echo "\def\versionyear{$(YEAR)}" >> org-version.tex
+	@echo "\def\year{$(YEAR)}" >> org-version.tex
+
 install:	org
 	if [ ! -d $(DESTDIR)$(infodir) ]; then $(MKDIR) $(DESTDIR)$(infodir); else true; fi ;
 	$(CP) org $(DESTDIR)$(infodir)
 	$(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) org
 
 clean:
-	$(RM) org *.pdf *.html *_letter.tex org-version.inc \
+	$(RM) org *.pdf *.html *_letter.tex org-version.inc org-version.tex \
 	      *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs \
 	      *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps
 cleanall:	clean
@@ -59,7 +66,7 @@ clean-install:
 %.pdf:		LANG=C
 %.pdf:		%.texi org-version.inc
 	$(TEXI2PDF) $<
-%.pdf:		%.tex
+%.pdf:		%.tex org-version.tex
 	PDFLATEX=$(PDFTEX) $(TEXI2PDF) $<
 
 %.html:		%.texi org-version.inc

+ 1 - 3
doc/orgcard.tex

@@ -1,7 +1,5 @@
 % Reference Card for Org Mode
-\def\orgversionnumber{9.0.4}
-\def\versionyear{2017}          % latest update
-\def\year{2017}                 % latest copyright year
+\input org-version.tex
 
 %**start of header
 \newcount\columnsperpage

+ 1 - 0
mk/targets.mk

@@ -20,6 +20,7 @@ else
   ORGVERSION ?= N/A
 endif
 DATE          = $(shell date +%Y-%m-%d)
+YEAR          = $(shell date +%Y)
 ifneq ($(GITSTATUS),)
   GITVERSION := $(GITVERSION:.dirty=).dirty
 endif