2014-05-20 17:43:03 +00:00
|
|
|
LIB=cfb
|
2014-06-24 04:00:39 +00:00
|
|
|
DEPS=$(sort $(wildcard bits/*.js))
|
2014-05-20 17:43:03 +00:00
|
|
|
TARGET=$(LIB).js
|
2013-11-26 15:56:58 +00:00
|
|
|
|
|
|
|
$(TARGET): $(DEPS)
|
2014-06-24 04:00:39 +00:00
|
|
|
cat $^ | tr -d '\15\32' > $@
|
2013-11-26 15:56:58 +00:00
|
|
|
|
2014-05-20 17:43:03 +00:00
|
|
|
bits/31_version.js: package.json
|
2014-06-24 04:00:39 +00:00
|
|
|
echo "exports.version = '"`grep version package.json | awk '{gsub(/[^0-9a-z\.-]/,"",$$2); print $$2}'`"';" > $@
|
2014-05-20 17:43:03 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2014-06-24 04:00:39 +00:00
|
|
|
rm -f $(TARGET)
|
|
|
|
rm -rf ./test_files/
|
2014-05-20 17:43:03 +00:00
|
|
|
|
|
|
|
.PHONY: init
|
|
|
|
init:
|
|
|
|
if [ ! -e test_files ]; then git clone https://github.com/SheetJS/test_files; fi
|
|
|
|
cd test_files; git pull; make
|
|
|
|
|
2013-11-26 15:56:58 +00:00
|
|
|
.PHONY: test mocha
|
2014-05-20 17:43:03 +00:00
|
|
|
test mocha: test.js
|
2013-10-26 20:20:19 +00:00
|
|
|
mocha -R spec
|
|
|
|
|
2014-06-24 04:00:39 +00:00
|
|
|
.PHONY: prof
|
|
|
|
prof:
|
|
|
|
cat misc/prof.js test.js > prof.js
|
|
|
|
node --prof prof.js
|
|
|
|
|
2013-11-26 15:56:58 +00:00
|
|
|
.PHONY: lint
|
2014-05-20 17:43:03 +00:00
|
|
|
lint: $(TARGET)
|
|
|
|
jshint --show-non-errors $(TARGET)
|
2014-06-24 04:00:39 +00:00
|
|
|
jscs $(TARGET)
|
2013-10-27 20:13:02 +00:00
|
|
|
|
2014-06-24 04:00:39 +00:00
|
|
|
.PHONY: cov cov-spin
|
2014-05-20 17:43:03 +00:00
|
|
|
cov: misc/coverage.html
|
2014-06-24 04:00:39 +00:00
|
|
|
cov-spin:
|
|
|
|
make cov & bash misc/spin.sh $$!
|
2013-11-26 15:56:58 +00:00
|
|
|
|
2014-05-20 17:43:03 +00:00
|
|
|
misc/coverage.html: $(TARGET) test.js
|
2014-06-24 04:00:39 +00:00
|
|
|
mocha --require blanket -R html-cov > $@
|
2014-05-20 17:43:03 +00:00
|
|
|
|
2014-06-24 04:00:39 +00:00
|
|
|
.PHONY: coveralls coveralls-spin
|
2014-05-20 17:43:03 +00:00
|
|
|
coveralls:
|
|
|
|
mocha --require blanket --reporter mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
|
|
|
|
|
2014-06-24 04:00:39 +00:00
|
|
|
coveralls-spin:
|
|
|
|
make coveralls & bash misc/spin.sh $$!
|
|
|
|
|
2014-05-20 17:43:03 +00:00
|
|
|
.PHONY: dist
|
|
|
|
dist: $(TARGET)
|
|
|
|
cp $(TARGET) dist/
|
|
|
|
cp LICENSE dist/
|
|
|
|
uglifyjs $(TARGET) -o dist/$(LIB).min.js --source-map dist/$(LIB).min.map --preamble "$$(head -n 1 bits/00_header.js)"
|