summaryrefslogtreecommitdiff
path: root/sandbox/mallard/html/Makefile
blob: 8781306e8680fd103e2ef4e8f8c9ed14ef6a9c17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
xslts=$(wildcard ../../../xslt/mallard/common/*.xsl) $(wildcard ../../../xslt/mallard/html/*.xsl)
specs=$(filter-out ../../../doc/mallard/C/legal.xml, $(wildcard ../../../doc/mallard/C/*.xml))
pages=$(patsubst %.xml,%.html, $(notdir $(specs)))

all: $(pages) figures mallard.cache

mallard.cache : $(specs) $(xslts)
	echo '<cache xmlns="http://www.gnome.org/~shaunm/mallard">' > $@.in
	for file in $(specs); do \
	  echo "<page href='$$file'/>" >> $@.in; \
	done
	echo '</cache>' >> $@.in
	xsltproc ../../../xslt/mallard/utils/mal2cache.xsl $@.in | xmllint --format - > $@
	rm $@.in

$(pages) : mallard.cache $(xslts)
$(pages) : %.html : ../../../doc/mallard/C/%.xml
	xsltproc -o $@ \
	  --stringparam mal.cache.file `pwd`/mallard.cache \
	  --param mal2html.editor_mode 1 \
	  ../../../xslt/mallard/html/mal2html.xsl $<

figures:
	if [ ! -d figures ]; then mkdir figures; fi
	cp ../../../doc/mallard/C/figures/*.png figures/

.PHONY: clean
clean:
	rm mallard.cache *.html