forked from machinekit/machinekit-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
80 lines (62 loc) · 2.77 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
79
80
ifeq ($(BUILD_VERBOSE),1)
A2X_VERBOSE = -v
endif
DOCS_EN := $(patsubst %.asciidoc,%,$(wildcard *.asciidoc */*.asciidoc))
DOCS_ES := $(patsubst %.asciidoc,%,$(wildcard *_es.asciidoc */*_es.asciidoc))
DOCS_FR := $(patsubst %.asciidoc,%,$(wildcard *_fr.asciidoc */*_fr.asciidoc))
LARGE_EN := $(patsubst %.asciidoc,%,$(wildcard *.asciidoc))
LARGE_ES := $(patsubst %.asciidoc,%,$(wildcard *_es.asciidoc))
LARGE_FR := $(patsubst %.asciidoc,%,$(wildcard *_fr.asciidoc))
DOCS_EN := $(filter-out $(DOCS_ES), (filter-out $(DOCS_FR), $(DOCS_EN)) )
SMALL := $(filter-out $(LARGE_EN),$(DOCS_EN))
DOCS := $(DOCS_EN) $(DOCS_ES) $(DOCS_FR)
LARGE := $(LARGE_EN) $(LARGE_ES) $(LARGE_FR)
#include $(patsubst %,%.dep,$(LARGE))
A2X = ./a2x \
--xsltproc-opts "\
--stringparam toc.section.depth 3 \
--stringparam toc.max.depth 2 \
--stringparam generate.section.toc.level 2 \
--stringparam generate.toc 'book toc,title chapter toc'" \
--asciidoc-opts "-f docbook.conf" \
--dblatex-opts "\
-P doc.publisher.show=0 \
-P latex.output.revhistory=0 -s ./emc2.sty" \
$(A2X_VERBOSE)
all:
$(MAKE) -C ../../src docs
docs htmldocs pdfdocs:
$(MAKE) -C ../../src $@
docclean clean:
$(MAKE) -C ../../src docclean
pdf: $(patsubst %,%.pdf,$(LARGE))
html: xref_en.links $(patsubst %,%.html,$(DOCS))
htmlclean:
-rm -f $(patsubst %,%.html,$(DOCS))
dbclean:
-rm -f $(patsubst %,%.dep,$(DOCS))
-rm -f $(patsubst %,%.db,$(SMALL))
-rm -f xref_en.links
xref_en.links: $(patsubst %,%.db,$(SMALL))
echo $(SMALL)
./links_db_gen.py $^ > $@
%.db: %.asciidoc
asciidoc -d book -o- -b docbook $< | xsltproc links.xslt - > $@ || (X=$$?; rm $@; exit $$X)
%.dep: %.asciidoc
./asciideps $< > [email protected]
mv [email protected] $@
%.html: %.asciidoc
asciidoc -a linksfile=xref_en.links -a stylesheet=$(shell pwd)/linuxcnc.css -f xhtml11.conf -d book -a toc -a numbered -b xhtml11 $< || (X=$$?; rm $@; exit $$X)
#$(patsubst %,%.html,$(DOCS_ES)) :: %.html: %.asciidoc
# asciidoc -a stylesheet=$(shell pwd)/linuxcnc.css -f xhtml11.conf -d book -a toc -a numbered -b xhtml11 $< || (X=$$?; rm $@; exit $$X)
#$(patsubst %,%.html,$(DOCS_FR)) :: %.html: %.asciidoc
# asciidoc -a stylesheet=$(shell pwd)/linuxcnc.css -f xhtml11.conf -d book -a toc -a numbered -b xhtml11 $< || (X=$$?; rm $@; exit $$X)
%.pdf: %.asciidoc
$(A2X) -L -d book -f pdf $< || (X=$$?; rm $@; exit $$X)
$(patsubst %,%.html,$(LARGE)) :: %.html: %.asciidoc
$(A2X) --stylesheet=./linuxcnc.css -L -d book -f xhtml $< || (X=$$?; rm $@; exit $$X)
#$(patsubst %,%.html,$(LARGE_ES)) :: %.html: %.asciidoc
# $(A2X) --stylesheet=../linuxcnc.css -L -d book -f xhtml $< || (X=$$?; rm $@; exit $$X)
#$(patsubst %,%.html,$(LARGE_FR)) :: %.html: %.asciidoc
# $(A2X) --stylesheet=../linuxcnc.css -L -d book -f xhtml $< || (X=$$?; rm $@; exit $$X)
.PHONY: all docs htmldocs pdfdocs docclean clean