-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
64 lines (47 loc) · 933 Bytes
/
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
##
## P A N D O C
##
P=pandoc
# if pandoc is not installed, let's use pandocker
ifeq (, $(shell which $(P)))
DOCKER?=latest
endif
ifneq ($(DOCKER),)
P:=docker run --rm -it --privileged --volume $(CURDIR):/pandoc dalibo/pandocker:$(DOCKER)
endif
PANDOC_ARGS=--standalone
P+= $(PANDOC_ARGS)
##
## S O U R C E S
##
# Ignore documentation
EXCLUDES:= -and -not -name 'QUICKSTART.md' -and -not -name 'README.md'
# $(SRCS) is the list of all source files
SRCS=$(shell find . -type f -name '*.md' $(EXCLUDES) )
##
## O B J E C T S
##
PDF_OBJS=$(SRCS:.md=.pdf)
ODT_OBJS=$(SRCS:.md=.odt)
DOCX_OBJS=$(SRCS:.md=.docx)
##
## T A R G E T S
##
pdf: $(PDF_OBJS)
odt: $(ODT_OBJS)
docx: $(DOCX_OBJS)
all: pdf docx
clean:
rm -fr $(PDF_OBJS)
rm -fr $(ODT_OBJS)
rm -fr $(DOCX_OBJS)
##
## B U I L D
## R U L E S
##
%.pdf: %.md
$P --pdf-engine=xelatex --template=eisvogel $^ -o $@
%.odt: %.md
$P $^ -o $@
%.docx: %.md
$P $^ -o $@