-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (51 loc) · 1.05 KB
/
Makefile
File metadata and controls
69 lines (51 loc) · 1.05 KB
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
##
## P A N D O C
##
P=pandoc
# if pandoc is not installed,
# we'll use docker image pandoc/extra:latest-ubuntu
# instead
ifeq (, $(shell which $(P)))
#DOCKER?=latest-ubuntu
# https://github.com/dinolupo/pandoc-md/issues/1#issuecomment-3586755187
DOCKER?=3.7-ubuntu
endif
ifneq ($(DOCKER),)
P:=docker run --rm -it --privileged --volume $(CURDIR):/pandoc pandoc/extra:$(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 --from markdown --template eisvogel $^ -o $@
%.odt: %.md
$P $^ -o $@
%.docx: %.md
$P $^ -o $@