-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.odt
75 lines (54 loc) · 1.69 KB
/
Makefile.odt
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
FN = trname
FINAL = 0
EPUBFIX = META-INF css cover-logo.png cover.png
NAZEV = "Report Title"
AUTOR = "Author(s)"
TRNO = XX/2008
DATE = 6.12.2008
GOPTS = --stringparam tr-nazev $(NAZEV) --stringparam tr-autor $(AUTOR) \
--stringparam tr-number $(TRNO) --stringparam tr-datum $(DATE)
H1L = 1
TTS = Teletype
XSLDIR = /Users/lhotka/Projects/techrep
.PHONY: all init pdf html rss epub tarball
all: pdf html rss epub
pdf: $(FN).pdf
html: index.html
rss: $(FN).rss
epub: $(FN).epub
init:
if [ ! -d META-INF ] ; then cp -r $(XSLDIR)/EPUB/* . ; fi
tarball: $(FN).pdf index.html $(FN).rss $(FN).epub
mkdir $(FN)
cp $(shell xsltproc $(XSLDIR)/piclist.xsl $(FN).ctr) $^ $(FN)
tar czvf $(FN).tar.gz $(FN)
rm -rf $(FN)
content.xml: $(FN).odt
unzip $<
touch $@
%.xml: content.xml
xsltproc $(GOPTS) -o $@ $(XSLDIR)/odt2tr.xsl $<
%.ctr: %.xml
xsltproc --novalid -o $@ $(XSLDIR)/tr1to2.xsl $<
%.tex: %.ctr
xsltproc --stringparam final $(FINAL) -o $@ $(XSLDIR)/trtotex.xsl $<
%.pdf: %.tex
xetex $<
index.html: $(FN).ctr
xsltproc --stringparam tr-name $(FN) -o $@ $(XSLDIR)/trtoxhtml.xsl $<
$(FN).rss: $(FN).ctr
xsltproc --stringparam tr-name $(FN) -o $@ $(XSLDIR)/trtorss.xsl $<
$(FN).epub: content.opf etr.html etr-title.html etr-toc.html toc.ncx
zip -DX0 $@ mimetype
zip -DrX9 $@ $^ $(EPUBFIX) \
$(shell xsltproc $(XSLDIR)/piclist.xsl $(FN).ctr)
content.opf: $(FN).ctr
xsltproc -o $@ $(XSLDIR)/trtoopf.xsl $<
etr.html: $(FN).ctr
xsltproc -o $@ $(XSLDIR)/trtoepub.xsl $<
etr-title.html: $(FN).ctr
xsltproc -o $@ $(XSLDIR)/trtoetitle.xsl $<
etr-toc.html: $(FN).ctr
xsltproc -o $@ $(XSLDIR)/trtoetoc.xsl $<
toc.ncx: $(FN).ctr
xsltproc --stringparam tr-name $(FN) -o $@ $(XSLDIR)/trtoncx.xsl $<