forked from Normation/rudder-doc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
79 lines (60 loc) · 2.02 KB
/
Makefile
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
76
77
78
## Rudder User Documentation Makefile
.PHONY: all clean view
BASENAME = rudder-doc
SOURCES = $(BASENAME).txt
TARGETS = epub html pdf readme
ASCIIDOC = $(CURDIR)/bin/asciidoc/asciidoc.py
A2X = $(CURDIR)/bin/asciidoc/a2x.py
## Asciidoc with general options
ASCIIDOCTODOCBOOK = $(ASCIIDOC) --doctype=book -a docinfo1
## Specific asciidoc options for EPUB output
ASCIIDOCTOEPUB = $(A2X) -f epub \
--doctype=book -a docinfo1 \
--dblatex-opts "-P latex.output.revhistory=0"
## Specific asciidoc options for XHTML output
ASCIIDOCTOHTML = $(ASCIIDOC) --doctype=book \
--backend xhtml11 -a badges -a icons -a numbered -a toc2 \
-a stylesheet=$(CURDIR)/style/html/rudder.css \
-a toc-title="Rudder User Documentation" \
## unused options::
## stylesdir/stylesheet:
## we use standard asciidoc stylesheets (no specific stylesdir)
## and add specific styling for Rudder afterwards (stylesheet option)
# -a stylesdir=$(CURDIR)/style/html \
## the search path for 'theme' option cannot be set accurately -> unused
# -a theme=rudder \
## embed css into the html file, this option is not used:
# -a linkcss
## Generate PDF from docbook
DOCBOOK2PDF = dblatex -tpdf
SEE = see
all: $(TARGETS)
epub: epub/$(BASENAME).epub
html: html/$(BASENAME).html
pdf: html/$(BASENAME).pdf
readme: html/README.html
epub/$(BASENAME).epub: $(SOURCES)
mkdir -p html
$(ASCIIDOCTOEPUB) $?
mv $(BASENAME).epub html/
html/$(BASENAME).pdf: $(SOURCES)
mkdir -p html
$(ASCIIDOCTODOCBOOK) --backend docbook $?
$(DOCBOOK2PDF) $(BASENAME).xml
rm $(BASENAME).xml
rm -f *.svg
mv $(BASENAME).pdf html/
html/$(BASENAME).html: $(SOURCES)
mkdir -p html
$(ASCIIDOCTOHTML) --out-file $@ $?
cp -R style/html/* images html/
html/README.html: README.asciidoc
mkdir -p html
$(ASCIIDOCTOHTML) --out-file $@ $?
slides.html: $(SOURCES)
$(ASCIIDOC) -a theme=volnitsky --out-file slides.html --backend slidy $?
## WARNING: at cleanup, delete png files that were produced by output only !
clean:
rm -rf rudder-doc.xml *.pdf *.html *.png *.svg temp html epub
view: all
$(SEE) $(TARGETS)