forked from josephg/ShareJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (36 loc) · 1022 Bytes
/
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
.PHONY: all test clean webclient
COFFEE = node_modules/.bin/coffee
UGLIFY = node_modules/.bin/uglifyjs -d WEB=true
CLIENT = \
web-prelude.js \
microevent.js \
doc.js \
connection.js \
textarea.js \
query.js
# not included: index.coffee
BUNDLED_TYPES = \
webclient/text.js \
lib/types/text-api.js \
webclient/json0.js \
lib/types/json-api.js
# Disabled: lib/types/json-api.coffee
CLIENT_SRCS = $(addprefix lib/client/, $(CLIENT))
all: webclient
clean:
rm -rf webclient/*
webclient/share.uncompressed.js: $(BUNDLED_TYPES) $(CLIENT_SRCS)
mkdir -p webclient
echo '(function(){' > $@
cat $(filter %.js,$^) >> $@
echo '})();' >> $@
# Copy other types from ottypes.
webclient/%.js: node_modules/ottypes/webclient/%.js
mkdir -p webclient
cp $< $@
# .. Or uglify the ones we already have.
webclient/%.js: webclient/%.uncompressed.js
mkdir -p webclient
$(UGLIFY) $< -c unsafe=true --lint -mo $@
# Compile the types for a browser.
webclient: webclient/share.js webclient/text.js webclient/json0.js