sheetjs-clone/Makefile

58 lines
1.2 KiB
Makefile
Raw Normal View History

LIB=xlsx
DEPS=$(wildcard bits/*.js)
TARGET=$(LIB).js
FMT=xlsx xlsm xlsb misc
$(TARGET): $(DEPS)
cat $^ > $@
bits/01_version.js: package.json
echo "XLSX.version = '"`grep version package.json | awk '{gsub(/[^0-9a-z\.-]/,"",$$2); print $$2}'`"';" > $@
.PHONY: clean
clean:
2014-01-15 13:58:55 +00:00
rm $(TARGET)
.PHONY: init
init:
git submodule init
git submodule update
2014-01-15 13:58:55 +00:00
git submodule foreach git pull origin master
git submodule foreach make
.PHONY: test mocha
test mocha: test.js
mocha -R spec
TESTFMT=$(patsubst %,test_%,$(FMT))
.PHONY: $(TESTFMT)
$(TESTFMT): test_%:
FMTS=$* make test
2013-05-18 00:12:10 +00:00
.PHONY: lint
lint: $(TARGET)
jshint --show-non-errors $(TARGET)
.PHONY: cov cov-spin
cov: misc/coverage.html
cov-spin:
make cov & bash misc/spin.sh $$!
misc/coverage.html: $(TARGET) test.js
mocha --require blanket -R html-cov > $@
.PHONY: coveralls coveralls-spin
coveralls:
mocha --require blanket --reporter mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
coveralls-spin:
make coveralls & bash misc/spin.sh $$!
.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)"