forked from openjdk/amber-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (19 loc) · 680 Bytes
/
Copy pathMakefile
File metadata and controls
28 lines (19 loc) · 680 Bytes
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
OUT_DIR = out
IN_DIR = site
CSS = style.css
WILDCARD = $(patsubst $(IN_DIR)/%, %, $(wildcard $(IN_DIR)/*.$(1) $(IN_DIR)/**/*.$(1) ))
ASSET_EXTS = html jpg jpg gif svg
MD_SOURCES = $(call WILDCARD,md)
ASSET_SOURCES = $(foreach X, $(ASSET_EXTS), $(call WILDCARD,$(X)))
GENERATED_FILES = $(patsubst %.md, $(OUT_DIR)/%.html, $(MD_SOURCES))
COPIED_FILES = $(patsubst %,$(OUT_DIR)/%, $(ASSET_SOURCES))
site: $(GENERATED_FILES) $(COPIED_FILES)
$(GENERATED_FILES) : $(OUT_DIR)/%.html : $(IN_DIR)/%.md
mkdir -p $(dir $@)
pandoc -f markdown $< -o $@ -H $(CSS)
$(COPIED_FILES) : $(OUT_DIR)/% : $(IN_DIR)/%
mkdir -p $(dir $@)
cp $< $@
clean:
rm -rf $(OUT_DIR)
.PHONY: all clean