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.
This commit is contained in:
Kyle Meyer 2017-06-23 14:54:02 -04:00
parent 6c498f1337
commit a8d007db15
4 changed files with 12 additions and 5 deletions

1
.gitignore vendored
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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