js-crc32/Makefile

80 lines
1.7 KiB
Makefile
Raw Normal View History

2014-06-16 21:27:47 +00:00
LIB=crc32
2015-05-06 21:47:18 +00:00
REQS=
ADDONS=
AUXTARGETS=
ULIB=$(shell echo $(LIB) | tr a-z A-Z)
2014-06-16 21:27:47 +00:00
DEPS=$(sort $(wildcard bits/*.js))
TARGET=$(LIB).js
2015-05-06 21:47:18 +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-16 21:27:47 +00:00
cat $^ | tr -d '\15\32' > $@
bits/01_version.js: package.json
echo "CRC32.version = '"`grep version package.json | awk '{gsub(/[^0-9a-z\.-]/,"",$$2); print $$2}'`"';" > $@
.PHONY: clean
clean: clean-baseline
2014-06-16 21:27:47 +00:00
rm -f $(TARGET)
.PHONY: test mocha
test mocha: test.js $(TARGET) baseline
2015-05-06 21:47:18 +00:00
mocha -R spec -t 20000
2014-06-16 21:27:47 +00:00
.PHONY: ctest
ctest:
cat misc/*.js > ctest/fixtures.js
cp -f test.js ctest/test.js
2015-05-06 21:47:18 +00:00
cp -f $(TARGET) ctest/
2014-06-16 21:27:47 +00:00
.PHONY: lint
2015-05-06 21:47:18 +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-16 21:27:47 +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
2015-05-06 21:47:18 +00:00
mocha --require blanket -R html-cov -t 20000 > $@
2014-06-16 21:27:47 +00:00
.PHONY: coveralls coveralls-spin
coveralls:
2015-05-06 21:47:18 +00:00
mocha --require blanket --reporter mocha-lcov-reporter -t 20000 | ./node_modules/coveralls/bin/coveralls.js
2014-06-16 21:27:47 +00:00
coveralls-spin:
make coveralls & bash misc/spin.sh $$!
.PHONY: perf
perf:
bash perf/perf.sh
.PHONY: perf-all
perf-all:
bash misc/perf.sh
.PHONY: baseline clean-baseline
baseline:
./misc/make_baseline.sh
clean-baseline:
rm -f test_files/*.*