forked from Nilkalibur/ClipEdit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (52 loc) · 1.57 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
# ClipEdit Makefile
# -----------------
# Language directories
DIR_FR=Docs/fr
DIR_EN=Docs/en
# Output files
PDF=$(patsubst %.md, %.pdf, $(wildcard $(DIR_EN)/*.md $(DIR_FR)/*.md))
ODT=$(patsubst %.md, %.odt, $(wildcard $(DIR_EN)/*.md $(DIR_FR)/*.md))
DOCX=$(patsubst %.md, %.docx, $(wildcard $(DIR_EN)/*.md $(DIR_FR)/*.md))
EPUB=$(patsubst %.md, %.epub, $(wildcard $(DIR_EN)/*.md $(DIR_FR)/*.md))
HTML=$(patsubst %.md, %.html, $(wildcard $(DIR_EN)/*.md $(DIR_FR)/*.md))
MAN=$(patsubst %.md, %, $(wildcard $(DIR_EN)/*.md $(DIR_FR)/*.md))
all: $(PDF) $(ODT) $(DOCX) $(EPUB) $(HTML) $(MAN)
%.pdf: %.md
# Create dir if necessary
@mkdir -p $(DIR_FR)/pdf $(DIR_EN)/pdf
# Generate docs
pandoc $< -V fontsize:11pt --toc -o $@
@mv $@ $(dir $@)/pdf
%.odt: %.md
# Create dir if neccessary
@mkdir -p $(DIR_FR)/odt $(DIR_EN)/odt
# Generate docs
pandoc -f markdown -t odt $< -o $@
@mv $@ $(dir $@)/odt
%.docx: %.md
# Create dir if necessary
@mkdir -p $(DIR_FR)/docx $(DIR_EN)/docx
# Generate docs
pandoc --toc -f markdown -t docx $< -o $@
@mv $@ $(dir $@)/docx
%.epub: %.md
# Create dir if necessary
@mkdir -p $(DIR_FR)/epub $(DIR_EN)/epub
# Generate docs
pandoc -s --toc -t EPUB $< -o $@
@mv $@ $(dir $@)/epub
%.html: %.md
# Create dir if necessary
@mkdir -p $(DIR_FR)/html $(DIR_EN)/html
# Generate docs
pandoc --ascii --from=markdown --to=html $< -o $@
@mv $@ $(dir $@)/html
%: %.md
# Create dir if necessary
@mkdir -p $(DIR_FR)/man $(DIR_EN)/man
# Generate docs
pandoc -s -t man $< -o $@
@mv $@ $(dir $@)/man
clean:
@rm -f *.o
@rm -rf $(DIR_FR)/*/ $(DIR_EN)/*/