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)