Skip to content

Commit

Permalink
Add doc revision to C++ for OpenCL in Makefile (#739)
Browse files Browse the repository at this point in the history
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 <sven.vanhaastregt@arm.com>
  • Loading branch information
AnastasiaStulova and svenvh authored Dec 20, 2021
1 parent 211d598 commit 3d36d93
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,36 @@ SPECREVISION = $(shell echo `git describe --tags --dirty`)
SPECREMARK = from git branch: $(shell echo `git symbolic-ref --short HEAD`) \
commit: $(shell echo `git log -1 --format="%H"`)
endif

ATTRIBOPTS_NO_VERSION = -a revdate="$(SPECDATE)" \
-a revremark="$(SPECREMARK)" \
# The C++ for OpenCL document revision scheme is aligned with its release date.
# Revision naming scheme is as follows:
# DocRevYYYY.MM,
# where YYYY corresponds to its release year,
# MM corresponds to its release month.
# Example for the release in Dec 2021 the revision is DocRev2021.12.
# Leave as 'DocRevYYYY.MM-Next' if the doc content does not correspond to any official revision.
# where DocRevYYYY.MM is the last released revision.
CXX4OPENCL_DOCREVISION = DocRev2021.12
CXX4OPENCL_DOCREMARK = $(SPECREMARK) \
tag: $(SPECREVISION)

COMMONATTRIBOPTS = -a revdate="$(SPECDATE)" \
-a stem=latexmath \
-a generated=$(GENERATED) \
-a sectnumlevels=5

ATTRIBOPTS = -a revnumber="$(SPECREVISION)" \
$(ATTRIBOPTS_NO_VERSION)
-a revremark="$(SPECREMARK)" \
$(COMMONATTRIBOPTS)

CXX4OPENCL_ATTRIBOPTS = -a revnumber="$(CXX4OPENCL_DOCREVISION)" \
-a revremark="$(CXX4OPENCL_DOCREMARK)" \
$(COMMONATTRIBOPTS)


ADOCEXTS = -r $(CURDIR)/config/sectnumoffset-treeprocessor.rb \
-r $(CURDIR)/config/spec-macros.rb \
-r $(CURDIR)/config/rouge_opencl.rb
ADOCOPTS_NO_VERSION = -d book $(ATTRIBOPTS_NO_VERSION) $(NOTEOPTS) $(VERBOSE) $(ADOCEXTS)
CXX4OPENCL_ADOCOPTS = -d book $(CXX4OPENCL_ATTRIBOPTS) $(NOTEOPTS) $(VERBOSE) $(ADOCEXTS)
ADOCCOMMONOPTS = -a apispec="$(CURDIR)/api" \
-a config="$(CURDIR)/config" \
-a cspec="$(CURDIR)/c" \
Expand Down Expand Up @@ -352,14 +368,14 @@ CXX4OPENCLDOCSRC = $(CXX4OPENCLDOC).txt $(GENDEPENDS) \
cxx4openclhtml: $(HTMLDIR)/$(CXX4OPENCLDOC).html $(CXX4OPENCLDOCSRC)

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

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

$(PDFDIR)/$(CXX4OPENCLDOC).pdf: $(CXX4OPENCLDOCSRC)
$(QUIET)$(MKDIR) $(PDFDIR)
$(QUIET)$(MKDIR) $(PDFMATHDIR)
$(QUIET)$(ASCIIDOCTOR) -b pdf $(ADOCOPTS_NO_VERSION) $(ADOCPDFOPTS) -o $@ $(CXX4OPENCLDOC).txt
$(QUIET)$(ASCIIDOCTOR) -b pdf $(CXX4OPENCL_ADOCOPTS) $(ADOCPDFOPTS) -o $@ $(CXX4OPENCLDOC).txt
ifndef GS_EXISTS
$(QUIET) echo "Warning: Ghostscript not installed, skipping pdf optimization"
else
Expand Down

0 comments on commit 3d36d93

Please sign in to comment.