-
Notifications
You must be signed in to change notification settings - Fork 477
/
Makefile
89 lines (66 loc) · 1.24 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#
# Variables
#
NAME = Switchery
#
# Paths
#
COMPONENT_BUILD = node_modules/.bin/component-build
COMPONENT_INSTALL = node_modules/.bin/component-install
UGLIFYJS = node_modules/uglify-js/bin/uglifyjs
UGLIFYCSS = node_modules/uglifycss/uglifycss
JS_DEST = dist/switchery.js
JS_MIN_DEST = dist/switchery.min.js
CSS_DEST = dist/switchery.css
CSS_MIN_DEST = dist/switchery.min.css
#
# All
#
all: install
#
# Install
#
install: node_modules components build
#
# Make a new development build
#
build: components switchery.js switchery.css
@$(COMPONENT_BUILD) --dev
#
# Install components (+ dev)
#
components: component.json
@$(COMPONENT_INSTALL) --dev
#
# Make a standalone version that doesn't depend on component etc.
#
standalone: build components
@$(COMPONENT_BUILD) -s $(NAME) -o .
@mv build.js $(JS_DEST)
@mv build.css $(CSS_DEST)
@$(UGLIFYJS) $(JS_DEST) --output $(JS_MIN_DEST)
@$(UGLIFYCSS) $(CSS_DEST) > $(CSS_MIN_DEST)
#
# Install Node.js modules
#
node_modules:
@npm install
#
# Clean all
#
clean: clean-components clean-node
#
# Clean components & build
#
clean-components:
@rm -rf build
@rm -rf components
#
# Clean the installed Node.js modules
#
clean-node:
@rm -rf node_modules
#
# Instructions
#
.PHONY: clean build components