]> Lady’s Gitweb - Shushe/commitdiff
Add EXTRA* variables
authorLady <redacted>
Wed, 31 Jan 2024 05:40:55 +0000 (00:40 -0500)
committerLady <redacted>
Wed, 31 Jan 2024 05:40:55 +0000 (00:40 -0500)
It shouldn’t be necessary to know where existing parsers and transforms
are kept or what the default find rules are in order to supply
additional ones.

GNUmakefile
README.markdown

index bcaa00d92459bae0c478e8233df8d6b58b14693b..1fe78ecd056bbda38c1036f59ca96bee05524c6f 100644 (file)
@@ -145,16 +145,20 @@ MAGICDIR := $(patsubst ./%,%,$(THISDIR)/magic)
 # Configuration of `find´.
 #
 # By default, `find´ will ignore files which begin with a period and those which are likely to cause problems for `make´.
-FINDRULES := ! '(' '(' -name '[.-]*' -o -name '*[][*?:|$$%\#\\; ]*' ')' -a -prune ')'
-FINDINCLUDERULES := $(FINDRULES)
+EXTRAFINDRULES :=
+EXTRAFINDINCLUDERULES :=
+FINDRULES := ! '(' '(' -name '[.-]*' -o -name '*[][*?:|$$%\#\\; ]*' ')' -a -prune ')'$(if $(EXTRAFINDRULES), -a $(EXTRAFINDRULES),)
+FINDINCLUDERULES := $(FINDRULES)$(if $(EXTRAFINDINCLUDERULES), -a $(EXTRAFINDINCLUDERULES),)
 
 # The list of parsers for plaintext file types.
 #
 # Which parsers are provided will influence which kinds of files are recognized as plaintext.
-PARSERS := $(patsubst ./%,%,$(wildcard $(THISDIR)/parsers/*.xslt))
+EXTRAPARSERS :=
+PARSERS := $(sort $(patsubst ./%,%,$(wildcard $(THISDIR)/parsers/*.xslt)) $(EXTRAPARSERS))
 
 # The list of transforms.
-TRANSFORMS := $(patsubst ./%,%,$(wildcard $(THISDIR)/transforms/*.xslt))
+EXTRATRANSFORMS :=
+TRANSFORMS := $(sort $(patsubst ./%,%,$(wildcard $(THISDIR)/transforms/*.xslt)) $(EXTRATRANSFORMS))
 
 # List of types which should be treated as X·M·L.
 XMLTYPES := application/xml text/xml
index 9d518896eaed97d4e8903bde4c9390a71c1deda3..654904ae9eda3ab787fbdc83dc7b001778f5ffda 100644 (file)
@@ -173,18 +173,35 @@ The following additional variables can be used to control the behaviour
     and those which contain a hash, buck, percent, asterisk, colon,
     semi, eroteme, bracket, backslash, or pipe.
 
+- **`EXTRAFINDRULES`:**
+  The value of this variable is appended to `FINDRULES` by default, to
+    enable additional rules without overriding the existing ones.
+
 - **`FINDINCLUDERULES`:**
   Rules to use with `find` when searching for includes (default:
     `$(FINDRULES)`).
 
+- **`EXTRAFINDINCLUDERULES`:**
+  The value of this variable is appended to `FINDINCLUDERULES` by
+    default, to enable additional rules without overriding the existing
+    ones.
+
 - **`PARSERS`:**
   A white·space‐separated list of parsers to use (default:
     `$(THISDIR)/parsers/*.xslt`).
 
+- **`EXTRAPARSERS`:**
+  The value of this variable is appended to `PARSERS` by default, to
+    enable additional parsers without overriding the existing ones.
+
 - **`TRANSFORMS`:**
   A white·space‐separated list of transforms to use (default:
     `$(THISDIR)/transforms/*.xslt`).
 
+- **`EXTRATRANSFORMS`:**
+  The value of this variable is appended to `TRANSFORMS` by default, to
+    enable additional transforms without overriding the existing ones.
+
 - **`XMLTYPES`:**
   A white·space‐separated list of media types to consider X·M·L
     (default: `application/xml text/xml`).
This page took 0.03028 seconds and 4 git commands to generate.