2014-05-01 03:21:53 +00:00
|
|
|
LIB=frac
|
2015-04-22 04:14:03 +00:00
|
|
|
REQS=
|
|
|
|
ADDONS=
|
|
|
|
AUXTARGETS=
|
|
|
|
|
|
|
|
ULIB=$(shell echo $(LIB) | tr a-z A-Z)
|
|
|
|
DEPS=$(LIB).md
|
2014-05-01 03:21:53 +00:00
|
|
|
TARGET=$(LIB).js
|
2013-12-14 07:11:37 +00:00
|
|
|
|
2015-04-22 04:14:03 +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)
|
|
|
|
voc $^
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f $(TARGET)
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: test mocha
|
|
|
|
test mocha: test.js
|
|
|
|
mocha -R spec -t 20000
|
2014-05-01 02:32:25 +00:00
|
|
|
|
|
|
|
.PHONY: lint
|
2015-04-22 04:14:03 +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-05-01 02:32:25 +00:00
|
|
|
|
2015-04-22 04:14:03 +00:00
|
|
|
.PHONY: cov cov-spin
|
|
|
|
cov: misc/coverage.html
|
|
|
|
cov-spin:
|
|
|
|
make cov & bash misc/spin.sh $$!
|
2014-05-01 02:32:25 +00:00
|
|
|
|
2015-04-22 04:14:03 +00:00
|
|
|
misc/coverage.html: $(TARGET) test.js
|
|
|
|
mocha --require blanket -R html-cov -t 20000 > $@
|
2014-05-01 02:32:25 +00:00
|
|
|
|
2015-04-22 04:14:03 +00:00
|
|
|
.PHONY: coveralls coveralls-spin
|
2014-05-01 02:32:25 +00:00
|
|
|
coveralls:
|
2015-04-22 04:14:03 +00:00
|
|
|
mocha --require blanket --reporter mocha-lcov-reporter -t 20000 | ./node_modules/coveralls/bin/coveralls.js
|
|
|
|
|
|
|
|
coveralls-spin:
|
|
|
|
make coveralls & bash misc/spin.sh $$!
|
2014-05-01 03:21:53 +00:00
|
|
|
|
|
|
|
.PHONY: dist
|
2015-04-22 04:14:03 +00:00
|
|
|
dist: dist-deps $(TARGET)
|
2014-05-01 03:21:53 +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 frac.js)"
|
2015-04-22 04:14:03 +00:00
|
|
|
misc/strip_sourcemap.sh dist/$(LIB).min.js
|
|
|
|
|
|
|
|
.PHONY: aux
|
|
|
|
aux: $(AUXTARGETS)
|
|
|
|
.PHONY: dist-deps
|
|
|
|
dist-deps:
|
|
|
|
|
|
|
|
## Python
|
|
|
|
|
|
|
|
.PHONY: pylint
|
2015-05-05 06:19:23 +00:00
|
|
|
pylint: frac.py $(wildcard test_*.py)
|
2015-04-22 04:14:03 +00:00
|
|
|
pep8 $^
|
|
|
|
|
|
|
|
.PHONY: pypi
|
|
|
|
pypi: frac.py
|
|
|
|
python setup.py sdist upload
|
|
|
|
|
2015-05-05 06:19:23 +00:00
|
|
|
.PHONY: pytest pypytest
|
|
|
|
pytest: pylint
|
|
|
|
py.test -v --durations=5
|
|
|
|
|
|
|
|
pypytest: pylint
|
|
|
|
pypy $$(which py.test) -v --durations=5
|