-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (24 loc) · 709 Bytes
/
Copy pathMakefile
File metadata and controls
35 lines (24 loc) · 709 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
29
30
31
32
33
34
35
www=www
dist=.dist
frame=frame
static=static
posts=$(www)/posts
www-dirs := $(shell find $(www) -type d)
www-files := $(shell find $(www) -type f -prune)
dist-dirs := $(www-dirs:$(www)%=$(dist)%)
dist-files := $(www-files:$(www)/%.md=$(dist)/%.html)
static-files := $(shell find $(static) -type f -prune)
static-files := $(static-files:$(static)%=$(dist)%)
frame-files := $(shell find $(frame) -type f -prune)
all: $(dist-dirs) $(dist-files) $(static-files)
$(dist)/%.html: $(www)/%.md $(frame-files)
bin/cc $< > $@
$(static-files): $(dist-dirs)
cp -r $(static)/* $(dist)
$(dist-dirs):
mkdir -pv $@
.PHONY: clean post
clean:
rm -rf $(dist)
post:
bin/new -b posts "$(title)" -f frame/post.html