summaryrefslogtreecommitdiff
path: root/sandbox/mallard/html/Makefile
blob: a56fc2a472a1e41f800d874956f9b5af6ee763f7 (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
specs=$(filter-out ../spec/legal.xml, $(wildcard ../spec/*.xml))
pages=$(patsubst %.xml,%.xhtml, $(notdir $(specs)))

all: $(pages) figures mallard.cache

mallard.cache : $(wildcard ../xslt/*.xsl)
	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/mal2cache.xsl $@.in | xmllint --format - > $@
	rm $@.in

$(pages) : mallard.cache
$(pages) : $(wildcard ../xslt/*.xsl)
$(pages) : %.xhtml : ../spec/%.xml
	xsltproc -o $@ \
	  --stringparam mal.cache_file `pwd`/mallard.cache \
	  ../xslt/mal2html.xsl $<

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