-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
73 lines (52 loc) · 1.69 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
63
64
65
66
67
68
69
70
71
72
73
SKETCHFILE = prettier.sketch
DATAFILES = icon.json wide.json
BIN = ./node_modules/.bin
EXPORT_DIR = images
EXPORTS = banner avatar logo icon wide
DARK_EXPORTS = $(EXPORTS:%=prettier-%-dark)
LIGHT_EXPORTS = $(EXPORTS:%=prettier-%-light)
ALL_EXPORTS = $(DARK_EXPORTS) $(LIGHT_EXPORTS)
PNG_EXPORTS = $(ALL_EXPORTS:%=$(EXPORT_DIR)/%.png)
SVG_EXPORTS = $(ALL_EXPORTS:%=$(EXPORT_DIR)/%.svg)
EXPORT_FILES = $(PNG_EXPORTS) $(SVG_EXPORTS)
.PHONY: build deploy watch watch-all watch-stylus watch-js serve clean exports
watch: $(DATAFILES)
@$(MAKE) -j4 watch-all
build: dist/app.css dist/wide.css dist/icon.css dist/bundle.js dist/AnimatedLogo.js dist/index.js dist/index.html
deploy: build
$(BIN)/gh-pages -d dist
watch-all: watch-stylus watch-bundle watch-babel serve
watch-stylus:
@mkdir -p dist
$(BIN)/stylus -w src -o dist
watch-bundle:
@mkdir -p dist
$(BIN)/watchify -t babelify src/app.js -o dist/bundle.js
watch-babel:
@mkdir -p dist
$(BIN)/babel src --out-dir dist
serve: dist/index.html dist/app.css dist/bundle.js
$(BIN)/serve dist
dist/%.html: src/%.html
@mkdir -p dist
cp $< $@
exports: $(EXPORT_FILES) $(EXPORT_DIR)/key.png
$(EXPORT_FILES): $(SKETCHFILE)
sketchtool export artboards --output=$(EXPORT_DIR) $^
$(EXPORT_DIR)/key.png: $(SKETCHFILE)
sketchtool export pages --item=key --output=$(EXPORT_DIR) $^
dist/bundle.js: src/app.js
@mkdir -p dist
$(BIN)/browserify -t babelify $< > $@
dist/%.css: src/%.styl $(DATAFILES)
@mkdir -p dist
$(BIN)/stylus $< -o $@
dist/%.js: src/%.js
@mkdir -p dist
$(BIN)/babel $< -o $@
%.json: $(EXPORT_DIR)/prettier-%-light.svg
node from-svg.js < $< > $@
clean:
$(RM) -r dist $(DATAFILES)
clean-exports:
$(RM) $(EXPORT_FILES) $(EXPORT_DIR)/key.png