Skip to content

Commit 3d36d93

Browse files
Add doc revision to C++ for OpenCL in Makefile (#739)
This commit adds a document revision according to this scheme: DocRev<YYYY.MM> - where YYYY is a year of the release - and MM is a month of the release This revisioning will divorce the document versioning from the language versioning, providing an easy way to reference the document independent from the language versions it describes. Co-authored-by: Sven van Haastregt <[email protected]>
1 parent 211d598 commit 3d36d93

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

Makefile

+23-7
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,36 @@ SPECREVISION = $(shell echo `git describe --tags --dirty`)
6868
SPECREMARK = from git branch: $(shell echo `git symbolic-ref --short HEAD`) \
6969
commit: $(shell echo `git log -1 --format="%H"`)
7070
endif
71-
72-
ATTRIBOPTS_NO_VERSION = -a revdate="$(SPECDATE)" \
73-
-a revremark="$(SPECREMARK)" \
71+
# The C++ for OpenCL document revision scheme is aligned with its release date.
72+
# Revision naming scheme is as follows:
73+
# DocRevYYYY.MM,
74+
# where YYYY corresponds to its release year,
75+
# MM corresponds to its release month.
76+
# Example for the release in Dec 2021 the revision is DocRev2021.12.
77+
# Leave as 'DocRevYYYY.MM-Next' if the doc content does not correspond to any official revision.
78+
# where DocRevYYYY.MM is the last released revision.
79+
CXX4OPENCL_DOCREVISION = DocRev2021.12
80+
CXX4OPENCL_DOCREMARK = $(SPECREMARK) \
81+
tag: $(SPECREVISION)
82+
83+
COMMONATTRIBOPTS = -a revdate="$(SPECDATE)" \
7484
-a stem=latexmath \
7585
-a generated=$(GENERATED) \
7686
-a sectnumlevels=5
7787

7888
ATTRIBOPTS = -a revnumber="$(SPECREVISION)" \
79-
$(ATTRIBOPTS_NO_VERSION)
89+
-a revremark="$(SPECREMARK)" \
90+
$(COMMONATTRIBOPTS)
91+
92+
CXX4OPENCL_ATTRIBOPTS = -a revnumber="$(CXX4OPENCL_DOCREVISION)" \
93+
-a revremark="$(CXX4OPENCL_DOCREMARK)" \
94+
$(COMMONATTRIBOPTS)
95+
8096

8197
ADOCEXTS = -r $(CURDIR)/config/sectnumoffset-treeprocessor.rb \
8298
-r $(CURDIR)/config/spec-macros.rb \
8399
-r $(CURDIR)/config/rouge_opencl.rb
84-
ADOCOPTS_NO_VERSION = -d book $(ATTRIBOPTS_NO_VERSION) $(NOTEOPTS) $(VERBOSE) $(ADOCEXTS)
100+
CXX4OPENCL_ADOCOPTS = -d book $(CXX4OPENCL_ATTRIBOPTS) $(NOTEOPTS) $(VERBOSE) $(ADOCEXTS)
85101
ADOCCOMMONOPTS = -a apispec="$(CURDIR)/api" \
86102
-a config="$(CURDIR)/config" \
87103
-a cspec="$(CURDIR)/c" \
@@ -352,14 +368,14 @@ CXX4OPENCLDOCSRC = $(CXX4OPENCLDOC).txt $(GENDEPENDS) \
352368
cxx4openclhtml: $(HTMLDIR)/$(CXX4OPENCLDOC).html $(CXX4OPENCLDOCSRC)
353369

354370
$(HTMLDIR)/$(CXX4OPENCLDOC).html: $(CXX4OPENCLDOCSRC) $(KATEXINST)
355-
$(QUIET)$(ASCIIDOCTOR) -b html5 $(ADOCOPTS_NO_VERSION) $(ADOCHTMLOPTS) -o $@ $(CXX4OPENCLDOC).txt
371+
$(QUIET)$(ASCIIDOCTOR) -b html5 $(CXX4OPENCL_ADOCOPTS) $(ADOCHTMLOPTS) -o $@ $(CXX4OPENCLDOC).txt
356372

357373
cxx4openclpdf: $(PDFDIR)/$(CXX4OPENCLDOC).pdf $(CXX4OPENCLDOCSRC)
358374

359375
$(PDFDIR)/$(CXX4OPENCLDOC).pdf: $(CXX4OPENCLDOCSRC)
360376
$(QUIET)$(MKDIR) $(PDFDIR)
361377
$(QUIET)$(MKDIR) $(PDFMATHDIR)
362-
$(QUIET)$(ASCIIDOCTOR) -b pdf $(ADOCOPTS_NO_VERSION) $(ADOCPDFOPTS) -o $@ $(CXX4OPENCLDOC).txt
378+
$(QUIET)$(ASCIIDOCTOR) -b pdf $(CXX4OPENCL_ADOCOPTS) $(ADOCPDFOPTS) -o $@ $(CXX4OPENCLDOC).txt
363379
ifndef GS_EXISTS
364380
$(QUIET) echo "Warning: Ghostscript not installed, skipping pdf optimization"
365381
else

0 commit comments

Comments
 (0)