forked from ldapjs/node-ldapjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
75 lines (59 loc) · 1.63 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
NAME=ldapjs
ifeq ($(VERSION), "")
@echo "Use gmake"
endif
SRC := $(shell pwd)
TAR = tar
UNAME := $(shell uname)
ifeq ($(UNAME), SunOS)
TAR = gtar
endif
HAVE_GJSLINT := $(shell which gjslint >/dev/null && echo yes || echo no)
NPM := npm_config_tar=$(TAR) npm
RESTDOWN_VERSION=1.2.13
DOCPKGDIR = ./docs/pkg
RESTDOWN = ./node_modules/.restdown/bin/restdown \
-b ./docs/branding \
-m ${DOCPKGDIR} \
-D mediaroot=media
.PHONY: dep lint test doc clean all
all:: test doc
node_modules/.ldapjs.npm.installed:
$(NPM) install
if [[ ! -d node_modules/.restdown ]]; then \
git clone git://github.com/trentm/restdown.git node_modules/.restdown; \
else \
(cd node_modules/.restdown && git fetch origin); \
fi
@(cd ./node_modules/.restdown && git checkout $(RESTDOWN_VERSION))
@touch ./node_modules/.ldapjs.npm.installed
dep: ./node_modules/.ldapjs.npm.installed
gjslint:
gjslint --nojsdoc -r lib -r tst
ifeq ($(HAVE_GJSLINT), yes)
lint: gjslint
else
lint:
@echo "* * *"
@echo "* Warning: Cannot lint with gjslint. Install it from:"
@echo "* http://code.google.com/closure/utilities/docs/linter_howto.html"
@echo "* * *"
endif
doc: dep
@rm -rf ${DOCPKGDIR}
@mkdir -p ${DOCPKGDIR}
${RESTDOWN} ./docs/client.md
${RESTDOWN} ./docs/dn.md
${RESTDOWN} ./docs/errors.md
${RESTDOWN} ./docs/examples.md
${RESTDOWN} ./docs/filters.md
${RESTDOWN} ./docs/guide.md
${RESTDOWN} ./docs/index.md
${RESTDOWN} ./docs/server.md
rm docs/*.json
mv docs/*.html ${DOCPKGDIR}
(cd ${DOCPKGDIR} && $(TAR) -czf ${SRC}/${NAME}-docs-`git log -1 --pretty='format:%h'`.tar.gz *)
test: dep lint
$(NPM) test
clean:
@rm -fr ${DOCPKGDIR} node_modules *.log *.tar.gz