make
all .js.coffee
entry points will be bundled into corresponding .js
files
PATH := $(PATH):./node_modules/.bin/ | |
JS = ./app/assets/javascripts | |
APP = $(JS)/legacy | |
SOURCE = $(wildcard $(APP)/common.js.coffee $(APP)/controllers/**/*.js.coffee) | |
TARGET = $(patsubst %.js.coffee,%.js,$(SOURCE)) | |
LIBS = $(shell find $(APP)/{controllers,modules,utils} -name '*.js.coffee' -print) | |
VENDOR = $(shell find ./vendor/assets/javascripts -name '*.js' -print) | |
PKG = $(wildcard package.json) | |
FLAGS = -t browserify-shim -t coffeeify --extension='.js.coffee' | |
.PHONY: build clean watch | |
build: $(TARGET) | |
%.js: %.js.coffee | |
NODE_PATH=$(JS) BROWSERIFYSHIM_DIAGNOSTICS=1 browserify $(FLAGS) -o $@ -- $^ | |
print-%: ; @echo $* = $($*) | |
clean: | |
rm -rf $(TARGET) |