forked from fletcher/MultiMarkdown-6-Syntax-Guide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (26 loc) · 902 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
SOURCE_DIR = source
# Find source fragments
srcfiles := $(wildcard $(SOURCE_DIR)/*/*.txt)
htmlfiles := $(patsubst %.txt, %.html, $(srcfiles))
# Don't clean certain files
cleanfiles := $(filter-out $(wildcard $(SOURCE_DIR)/html-blocks/*.html) $(wildcard $(SOURCE_DIR)/metadata/*.html) $(wildcard $(SOURCE_DIR)/links/*.html) $(wildcard $(SOURCE_DIR)/variables/*.html), $(wildcard $(SOURCE_DIR)/*/*.html))
.PHONY : release
release: index.txt
cat templates/header.txt > index.html
# Transclude only -- don't process
multimarkdown -s -t mmd index.txt > index-body.html
cat index-body.html >> index.html
rm index.txt
rm index-body.html
# Build HTML fragments from source fragments
%.html: %.txt
multimarkdown -b -s $*.txt
# Build final source file
index.txt: $(htmlfiles)
scripts/make_index $(SOURCE_DIR)
.PHONY: clean
clean:
rm $(cleanfiles)
rm index.html
rm index.txt
rm index-body.html