]> Lady’s Gitweb - Shushe/blob - GNUmakefile
fe0cbd520b186730404087ea44891270872e70a4
[Shushe] / GNUmakefile
1 SHELL = /bin/sh
2
3 # ━ § BASIC INFORMATION ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4 override define makefileinfo
5 ╭────────────────────────────╮
6 ╔╡ ⁌ ⛩️📰 书社 ∷ GNUmakefile ╞════════════════════════════════╗
7 ║╰────────────────────────────╯ ║
8 ╟┬ ¶ Prerequisites ───────────────────────────────────────────┬╢
9 ║│ │║
10 ║│ Requires G·N·U Make, at least version 3.81, a version of │║
11 ║│ uuencode with base64 support, and the various programs │║
12 ║│ offered by libxml2 and libxslt. Beyond this, only programs │║
13 ║│ required by Posix are used, altho there is a chance of │║
14 ║│ version incompatibilities. The full list of program │║
15 ║│ requirements is as follows :— │║
16 ║│ │║
17 ║│ • cat │║
18 ║│ • cp │║
19 ║│ • echo │║
20 ║│ • file │║
21 ║│ • find │║
22 ║│ • mkdir (requires support for `-p´) │║
23 ║│ • mv │║
24 ║│ • printf │║
25 ║│ • sed │║
26 ║│ • test │║
27 ║│ • touch │║
28 ║│ • tr (requires support for `-d´) │║
29 ║│ • uuencode (requires support for `-m´ and `-r´) │║
30 ║│ • xmlcatalog (provided by libxml2) │║
31 ║│ • xmllint (provided by libxml2) │║
32 ║│ • xsltproc (provided by libxslt) │║
33 ║│ │║
34 ║│ In all cases, you can supply your own version of any │║
35 ║│ program `program´ by overriding the corresponding variable │║
36 ║│ `PROGRAM´ when calling Make. │║
37 ║╰────────────────────────────────────────────────────────────╯║
38 ╟┬ ¶ Usage ───────────────────────────────────────────────────┬╢
39 ║│ │║
40 ║│ • `make all´: Compile, but do not install, all files. │║
41 ║│ │║
42 ║│ • `make clean´: Remove `BUILDDIR´. │║
43 ║│ │║
44 ║│ • `make gone´: Remove installed files. │║
45 ║│ │║
46 ║│ • `make help´ (default): Print this message. │║
47 ║│ │║
48 ║│ • `make install´: Compile all files and install in │║
49 ║│ `DESTDIR´. │║
50 ║│ │║
51 ║│ • `make list´: List all recognized source files and their │║
52 ║│ classification (including media type and dependencies). │║
53 ║│ │║
54 ║│ Set `VERBOSE=1´ to see the text of commands as they are │║
55 ║│ executed. │║
56 ║│ │║
57 ║│ See `README.markdown´ for a more involved description of │║
58 ║│ the capabilities and configuration of this program. │║
59 ║╰────────────────────────────────────────────────────────────╯║
60 ╟┬ ¶ License ─────────────────────────────────────────────────┬╢
61 ║│ This Source Code Form is subject to the terms of the │║
62 ║│ Mozilla Public License, v 2.0. If a copy of the M·P·L was │║
63 ║│ not distributed with this file, You can obtain one at │║
64 ║│ <http://mozilla.org/MPL/2.0/>. │║
65 ║╰────────────────────────────────────────────────────────────╯║
66 ╚══════════════════════════════════════════════════════════════╝
67 endef
68
69 # ━ § MAKE·FILE SETUP ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
70
71 # Programs needed to run this make·file.
72 #
73 # If these are not installed on your computer, or you need to use a
74 # different implementation, you can override the appropriate variable.
75 CAT := cat
76 CP := cp
77 ECHO := echo
78 FILE := file
79 FIND := find
80 MKDIR := mkdir
81 MV := mv
82 PRINTF := printf
83 RM := rm
84 SED := sed
85 TEST := test
86 TOUCH := touch
87 TR := tr
88 UUENCODE := uuencode
89 XMLCATALOG := xmlcatalog
90 XMLLINT := xmllint
91 XSLTPROC := xsltproc
92
93 # The directory which contains the source files.
94 SRCDIR := sources
95
96 # The directory which contains “includes”: Files which may be included
97 # in other files but for which no final output will be generated.
98 #
99 # This can be inside of `SOURCES_DIRECTORY´ if desired.
100 INCLUDEDIR := sources/includes
101
102 # The directory in which to generate temporary buildfiles.
103 BUILDDIR := build
104
105 # The directory into which to output files on `make install´.
106 DESTDIR := public
107
108 # The location of this Makefile (and related ⛩️📰 书社 files),
109 # relative to the current working directory.
110 #
111 # By default, this is inferred from the variable `MAKEFILE_LIST´.
112 THISDIR := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
113
114 # The location of the magic files to use when determining media types.
115 #
116 # One is provided as part of this repository, but you can override it
117 # if you need different media type detection.
118 #
119 # Your computer probably has a more comprehensive one installed at
120 # `/usr/share/file/magic´, but it is not recommended that you use this
121 # directly. Instead, link or copy just the files you expect to need for
122 # your project.
123 MAGICDIR := $(patsubst ./%,%,$(THISDIR)/magic)
124
125 # Configuration of `find´.
126 #
127 # By default, `find´ will follow symlinks and use extended regular
128 # expressions, ignoring hidden files and those which begin with a
129 # period.
130 FINDOPTS := -LE
131 FINDRULES := -flags -nohidden -and -not -name '.*'
132
133 # The list of parsers for plaintext file types.
134 #
135 # Which parsers are provided will influence which kinds of files are
136 # recognized as plaintext.
137 #
138 # Each parser ⁜must⁜ have a template which matches ⁜only⁜ X·H·T·M·L
139 # `<script>´ elements that have a `@type´ of a plaintext type supported
140 # by the parser. They may have multiple.
141 PARSERS := $(patsubst ./%,%,$(wildcard $(THISDIR)/parsers/*.xslt))
142
143 # The list of transforms.
144 TRANSFORMS := $(patsubst ./%,%,$(wildcard $(THISDIR)/transforms/*.xslt))
145
146 # List of types which should be treated as X·M·L.
147 XMLTYPES := application/xml text/xml
148
149 # Set to a non·empty value to print all commands as they run.
150 VERBOSE :=
151
152 # The default target for this makefile.
153 #
154 # Print help and exit.
155 .DEFAULT_GOAL := help
156
157 # ━ § BEGIN MAKE·FILE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
158
159 # ─ ¶ Non‐Recipe Variable Definitions ─────────────────────────────────
160
161 # A variable with no value, usable when assigning values which contain
162 # whitespace.
163 override empty :=
164
165 # A variable which contains a newline, to allow the generation of
166 # multiline strings in function calls.
167 override define newline
168
169
170 endef
171
172 # A variable which contains a single space.
173 override space := $(empty) $(empty)
174
175 # A variable which contains a single comma.
176 override comma := ,
177
178 # (callable) Quote the given string for use within shell calls.
179 override quote = '$(subst ','"'"',$1)'
180
181 # Outputs an `@´ to silence rules, unless `VERBOSE´ is nonempty.
182 override silent := $(if $(VERBOSE),,@)
183
184 # (callable) Escape special characters for use in sed regular
185 # expressions.
186 override sedesc = $(subst $$,\$$,$(subst *,\*,$(subst .,\.,$(subst [,\[,$(subst ^,\^,$(subst \,\\,$1))))))
187
188 # Collect all of the applicable includes from the includes directory.
189 sourceincludes := $(shell $(FIND) $(FINDOPTS) $(INCLUDEDIR) -type f '(' $(FINDRULES) ')')
190
191 # Collect all of the applicable source files from the source directory,
192 # removing any which are also includes.
193 sourcefiles := $(filter-out $(sourceincludes),$(shell $(FIND) $(FINDOPTS) $(SRCDIR) -type f '(' $(FINDRULES) ')'))
194
195 # Figure out the file type of each source file and source include.
196 ifneq ($(wildcard $(BUILDDIR)/magic.mgc),)
197 override types := $(shell $(SED) 's/^ *//;s/ *$$//;s/ {2,}/ /g' <<< $(call quote,$(sourcefiles) $(sourceincludes)) | $(TR) ' ' '\n' | $(FILE) -m $(call quote,$(BUILDDIR)/magic.mgc) --mime-type --separator '`' --files-from - | $(SED) 's/` */?type=/g')
198 endif
199
200 # Get the list of supported plaintext file types from the parser.
201 ifneq ($(wildcard $(BUILDDIR)/parser.xslt),)
202 override plaintexttypes := $(shell $(XSLTPROC) $(call quote,$(THISDIR)/lib/parser2types.xslt) $(call quote,$(BUILDDIR)/parser.xslt))
203 endif
204
205 # Simplify the file type by only taking the first component (image,
206 # text, ⁊·c).
207 override simpletypes := $(shell $(TR) ' ' '\n' <<< $(call quote,$(types)) | $(SED) 's`/[^/]*$$``g')
208
209 # (callable) Get all of the files (source and includes) which have the
210 # given types.
211 override filesoftype = $(foreach type,$1,$(patsubst %?type=$(type),%,$(filter %?type=$(type),$(types))))
212
213 # Build up collections of various file types.
214 override plaintextfiles := $(call filesoftype,$(plaintexttypes))
215 override xmlfiles := $(filter-out $(plaintextfiles),$(call filesoftype,$(XMLTYPES)))
216 override assetfiles := $(filter-out $(xmlfiles) $(plaintextfiles),$(sourcefiles) $(sourceincludes))
217
218 # (callable) Get the types of the given files.
219 override typeoffile = $(patsubst $(foreach file,$1,$(file)?type=%),%,$(filter $(foreach file,$1,$(file)?type=%),$(types)))
220
221 # (callable) Get base64 data u·r·i’s for the given files.
222 override datauri = $(foreach file,$1,data:$(call typeoffile,$(file));base64,$(shell $(UUENCODE) -m -r $(call quote,$(file)) _ | tr -d ' \n'))
223
224 # (callable) Get local leiris for the given files.
225 override localuri = $(foreach file,$1,$(if $(filter $(file),$(sourceincludes)),$(patsubst $(INCLUDEDIR)/%,about:shushe?include=%,$(file)),$(patsubst $(SRCDIR)/%,about:shushe?source=%,$(file))))
226
227 # (callable) Get the source files for the given local leiris.
228 override sourcefile = $(foreach file,$1,$(if $(filter about:shushe?include=%,$(file)),$(patsubst about:shushe?include=%,$(INCLUDEDIR)/%,$(file)),$(patsubst about:shushe?source=%,$(SRCDIR)/%,$(file))))
229
230 # Adds a requirement on `$(BUILDDIR)/.update-types´ if the file is
231 # present.
232 #
233 # This file is created after a reload due to type changes, and is
234 # removed after. Requiring it ensures that file classifications are
235 # up‐to‐date immediately after the reload.
236 override typeupdates := $(if $(wildcard $(BUILDDIR)/.update-types),$(BUILDDIR)/.update-types,)
237
238 # (callable) Get the location of the transformed X·M·L files for the
239 # given source files.
240 override parsed = $(foreach file,$1,$(if $(filter $(file),$(sourceincludes)),$(patsubst $(INCLUDEDIR)/%,$(BUILDDIR)/includes/%,$(file)),$(patsubst $(SRCDIR)/%,$(BUILDDIR)/sources/%,$(file))))
241
242 ifneq ($(wildcard $(BUILDDIR)/dependencies),)
243 # Pair each file with a list of dependencies for it.
244 override dependenciesforfile := $(foreach file,$(sourcefiles),$(file)`$(subst $(space),`,$(shell $(CAT) $(call quote,$(BUILDDIR)/dependencies) | $(SED) $(call quote,/^$(call sedesc,$(call localuri,$(file)))$$/$(comma)/^[^ ]/!d;/^ /!d;s/^ //))))
245
246 # (callable) Get the list of dependency leiris for the given source
247 # files.
248 #
249 # Recursive dependencies are marked with a leading `!´.
250 override dependencyuris = $(foreach file,$1,$(subst `, ,$(patsubst $(file)`%,%,$(filter $(file)`%,$(dependenciesforfile)))))
251
252 # (callable) Get the list of recursive dependencies for the given
253 # source files.
254 override recursives = $(foreach uri,$(filter !%,$(call dependencyuris,$1)),$(call sourcefile,$(patsubst !%,%,$(uri))))
255
256 # (callable) Get the list of (nonrecursive) dependencies for the given
257 # source files.
258 override dependencies = $(foreach uri,$(filter-out !%,$(call dependencyuris,$1)),$(call sourcefile,$(uri)))
259 endif
260
261 # Collect all files with recursive dependencies.
262 override recursivefiles := $(foreach file,$(filter-out $(assetfiles),$(sourcefiles)),$(if $(call recursives,$(file)),$(file),))
263
264 # Collect all files which should be compiled.
265 #
266 # This is all of the non·asset, nonrecursive files.
267 override compilablefiles := $(filter-out $(assetfiles) $(recursivefiles),$(sourcefiles))
268
269 # (callable) Get the compiled locations for the given source files.
270 override compiled = $(patsubst $(SRCDIR)/%,$(BUILDDIR)/public/%,$(1))
271
272 # (callable) Get the installed locations for the given source files.
273 override installed = $(patsubst $(SRCDIR)/%,$(DESTDIR)/%,$(1))
274
275 # ─ ¶ Recipe Variable Definitions ─────────────────────────────────────
276
277 # (callable) Check to see if the given directory exists and
278 # create it if not.
279 override ensuredirectory = if $(TEST) ! -d $(call quote,$1); then $(MKDIR) -p $(call quote,$1); fi
280
281 # (callable) Sanitize and wrap the provided plaintext file in
282 # X·M·L, printing to `stdout´.
283 override wrapplaintext = $(PRINTF) '%s\n' "$$($(PRINTF) '%b' '<?xml version=\042\061.0\042?>\n<script xmlns=\042http://www.w3.org/1999/xhtml\042 type=\042$(patsubst $1?type=%,%,$(filter $1?type=%,$(types)))\042><![CDATA['; $(CAT) $(call quote,$1) | $(TR) '\000\013\014' '\032\011\012' | $(SED) $$($(PRINTF) '%s%b' 's/]]>/]]]]><!\[CDATA\[>/g;s/\xEF\xBF\xBE/�/g;s/\xEF\xBF\xBF/�/g;$$!s/\r$$//g;s/\r/\n/g;$$!s/\xC2\x85$$//g;s/\xC2\x85/\n/g;s/\xE2\x80\xA8/\n/g;' 's/[\0001-\0010]/�/g;s/[\0016-\0037]/�/g'); $(PRINTF) '%s' ']]></script>')"
284
285 # ─ ¶ Phony Targets ───────────────────────────────────────────────────
286
287 # Provide help.
288 help:
289 $(silent)$(PRINTF) '%b' '$(subst $(newline),\n,$(makefileinfo))'
290
291 # Compile all files, or error if any are recursive.
292 all: $(call compiled,$(recursivefiles) $(compilablefiles) $(assetfiles)) ;
293
294 # Destroy buildfiles.
295 clean:
296 $(silent)$(RM) -rf $(BUILDDIR)/
297
298 # Destroy buildfiles and the install directory.
299 gone:
300 $(silent)$(RM) -rf $(BUILDDIR)/ $(call compiled,$(recursivefiles) $(compilablefiles))
301
302 # Install the compiled files into `DESTDIR´.
303 install: $(call installed,$(recursivefiles) $(compilablefiles) $(assetfiles)) ;
304
305 # List all source files and includes and their computed types.
306 list:
307 $(silent)$(PRINTF) '%b' $(call quote,$(foreach file,$(sort $(sourcefiles)) $(sort $(sourceincludes)),\0033[1m$(file)\0033[22m`$(call typeoffile,$(file))`[\0033[3m$(if $(filter $(file),$(xmlfiles)),xml,$(if $(filter $(file),$(plaintextfiles)),text,asset))$(if $(filter $(file),$(sourceincludes)), include,)\0033[23m]$(if $(call dependencies,$(file))$(call recursives,$(file)), $(strip $(foreach recursive,$(call recursives,$(file)),\0033[93;41m•`Recursive`Dependency:\0033[39;49m`$(recursive)) $(foreach dependency,$(call dependencies,$(file)),\0033[2m•`Dependency:\0033[22m`$(dependency)))) )) | $(TR) ' `' '\n '
308
309 # Raise an error when attempting to build any files with recursive
310 # dependencies.
311 $(call compiled,$(recursivefiles)): $(BUILDDIR)/public/%:
312 @$(PRINTF) '%b\n' $(call quote,\0033[93;41mError:\0033[39;49m `$*´ has recursive dependencies:\n$(subst `, ,$(subst $(space),$(newline),$(foreach recursive,$(call recursives,$(SRCDIR)/$*),•`$(patsubst $(SRCDIR)/%,%,$(recursive)))))) && false
313
314 # ─ ¶ Special Targets ─────────────────────────────────────────────────
315
316 # Perform secondary expansion; this enables pattern rules to determine
317 # their prerequisites based on the matched pattern.
318 .SECONDEXPANSION: ;
319
320 # Don’t use any implicit rules.
321 .SUFFIXES: ;
322
323 # Phony rules; always consider these out‐of‐date.
324 .PHONY: all default clean gone info install list $(call compiled,$(recursivefiles));
325
326 # Reload this make·file if any of the magic files or parsers have
327 # changed.
328 #
329 # These are used to classify source files, so if they have changed then
330 # the make·file must be reloaded.
331 $(THISDIR)/GNUmakefile:: $(BUILDDIR)/magic.mgc $(BUILDDIR)/parser.xslt $(THISDIR)/lib/parser2types.xslt
332 $(silent)$(TOUCH) $(THISDIR)/GNUmakefile
333 $(silent)$(TOUCH) $(call quote,$(BUILDDIR)/.update-types)
334 $(silent)$(RM) -f $(call quote,$(BUILDDIR)/dependencies)
335 @$(PRINTF) '%b\n' '\0033[1mMagic file or parsers have updated. Restarting…\0033[22m'
336
337 ifneq ($(wildcard $(BUILDDIR)/.update-types)$(wildcard $(BUILDDIR)/dependencies),)
338 # Reload this make·file if the dependency graph has changed.
339 #
340 # This graph is a dependency for some of the variables that this
341 # make·file uses, so it’s important to ensure that they are actually
342 # up‐to‐date prior to executing any later rules.
343 #
344 # This recipe only exists after types have been updated or when the
345 # dependency graph already exists.
346 $(THISDIR)/GNUmakefile:: $(BUILDDIR)/dependencies
347 $(silent)$(TOUCH) $(THISDIR)/GNUmakefile
348 $(silent)$(RM) -f $(BUILDDIR)/.update-types
349 @$(PRINTF) '%b\n' '\0033[1mDependency graph updated. Restarting…\0033[22m'
350 endif
351
352 # ─ ¶ Build Targets ───────────────────────────────────────────────────
353
354 # Generate the compiled magic file from its sources.
355 #
356 # It must be updated if any of the files in the magic directory change.
357 # It ⁜also⁜ should be updated if any of the files in the magic
358 # directory are deleted, but this isn’t tracked presently.
359 $(BUILDDIR)/magic.mgc: $(wildcard $(MAGICDIR)/*)
360 @$(ECHO) "Compiling new magic…"
361 $(silent)$(call ensuredirectory,$(dir $@))
362 $(silent)$(FILE) -C -m $(call quote,$(MAGICDIR))
363 $(silent)$(MV) $(call quote,$(MAGICDIR).mgc) $(call quote,$(BUILDDIR)/magic.mgc)
364
365 # Generate the main parser.
366 $(BUILDDIR)/parser.catalog: $(PARSERS)
367 @$(ECHO) "Generating catalog of parsers…"
368 $(silent)$(XMLCATALOG) --create --noout $(call quote,$@)
369 $(foreach parser,$(PARSERS),$(silent)$(XMLCATALOG) --add uri $(call quote,$(basename $(notdir $(parser)))) $(call quote,../$(parser)) --noout $(call quote,$@)$(newline))
370 $(BUILDDIR)/parser.xslt: $(BUILDDIR)/parser.catalog $(THISDIR)/lib/catalog2parser.xslt
371 @$(ECHO) "Generating main parser…"
372 $(silent)$(XSLTPROC) -o $(call quote,$@) $(call quote,$(THISDIR)/lib/catalog2parser.xslt) $(call quote,$<)
373
374 # Note updates to parsers or magic.
375 #
376 # This file is actually generated as part of the make·file restart
377 # process, so it doesn’t need any recipes.
378 $(BUILDDIR)/.update-types: $(BUILDDIR)/magic.mgc $(BUILDDIR)/parser.xslt $(THISDIR)/lib/parser2types.xslt ;
379
380 # Parse the files.
381 #
382 # Even plain X·M·L files are parsed, because they may contain X·H·T·M·L
383 # `<script>´ elements which contain other kinds of data. Asset files
384 # are turned into H·T·M·L embeds pointing to `data:´ U·R·I’s.
385 $(call parsed,$(sourceincludes)): $(BUILDDIR)/includes/%: $(INCLUDEDIR)/% $(typeupdates)
386 @$(PRINTF) '%s\n' $(call quote,Processing `$<´…)
387 $(silent)$(call ensuredirectory,$(dir $@))
388 $(silent)$(if $(filter $<,$(assetfiles)),$(PRINTF) '%s\n' $(call quote,<object xmlns="http://www.w3.org/1999/xhtml" type="$(call typeoffile,$(INCLUDEDIR)/$*)" data="$(call datauri,$<)"/>) > $(call quote,$@),$(if $(filter $<,$(plaintextfiles)),$(call wrapplaintext,$<),$(CAT) $(call quote,$<)) | $(XSLTPROC) -o $(call quote,$@) $(call quote,$(BUILDDIR)/parser.xslt) -)
389 $(call parsed,$(sourcefiles)): $(BUILDDIR)/sources/%: $(SRCDIR)/% $(typeupdates)
390 @$(PRINTF) '%s\n' $(call quote,Processing `$<´…)
391 $(silent)$(call ensuredirectory,$(dir $@))
392 $(silent)$(if $(filter $<,$(assetfiles)),$(PRINTF) '%s\n' $(call quote,<object xmlns="http://www.w3.org/1999/xhtml" type="$(call typeoffile,$(SRCDIR)/$*)" data="$(call datauri,$<)"/>) > $(call quote,$@),$(if $(filter $<,$(plaintextfiles)),$(call wrapplaintext,$<),$(CAT) $(call quote,$<)) | $(XSLTPROC) -o $(call quote,$@) $(call quote,$(BUILDDIR)/parser.xslt) -)
393
394 # Generate a catalog of all transformed files, for use when processing
395 # includes. This does not depend on actually transforming the files.
396 $(BUILDDIR)/catalog: $(sourcefiles) $(sourceincludes) $(typeupdates)
397 @$(ECHO) "Generating catalog of parsed files…"
398 $(silent)$(XMLCATALOG) --create --noout $(call quote,$@)
399 $(foreach source,$(sourcefiles) $(sourceincludes),$(silent)$(XMLCATALOG) --add uri $(call quote,$(call localuri,$(source))) $(call quote,$(patsubst $(BUILDDIR)/%,%,$(call parsed,$(source)))#$(if $(filter $(source),$(assetfiles)),asset,xml)) --noout $(call quote,$@)$(newline))
400
401 # Build a list of dependencies for each transformed file.
402 #
403 # This recipe also adjusts backwards the modification time of this
404 # make·file by one second, to ensure that it is always more outdated
405 # than the built dependencies (triggering a restart).
406 $(BUILDDIR)/dependencies: $(BUILDDIR)/catalog $(call parsed,$(plaintextfiles) $(xmlfiles)) $(THISDIR)/lib/catalog2dependencies.xslt
407 @$(ECHO) "Identifying dependencies…"
408 $(silent)$(XSLTPROC) -o $(call quote,$@) $(call quote,$(THISDIR)/lib/catalog2dependencies.xslt) $(call quote,$<)
409 $(silent)$(TOUCH) -A -000001 -am $(THISDIR)/GNUmakefile
410
411 # Generate the main transform.
412 $(BUILDDIR)/transform.catalog: $(TRANSFORMS)
413 @$(ECHO) "Generating catalog of transforms…"
414 $(silent)$(XMLCATALOG) --create --noout $(call quote,$@)
415 $(foreach transform,$(TRANSFORMS),$(silent)$(XMLCATALOG) --add uri $(call quote,$(basename $(notdir $(transform)))) $(call quote,../$(transform)) --noout $(call quote,$@)$(newline))
416 $(BUILDDIR)/transform.xslt: $(BUILDDIR)/transform.catalog $(THISDIR)/lib/catalog2transform.xslt
417 @$(ECHO) "Generating main transform…"
418 $(silent)$(XSLTPROC) -o $(call quote,$@) $(call quote,$(THISDIR)/lib/catalog2transform.xslt) $(call quote,$<)
419
420 # Generate the output files using the dependencies as necessary.
421 $(call compiled,$(compilablefiles)): $(BUILDDIR)/public/%: $$(call parsed,$(SRCDIR)/%) $(BUILDDIR)/transform.xslt $$(call parsed,$$(call dependencies,$(SRCDIR)/%))
422 $(silent)$(call ensuredirectory,$(dir $@))
423 @$(PRINTF) '%s\n' $(call quote,Compiling `$*´…)
424 $(silent)$(XSLTPROC) -o $(call quote,$@) --stringparam catalog 'catalog' $(call quote,$(BUILDDIR)/transform.xslt) $(call quote,$<)
425 $(call compiled,$(filter $(assetfiles),$(sourcefiles))): $(BUILDDIR)/public/%: $(SRCDIR)/%
426 @$(PRINTF) '%s\n' $(call quote,Compiling `$*´…)
427 $(silent)$(call ensuredirectory,$(dir $@))
428 $(silent)$(CP) $(call quote,$<) $(call quote,$@)
429
430 # Install compiled files (or error in the case of recursive ones).
431 $(call installed,$(filter $(assetfiles),$(sourcefiles)) $(recursivefiles) $(compilablefiles)): $(DESTDIR)/%: $(BUILDDIR)/public/%
432 @$(PRINTF) '%s\n' $(call quote,Installing `$*´…)
433 $(silent)$(call ensuredirectory,$(dir $@))
434 $(silent)$(CP) $(call quote,$<) $(call quote,$@)
This page took 0.125825 seconds and 3 git commands to generate.