From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: [PATCH] doc/Makefile: Auto-generate org-version.tex for orgcard Date: Fri, 23 Jun 2017 15:58:06 -0400 Message-ID: <871sqabho1.fsf@kyleam.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dOUid-0003Ax-C6 for emacs-orgmode@gnu.org; Fri, 23 Jun 2017 15:58:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dOUic-0004Wt-CS for emacs-orgmode@gnu.org; Fri, 23 Jun 2017 15:58:15 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Org-mode Cc: Bastien Guerry Hello, It seems that the only place where we hardcode the Org version is orgcard.tex. Any objections to auto-generating this as well? -- >8 -- * 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. --- .gitignore | 1 + doc/Makefile | 11 +++++++++-- doc/orgcard.tex | 4 +--- mk/targets.mk | 1 + 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 70980cede..68d94d595 100644 --- a/.gitignore +++ b/.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 diff --git a/doc/Makefile b/doc/Makefile index 2c8a3c58c..87f8c2781 100644 --- a/doc/Makefile +++ b/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 diff --git a/doc/orgcard.tex b/doc/orgcard.tex index 7f300633f..9659c5b4b 100644 --- a/doc/orgcard.tex +++ b/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 diff --git a/mk/targets.mk b/mk/targets.mk index 0ccb6eafb..de4b8b861 100644 --- a/mk/targets.mk +++ b/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 -- 2.13.1