summaryrefslogtreecommitdiff
path: root/www/Makefile
blob: bc48017b3093f5f359c073cd68fd490459acccb0 (plain)
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
DEPLOY_TARGET="/var/www/imok.ngha.ro/"

PATH       := node_modules/.bin:$(PATH)
SHELL      := /bin/bash
DEPLOY_CMD := rsync --delete -a

css_out    := index.css
js_out     := index.js
css_smap   := $(css_out:%.css=%.css.map)
js_smap    := $(js_out:%.js=%.js.map)

.PHONY: all clean build deploy deploy-prod

$(js_out): src/app.js
	browserify --debug $< | \
	babel --source-maps inline --presets env -o $@
#	uglifyjs -c -m "reserved=['require','exports']" \
		--source-map "content='inline',url='index.js.map',filename='index.js.map'" \
		--output $@

$(css_out): styles/app.scss
	sass --style compressed $< $@

clean:
	rm index.{js,css}*

$(css_smap) $(js_smap): $(css_out) $(js_out)

build deploy deploy-prod: $(css_out) $(js_out)

#deploy: $(css_smap) $(js_smap)
deploy: $(css_smap)
	$(DEPLOY_CMD) $^ $(DEPLOY_TARGET)

deploy-prod: 
	$(DEPLOY_CMD) $^ $(DEPLOY_TARGET)