mirror of
https://github.com/status-im/Vulkan-Docs.git
synced 2025-02-21 02:28:07 +00:00
* Vulkan 1.1 initial release. Bump API patch number and header version number to 70 for this update. The patch number will be used for both Vulkan 1.1 and Vulkan 1.0 updates, and continues to increment continuously from the previous Vulkan 1.0.69 update. NOTE: We are not publishing an updated 1.0.70 specification, or 1.1 reference pages, along with 1.1.70. There are still minor issues to work out with those build targets. However, we will soon generate all three types of documents as part of the regular spec update cycle. NOTE: The GitHub KhronosGroup/Vulkan-Docs repository now maintains the current specification in the `master` branch. The `1.0` branch is out of date and will not be maintained, since we will be generating both 1.1 and 1.0 specifications from the `master` branch in the future. Github Issues: * Clarify how mapped memory ranges are flushed in flink:vkFlushMappedMemoryRanges (public issue 127). * Specify that <<synchronization-pipeline-stages, Pipeline Stages>> are a list of tasks that each command performs, rather than necessarily being discrete pieces of hardware that one task flows through. Add a "`synchronization command`" pipeline type which all synchronization command execute (it's just TOP + BOTTOM), with an explanatory note (public issue 554). Internal Issues: * Regenerate all images used in the spec in Inkscape with a consistent look-and-feel, and adjust image size attributes so they're all legible, and not too large with respect to the spec body text (internal issue 701). * Document in the <<extensions,extensions>> appendix and in the style guide that `KHX` extensions are no longer supported or used in the Vulkan 1.1 timeframe (internal issue 714). * Remove the leftover equations_temp directory after PDF build completes (internal issue 925). * Update the <<credits, Credits (Informative)>> appendix to include contributors to Vulkan 1.1, and to list them according to the API version(s) they contributed to (internal issue 987). * Add a NOTE to the introduction explaining that interfaces defined by extensions which were promoted to Vulkan 1.1 are now expressed as aliases of the Vulkan 1.1 type (internal issue 991). * Instrument spec source conditionals so spec can be built with 1.1 features, extensions promoted to 1.1, or both (internal issues 992, 998). * Modify the XML schema and tools to support explicit aliasing of types, structures, and commands, and use this to express the promotion of 1.0 extensions to 1.1 core features, by making the extension interfaces aliases of the core features they were promoted to. Mark up promoted interfaces to allow still generating 1.0 + extension specifications (internal issue 991). * Platform names, along with corresponding preprocessor symbols to enable extensions specific to those platforms, are now reserved in vk.xml using the <platform> tag. Update the registry schema and schema specification to match (internal issue 1011). * Updated the <<textures-texel-replacement, Texel Replacement>> section to clarify that reads from invalid texels for image resources result in undefined values (internal issue 1014). * Modify description of patch version so it continues to increment across minor version changes (internal issue 1033). * Clarify and unify language describing physical device-level core and extension functionality in the <<fundamentals-validusage-extensions, Valid Usage for Extensions>>, <<fundamentals-validusage-versions, Valid Usage for Newer Core Versions>>, <<initialization-functionpointers Command Function Pointers>>, <<initialization-phys-dev-extensions, Extending Physical Device From Device Extensions>> <<extended-functionality-instance-extensions-and-devices, Instance Extensions and Device Extensions>> sections and for flink:vkGetPhysicalDeviceImageFormatProperties2. This documents that instance-level functionality is tied to the loader, and independent of the ICD; physical device-level functionality is tied to the ICD, and associated with device extensions; physical devices are treated more uniformly between core and extensions; and instance and physical versions can be different (internal issue 1048). * Updated the <<commandbuffers-lifecycle, Command Buffer Lifecycle>> section to clarify the ability for pending command buffers to transition to the invalid state after submission, and add a command buffer lifecycle diagram (internal issue 1050). * Clarify that some flink:VkDescriptorUpdateTemplateCreateInfo parameters are ignored when push descriptors are not supported (internal issue 1054). * Specify that flink:vkCreateImage will return an error if the image is too large, in a NOTE in the slink:VkImageFormatProperties description (internal issue 1078). * Remove near-duplicate NOTEs about when to query function pointers dynamically in the <<initialization, Initialization>> chapter and replace by extending the NOTE in the <<fundamentals-abi, Application Binary Interface>> section (internal issue 1085). * Restore missing references to "`Sparse Resource Features`" in the flink:VkBufferCreateFlagBits description (internal issue 1086). * Tidy up definitions of descriptor types in the `GL_KHR_vulkan_glsl` specification, the <<descriptorsets, Resource Descriptors>> section and its subsections, and the <<interfaces-resources-descset, Descriptor Set Interface>> for consistency, reduction of duplicate information, and removal of GLSL correspondance/examples (internal issue 1090). * Correctly describe code:PrimitiveId as an Input for tessellation control and evaluation shaders, not an Output (internal issue 1109). * Relax the requirements on chroma offsets for nearest filtering in <<textures-implict-reconstruction, Implicit Reconstruction>> (internal issue 1116). Other Issues: * Clarify the intended relationship between specification language and certain terms defined in the Khronos Intellectual Property Rights policy. Specific changes include: ** Rewrote IP/Copyright preamble and introduction to better agree with normative language both as laid out in the introduction, and the Khronos IPR policy. ** Added notion of fully informative sections, which are now tagged with "`(Informative)`" in their titles. ** Removed non-normative uses of the phrase "`not required`" ** Clarified the distinction between terms "`optional`" and "`not required:`" as they relate to the IPR Policy, and updated specification text to use terms consistent with the intent. ** Reduced additions to RFC 2119, and ensured the specification agreed with the leaner language. ** Removed the terms "`hardware`", "`software`", "`CPU`", and "`GPU`" from normative text. ** Moved several paragraphs that should not have been normative to informative notes. ** Clarified a number of definitions in the Glossary. ** Updated the document writing guide to match new terminology changes. * Explicitly state in the <<fundamentals-objectmodel-lifetime-acquire, application memory lifetime>> language that that for objects other than descriptor sets, a slink:VkDescriptorSetLayout object used in the creation of another object (such as slink:VkPipelineLayout or slink:VkDescriptorUpdateTemplateKHR) is only in use during the creation of that object and can be safely destroyed afterwards. * Updated the <<textures-scale-factor, Scale Factor Operation>> section to use the ratio of anisotropy, rather than the integer sample rate, to perform the LOD calculation. The spec still allows use of the sample rate as the value used to calculate the LOD, but no longer requires it. * Update `vulkan_ext.c` to include all platform-related definitions from the Vulkan platform headers, following the split of the headers into platform-specific and non-platform-specific files. * Fix bogus anchor name in the <<commandbuffers, Command Buffers>> chapter which accidentally duplicated an anchor in the pipelines chapter. There were no reference to this anchor, fortunately. * Add valid usage statement for slink:VkWriteDescriptorSet and slink:VkCopyDescriptorSet requiring that the slink:VkDescriptorSetLayout used to allocate the source and destination sets must not have been destroyed at the time flink:vkUpdateDescriptorSets is called. * Document mapping of subgroup barrier functions to SPIR-V, and clarify a place where subgroupBarrier sounds like it's execution-only in the standalone `GL_KHR_shader_subgroup` specification. * Use an HTML stylesheet derived from the Asciidoctor `colony` theme, with the default Arial font family replaced by the sans-serif Noto font family. * Numerous minor updates to README.adoc, build scripts, Makefiles, and registry and style guide specifications to support Vulkan 1.1 outputs, use them as defaults, and remove mention of `KHX` extensions, which are no longer supported. New Extensions: * `VK_EXT_vertex_attrib_divisor`
460 lines
18 KiB
Makefile
460 lines
18 KiB
Makefile
# Copyright (c) 2014-2018 The Khronos Group Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
# Vulkan Specification makefile
|
|
#
|
|
# To build the spec with a specific version included, set the
|
|
# $(VERSIONS) variable on the make command line to a space-separated
|
|
# list of version names (e.g. VK_VERSION_1_1) *including all previous
|
|
# versions of the API* (e.g. VK_VERSION_1_1 must also include
|
|
# VK_VERSION_1_0). $(VERSIONS) is converted into asciidoc and generator
|
|
# script arguments $(VERSIONATTRIBS) and $(VERSIONOPTIONS)
|
|
#
|
|
# To build the specification and reference pages with optional
|
|
# extensions included, set the $(EXTENSIONS) variable on the make
|
|
# command line to a space-separated list of extension names. The
|
|
# VK_KHR_sampler_mirror_clamp_to_edge extension which is a required part
|
|
# of Vulkan 1.0, is always included. $(EXTENSIONS) is converted into
|
|
# asciidoc and generator script arguments $(EXTATTRIBS) and
|
|
# $(EXTOPTIONS).
|
|
|
|
# If a recipe fails, delete its target file. Without this cleanup, the leftover
|
|
# file from the failed recipe can falsely satisfy dependencies on subsequent
|
|
# runs of `make`.
|
|
.DELETE_ON_ERROR:
|
|
|
|
VERSIONS := VK_VERSION_1_0 VK_VERSION_1_1
|
|
VERSIONATTRIBS := $(foreach version,$(VERSIONS),-a $(version))
|
|
VERSIONOPTIONS := $(foreach version,$(VERSIONS),-feature $(version))
|
|
|
|
EXTS := $(sort VK_KHR_sampler_mirror_clamp_to_edge $(EXTENSIONS) $(DIFFEXTENSIONS))
|
|
EXTATTRIBS := $(foreach ext,$(EXTS),-a $(ext))
|
|
EXTOPTIONS := $(foreach ext,$(EXTS),-extension $(ext))
|
|
|
|
# APITITLE can be set to extra text to append to the document title,
|
|
# normally used when building with extensions included.
|
|
APITITLE =
|
|
|
|
# The default 'all' target builds the following sub-targets:
|
|
# html - HTML single-page API specification
|
|
# pdf - PDF single-page API specification
|
|
# styleguide - HTML5 single-page "Documentation and Extensions" guide
|
|
# registry - HTML5 single-page XML Registry Schema documentation
|
|
# manhtml - HTML5 single-page reference guide
|
|
# manpdf - PDF reference guide
|
|
# manhtmlpages - HTML5 separate per-feature reference pages
|
|
# checkinc - validator script for asciidoc include files
|
|
# checklinks - validator script for asciidoc xrefs
|
|
|
|
all: alldocs allchecks
|
|
|
|
alldocs: allspecs allman
|
|
|
|
allspecs: html pdf styleguide registry
|
|
|
|
allman: manhtml manpdf manhtmlpages
|
|
|
|
allchecks: checkinc checklinks
|
|
|
|
# Note that the := assignments below are immediate, not deferred, and
|
|
# are therefore order-dependent in the Makefile
|
|
|
|
QUIET ?= @
|
|
PYTHON ?= python3
|
|
ASCIIDOC ?= asciidoctor
|
|
RM = rm -f
|
|
RMRF = rm -rf
|
|
MKDIR = mkdir -p
|
|
CP = cp
|
|
ECHO = echo
|
|
GS_EXISTS := $(shell command -v gs 2> /dev/null)
|
|
|
|
# Target directories for output files
|
|
# HTMLDIR - 'html' target
|
|
# PDFDIR - 'pdf' target
|
|
# CHECKDIR - 'allchecks' target
|
|
OUTDIR := $(CURDIR)/../../../out/1.0
|
|
HTMLDIR := $(OUTDIR)/html
|
|
VUDIR := $(OUTDIR)/validation
|
|
PDFDIR := $(OUTDIR)/pdf
|
|
CHECKDIR := $(OUTDIR)/checks
|
|
|
|
# PDF Equations are written to SVGs, this dictates the location to store those files (temporary)
|
|
PDFMATHDIR:=$(OUTDIR)/equations_temp
|
|
|
|
# Set VERBOSE to -v to see what asciidoc is doing.
|
|
VERBOSE =
|
|
|
|
# asciidoc attributes to set.
|
|
# PATCHVERSION must == VK_HEADER_VERSION from vk.xml / vulkan_core.h
|
|
# NOTEOPTS sets options controlling which NOTEs are generated
|
|
# ATTRIBOPTS sets the api revision and enables MathJax generation
|
|
# VERSIONATTRIBS sets attributes for enabled API versions (set above
|
|
# based on $(VERSIONS))
|
|
# EXTATTRIBS sets attributes for enabled extensions (set above based on
|
|
# $(EXTENSIONS))
|
|
# ADOCOPTS options for asciidoc->HTML5 output
|
|
NOTEOPTS = -a editing-notes -a implementation-guide
|
|
PATCHVERSION = 70
|
|
ifneq (,$(findstring VK_VERSION_1_1,$(VERSIONS)))
|
|
SPECREVISION = 1.1.$(PATCHVERSION)
|
|
else
|
|
SPECREVISION = 1.0.$(PATCHVERSION)
|
|
endif
|
|
|
|
# Spell out ISO 8601 format as not all date commands support --rfc-3339
|
|
SPECDATE = $(shell echo `date -u "+%Y-%m-%d %TZ"`)
|
|
|
|
# Generate Asciidoc attributes for spec remark
|
|
# Could use `git log -1 --format="%cd"` to get branch commit date
|
|
# This used to be a dependency in the spec html/pdf targets,
|
|
# but that's likely to lead to merge conflicts. Just regenerate
|
|
# when pushing a new spec for review to the sandbox.
|
|
# The dependency on HEAD is per the suggestion in
|
|
# http://neugierig.org/software/blog/2014/11/binary-revisions.html
|
|
SPECREMARK = from git branch: $(shell echo `git symbolic-ref --short HEAD 2> /dev/null || echo Git branch information not available`) \
|
|
commit: $(shell echo `git log -1 --format="%H"`)
|
|
|
|
ATTRIBOPTS = -a revnumber="$(SPECREVISION)" \
|
|
-a revdate="$(SPECDATE)" \
|
|
-a revremark="$(SPECREMARK)" \
|
|
-a apititle="$(APITITLE)" \
|
|
-a stem=latexmath \
|
|
$(VERSIONATTRIBS) \
|
|
$(EXTATTRIBS)
|
|
|
|
ADOCEXTS = -r $(CURDIR)/config/vulkan-macros.rb -r $(CURDIR)/config/tilde_open_block.rb
|
|
ADOCOPTS = -d book $(ATTRIBOPTS) $(NOTEOPTS) $(VERBOSE) $(ADOCEXTS)
|
|
|
|
ADOCHTMLEXTS = -r $(CURDIR)/config/katex_replace.rb
|
|
|
|
# ADOCHTMLOPTS relies on the relative runtime path from the output HTML
|
|
# file to the katex scripts being set with KATEXDIR. This is overridden
|
|
# by some targets.
|
|
# ADOCHTMLOPTS also relies on the absolute build-time path to the
|
|
# 'stylesdir' containing our custom CSS.
|
|
KATEXDIR = katex
|
|
ADOCHTMLOPTS = $(ADOCHTMLEXTS) -a katexpath=$(KATEXDIR) \
|
|
-a stylesheet=khronos.css -a stylesdir=$(CURDIR)/config
|
|
|
|
ADOCPDFEXTS = -r asciidoctor-pdf -r asciidoctor-mathematical -r $(CURDIR)/config/asciidoctor-mathematical-ext.rb
|
|
ADOCPDFOPTS = $(ADOCPDFEXTS) -a mathematical-format=svg \
|
|
-a imagesoutdir=$(PDFMATHDIR) \
|
|
-a pdf-stylesdir=config/themes -a pdf-style=pdf
|
|
|
|
ADOCVUEXTS = -r $(CURDIR)/config/vu-to-json.rb
|
|
ADOCVUOPTS = $(ADOCVUEXTS)
|
|
|
|
.PHONY: directories
|
|
|
|
# Images used by the spec. These are included in generated HTML now.
|
|
IMAGEPATH :=images
|
|
SVGFILES := $(wildcard $(IMAGEPATH)/*.svg)
|
|
|
|
# Top-level spec source file
|
|
SPECSRC := vkspec.txt
|
|
# Files making up sections of the API spec. The wildcard expression
|
|
# should work in extension branches to pull in those files as well.
|
|
SPECFILES = $(wildcard chapters/[A-Za-z]*.txt appendices/[A-Za-z]*.txt chapters/*/[A-Za-z]*.txt appendices/*/[A-Za-z]*.txt)
|
|
GENINCLUDE = $(wildcard api/*/[A-Za-z]*.txt validity/*/[A-Za-z]*.txt hostsynctable/*.txt)
|
|
# Shorthand for where the extension appendix generated files go
|
|
METADIR = appendices/meta
|
|
# Generated dependencies of the spec
|
|
GENDEPENDS = api/timeMarker validity/timeMarker hostsynctable/timeMarker $(METADIR)/timeMarker
|
|
# All non-format-specific dependencies
|
|
COMMONDOCS = $(SPECFILES) $(GENINCLUDE) $(GENDEPENDS)
|
|
|
|
# Install katex in $(OUTDIR)/katex for reference by all HTML targets
|
|
# README.md is a proxy for all the katex files that need to be installed
|
|
katexinst: KATEXDIR = katex
|
|
katexinst: $(OUTDIR)/$(KATEXDIR)/README.md
|
|
|
|
$(OUTDIR)/$(KATEXDIR)/README.md: katex/README.md
|
|
$(QUIET)$(MKDIR) $(OUTDIR)
|
|
$(QUIET)$(RMRF) $(OUTDIR)/$(KATEXDIR)
|
|
$(QUIET)$(CP) -rf katex $(OUTDIR)
|
|
|
|
# Spec targets
|
|
# There is some complexity to try and avoid short virtual targets like 'html'
|
|
# causing specs to *always* be regenerated.
|
|
html: $(HTMLDIR)/vkspec.html $(SPECSRC) $(COMMONDOCS)
|
|
|
|
$(HTMLDIR)/vkspec.html: KATEXDIR = ../katex
|
|
$(HTMLDIR)/vkspec.html: $(SPECSRC) $(COMMONDOCS) katexinst
|
|
$(QUIET)$(ASCIIDOC) -b html5 $(ADOCOPTS) $(ADOCHTMLOPTS) -o $@ $(SPECSRC)
|
|
|
|
diff_html: $(HTMLDIR)/diff.html $(SPECSRC) $(COMMONDOCS)
|
|
|
|
$(HTMLDIR)/diff.html: KATEXDIR = ../katex
|
|
$(HTMLDIR)/diff.html: $(SPECSRC) $(COMMONDOCS) katexinst
|
|
$(QUIET)$(ASCIIDOC) -b html5 $(ADOCOPTS) $(ADOCHTMLOPTS) -a diff_extensions="$(DIFFEXTENSIONS)" -r $(CURDIR)/config/extension-highlighter.rb --trace -o $@ $(SPECSRC)
|
|
|
|
pdf: $(PDFDIR)/vkspec.pdf $(SPECSRC) $(COMMONDOCS)
|
|
|
|
$(PDFDIR)/vkspec.pdf: $(SPECSRC) $(COMMONDOCS)
|
|
$(QUIET)$(MKDIR) $(PDFDIR)
|
|
$(QUIET)$(MKDIR) $(PDFMATHDIR)
|
|
$(QUIET)$(ASCIIDOC) -b pdf $(ADOCOPTS) $(ADOCPDFOPTS) -o $@ $(SPECSRC)
|
|
ifndef GS_EXISTS
|
|
$(QUIET) echo "Warning: Ghostscript not installed, skipping pdf optimization"
|
|
else
|
|
$(QUIET)$(CURDIR)/config/optimize-pdf $@
|
|
$(QUIET)rm $@
|
|
$(QUIET)mv $(PDFDIR)/vkspec-optimized.pdf $@
|
|
endif
|
|
$(QUIET)rm -rf $(PDFMATHDIR)
|
|
|
|
validusage: $(VUDIR)/validusage.json $(SPECSRC) $(COMMONDOCS)
|
|
|
|
$(VUDIR)/validusage.json: $(SPECSRC) $(COMMONDOCS)
|
|
$(QUIET)$(MKDIR) $(VUDIR)
|
|
$(QUIET)$(ASCIIDOC) $(ADOCOPTS) $(ADOCVUOPTS) --trace -a json_output=$@ -o $@ $(SPECSRC)
|
|
|
|
# Vulkan Documentation and Extensions, a.k.a. "Style Guide" documentation
|
|
|
|
STYLESRC = styleguide.txt
|
|
STYLEFILES = $(wildcard style/[A-Za-z]*.txt)
|
|
|
|
styleguide: $(OUTDIR)/styleguide.html
|
|
|
|
$(OUTDIR)/styleguide.html: KATEXDIR = katex
|
|
$(OUTDIR)/styleguide.html: $(STYLESRC) $(STYLEFILES) $(GENINCLUDE) $(GENDEPENDS) katexinst
|
|
$(QUIET)$(MKDIR) $(OUTDIR)
|
|
$(QUIET)$(ASCIIDOC) -b html5 $(ADOCOPTS) $(ADOCHTMLOPTS) -o $@ $(STYLESRC)
|
|
|
|
|
|
# Vulkan API Registry (XML Schema) documentation
|
|
# Currently does not use latexmath / KaTeX
|
|
|
|
REGSRC = registry.txt
|
|
|
|
registry: $(OUTDIR)/registry.html
|
|
|
|
$(OUTDIR)/registry.html: $(REGSRC)
|
|
$(QUIET)$(MKDIR) $(OUTDIR)
|
|
$(QUIET)$(ASCIIDOC) -b html5 $(ADOCOPTS) $(ADOCHTMLOPTS) -o $@ $(REGSRC)
|
|
|
|
|
|
# Reflow text in spec sources
|
|
REFLOW = reflow.py
|
|
REFLOWOPTS = -overwrite
|
|
|
|
reflow:
|
|
$(QUIET) echo "Warning: please verify the spec outputs build without changes!"
|
|
$(PYTHON) $(REFLOW) $(REFLOWOPTS) $(SPECSRC) $(SPECFILES) $(STYLESRC) $(STYLEFILES)
|
|
|
|
# Clean generated and output files
|
|
|
|
clean: clean_html clean_pdf clean_man clean_checks clean_generated clean_validusage
|
|
|
|
clean_html:
|
|
$(QUIET)$(RMRF) $(HTMLDIR) $(OUTDIR)/katex
|
|
$(QUIET)$(RM) $(OUTDIR)/apispec.html $(OUTDIR)/styleguide.html \
|
|
$(OUTDIR)/registry.html
|
|
|
|
clean_pdf:
|
|
$(QUIET)$(RM) $(PDFDIR)/vkspec.pdf $(OUTDIR)/apispec.pdf
|
|
|
|
clean_man:
|
|
$(QUIET)$(RMRF) $(MANHTMLDIR)
|
|
|
|
clean_checks:
|
|
$(QUIET)$(RMRF) $(CHECKDIR)
|
|
|
|
clean_generated:
|
|
$(QUIET)$(RMRF) api/* hostsynctable/* validity/* $(METADIR)/* vkapi.py
|
|
$(QUIET)$(RM) config/extDependency.stamp config/extDependency.pyc config/extDependency.sh config/extDependency.py
|
|
$(QUIET)$(RM) man/apispec.txt $(LOGFILE) man/[Vv][Kk]*.txt man/PFN*.txt
|
|
$(QUIET)$(RMRF) $(PDFMATHDIR)
|
|
|
|
clean_validusage:
|
|
$(QUIET)$(RM) $(VUDIR)/validusage.json
|
|
|
|
|
|
# Ref page targets for individual pages
|
|
MANDIR := man
|
|
MANSECTION := 3
|
|
|
|
# These lists should be autogenerated
|
|
|
|
# Ref page sources, split up by core API (CORE), KHR extensions (KHR), and
|
|
# other extensions (VEN). This is a hacky approach to ref page generation
|
|
# now that the single-branch model is in place, and there are outstanding
|
|
# issues to resolve it. For the moment, we always just build the core
|
|
# ref pages.
|
|
|
|
KHRSOURCES = $(wildcard $(MANDIR)/*KHR.txt)
|
|
MACROSOURCES = $(wildcard $(MANDIR)/VK_*[A-Z][A-Z].txt)
|
|
VENSOURCES = $(filter-out $(KHRSOURCES) $(MACROSOURCES),$(wildcard $(MANDIR)/*[A-Z][A-Z].txt))
|
|
CORESOURCES = $(filter-out $(KHRSOURCES) $(VENSOURCES),$(wildcard $(MANDIR)/[Vv][Kk]*.txt $(MANDIR)/PFN*.txt))
|
|
MANSOURCES = $(CORESOURCES)
|
|
MANCOPYRIGHT = $(MANDIR)/copyright-ccby.txt $(MANDIR)/footer.txt
|
|
|
|
# Automatic generation of ref pages. Needs to have a proper dependency
|
|
# causing the man page sources to be generated by running genRef (once),
|
|
# but adding $(MANSOURCES) to the targets causes genRef to run
|
|
# once/target.
|
|
#
|
|
# @@ Needs to pass in $(EXTOPTIONS) and use that to determine which
|
|
# pages to generate. As it stands, all the extension ref pages are
|
|
# also generated, though they are not usable at present.
|
|
|
|
LOGFILE = man/logfile
|
|
man/apispec.txt: $(SPECFILES) genRef.py reflib.py vkapi.py
|
|
$(PYTHON) genRef.py -log $(LOGFILE) $(SPECFILES)
|
|
|
|
# These dependencies don't take into account include directives
|
|
|
|
# These targets are HTML5 ref pages
|
|
|
|
MANHTMLDIR := $(OUTDIR)/man/html
|
|
MANHTML = $(MANSOURCES:$(MANDIR)/%.txt=$(MANHTMLDIR)/%.html)
|
|
|
|
manhtmlpages: man/apispec.txt $(MANHTML)
|
|
|
|
$(MANHTMLDIR)/%.html: KATEXDIR = ../../katex
|
|
$(MANHTMLDIR)/%.html: $(MANDIR)/%.txt $(MANCOPYRIGHT) $(GENINCLUDE) $(GENDEPENDS) katexinst
|
|
$(QUIET)$(MKDIR) $(MANHTMLDIR)
|
|
$(QUIET)$(ASCIIDOC) -b html5 -a cross-file-links -a html_spec_relative='../../html/vkspec.html' $(ADOCOPTS) $(ADOCHTMLOPTS) -d manpage -o $@ $<
|
|
|
|
# These targets are HTML5 and PDF single-file versions of the ref pages
|
|
|
|
manpdf: $(OUTDIR)/apispec.pdf
|
|
|
|
$(OUTDIR)/apispec.pdf: $(SPECVERSION) man/apispec.txt $(MANSOURCES) $(MANCOPYRIGHT) $(SVGFILES) $(GENINCLUDE) $(GENDEPENDS)
|
|
$(QUIET)$(MKDIR) $(OUTDIR)
|
|
$(QUIET)$(MKDIR) $(PDFMATHDIR)
|
|
$(QUIET)$(ASCIIDOC) -b pdf -a html_spec_relative='html/vkspec.html' $(ADOCOPTS) $(ADOCPDFOPTS) -o $@ man/apispec.txt
|
|
ifndef GS_EXISTS
|
|
$(QUIET) echo "Warning: Ghostscript not installed, skipping pdf optimization"
|
|
else
|
|
$(QUIET)$(CURDIR)/config/optimize-pdf $@
|
|
$(QUIET)rm $@
|
|
$(QUIET)mv $(OUTDIR)/apispec-optimized.pdf $@
|
|
endif
|
|
|
|
manhtml: $(OUTDIR)/apispec.html
|
|
|
|
$(OUTDIR)/apispec.html: KATEXDIR = katex
|
|
$(OUTDIR)/apispec.html: $(SPECVERSION) man/apispec.txt $(MANSOURCES) $(MANCOPYRIGHT) $(SVGFILES) $(GENINCLUDE) $(GENDEPENDS) katexinst
|
|
$(QUIET)$(MKDIR) $(OUTDIR)
|
|
$(QUIET)$(ASCIIDOC) -b html5 -a html_spec_relative='html/vkspec.html' $(ADOCOPTS) $(ADOCHTMLOPTS) -o $@ man/apispec.txt
|
|
|
|
# Automated (though heuristic) checks of consistency in the spec and
|
|
# ref page sources
|
|
|
|
# Validate includes in spec source vs. includes actually in the tree
|
|
# Generates file in $(CHECKDIR)
|
|
# $(NOTINSPEC) notInSpec.txt - include files only found in XML, not in spec
|
|
# Intermediate files removed after the run
|
|
# $(ACTUAL) - include files generated from vk.xml
|
|
# $(INSPEC) - include files referenced from the spec (not ref page) source
|
|
# Other files which could be generated but are basically useless
|
|
# include files only found in the spec source - comm -13 $(ACTUAL) $(INSPEC)
|
|
# include files both existing and referenced by the spec - comm -12 $(ACTUAL) $(INSPEC)
|
|
INCFILES = $(CHECKDIR)/incfiles
|
|
ACTUAL = $(CHECKDIR)/actual
|
|
INSPEC = $(CHECKDIR)/inspec
|
|
NOTINSPEC = $(CHECKDIR)/notInSpec.txt
|
|
checkinc:
|
|
$(QUIET)if test ! -d $(CHECKDIR) ; then $(MKDIR) $(CHECKDIR) ; fi
|
|
$(QUIET)ls $(GENINCLUDE) | sort > $(ACTUAL)
|
|
$(QUIET)cat $(SPECFILES) | \
|
|
egrep '^include::\.\./' | tr -d '[]' | \
|
|
sed -e 's#^include::\.\./##g' | sort > $(INCFILES)
|
|
$(QUIET)echo "List of API include files repeatedly included in the API specification" > $(NOTINSPEC)
|
|
$(QUIET)echo "----------------------------------------------------------------------" >> $(NOTINSPEC)
|
|
$(QUIET)uniq -d $(INCFILES) >> $(NOTINSPEC)
|
|
$(QUIET)(echo ; echo "List of API include files not referenced in the API specification") >> $(NOTINSPEC)
|
|
$(QUIET)echo "-----------------------------------------------------------------" >> $(NOTINSPEC)
|
|
$(QUIET)comm -23 $(ACTUAL) $(INCFILES) >> $(NOTINSPEC)
|
|
$(QUIET)echo "Include files not found in the spec source are in $(CHECKDIR)/notInSpec.txt"
|
|
$(QUIET)$(RM) $(INCFILES) $(ACTUAL) $(INSPEC)
|
|
|
|
# Validate link tags in spec and ref page sources against vk.xml
|
|
# (represented in vkapi.py, which is autogenerated along with the
|
|
# headers and ref page includes).
|
|
# Generates files in $(CHECKDIR):
|
|
# specErrs.txt - errors & warnings in API spec
|
|
# manErrs.txt - errors & warnings in man pages
|
|
checklinks: vkapi.py
|
|
$(QUIET)if test ! -d $(CHECKDIR) ; then $(MKDIR) $(CHECKDIR) ; fi
|
|
$(QUIET)echo "Generating link checks for spec (specErrs.txt) and man pages (manErrs.txt)"
|
|
$(QUIET)$(PYTHON) checkLinks.py -follow man/[Vv][Kk]*.txt > $(CHECKDIR)/manErrs.txt
|
|
$(QUIET)$(PYTHON) checkLinks.py -follow $(SPECFILES) > $(CHECKDIR)/specErrs.txt
|
|
|
|
# Targets generated from the XML and registry processing scripts
|
|
# vkapi.py - Python encoding of the registry
|
|
# api/timeMarker - proxy for 'apiincludes' - API include files under api/*/*.txt
|
|
# hostsynctable/timeMarker - proxy for host sync table include files under hostsynctable/*.txt
|
|
# validity/timeMarker - proxy for API validity include files under validity/*/*.txt
|
|
# appendices/meta/timeMarker - proxy for extension appendix metadata include files under appendices/*.txt
|
|
#
|
|
# $(VERSIONOPTIONS) specifies the core API versions which are included
|
|
# in these targets, and is set above based on $(VERSIONS)
|
|
#
|
|
# $(EXTOPTIONS) specifies the extensions which are included in these
|
|
# targets, and is set above based on $(EXTENSIONS).
|
|
|
|
REGISTRY = ../../../src/spec
|
|
VKXML = $(REGISTRY)/vk.xml
|
|
GENVK = $(REGISTRY)/genvk.py
|
|
GENVKOPTS= $(VERSIONOPTIONS) $(EXTOPTIONS) -registry $(VKXML)
|
|
|
|
vkapi.py: $(VKXML) $(GENVK)
|
|
$(PYTHON) $(GENVK) $(GENVKOPTS) -o . vkapi.py
|
|
|
|
apiinc: api/timeMarker
|
|
|
|
api/timeMarker: $(VKXML) $(GENVK)
|
|
$(QUIET)$(MKDIR) api
|
|
$(QUIET)$(PYTHON) $(GENVK) $(GENVKOPTS) -o api apiinc
|
|
|
|
hostsyncinc: hostsynctable/timeMarker
|
|
|
|
hostsynctable/timeMarker: $(VKXML) $(GENVK)
|
|
$(QUIET)$(MKDIR) hostsynctable
|
|
$(QUIET)$(PYTHON) $(GENVK) $(GENVKOPTS) -o hostsynctable hostsyncinc
|
|
|
|
validinc: validity/timeMarker
|
|
|
|
validity/timeMarker: $(VKXML) $(GENVK)
|
|
$(QUIET)$(MKDIR) validity
|
|
$(QUIET)$(PYTHON) $(GENVK) $(GENVKOPTS) -o validity validinc
|
|
|
|
extinc: $(METADIR)/timeMarker
|
|
|
|
$(METADIR)/timeMarker: $(VKXML) $(GENVK)
|
|
$(QUIET)$(MKDIR) $(METADIR)
|
|
$(QUIET)$(PYTHON) $(GENVK) $(GENVKOPTS) -o $(METADIR) extinc
|
|
|
|
# Debugging aid - generate all files from registry XML
|
|
# This leaves out config/extDependency.sh intentionally as it only
|
|
# needs to be updated when the extension dependencies in vk.xml change.
|
|
|
|
generated: vkapi.py api/timeMarker hostsynctable/timeMarker validity/timeMarker $(METADIR)/timeMarker
|
|
|
|
# Extension dependencies derived from vk.xml
|
|
# Both Bash and Python versions are generated
|
|
|
|
config/extDependency.sh: config/extDependency.stamp
|
|
config/extDependency.py: config/extDependency.stamp
|
|
|
|
DEPSCRIPT = $(REGISTRY)/extDependency.py
|
|
config/extDependency.stamp: $(VKXML) $(DEPSCRIPT)
|
|
$(QUIET)$(PYTHON) $(DEPSCRIPT) -registry $(VKXML) \
|
|
-outscript config/extDependency.sh \
|
|
-outpy config/extDependency.py
|
|
$(QUIET)touch $@
|