forked from strophe/strophejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
80 lines (68 loc) · 1.69 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
SHELL ?= /usr/env/bin/bash
BOWER ?= node_modules/.bin/bower
GRUNT ?= ./node_modules/.bin/grunt
HTTPSERVE ?= ./node_modules/.bin/http-server
PHANTOMJS ?= ./node_modules/.bin/phantomjs
SRC_DIR = src
DOC_DIR = doc
DOC_TEMP = doc-temp
NDPROJ_DIR = ndproj
STROPHE = strophe.js
STROPHE_MIN = strophe.min.js
STROPHE_LIGHT = strophe.light.js
all: doc $(STROPHE_MIN)
stamp-npm: package.json
npm install
touch stamp-npm
stamp-bower: stamp-npm bower.json
$(BOWER) install
touch stamp-bower
$(STROPHE)::
make stamp-bower
@@echo "Building" $(STROPHE) "..."
$(GRUNT) concat:dist
@@echo
$(STROPHE_LIGHT)::
@@echo "Building" $(STROPHE_LIGHT) "..."
$(GRUNT) concat:light
@@echo
$(STROPHE_MIN)::
make $(STROPHE)
@@echo "Building" $(STROPHE_MIN) "..."
$(GRUNT) min
.PHONY: doc
doc:
@@echo "Building Strophe documentation..."
@@if [ ! -d $(NDPROJ_DIR) ]; then mkdir $(NDPROJ_DIR); fi
@@cp docs.css $(NDPROJ_DIR);
@@if [ ! -d $(DOC_DIR) ]; then mkdir $(DOC_DIR); fi
@@if [ ! -d $(DOC_TEMP) ]; then mkdir $(DOC_TEMP); fi
@@cp $(STROPHE) $(DOC_TEMP)
@@naturaldocs -r -ro -q -i $(DOC_TEMP) -o html $(DOC_DIR) -p $(NDPROJ_DIR) -s docs
@@rm -r $(DOC_TEMP)
@@echo "Documentation built."
@@echo
.PHONY: release
release:
@@$(GRUNT) release
@@echo "Release created."
@@echo
.PHONY: check
check::
make stamp-bower
@@$(GRUNT) jshint
$(PHANTOMJS) node_modules/qunit-phantomjs-runner/runner-list.js tests/strophe.html
.PHONY: serve
serve:
$(HTTPSERVE) -p 8080
.PHONY: clean
clean:
@@rm -f stamp-npm stamp-bower
@@rm -rf node_modules bower_components
@@rm -f $(STROPHE)
@@rm -f $(STROPHE_MIN)
@@rm -f $(STROPHE_LIGHT)
@@rm -f $(PLUGIN_FILES_MIN)
@@rm -rf $(NDPROJ_DIR) $(DOC_DIR) $(DOC_TEMP)
@@echo "Done."
@@echo