2012-02-12 22:46:51 -08:00
|
|
|
#
|
|
|
|
|
# Copyright (c) 2012, Joyent, Inc. All rights reserved.
|
|
|
|
|
#
|
2012-05-03 14:11:06 -07:00
|
|
|
# Makefile: basic Makefile for template API service
|
|
|
|
|
#
|
|
|
|
|
# This Makefile is a template for new repos. It contains only repo-specific
|
|
|
|
|
# logic and uses included makefiles to supply common targets (javascriptlint,
|
|
|
|
|
# jsstyle, restdown, etc.), which are used by other repos as well. You may well
|
|
|
|
|
# need to rewrite most of this file, but you shouldn't need to touch the
|
|
|
|
|
# included makefiles.
|
|
|
|
|
#
|
|
|
|
|
# If you find yourself adding support for new targets that could be useful for
|
|
|
|
|
# other projects too, you should add these to the original versions of the
|
|
|
|
|
# included Makefiles (in eng.git) so that other teams can use them too.
|
2012-02-12 22:46:51 -08:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Tools
|
|
|
|
|
#
|
2015-05-20 18:46:32 -07:00
|
|
|
ESLINT := ./node_modules/.bin/eslint
|
2017-10-13 01:23:18 +02:00
|
|
|
DOCUMENTATION := ./node_modules/.bin/documentation
|
2015-05-24 21:37:37 -07:00
|
|
|
NODEUNIT := ./node_modules/.bin/nodeunit
|
2017-05-11 12:53:16 -07:00
|
|
|
MOCHA := ./node_modules/.bin/mocha
|
2015-05-24 21:37:37 -07:00
|
|
|
NODECOVER := ./node_modules/.bin/cover
|
2017-10-13 01:23:18 +02:00
|
|
|
DOCS_BUILD := ./tools/docsBuild.js
|
2012-05-03 14:11:06 -07:00
|
|
|
NPM := npm
|
2017-10-13 01:23:18 +02:00
|
|
|
NODE := node
|
2017-10-31 19:29:49 +01:00
|
|
|
PRETTIER := ./node_modules/.bin/prettier
|
2012-02-12 22:46:51 -08:00
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Files
|
|
|
|
|
#
|
2015-05-22 12:14:52 -07:00
|
|
|
JS_FILES = '.'
|
2012-05-03 14:11:06 -07:00
|
|
|
|
2017-09-10 08:38:23 +02:00
|
|
|
CLEAN_FILES += node_modules cscope.files
|
2012-05-03 14:11:06 -07:00
|
|
|
|
|
|
|
|
include ./tools/mk/Makefile.defs
|
2012-02-12 22:46:51 -08:00
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Repo-specific targets
|
|
|
|
|
#
|
|
|
|
|
.PHONY: all
|
2012-05-03 14:11:06 -07:00
|
|
|
all: $(NODEUNIT) $(REPO_DEPS)
|
|
|
|
|
$(NPM) rebuild
|
2012-02-12 22:46:51 -08:00
|
|
|
|
2012-05-03 14:11:06 -07:00
|
|
|
$(NODEUNIT): | $(NPM_EXEC)
|
|
|
|
|
$(NPM) install
|
2012-02-12 22:46:51 -08:00
|
|
|
|
2012-05-03 14:11:06 -07:00
|
|
|
$(NODECOVER): | $(NPM_EXEC)
|
2011-12-16 18:03:52 -08:00
|
|
|
$(NPM) install
|
2011-12-19 13:49:03 -08:00
|
|
|
|
2012-05-03 14:11:06 -07:00
|
|
|
.PHONY: cover
|
|
|
|
|
cover: $(NODECOVER)
|
|
|
|
|
@rm -fr ./.coverage_data
|
2017-05-11 12:53:16 -07:00
|
|
|
$(NODECOVER) run $(NODEUNIT) ./test/*.js
|
2012-05-03 14:11:06 -07:00
|
|
|
$(NODECOVER) report html
|
2012-02-03 12:46:11 -08:00
|
|
|
|
2012-05-03 14:11:06 -07:00
|
|
|
CLEAN_FILES += $(TAP) ./node_modules/nodeunit
|
2012-02-13 11:42:31 -08:00
|
|
|
|
2012-05-03 14:11:06 -07:00
|
|
|
.PHONY: test
|
|
|
|
|
test: $(NODEUNIT)
|
2015-06-02 14:34:40 -07:00
|
|
|
$(NODEUNIT) test/*.test.js
|
2019-03-06 17:07:29 -08:00
|
|
|
$(MOCHA) --full-trace --no-exit test/plugins/*.test.js
|
2012-02-13 11:42:31 -08:00
|
|
|
|
2017-10-13 01:23:18 +02:00
|
|
|
.PHONY: docs-build
|
|
|
|
|
docs-build:
|
|
|
|
|
@($(NODE) $(DOCS_BUILD))
|
|
|
|
|
|
2017-11-08 17:07:51 +01:00
|
|
|
.PHONY: benchmark
|
|
|
|
|
benchmark:
|
2018-02-23 11:20:44 -08:00
|
|
|
@(cd ./benchmark && $(NPM) i && $(NODE) index.js)
|
2017-11-08 17:07:51 +01:00
|
|
|
|
2019-01-24 14:16:53 -08:00
|
|
|
.PHONY: audit
|
|
|
|
|
audit:
|
|
|
|
|
@($(NPM) audit || true)
|
|
|
|
|
|
2012-05-03 14:11:06 -07:00
|
|
|
include ./tools/mk/Makefile.deps
|
|
|
|
|
include ./tools/mk/Makefile.targ
|