]> Lady’s Gitweb - Shushe/blobdiff - GNUmakefile
Support +xml suffix for determining X·M·L files
[Shushe] / GNUmakefile
index 338c55d5269cc0f8a782176f57ef887407d737f2..77650952d395d1ee58c9eea215877871f14266fd 100644 (file)
@@ -193,7 +193,10 @@ 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
+#
+# Types which start with a `+´ are suffixes and match any type which
+# ends accordingly.
+XMLTYPES := application/xml text/xml +xml
 
 ifdef GIT
 ifneq ($(wildcard $(THISDIR)/.git),)
@@ -343,8 +346,10 @@ ifneq ($(wildcard $(BUILDDIR)/parser.xslt),)
 override plaintexttypes := $(filter-out $(XMLTYPES),$(shell $(XMLLINT) --xpath '/*/*[@name="书社:parsers"]//*[namespace-uri()="http://www.w3.org/1999/xhtml" and local-name()="dd"]/text()' $(call quote,$(BUILDDIR)/parser.xslt)))
 endif
 
-# (callable) Get all of the files (source and includes) which have the given types.
-override filesoftype = $(foreach type,$1,$(patsubst %|$(type),%,$(filter %|$(type),$(types))))
+# (callable) Get all of the files (source and includes) which have the provided types.
+#
+# If a provided type begins with a `+´, it is analysed as a suffix, and all matching types will be used.
+override filesoftype = $(foreach typeorsuffix,$1,$(foreach type,$(if $(filter +%,$(typeorsuffix)),$(sort $(foreach suffixedtype,$(filter %$(typeorsuffix),$(types)),$(lastword $(subst |, ,$(suffixedtype))))),$(typeorsuffix)),$(patsubst %|$(type),%,$(filter %|$(type),$(types)))))
 
 # Build up collections of various file types.
 override xmlfiles := $(call filesoftype,$(XMLTYPES))
This page took 0.070131 seconds and 4 git commands to generate.