forked from segmentio/analytics.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (44 loc) · 928 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
#
# Binaries.
#
DUO = node_modules/.bin/duo
ESLINT = node_modules/.bin/eslint
UGLIFYJS = node_modules/.bin/uglifyjs
#
# Files.
#
SRC = $(wildcard lib/*.js)
#
# Chore tasks.
#
# Install node dependencies.
node_modules: package.json $(wildcard node_modules/*/package.json)
@npm install
@touch node_modules
# Remove temporary/built files.
clean:
rm -rf *.log analytics.js analytics.min.js
.PHONY: clean
# Remove temporary/built files and vendor dependencies.
distclean: clean
rm -rf components node_modules
.PHONY: distclean
#
# Build tasks.
#
# Build analytics.js.
analytics.js: node_modules $(SRC) package.json
@$(DUO) --stdout --standalone analytics lib/index.js > $@
# Build minified analytics.js.
analytics.min.js: analytics.js
@$(UGLIFYJS) $< --output $@
# Build shortcut.
build: analytics.min.js
.PHONY: build
#
# Test tasks.
#
# Lint JavaScript source.
lint: node_modules
@$(ESLINT) $(SRC)
.PHONY: lint