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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
default: all
SRC = $(shell find src -name "*.ls" -type f | sort)
LIB = $(SRC:src/%.ls=lib/%.js) lib/parser.js
LSC = /usr/bin/lsc
BROWSERIFY = node_modules/.bin/browserify
UGLIFYJS = node_modules/.bin/uglifyjs
ISTANBUL = node_modules/.bin/istanbul
lib:
mkdir -p lib/
lib/parser.js: lib/grammar.js
./scripts/build-parser > lib/parser.js
lib/%.js: src/%.ls lib
$(LSC) --output lib --bare --compile "$<"
browser:
mkdir browser/
browser/livescript.js: $(LIB) browser scripts/preroll
{ ./scripts/preroll ; $(BROWSERIFY) -r ./lib/browser.js:livescript ; } > browser/livescript.js
browser/livescript-min.js: browser/livescript.js
$(UGLIFYJS) browser/livescript.js --mangle --comments "all" > browser/livescript-min.js
package.json: package.json.ls
$(LSC) --compile package.json.ls
.PHONY: build build-browser force full install dev-install test test-harmony coverage loc clean
all: build
build: $(LIB) package.json
build-browser: browser/livescript.js browser/livescript-min.js
force:
make -B
full:
make force && make force && make test && make coverage
install: build
#npm install .
dev-install: package.json
npm install .
test: build
./scripts/test
test-harmony: build
nodejs --harmony ./scripts/test
coverage: build
$(ISTANBUL) cover ./scripts/test
loc:
wc --lines src/*
clean:
# rm -f ./*.js
# rm -rf lib
# rm -rf browser/*.js
rm -rf coverage
# rm -f package.json
|