2014-05-20 17:43:03 +00:00
|
|
|
LIB=cfb
|
2014-11-03 04:02:42 +00:00
|
|
|
FMT=xls doc ppt misc full
|
|
|
|
REQS=
|
|
|
|
ADDONS=
|
|
|
|
AUXTARGETS=xlscfb.js
|
|
|
|
|
|
|
|
ULIB=$(shell echo $(LIB) | tr a-z A-Z)
|
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
|
|
|
|
2014-11-03 04:02:42 +00:00
|
|
|
.PHONY: all
|
|
|
|
all: $(TARGET) $(AUXTARGETS)
|
|
|
|
|
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)
|
2014-11-03 04:02:42 +00:00
|
|
|
|
|
|
|
.PHONY: clean-data
|
|
|
|
clean-data:
|
|
|
|
rm -fr ./test_files/ ./test_files_pres/
|
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
|
2014-11-03 04:02:42 +00:00
|
|
|
if [ ! -e test_files_pres ]; then git clone https://github.com/SheetJS/test_files_pres; fi
|
|
|
|
cd test_files_pres; git pull
|
2014-05-20 17:43:03 +00:00
|
|
|
|
2013-11-26 15:56:58 +00:00
|
|
|
.PHONY: test mocha
|
2014-05-20 17:43:03 +00:00
|
|
|
test mocha: test.js
|
2014-11-03 04:02:42 +00:00
|
|
|
mocha -R spec -t 20000
|
2013-10-26 20:20:19 +00:00
|
|
|
|
2014-06-24 04:00:39 +00:00
|
|
|
.PHONY: prof
|
|
|
|
prof:
|
|
|
|
cat misc/prof.js test.js > prof.js
|
|
|
|
node --prof prof.js
|
|
|
|
|
2014-11-03 04:02:42 +00:00
|
|
|
TESTFMT=$(patsubst %,test_%,$(FMT))
|
|
|
|
.PHONY: $(TESTFMT)
|
|
|
|
$(TESTFMT): test_%:
|
|
|
|
FMTS=$* make test
|
|
|
|
|
|
|
|
|
2013-11-26 15:56:58 +00:00
|
|
|
.PHONY: lint
|
2014-05-20 17:43:03 +00:00
|
|
|
lint: $(TARGET)
|
2014-11-03 04:02:42 +00:00
|
|
|
jshint --show-non-errors $(TARGET) $(AUXTARGETS)
|
|
|
|
jscs $(TARGET) $(AUXTARGETS)
|
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-11-03 04:02:42 +00:00
|
|
|
COVFMT=$(patsubst %,cov_%,$(FMT))
|
|
|
|
.PHONY: $(COVFMT)
|
|
|
|
$(COVFMT): cov_%:
|
|
|
|
FMTS=$* make cov
|
|
|
|
|
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
|
2014-11-03 04:02:42 +00:00
|
|
|
dist: dist-deps $(TARGET)
|
2014-05-20 17:43:03 +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)"
|
2014-11-03 04:02:42 +00:00
|
|
|
misc/strip_sourcemap.sh dist/$(LIB).min.js
|
|
|
|
|
|
|
|
.PHONY: aux
|
|
|
|
aux: $(AUXTARGETS)
|
|
|
|
|
|
|
|
.PHONY: xls
|
|
|
|
xls: xlscfb.js
|
|
|
|
|
|
|
|
XLSDEPS=misc/suppress_export.js $(filter-out bits/08_blob.js,$(DEPS))
|
|
|
|
xlscfb.js: $(XLSDEPS)
|
|
|
|
cat $^ | tr -d '\15\32' > $@
|
|
|
|
|
|
|
|
.PHONY: dist-deps
|
|
|
|
dist-deps: xlscfb.js
|
|
|
|
cp xlscfb.js dist/xlscfb.js
|