-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
56 lines (40 loc) · 1.08 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
all : test
SRC=lib/*.js
TESTSRC=test
DISTDIR=dist
DISTPREFIX=typify
BUNDLESRC=lib/typify.js
BUNDLEDST=$(DISTDIR)/$(DISTPREFIX).standalone.js
BUNDLEVAR=jsc
MINSRC=$(BUNDLEDST)
MINDST=$(DISTDIR)/$(DISTPREFIX).min.js
MINMAP=$(DISTDIR)/$(DISTPREFIX).min.js.map
.PHONY : all test eslint mocha istanbul browserify typify dist david
BINDIR=node_modules/.bin
MOCHA=$(BINDIR)/_mocha
ESLINT=$(BINDIR)/eslint
NYC=$(BINDIR)/nyc
BROWSERIFY=$(BINDIR)/browserify
UGLIFY=$(BINDIR)/uglifyjs
TYPIFY=$(BINDIR)/typify
DAVID=$(BINDIR)/david
test : eslint mocha istanbul typify david
eslint :
$(ESLINT) $(SRC)
mocha :
$(MOCHA) --reporter=spec $(TESTSRC)
istanbul :
$(NYC) -r text -r html $(MOCHA) test
$(NYC) check-coverage -statements -11 --branches -5 --functions -6
browserify : $(SRC)
mkdir -p $(DISTDIR)
$(BROWSERIFY) -s $(BUNDLEVAR) -o $(BUNDLEDST) $(BUNDLESRC)
uglify : browserify $(SRC)
mkdir -p $(DISTDIR)
$(UGLIFY) -o $(MINDST) --source-map $(MINMAP) $(MINSRC)
typify :
$(TYPIFY) -- $(MOCHA) --timeout 20000 $(TESTSRC)
david :
$(DAVID)
dist : test uglify
git clean -fdx -e node_modules