2014-06-18 17:58:20 +00:00
|
|
|
LIB=adler32
|
2016-01-16 05:36:58 +00:00
|
|
|
REQS=
|
|
|
|
ADDONS=
|
|
|
|
AUXTARGETS=
|
|
|
|
|
|
|
|
ULIB=$(shell echo $(LIB) | tr a-z A-Z)
|
2014-06-18 17:58:20 +00:00
|
|
|
DEPS=$(sort $(wildcard bits/*.js))
|
|
|
|
TARGET=$(LIB).js
|
|
|
|
|
2016-01-16 05:36:58 +00:00
|
|
|
.PHONY: all
|
|
|
|
all: $(TARGET) $(AUXTARGETS)
|
|
|
|
|
|
|
|
$(TARGET) $(AUXTARGETS): %.js : %.flow.js
|
|
|
|
node -e 'process.stdout.write(require("fs").readFileSync("$<","utf8").replace(/^\s*\/\*:[^*]*\*\/\s*(\n)?/gm,"").replace(/\/\*:[^*]*\*\//gm,""))' > $@
|
|
|
|
|
|
|
|
$(LIB).flow.js: $(DEPS)
|
2014-06-18 17:58:20 +00:00
|
|
|
cat $^ | tr -d '\15\32' > $@
|
|
|
|
|
|
|
|
bits/01_version.js: package.json
|
|
|
|
echo "ADLER32.version = '"`grep version package.json | awk '{gsub(/[^0-9a-z\.-]/,"",$$2); print $$2}'`"';" > $@
|
|
|
|
|
|
|
|
.PHONY: clean
|
2016-01-16 05:36:58 +00:00
|
|
|
clean: clean-baseline
|
2014-06-18 17:58:20 +00:00
|
|
|
rm -f $(TARGET)
|
|
|
|
|
|
|
|
.PHONY: test mocha
|
2016-01-16 05:36:58 +00:00
|
|
|
test mocha: test.js $(TARGET) baseline
|
|
|
|
mocha -R spec -t 20000
|
2014-06-18 17:58:20 +00:00
|
|
|
|
|
|
|
.PHONY: ctest
|
|
|
|
ctest:
|
|
|
|
cat misc/*.js > ctest/fixtures.js
|
|
|
|
cp -f test.js ctest/test.js
|
2016-01-16 05:36:58 +00:00
|
|
|
cp -f $(TARGET) ctest/
|
2014-06-18 17:58:20 +00:00
|
|
|
|
|
|
|
.PHONY: lint
|
2016-01-16 05:36:58 +00:00
|
|
|
lint: $(TARGET) $(AUXTARGETS)
|
|
|
|
jshint --show-non-errors $(TARGET) $(AUXTARGETS)
|
|
|
|
jshint --show-non-errors package.json
|
|
|
|
jscs $(TARGET) $(AUXTARGETS)
|
|
|
|
|
|
|
|
.PHONY: flow
|
|
|
|
flow: lint
|
|
|
|
flow check --all --show-all-errors
|
2014-06-18 17:58:20 +00:00
|
|
|
|
|
|
|
.PHONY: cov cov-spin
|
|
|
|
cov: misc/coverage.html
|
|
|
|
cov-spin:
|
|
|
|
make cov & bash misc/spin.sh $$!
|
|
|
|
|
|
|
|
COVFMT=$(patsubst %,cov_%,$(FMT))
|
|
|
|
.PHONY: $(COVFMT)
|
|
|
|
$(COVFMT): cov_%:
|
|
|
|
FMTS=$* make cov
|
|
|
|
|
|
|
|
misc/coverage.html: $(TARGET) test.js
|
2016-01-16 05:36:58 +00:00
|
|
|
mocha --require blanket -R html-cov -t 20000 > $@
|
2014-06-18 17:58:20 +00:00
|
|
|
|
|
|
|
.PHONY: coveralls coveralls-spin
|
|
|
|
coveralls:
|
2016-01-16 05:36:58 +00:00
|
|
|
mocha --require blanket --reporter mocha-lcov-reporter -t 20000 | ./node_modules/coveralls/bin/coveralls.js
|
2014-06-18 17:58:20 +00:00
|
|
|
|
|
|
|
coveralls-spin:
|
|
|
|
make coveralls & bash misc/spin.sh $$!
|
|
|
|
|
|
|
|
.PHONY: perf
|
|
|
|
perf:
|
|
|
|
bash perf/perf.sh
|
2016-01-16 05:36:58 +00:00
|
|
|
|
|
|
|
.PHONY: perf-all
|
|
|
|
perf-all:
|
|
|
|
bash misc/perf.sh
|
|
|
|
|
|
|
|
.PHONY: baseline clean-baseline
|
|
|
|
baseline:
|
|
|
|
./misc/make_baseline.sh
|
|
|
|
|
|
|
|
clean-baseline:
|
|
|
|
rm -f test_files/*.*
|