-
Notifications
You must be signed in to change notification settings - Fork 35
/
Makefile
52 lines (36 loc) · 1.27 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
# helpers
RSYNC_EXCLUDES = --exclude 'src' --exclude '.DS_Store' --exclude '.gitignore' --exclude '.hgignore'
# input
JADE_DIR = jade
#JADE_PARTIALS = $(shell find $(JADE_DIR)/templates/partials/*.jade)
JADE_PAGES = $(shell find $(JADE_DIR)/*.jade)
JS_IN_DIR = js
JS_FILES = $(shell find $(JS_IN_DIR)/ -type f -name '*.js')
# output
OUT_DIR = build
STATIC_IN_DIR = static
STATIC_OUT_DIR = $(OUT_DIR)
STATIC_FILES = $(shell find $(STATIC_IN_DIR) -type f)
HTML_OUT_DIR = $(OUT_DIR)
JS_OUT_DIR = $(OUT_DIR)/js
JS_CONCAT_FILES = $(shell find $(JS_IN_DIR)/*.js)
.PHONY: all
all: html css static_files rss
html:
./node_modules/.bin/quinoa jade
css: out/css/style.min.css
out/css/style.slim.css: $(shell find $(STATIC_OUT_DIR) -type f -name '*.html') out/css/style.css
./node_modules/.bin/uncss --stylesheets css/style.css out/index.html > out/css/style.slim.css
out/css/style.min.css: out/css/style.slim.css
./node_modules/.bin/cleancss --s0 < out/css/style.slim.css > out/css/style.min.css
rss:
node rss.js
static_files: $(STATIC_FILES)
rsync -vaz $(RSYNC_EXCLUDES) $(STATIC_IN_DIR)/ $(STATIC_OUT_DIR)
#$(HTML_OUT_DIR)/%.html: %.jade
# jade --path $(JADE_DIR) --out $(HTML_OUT_DIR) $<
$(JS_OUT_DIR)/%.js: $(JS_IN_DIR)/%.js
@mkdir -p "$(@D)"
cp $< $@
clean:
rm -rf $(OUT_DIR)/*