forked from josephg/node-browserchannel
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
61 lines (46 loc) · 1.98 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
# I require a local version of the closure library because the version in google's
# REST service is too old and crufty to be useful.
#
# You can get the closure library like this:
#
# % svn co http://closure-library.googlecode.com/svn/trunk closure-library
#
# And download the closure compiler JAR here:
#
# http://code.google.com/p/closure-compiler/downloads/list
#
# I also compile with this patch to the closure library:
# http://code.google.com/p/closure-library/issues/detail?id=388&sort=-id
# ... which fixes a couple timing issues in nodejs.
.PHONY: clean, all
CLOSURE_DIR = ../closure-library
CLOSURE_COMPILER = ../closure-library/compiler.jar
CLOSURE_BUILDER = $(CLOSURE_DIR)/closure/bin/build/closurebuilder.py
CLOSURE_CFLAGS = \
--root="$(CLOSURE_DIR)" \
--root=tmp/ \
--output_mode=compiled \
--compiler_jar="$(CLOSURE_COMPILER)" \
--compiler_flags=--compilation_level=ADVANCED_OPTIMIZATIONS \
--compiler_flags=--warning_level=DEFAULT \
--compiler_flags=--externs=lib/handler-externs.js \
--namespace=bc.BCSocket
PRETTY_PRINT = --compiler_flags=--formatting=PRETTY_PRINT
COFFEE = coffee
all: dist/bcsocket.js dist/node-bcsocket.js dist/bcsocket-uncompressed.js dist/node-bcsocket-uncompressed.js
clean:
rm -rf tmp
tmp/%.js: lib/%.coffee
$(COFFEE) -bco tmp $+
dist/%.js: tmp/compiled-%.js
echo '(function(){' > $@
cat $+ >> $@
echo "})();" >> $@
tmp/compiled-bcsocket.js: tmp/bcsocket.js tmp/browserchannel.js
$(CLOSURE_BUILDER) $(CLOSURE_CFLAGS) > $@
tmp/compiled-node-bcsocket.js: tmp/bcsocket.js tmp/nodejs-override.js tmp/browserchannel.js
$(CLOSURE_BUILDER) $(CLOSURE_CFLAGS) --namespace=bc.node > $@
tmp/compiled-bcsocket-uncompressed.js: tmp/bcsocket.js tmp/browserchannel.js
$(CLOSURE_BUILDER) $(CLOSURE_CFLAGS) --compiler_flags=--formatting=PRETTY_PRINT > $@
tmp/compiled-node-bcsocket-uncompressed.js: tmp/bcsocket.js tmp/nodejs-override.js tmp/browserchannel.js
$(CLOSURE_BUILDER) $(CLOSURE_CFLAGS) --compiler_flags=--formatting=PRETTY_PRINT --namespace=bc.node > $@