This file contains the entire parse result, so there is no need to load
the parse result separately. This commit also updates the Make
dependencies to accurately track that these files are required.
-# SPDX-FileCopyrightText: 2023, 2024, 2025 Lady <https://www.ladys.computer/about/#lady>
+# SPDX-FileCopyrightText: 2023, 2024, 2025, 2026 Lady <https://www.ladys.computer/about/#lady>
# SPDX-License-Identifier: MPL-2.0
SHELL = /bin/sh
# SPDX-License-Identifier: MPL-2.0
SHELL = /bin/sh
╭────────────────────────────╮
╔╡ ⁌ ⛩📰 书社 ∷ GNUmakefile ╞═════════════════════════════════╗
║╰────────────────────────────╯ ║
╭────────────────────────────╮
╔╡ ⁌ ⛩📰 书社 ∷ GNUmakefile ╞═════════════════════════════════╗
║╰────────────────────────────╯ ║
-╟┬ ¶ Prerequisites ───────────────────────────────────────────┬╢
+╟┬ § Prerequisites ───────────────────────────────────────────┬╢
║│ │║
║│ Requires G·N·U Make, at least version 3.81, the Fine Free │║
║│ File Command, and the various programs packaged with │║
║│ │║
║│ Requires G·N·U Make, at least version 3.81, the Fine Free │║
║│ File Command, and the various programs packaged with │║
║│ program `program´ by overriding the corresponding variable │║
║│ `PROGRAM´ when calling Make. │║
║╰────────────────────────────────────────────────────────────╯║
║│ program `program´ by overriding the corresponding variable │║
║│ `PROGRAM´ when calling Make. │║
║╰────────────────────────────────────────────────────────────╯║
-╟┬ ¶ Usage ───────────────────────────────────────────────────┬╢
+╟┬ § Usage ───────────────────────────────────────────────────┬╢
║│ │║
║│ • `make all´ (default): Compile, but do not install, all │║
║│ files. │║
║│ │║
║│ • `make all´ (default): Compile, but do not install, all │║
║│ files. │║
║│ See `README.markdown´ for a more involved description of │║
║│ the capabilities and configuration of this program. │║
║╰────────────────────────────────────────────────────────────╯║
║│ See `README.markdown´ for a more involved description of │║
║│ the capabilities and configuration of this program. │║
║╰────────────────────────────────────────────────────────────╯║
-╟┬ ¶ Copyright & License ─────────────────────────────────────┬╢
+╟┬ § Copyright & License ─────────────────────────────────────┬╢
-║│ Copyright © 2023–2025 Lady [@ Ladys Computer]. │║
+║│ Copyright © 2023–2026 Lady [@ Ladys Computer]. │║
║│ │║
║│ This Source Code Form is subject to the terms of the │║
║│ Mozilla Public License, v 2.0. If a copy of the M·P·L was │║
║│ │║
║│ This Source Code Form is subject to the terms of the │║
║│ Mozilla Public License, v 2.0. If a copy of the M·P·L was │║
# Collect the metadata into a single file, and generate the dependencies and destinations files as side·effects.
#
# Doing this all in one step reduces the number of calls to `xsltproc´ required, but requires that it be called from the build directory (necessitating a subshell).
# Collect the metadata into a single file, and generate the dependencies and destinations files as side·effects.
#
# Doing this all in one step reduces the number of calls to `xsltproc´ required, but requires that it be called from the build directory (necessitating a subshell).
-$(BUILDDIR)/dependencies $(BUILDDIR)/destinations $(BUILDDIR)/metadata : $(call diffprereqs,metadatas,$(call metadata,$(sort $(sourcefiles) $(sourceincludes)))) $$(call parseresult,$(sourcefiles) $(sourceincludes)) $(THISDIR)/lib/expandmetadata.xslt
+$(BUILDDIR)/dependencies $(BUILDDIR)/destinations $(BUILDDIR)/metadata : $(call diffprereqs,metadatas,$(call metadata,$(sort $(sourcefiles) $(sourceincludes)))) $(call diffprereqs,parseds,$$(call parsed,$(sort $(sourcefiles) $(sourceincludes)))) $(THISDIR)/lib/expandmetadata.xslt
$(call inform,$(PRINTF) '%s\n' 'Compiling metadata…' >&2)
$(silent){ $(PRINTF) '<?xml version="1.0"?><rdf:RDF xmlns:nie="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#" xmlns:nfo="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:书社vocab="urn:fdc:ladys.computer:20231231:Shu1She4:vocab:"><书社vocab:BuildDirectory nfo:fileUrl="%s"/>' $(call quote,$(call attresc,$(call fileuri,$(BUILDDIR)))); {$(foreach meta,$(call metadata,$(sort $(sourcefiles) $(sourceincludes))), $(CAT) $(call quote,$(meta));) } | $(SED) 's/<?xml version="1.0"?>//g'; $(PRINTF) '%s\n' '</rdf:RDF>'; } | ( $(CD) $(call quote,$(BUILDDIR)); $(XSLTPROC) --nonet --novalid --nomkdir $(call quote,$(abspath $(THISDIR)/lib/expandmetadata.xslt)) - ) | $(XMLLINT) --nonet --nsclean - >|$(call quote,$(BUILDDIR)/metadata)
$(call inform,$(PRINTF) '%s\n' 'Compiling metadata…' >&2)
$(silent){ $(PRINTF) '<?xml version="1.0"?><rdf:RDF xmlns:nie="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#" xmlns:nfo="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:书社vocab="urn:fdc:ladys.computer:20231231:Shu1She4:vocab:"><书社vocab:BuildDirectory nfo:fileUrl="%s"/>' $(call quote,$(call attresc,$(call fileuri,$(BUILDDIR)))); {$(foreach meta,$(call metadata,$(sort $(sourcefiles) $(sourceincludes))), $(CAT) $(call quote,$(meta));) } | $(SED) 's/<?xml version="1.0"?>//g'; $(PRINTF) '%s\n' '</rdf:RDF>'; } | ( $(CD) $(call quote,$(BUILDDIR)); $(XSLTPROC) --nonet --novalid --nomkdir $(call quote,$(abspath $(THISDIR)/lib/expandmetadata.xslt)) - ) | $(XMLLINT) --nonet --nsclean - >|$(call quote,$(BUILDDIR)/metadata)
<?xml version="1.0"?>
<!--
<?xml version="1.0"?>
<!--
-SPDX-FileCopyrightText: 2023, 2024, 2025 Lady <https://www.ladys.computer/about/#lady>
+SPDX-FileCopyrightText: 2023, 2024, 2025, 2026 Lady <https://www.ladys.computer/about/#lady>
SPDX-License-Identifier: MPL-2.0
-->
<!--
⁌ ⛩📰 书社 ∷ lib/expandmetadata.xslt
SPDX-License-Identifier: MPL-2.0
-->
<!--
⁌ ⛩📰 书社 ∷ lib/expandmetadata.xslt
-© 2023–2025 Lady [@ Ladys Computer].
+© 2023–2026 Lady [@ Ladys Computer].
This Source Code Form is subject to the terms of the Mozilla Public License, v 2.0.
If a copy of the M·P·L was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
This Source Code Form is subject to the terms of the Mozilla Public License, v 2.0.
If a copy of the M·P·L was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
<variable name="files" select="//书社vocab:SourceFile|//书社vocab:IncludeFile"/>
<variable name="stated-dependencies-fragment">
<for-each select="$files[nie:interpretedAs/nfo:PlainTextDocument]">
<variable name="files" select="//书社vocab:SourceFile|//书社vocab:IncludeFile"/>
<variable name="stated-dependencies-fragment">
<for-each select="$files[nie:interpretedAs/nfo:PlainTextDocument]">
- <variable name="uri" select="书社vocab:hasParsedFile/@nfo:fileUrl"/>
+ <variable name="uri" select="书社vocab:hasParsedFileWithMetadata/@nfo:fileUrl"/>
<书社:Dependencies for="{@rdf:about}">
<书社:Dependencies for="{@rdf:about}">
- <for-each select="document($uri)//书社:link">
+ <for-each select="document($uri)/书社:parsed/书社:result//书社:link">
<variable name="spaced-show">
<choose>
<when test="@xlink:show">
<variable name="spaced-show">
<choose>
<when test="@xlink:show">
</copy>
</template>
<template match="//书社vocab:SourceFile[nie:interpretedAs/nfo:PlainTextDocument]" priority="1">
</copy>
</template>
<template match="//书社vocab:SourceFile[nie:interpretedAs/nfo:PlainTextDocument]" priority="1">
- <variable name="parsed" select="document(书社vocab:hasParsedFile/@nfo:fileUrl)"/>
+ <variable name="parsed" select="document(书社vocab:hasParsedFileWithMetadata/@nfo:fileUrl)/书社:parsed/书社:result"/>
<variable name="provided-destinations" select="normalize-space($parsed/*/@书社:destination)"/>
<variable name="destinations-fragment">
<if test="$provided-destinations!=''">
<variable name="provided-destinations" select="normalize-space($parsed/*/@书社:destination)"/>
<variable name="destinations-fragment">
<if test="$provided-destinations!=''">
<variable name="result" select="exsl:node-set($result-fragment)"/>
<copy-of select="$result/*"/>
<exsl:document href="dependencies" method="text" encoding="UTF-8">
<variable name="result" select="exsl:node-set($result-fragment)"/>
<copy-of select="$result/*"/>
<exsl:document href="dependencies" method="text" encoding="UTF-8">
- <for-each select="$result/rdf:RDF/*[nie:interpretedAs/nfo:PlainTextDocument]">
+ <for-each select="$result/rdf:RDF/*[self::书社vocab:SourceFile|self::书社vocab:IncludeFile]">
<value-of select="@rdf:about"/>
<text>
</text>
<for-each select="书社vocab:hasRecursiveDependencyOn/@rdf:resource">
<value-of select="@rdf:about"/>
<text>
</text>
<for-each select="书社vocab:hasRecursiveDependencyOn/@rdf:resource">
</for-each>
</exsl:document>
<exsl:document href="destinations" method="text" encoding="UTF-8">
</for-each>
</exsl:document>
<exsl:document href="destinations" method="text" encoding="UTF-8">
- <for-each select="$result//书社vocab:SourceFile">
+ <for-each select="$result/rdf:RDF/书社vocab:SourceFile">
<value-of select="@rdf:about"/>
<text>|</text>
<for-each select="书社vocab:destination">
<value-of select="@rdf:about"/>
<text>|</text>
<for-each select="书社vocab:destination">