2014-02-17 08:44:22 +00:00
|
|
|
LIB=xlsx
|
2015-04-02 20:32:22 +00:00
|
|
|
FMT=xlsx xlsm xlsb ods xls xml misc full
|
2014-04-23 01:37:08 +00:00
|
|
|
REQS=jszip.js
|
|
|
|
ADDONS=dist/cpexcel.js
|
2014-10-10 02:22:38 +00:00
|
|
|
AUXTARGETS=ods.js
|
|
|
|
|
|
|
|
ULIB=$(shell echo $(LIB) | tr a-z A-Z)
|
|
|
|
DEPS=$(sort $(wildcard bits/*.js))
|
|
|
|
TARGET=$(LIB).js
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: $(TARGET) $(AUXTARGETS)
|
2014-01-22 04:58:26 +00:00
|
|
|
|
2013-10-30 19:26:07 +00:00
|
|
|
$(TARGET): $(DEPS)
|
2014-05-29 22:30:03 +00:00
|
|
|
cat $^ | tr -d '\15\32' > $@
|
2013-03-31 22:56:45 +00:00
|
|
|
|
2014-04-15 09:04:03 +00:00
|
|
|
bits/01_version.js: package.json
|
2014-10-10 02:22:38 +00:00
|
|
|
echo "$(ULIB).version = '"`grep version package.json | awk '{gsub(/[^0-9a-z\.-]/,"",$$2); print $$2}'`"';" > $@
|
2014-01-22 04:58:26 +00:00
|
|
|
|
2015-04-02 20:32:22 +00:00
|
|
|
bits/18_cfb.js: node_modules/cfb/dist/xlscfb.js
|
|
|
|
cp $^ $@
|
|
|
|
|
2013-03-31 22:56:45 +00:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2014-06-05 07:06:20 +00:00
|
|
|
rm -f $(TARGET)
|
|
|
|
|
|
|
|
.PHONY: clean-data
|
|
|
|
clean-data:
|
|
|
|
rm -f *.xlsx *.xlsm *.xlsb *.xls *.xml
|
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
|
2014-05-16 00:33:34 +00:00
|
|
|
mkdir -p tmp
|
2014-07-28 15:57:28 +00:00
|
|
|
mocha -R spec -t 20000
|
2013-10-30 19:26:07 +00:00
|
|
|
|
2014-06-29 18:29:45 +00:00
|
|
|
.PHONY: prof
|
|
|
|
prof:
|
|
|
|
cat misc/prof.js test.js > prof.js
|
|
|
|
node --prof prof.js
|
|
|
|
|
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)
|
2014-10-10 02:22:38 +00:00
|
|
|
jshint --show-non-errors $(TARGET) $(AUXTARGETS)
|
2015-04-03 14:34:37 +00:00
|
|
|
jshint --show-non-errors package.json bower.json
|
2014-10-10 02:22:38 +00:00
|
|
|
jscs $(TARGET) $(AUXTARGETS)
|
2014-06-05 07:06:20 +00:00
|
|
|
|
|
|
|
.PHONY: test-osx
|
|
|
|
test-osx:
|
|
|
|
node tests/write.js
|
|
|
|
open -a Numbers sheetjs.xlsx
|
|
|
|
open -a "Microsoft Excel" sheetjs.xlsx
|
2014-01-22 04:58:26 +00:00
|
|
|
|
2014-04-15 09:04:03 +00:00
|
|
|
.PHONY: cov cov-spin
|
2014-01-22 04:58:26 +00:00
|
|
|
cov: misc/coverage.html
|
2014-04-15 09:04:03 +00:00
|
|
|
cov-spin:
|
|
|
|
make cov & bash misc/spin.sh $$!
|
2014-01-22 04:58:26 +00:00
|
|
|
|
2014-05-16 00:33:34 +00:00
|
|
|
COVFMT=$(patsubst %,cov_%,$(FMT))
|
|
|
|
.PHONY: $(COVFMT)
|
|
|
|
$(COVFMT): cov_%:
|
|
|
|
FMTS=$* make cov
|
|
|
|
|
2014-02-17 08:44:22 +00:00
|
|
|
misc/coverage.html: $(TARGET) test.js
|
2014-04-15 09:04:03 +00:00
|
|
|
mocha --require blanket -R html-cov > $@
|
2014-01-22 04:58:26 +00:00
|
|
|
|
2014-04-15 09:04:03 +00:00
|
|
|
.PHONY: coveralls coveralls-spin
|
2014-01-22 04:58:26 +00:00
|
|
|
coveralls:
|
|
|
|
mocha --require blanket --reporter mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
|
2014-02-14 06:25:46 +00:00
|
|
|
|
2014-04-15 09:04:03 +00:00
|
|
|
coveralls-spin:
|
|
|
|
make coveralls & bash misc/spin.sh $$!
|
|
|
|
|
2014-08-26 17:40:04 +00:00
|
|
|
bower.json: misc/_bower.json package.json
|
|
|
|
cat $< | sed 's/_VERSION_/'`grep version package.json | awk '{gsub(/[^0-9a-z\.-]/,"",$$2); print $$2}'`'/' > $@
|
|
|
|
|
2014-02-14 06:25:46 +00:00
|
|
|
.PHONY: dist
|
2014-08-26 17:40:04 +00:00
|
|
|
dist: dist-deps $(TARGET) bower.json
|
2014-02-17 08:44:22 +00:00
|
|
|
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)"
|
2015-04-02 20:32:22 +00:00
|
|
|
misc/strip_sourcemap.sh dist/$(LIB).min.js
|
2014-04-23 01:37:08 +00:00
|
|
|
uglifyjs $(REQS) $(TARGET) -o dist/$(LIB).core.min.js --source-map dist/$(LIB).core.min.map --preamble "$$(head -n 1 bits/00_header.js)"
|
2015-04-02 20:32:22 +00:00
|
|
|
misc/strip_sourcemap.sh dist/$(LIB).core.min.js
|
2014-04-23 01:37:08 +00:00
|
|
|
uglifyjs $(REQS) $(ADDONS) $(TARGET) -o dist/$(LIB).full.min.js --source-map dist/$(LIB).full.min.map --preamble "$$(head -n 1 bits/00_header.js)"
|
2015-04-02 20:32:22 +00:00
|
|
|
misc/strip_sourcemap.sh dist/$(LIB).full.min.js
|
2014-04-23 01:37:08 +00:00
|
|
|
|
2014-10-10 02:22:38 +00:00
|
|
|
.PHONY: aux
|
|
|
|
aux: $(AUXTARGETS)
|
|
|
|
|
|
|
|
.PHONY: ods
|
|
|
|
ods: ods.js
|
|
|
|
|
|
|
|
ODSDEPS=$(sort $(wildcard odsbits/*.js))
|
|
|
|
ods.js: $(ODSDEPS)
|
|
|
|
cat $(ODSDEPS) | tr -d '\15\32' > $@
|
|
|
|
cp ods.js dist/ods.js
|
|
|
|
|
2014-04-23 01:37:08 +00:00
|
|
|
.PHONY: dist-deps
|
2014-10-10 02:22:38 +00:00
|
|
|
dist-deps: ods.js
|
2014-04-23 01:37:08 +00:00
|
|
|
cp node_modules/codepage/dist/cpexcel.full.js dist/cpexcel.js
|
|
|
|
cp jszip.js dist/jszip.js
|
2014-10-10 02:22:38 +00:00
|
|
|
cp ods.js dist/ods.js
|