UNPKG

1.12 kBPlain TextView Raw
1.PHONY: all serve clean
2
3COFFEE:=./node_modules/.bin/coffee
4
5#### General
6
7all: build
8
9build: src/*coffee
10 @$(COFFEE) -v > /dev/null
11 $(COFFEE) -o lib/ -c src/*.coffee
12
13clean:
14 rm -f lib/*.js
15
16
17#### Testing
18
19test_server:
20 node examples/test_server/server.js
21
22serve:
23 @if [ -e .pidfile.pid ]; then \
24 kill `cat .pidfile.pid`; \
25 rm .pidfile.pid; \
26 fi
27
28 @while [ 1 ]; do \
29 make build; \
30 echo " [*] Running http server"; \
31 make test_server & \
32 SRVPID=$$!; \
33 echo $$SRVPID > .pidfile.pid; \
34 echo " [*] Server pid: $$SRVPID"; \
35 inotifywait -r -q -e modify .; \
36 kill `cat .pidfile.pid`; \
37 rm -f .pidfile.pid; \
38 sleep 0.1; \
39 done
40
41#### Release process
42# 1) commit everything
43# 2) amend version in package.json
44# 3) run 'make tag' and run suggested 'git push' variants
45# 4) run 'npm publish'
46
47RVER:=$(shell grep "version" package.json|tr '\t"' ' \t'|cut -f 4)
48VER:=$(shell ./VERSION-GEN)
49
50.PHONY: tag
51tag: all
52 git commit $(TAG_OPTS) package.json Changelog -m "Release $(RVER)"
53 git tag v$(RVER) -m "Release $(RVER)"
54 @echo ' [*] Now run'
55 @echo 'git push; git push --tag'