-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (50 loc) · 1.09 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
STYL = ./node_modules/.bin/styl
COMP = ./node_modules/.bin/component
SERVE = ./node_modules/.bin/serve
STYLS = $(wildcard styl/*)
dist:
cp out/*.css public/css/
cp out/*.js public/js/
cp fonts/* public/fonts/
.PHONY:
public:
mkdir -p public
mkdir -p public/js
mkdir -p public/css
mkdir -p public/fonts
.PHONY: out
out: styl component css js
.PHONY: styl
styl: $(STYLS)
.PHONY: component
component: $(COMPONENTS)
@mkdir -p out/component
$(COMP) install
node bundle
.PHONY: $(STYLS)
$(STYLS):
@mkdir -p out/styl
$(STYL) -w < $(@) > out/styl/$(shell basename $(@:.styl=.css))
.PHONY: js
js: component
@mkdir -p out/js
rm -f out/spin.js
{ ls js/* 2>/dev/null && cp js/* out/js; } || true
@#{ cat out/js/* >> out/spin.js; } || true
{ cat out/component/* >> out/spin.js; } || true
.PHONY: css
css: $(STYLS)
@mkdir -p out/css
rm -f out/spin.css
cp css/* out/css
cat out/css/* >> out/spin.css
cat out/styl/* >> out/spin.css
@#cat out/component/*.css >> out/spin.css
clean:
rm -rf out
rm -rf public
.PHONY: index.html
serve: index.html
index.html:
open 'http://localhost:3000'
$(SERVE)