forked from sockjs/sockjs-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (42 loc) · 1.09 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
.PHONY: all serve clean
COFFEE:=./node_modules/.bin/coffee
#### General
all: build
build: src/*coffee
@$(COFFEE) -v > /dev/null
$(COFFEE) -o lib/ -c src/*.coffee
clean:
rm -f lib/*.js
#### Testing
test_server: build
node tests/test_server/server.js
serve:
@if [ -e .pidfile.pid ]; then \
kill `cat .pidfile.pid`; \
rm .pidfile.pid; \
fi
@while [ 1 ]; do \
make build; \
echo " [*] Running http server"; \
make test_server & \
SRVPID=$$!; \
echo $$SRVPID > .pidfile.pid; \
echo " [*] Server pid: $$SRVPID"; \
inotifywait -r -q -e modify .; \
kill `cat .pidfile.pid`; \
rm -f .pidfile.pid; \
sleep 0.1; \
done
#### Release process
# 1) commit everything
# 2) amend version in package.json
# 3) run 'make tag' and run suggested 'git push' variants
# 4) run 'npm publish'
RVER:=$(shell grep "version" package.json|tr '\t"' ' \t'|cut -f 4)
VER:=$(shell ./VERSION-GEN)
.PHONY: tag
tag: all
git commit $(TAG_OPTS) package.json Changelog -m "Release $(RVER)"
git tag v$(RVER) -m "Release $(RVER)"
@echo ' [*] Now run'
@echo 'git push; git push --tag'