opusdev/vector-similarity-api
1
1# get Makefile directory name: http://stackoverflow.com/a/5982798/3767732THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))3THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)4 5# BIN directory6BIN := $(THIS_DIR)/node_modules/.bin7 8# Path9PATH := node_modules/.bin:$(PATH)10SHELL := /bin/bash11 12# applications13NODE ?= $(shell which node)14YARN ?= $(shell which yarn)15PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm))16BROWSERIFY ?= $(NODE) $(BIN)/browserify17 18.FORCE:19 20install: node_modules21 22node_modules: package.json23 @NODE_ENV= $(PKG) install24 @touch node_modules25 26lint: .FORCE27 eslint browser.js debug.js index.js node.js28 29test-node: .FORCE30 istanbul cover node_modules/mocha/bin/_mocha -- test/**.js31 32test-browser: .FORCE33 mkdir -p dist34 35 @$(BROWSERIFY) \36 --standalone debug \37 . > dist/debug.js38 39 karma start --single-run40 rimraf dist41 42test: .FORCE43 concurrently \44 "make test-node" \45 "make test-browser"46 47coveralls:48 cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js49 50.PHONY: all install clean distclean51 