From ce1a236d93a971dc74930972a03d4d0fe409effd Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Tue, 8 Aug 2017 12:31:21 -0700 Subject: [PATCH] Makefile tweaks Re-introduce `make browser` to make a standalone build of `debug.js` for the web browser. --- Makefile | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 304b6a5..b86958a 100644 --- a/Makefile +++ b/Makefile @@ -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