-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
60 lines (49 loc) · 1004 Bytes
/
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
#
# Tools
#
TOP := $(shell pwd)
NODE_MODULES := $(TOP)/node_modules
NPM := npm
NODE_BIN := $(shell $(NPM) bin)
ESLINT := $(NODE_BIN)/eslint
JSCS := $(NODE_BIN)/jscs
TAPE := $(NODE_BIN)/tape
NYC := $(NODE_BIN)/nyc
#
# Files
#
TEST_FILES := test/index.js
JS_FILES := index.js $(TEST_FILES)
CLEAN_FILES += node_modules
#
# Repo-specific targets
#
.PHONY: all
all: node_modules check
.PHONY: lint
lint: node_modules $(ESLINT) $(JS_FILES)
$(ESLINT) $(JS_FILES)
.PHONY: style
style: node_modules $(JSCS) $(JS_FILES)
$(JSCS) $(JS_FILES)
.PHONY: test
test: node_modules $(TAPE) $(NYC)
$(NYC) $(TAPE) $(TEST_FILES)
.PHONY: fixstyle
fixstyle: node_modules $(JSCS) $(JS_FILES)
$(JSCS) --fix $(JS_FILES)
node_modules: package.json
$(NPM) install -d
@touch node_modules
.PHONY: check
check: lint style test
.PHONY: clean
clean:
@rm -rf $(CLEAN_FILES)
.PHONY: distclean
distclean:
@rm -rf $(CLEAN_FILES)
#
# Debug -- print out a a variable via `make print-FOO`
#
print-% : ; @echo $* = $($*)