@@ -44,7 +44,7 @@ ifneq (,$(strip $(VERY_STRICT)))
4444ASCIIDOC := $(ASCIIDOC ) --failure-level WARN
4545endif
4646
47- SPECREVISION = 1.0.19
47+ SPECREVISION = 1.0.20
4848REVISION_COMPONENTS = $(subst ., ,$(SPECREVISION ) )
4949MAJORMINORVER = $(word 1,$(REVISION_COMPONENTS ) ) .$(word 2,$(REVISION_COMPONENTS ) )
5050
@@ -65,6 +65,8 @@ SPECTOOLS := $(SCRIPTS)/spec_tools
6565XRAPI := scripts/xrapi.py
6666METADIR := sources/chapters/extensions/meta
6767
68+ VK_REF_PAGE_ROOT := https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html
69+
6870# Gets built automatically
6971ASCIIDOCTOR_TARGETS :=
7072
@@ -96,7 +98,9 @@ default:
9698 $(ECHO) "all: build as many of these as possible: header header-test html pdf styleguide loader build-examples check-spec-links"
9799
98100 @if [ -d sources/chapters ] && [ -d loader ]; then \
99- echo "release: build header html pdf manhtmlpages and copy output to an OpenXR-Registry-like layout"; fi
101+ echo "release-htmlpdf: build html pdf and copy output to an OpenXR-Registry-like layout"; \
102+ echo "release: build html pdf manhtmlpages loader styleguide extprocess and copy output to an OpenXR-Registry-like layout"; \
103+ fi
100104
101105 $(ECHO) "reflow: reflow AsciiDoctor source files in-place"
102106 $(ECHO) "clean_dirt: remove intermediate files"
@@ -107,6 +111,9 @@ default:
107111 $(ECHO) "Pass VERBOSE=1 to invoke asciidoctor with the --verbose option and genxr.py without the -q option"
108112 $(ECHO) "Pass STRICT=1 to invoke asciidoctor with the --failure-level ERROR option"
109113 $(ECHO) "Pass VERY_STRICT=1 to invoke asciidoctor with the --failure-level WARN option"
114+ $(ECHO) "Pass RELEASE=1 to turn off all asciidoctor date/timestamps for a reproducible release build"
115+ @if [ -d sources/chapters ] && [ -d loader ]; then \
116+ echo "Pass some string for RELEASE_SPECS_SUFFIX to add a suffix to the version-numbered directory for the release targets"; fi
110117
111118# ###############################################
112119# Store our build configuration in a file, and force re-generation if it changes.
@@ -277,8 +284,10 @@ $(EXTPROCESSGUIDE): $(EXTPROCESSSRC)
277284
278285COMMONDOCS = $(SPECSRC ) $(SPECFILES ) $(GENINCLUDE ) $(GENDEPENDS )
279286
287+ SPEC_FILENAME_STEM := openxr
288+
280289# # HTML
281- HTMLSPEC := $(OUTDIR ) /openxr .html
290+ HTMLSPEC := $(OUTDIR ) /$( SPEC_FILENAME_STEM ) .html
282291html : $(HTMLSPEC )
283292
284293# Use the AsciiDoctor rule
@@ -291,8 +300,8 @@ $(HTMLSPEC): $(COMMONDOCS)
291300$(HTMLSPEC ) : POSTPROCESS=$(QUIET )$(PYTHON ) $(SCRIPTS ) /genanchorlinks.py $@ $@
292301
293302# # PDF
294- PDFSPEC := $(OUTDIR ) /openxr .pdf
295- PDFA4SPEC := $(OUTDIR ) /openxr .a4.pdf
303+ PDFSPEC := $(OUTDIR ) /$( SPEC_FILENAME_STEM ) .pdf
304+ PDFA4SPEC := $(OUTDIR ) /$( SPEC_FILENAME_STEM ) .a4.pdf
296305
297306pdf pdfLetter : $(PDFSPEC )
298307pdfA4 : $(PDFA4SPEC )
@@ -326,11 +335,8 @@ ifeq ($(GITBRANCH),)
326335GITBRANCH := $(shell echo `git symbolic-ref --short HEAD`)
327336endif
328337GITREMARK ?= from git branch: $(GITBRANCH )
329- SPECREMARK ?= $(GITREMARK ) \
330- commit: $(shell echo `git log -1 --format="% H"`)
331338
332339ATTRIBOPTS = -a revnumber="$(SPECREVISION ) " \
333- -a revdate="$(SPECDATE ) " \
334340 -a revremark="$(SPECREMARK ) " \
335341 -a apititle="$(APITITLE ) " \
336342 -a stem=latexmath \
@@ -342,6 +348,20 @@ ATTRIBOPTS = -a revnumber="$(SPECREVISION)" \
342348
343349ADOCOPTS = --doctype book -a data-uri -r $(CURDIR ) /scripts/openxr-macros.rb $(ATTRIBOPTS )
344350
351+ ifneq (,$(strip $(RELEASE ) ) )
352+ # No dates or internal commit hashes in release builds for reproducibility
353+ ATTRIBOPTS += -a revdate!
354+ ATTRIBOPTS += -a last-update-label!
355+ ATTRIBOPTS += -a reproducible
356+ SPECREMARK ?= $(GITREMARK )
357+
358+ else
359+ ATTRIBOPTS += -a revdate="$(SPECDATE ) "
360+ SPECREMARK ?= $(GITREMARK ) \
361+ commit: $(shell echo `git log -1 --format="% H"`)
362+
363+ endif
364+
345365ifneq (,$(strip $(KHRONOS_SPEC_LICENSED ) ) )
346366# Enable photo of JP in dedication: not CC-BY-4.0,
347367# so only used in generated docs now.
@@ -390,10 +410,13 @@ MANCOPYRIGHT = $(MANDIR)/copyright-ccby.txt $(MANDIR)/footer.txt
390410MANGENERATED = $(filter-out $(MANCOPYRIGHT ) ,$(wildcard $(MANDIR ) /* ) )
391411MANHTML = $(MANSOURCES:$(MANDIR ) /%.txt=$(MANHTMLDIR ) /%.html )
392412MANDEPS = $(MANCOPYRIGHT ) $(GENINCLUDE ) $(GENDEPENDS )
413+ HTML_SPEC_RELATIVE ?= ../../$(SPEC_FILENAME_STEM ) .html
393414MANATTRIBOPTS := -a stylesheet=khronos.css \
394- -a stylesdir=$(CURDIR ) /config \
395- -a html_spec_relative='../../openxr.html' \
396- -a imagesdir=$(CURDIR ) /sources
415+ -a stylesdir=$(CURDIR ) /config \
416+ -a html_spec_relative='$(HTML_SPEC_RELATIVE ) ' \
417+ -a imagesdir=$(CURDIR ) /sources \
418+ -a vkRefPageRoot='$(VK_REF_PAGE_ROOT ) '
419+
397420
398421# Pure makefile lowercase function, generated by a script.
399422make_lower = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$(1 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )
@@ -514,16 +537,23 @@ all:
514537
515538# ###############################################
516539# Meta build for releases. Also copies into approximately the right layout for the OpenXR-Registry repo.
517- REGISTRYOUTDIR = $(OUTDIR ) /../registry-release/specs/$(MAJORMINORVER )
518- release : header html pdf manhtmlpages loader styleguide extprocess
540+ REGISTRYOUTDIR = $(OUTDIR ) /../registry-release/specs/$(MAJORMINORVER )$(RELEASE_SPECS_SUFFIX )
541+
542+ $(REGISTRYOUTDIR ) :
543+ $(QUIET )$(MKDIR ) $@
544+
545+ $(REGISTRYOUTDIR ) /pdf $(REGISTRYOUTDIR ) /html $(REGISTRYOUTDIR ) /man : $(REGISTRYOUTDIR )
546+ $(QUIET )$(MKDIR ) $@
547+
548+ release-htmlpdf : html pdf $(REGISTRYOUTDIR ) /pdf $(REGISTRYOUTDIR ) /html
519549 -asciidoctor-pdf-optimize $(PDFSPEC )
520- $(QUIET )$(MKDIR ) $(REGISTRYOUTDIR ) /pdf
521550 $(QUIET )$(CP ) $(PDFSPEC ) $(REGISTRYOUTDIR ) /pdf/xrspec.pdf
522- $(QUIET )$(MKDIR ) $(REGISTRYOUTDIR ) /html
523551 $(QUIET )$(CP ) $(HTMLSPEC ) $(REGISTRYOUTDIR ) /html/xrspec.html
524- $(QUIET )$(CP ) $(OUTDIR ) /styleguide.html $(OUTDIR ) /extprocess.html $(REGISTRYOUTDIR )
525- $(QUIET )$(MKDIR ) $(REGISTRYOUTDIR ) /man
552+ .PHONY : release-htmlpdf
553+ release : release-htmlpdf manhtmlpages loader styleguide extprocess $(REGISTRYOUTDIR ) $(REGISTRYOUTDIR ) /man
554+ $(QUIET )$(CP ) $(OUTDIR ) /styleguide.html $(OUTDIR ) /extprocess.html $(OUTDIR ) /loader.html $(REGISTRYOUTDIR )
526555 $(QUIET )$(CP ) -R $(MANHTMLDIR ) $(REGISTRYOUTDIR ) /man/html
556+ .PHONY : release
527557
528558# ###############################################
529559# # Clean targets
0 commit comments