summaryrefslogtreecommitdiff
path: root/sandbox/mallard/html/Makefile
blob: f5921c61d1cc070a9f5eef66ee789a954f9ca030 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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)))
xhtmls=$(patsubst %.xml,%.xhtml, $(notdir $(specs)))
icons=admon-bug.png admon-caution.png admon-important.png admon-note.png admon-tip.png admon-warning.png
marks=watermark-blockquote-201C.png watermark-code.png

all: $(pages) $(icons) $(marks) 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


$(icons):
	ln -sf ../../../data/icons/hicolor/24x24/$@ $@
$(marks):
	ln -sf ../../../data/watermarks/$@ $@

$(pages) : mallard.cache $(xslts)
$(pages) : %.html : ../../../doc/mallard/C/%.xml
	xsltproc \
	  --stringparam mal.cache.file `pwd`/mallard.cache \
	  --stringparam theme.icon.admon.path '' \
	  --param mal.chunk.chunk_top 1 \
	  --param theme.icon.admon.size 24 \
	  --param mal2html.editor_mode 1 \
	  ../../../xslt/mallard/html/mal2html.xsl $<

$(xhtmls) : mallard.cache $(xslts)
$(xhtmls) : %.xhtml : ../../../doc/mallard/C/%.xml
	xsltproc \
	  --stringparam mal.cache.file `pwd`/mallard.cache \
	  --stringparam theme.icon.admon.path '' \
	  --param mal.chunk.chunk_top 1 \
	  --param theme.icon.admon.size 24 \
	  --param mal2html.editor_mode 1 \
	  ../../../xslt/mallard/html/mal2xhtml.xsl $<

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

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