2014-02-17 08:44:22 +00:00
|
|
|
LIB=xlsx
|
2013-03-31 22:56:45 +00:00
|
|
|
DEPS=$(wildcard bits/*.js)
|
2014-02-17 08:44:22 +00:00
|
|
|
TARGET=$(LIB).js
|
2014-02-19 03:03:28 +00:00
|
|
|
FMT=xlsx xlsm xlsb misc
|
2014-01-22 04:58:26 +00:00
|
|
|
|
2013-10-30 19:26:07 +00:00
|
|
|
$(TARGET): $(DEPS)
|
2013-03-31 22:56:45 +00:00
|
|
|
cat $^ > $@
|
|
|
|
|
2014-01-28 16:38:02 +00:00
|
|
|
bits/31_version.js: package.json
|
2014-02-22 21:36:28 +00:00
|
|
|
echo "XLSX.version = '"`grep version package.json | awk '{gsub(/[^0-9a-z\.-]/,"",$$2); print $$2}'`"';" > $@
|
2014-01-22 04:58:26 +00:00
|
|
|
|
2013-03-31 22:56:45 +00:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2014-01-15 13:58:55 +00:00
|
|
|
rm $(TARGET)
|
2013-10-30 19:26:07 +00:00
|
|
|
|
|
|
|
.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
|
2013-10-30 19:26:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
.PHONY: test mocha
|
2014-02-17 08:44:22 +00:00
|
|
|
test mocha: test.js
|
2013-10-30 19:26:07 +00:00
|
|
|
mocha -R spec
|
|
|
|
|
2014-02-13 06:22:42 +00:00
|
|
|
TESTFMT=$(patsubst %,test_%,$(FMT))
|
|
|
|
.PHONY: $(TESTFMT)
|
|
|
|
$(TESTFMT): test_%:
|
|
|
|
FMTS=$* make test
|
|
|
|
|
2013-05-18 00:12:10 +00:00
|
|
|
|
2013-10-30 19:26:07 +00:00
|
|
|
.PHONY: lint
|
|
|
|
lint: $(TARGET)
|
|
|
|
jshint --show-non-errors $(TARGET)
|
2014-01-22 04:58:26 +00:00
|
|
|
|
|
|
|
.PHONY: cov
|
|
|
|
cov: misc/coverage.html
|
|
|
|
|
2014-02-17 08:44:22 +00:00
|
|
|
misc/coverage.html: $(TARGET) test.js
|
2014-01-22 04:58:26 +00:00
|
|
|
mocha --require blanket -R html-cov > misc/coverage.html
|
|
|
|
|
|
|
|
.PHONY: coveralls
|
|
|
|
coveralls:
|
|
|
|
mocha --require blanket --reporter mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
|
2014-02-14 06:25:46 +00:00
|
|
|
|
|
|
|
.PHONY: dist
|
2014-02-17 08:44:22 +00:00
|
|
|
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)"
|