sub-cmd
Version:
A pass through sub command (git-style) runner.
51 lines (35 loc) • 959 B
Plain Text
VPATH=src
BUILDDIR=lib
BEANDIR=.
JSONDIR=.
COFFEE_SOURCES= $(wildcard $(VPATH)/*.coffee)
COFFEE_OBJECTS=$(patsubst $(VPATH)/%.coffee, $(BUILDDIR)/%.js, $(COFFEE_SOURCES))
BEAN_FILES=$(wildcard $(BEANDIR)/*.yml)
JSON_FILES=$(patsubst $(BEANDIR)/%.yml, $(JSONDIR)/%.json, $(BEAN_FILES))
CLIENT_JS_FILES = $(wildcard client/*.coffee)
all: build
build: node_modules objects
objects: $(COFFEE_OBJECTS) $(JSON_FILES)
$(JSONDIR)/%.json: $(BEANDIR)/%.yml
./node_modules/.bin/bean --source $<
test: build
./node_modules/.bin/testlet
clean:
rm -f $(COFFEE_OBJECTS)
.PHONE: pristine
pristine: clean
rm -rf node_modules
node_modules:
npm install -d
$(BUILDDIR)/%.js: $(VPATH)/%.coffee
coffee -o $(BUILDDIR) -c $<
watch:
coffee --watch -o $(BUILDDIR) -c $(VPATH)
start: all
./node_modules/.bin/supervisor -w routes,views,lib,src -e coffee,hbs,js,json -q server.js