-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (45 loc) · 1.46 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
# Author: Matthieu GOSSET
# Mail: matthieu.gosset.dev@outlook.com
# Purpose: Wrap marp calls into a classic Makefile
# User-land:
# Path to the theme you want to use
THEME_PATH=theme
CUSTOM_THEME=$(THEME_PATH)/company-theme.scss
# Choose if you want to use npx or not
NPX_BUILDER=npx @marp-team/marp-cli
NO_NPX_BUILDER=marp
BUILDER=$(NO_NPX_BUILDER)
# Main project entry
MAIN_FILE=Main
# Build path
BUILD_PATH=_build
# Common bins
RMRF=rm -rf
MV=mv
MKDIR=mkdir -p
# Marp-land:
THEME=--theme $(CUSTOM_THEME)
.PHONY: clean preview all html
all: $(BUILD_PATH)/$(MAIN_FILE).html $(BUILD_PATH)/$(MAIN_FILE).pdf $(BUILD_PATH)/$(MAIN_FILE).pptx
preview:
$(BUILDER) -w $(MAIN_FILE).md $(THEME)
$(BUILD_PATH):
$(MKDIR) $(BUILD_PATH)
$(BUILD_PATH)/$(MAIN_FILE).html: $(BUILD_PATH)
$(BUILDER) $(MAIN_FILE).md $(THEME) --html
$(MV) $(MAIN_FILE).html $(BUILD_PATH)/$(MAIN_FILE).html
$(MAIN_FILE).html: $(BUILD_PATH)/$(MAIN_FILE).html
html: $(MAIN_FILE).html
$(BUILD_PATH)/$(MAIN_FILE).pdf: $(BUILD_PATH)
$(BUILDER) $(MAIN_FILE).md $(THEME) --pdf --allow-local-files
$(MV) $(MAIN_FILE).pdf $(BUILD_PATH)/$(MAIN_FILE).pdf
$(MAIN_FILE).pdf: $(BUILD_PATH)/$(MAIN_FILE).pdf
pdf: $(MAIN_FILE).pdf
$(BUILD_PATH)/$(MAIN_FILE).pptx: $(BUILD_PATH)
$(BUILDER) $(MAIN_FILE).md $(THEME) --pptx --allow-local-files
$(MV) $(MAIN_FILE).pptx $(BUILD_PATH)/$(MAIN_FILE).pptx
$(MAIN_FILE).pptx: $(BUILD_PATH)/$(MAIN_FILE).pptx
pptx: $(MAIN_FILE).pptx
clean:
$(RMRF) $(BUILD_PATH)
$(RMRF) $(MAIN_FILE).html