Makefile tweaks

Re-introduce `make browser` to make a standalone build of `debug.js`
for the web browser.
This commit is contained in:
Nathan Rajlich 2017-08-08 12:31:21 -07:00
parent 87880f6ae1
commit ce1a236d93

View File

@ -15,31 +15,31 @@ YARN ?= $(shell which yarn)
PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm))
BROWSERIFY ?= $(NODE) $(BIN)/browserify
.FORCE:
install: node_modules
browser: dist/debug.js
node_modules: package.json
@NODE_ENV= $(PKG) install
@touch node_modules
lint: .FORCE
eslint *.js src/*.js
test-node: .FORCE
istanbul cover node_modules/mocha/bin/_mocha -- test/**.js
test-browser: .FORCE
mkdir -p dist
dist/debug.js: src/*.js node_modules
@mkdir -p dist
@$(BROWSERIFY) \
--standalone debug \
. > dist/debug.js
karma start --single-run
rimraf dist
lint:
eslint *.js src/*.js
test: .FORCE
test-node:
istanbul cover node_modules/mocha/bin/_mocha -- test/**.js
test-browser:
$(MAKE) browser
karma start --single-run
test:
concurrently \
"make test-node" \
"make test-browser"
@ -47,4 +47,7 @@ test: .FORCE
coveralls:
cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
clean:
rimraf dist
.PHONY: all install clean distclean