-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
41 lines (30 loc) · 1.1 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
CURR_HEAD_SHA := $(firstword $(shell git show-ref --hash HEAD | cut -b -6) master)
GITHUB_PROJECT_NAME := Sannis/node-ubjson
GITHUB_PROJECT_URL := https://github.com/${GITHUB_PROJECT_NAME}
API_SRC_URL_FMT := ${GITHUB_PROJECT_URL}/blob/${CURR_HEAD_SHA}/{file}\#L{line}
API_DEST_DIR := ./doc/api
all: npm-install
npm-install: npm-install-stamp
npm-install-stamp: ./package.json
npm install
touch npm-install-stamp
test: npm-install
@./node_modules/.bin/nodeunit ./test/test-*.js
test-coveralls: npm-install
rm -rf ./lib-cov && ./node_modules/.bin/jscoverage lib lib-cov
LIB_COV=1 ./node_modules/.bin/nodeunit ./test/test-*.js --reporter lcov | ./node_modules/coveralls/bin/coveralls.js
lint: npm-install
@./node_modules/.bin/jshint . --show-non-errors
doc-api: npm-install ./lib/*
rm -rf ${API_DEST_DIR}
./node_modules/.bin/ndoc \
--gh-ribbon ${GITHUB_PROJECT_URL} \
--link-format ${API_SRC_URL_FMT} \
--output ${API_DEST_DIR} \
./lib/*.js
doc: doc-api
pages: doc
@echo "Update gh-pages branch:"
./gh_pages.sh
.PHONY: all npm-install test test-coveralls lint doc pages