Skip to content

Instantly share code, notes, and snippets.

@seabre
Created May 16, 2014 03:12
Show Gist options
  • Save seabre/d9dc5039ff9f31471934 to your computer and use it in GitHub Desktop.
Save seabre/d9dc5039ff9f31471934 to your computer and use it in GitHub Desktop.
Filtrex Makefile
MODULES := ./node_modules
BIN := $(MODULES)/.bin
.PHONY: install_modules all clean
all: install_modules filtrex.js filtrex.min.js
clean:
rm -f filtrex.js
rm -f filtrex.min.js
rm -f src/grammar.json
rm -f src/parser.js
rm -rf $(MODULES)
install_modules:
npm install
src/grammar.json: src/grammar.js
node $< > $@
src/parser.js: src/grammar.json
$(BIN)/jison -j -o $@ $<
filtrex.js: src/filtrex.js src/parser.js
$(BIN)/browserify -s compileExpression index.js > $@
filtrex.min.js: filtrex.js
$(BIN)/uglifyjs < $< > $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment