-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (33 loc) · 826 Bytes
/
Makefile
File metadata and controls
48 lines (33 loc) · 826 Bytes
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
PACKAGE = sage
NODEBIN = ./node_modules/.bin
MOCHA = $(NODEBIN)/mocha
NPM = npm
GIT = git
JSDUCK := $(shell which jsduck)
MOCHAOPTS ?=
APIDOC = ./docs/api
TESTDIR = test
SOURCES = $(shell find src -name "*.js")
all: test
node_modules:
@ $(NPM) install
init-npm: node_modules
init-submodules:
@ $(GIT) submodule update --init
init: init-npm init-submodule
$(APIDOC):
@ mkdir -p $(APIDOC)
$(APIDOC)/index.html: $(SOURCES) $(APIDOC)
ifndef JSDUCK
$(error JSDuck not found (install with `gem install jsduck`).)
endif
@ $(JSDUCK) --builtin-classes --output $(APIDOC) -- $(SOURCES)
docs: $(APIDOC)/index.html
dist: init docs
test: init-npm
@ $(MOCHA) $(MOCHAOPTS) test/*.js
clean:
rm -rf $(DISTLIB) $(BUILDDIR) $(APIDOC)
dist-clean: clean
rm -rf node_modules/
.PHONY: test all dist