js-adler32/Makefile

80 lines
1.7 KiB
Makefile
Raw Normal View History

2014-06-18 17:58:20 +00:00
LIB=adler32
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
.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
clean: clean-baseline
2014-06-18 17:58:20 +00:00
rm -f $(TARGET)
.PHONY: test mocha
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
cp -f $(TARGET) ctest/
2014-06-18 17:58:20 +00:00
.PHONY: lint
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
mocha --require blanket -R html-cov -t 20000 > $@
2014-06-18 17:58:20 +00:00
.PHONY: coveralls coveralls-spin
coveralls:
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
.PHONY: perf-all
perf-all:
bash misc/perf.sh
.PHONY: baseline clean-baseline
baseline:
./misc/make_baseline.sh
clean-baseline:
rm -f test_files/*.*