-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (32 loc) · 793 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
34
35
36
37
38
39
40
41
42
43
44
NPM_BIN := $(shell pwd)/node_modules/.bin
#
# ASSETS
# ======
build/assets:
# Just symlink them. No processing necessary
mkdir -p build && ln -s ../client/assets $@
assets: build/assets
#
# CSS
# ====
build/css:
# Make build directory
mkdir -p $@
css: build/css
$(NPM_BIN)/node-sass client/scss --output-style compressed -o build/css \
| $(NPM_BIN)/autoprefixer -b "last 2 versions"
#
# JAVASCRIPT
# ==========
build/js:
mkdir -p $@
build/js/%.js: build/js
# js -> browserify -> uglify
$(NPM_BIN)/browserify client/js/$*.js \
| $(NPM_BIN)/uglifyjs -m -c warnings=false > build/js/$*.js
# turn client/js/*.js into build/js/*.js
js: $(patsubst client/js/%.js,build/js/%.js,$(wildcard client/js/*.js))
clean:
rm -rf build/*
all: assets css js
.PHONY: all clean css assets