-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathMakefile
87 lines (74 loc) · 2.27 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
81
82
83
84
85
86
87
OUTFILE=./jsjac.js
PACKFILE=./jsjac.packed.js
UNCOMPRESSED=./jsjac.uncompressed.js
SRC=src/jsextras.js src/ieXDRToXHR.js src/crypt.js src/JSJaCJSON.js src/xmlextras.js \
src/JSJaCUtils.js src/JSJaCBuilder.js src/JSJaCConstants.js \
src/JSJaCConsoleLogger.js src/JSJaCCookie.js src/JSJaCError.js \
src/JSJaCJID.js src/JSJaCKeys.js src/JSJaCPacket.js src/JSJaCConnection.js \
src/JSJaCHttpBindingConnection.js src/JSJaCWebSocketConnection.js \
src/JSJaC.js
POLLING_SRC=src/jsextras.js src/crypt.js src/JSJaCJSON.js src/xmlextras.js \
src/JSJaCUtils.js src/JSJaCBuilder.js src/JSJaCConstants.js \
src/JSJaCConsoleLogger.js src/JSJaCCookie.js src/JSJaCError.js \
src/JSJaCJID.js src/JSJaCKeys.js src/JSJaCPacket.js src/JSJaCConnection.js \
src/JSJaCHttpPollingConnection.js \
src/JSJaC.js
all: clean utils install doc
nodoc: clean utils install
polling: clean utils polling_install doc
install: build uncompressed crunch
@echo "done."
polling_install: polling_build uncompressed crunch
@echo "done."
build:
@echo "building ...";
@for i in ${SRC}; do \
echo -e "\t$$i"; \
cat "$$i" >> $(OUTFILE); \
done
polling_build:
@echo "building ...";
@for i in ${POLLING_SRC}; do \
echo -e "\t$$i"; \
cat "$$i" >> $(OUTFILE); \
done
crunch:
@echo "crunching ..."
@if [ -e $(OUTFILE) ]; then \
utils/jsmin < $(OUTFILE) > $(OUTFILE).tmp && \
cat src/header.js > $(OUTFILE) && \
cat src/JSJaCConfig.js >> $(OUTFILE) && \
cat $(OUTFILE).tmp >> $(OUTFILE) && \
rm $(OUTFILE).tmp; \
fi
pack: clean utils build moo crunch doc
moo:
@echo "packing..."
@if [ -e $(OUTFILE) ]; then \
php ./utils/packer/pack.php $(OUTFILE) $(PACKFILE).tmp && \
cat src/header.js > $(PACKFILE) && \
cat src/JSJaCConfig.js >> $(PACKFILE) && \
cat $(PACKFILE).tmp >> $(PACKFILE) && \
rm $(PACKFILE).tmp; \
else \
echo "$(OUTFILE) not found. build failed?"; \
fi
doc:
@echo -e "creating jsdoc ...\c"
@utils/jsdoc3/jsdoc -d doc src/
@echo " done."
utils:
@make -C utils
clean:
@rm -f $(OUTFILE) 2>/dev/null
@rm -f $(PACKFILE) 2>/dev/null
@rm -f $(UNCOMPRESSED) 2>/dev/null
@rm -rf doc/
@make -C utils clean
uncompressed:
@if [ -e $(OUTFILE) ]; then \
cat src/header.js > $(UNCOMPRESSED) && \
cat src/JSJaCConfig.js >> $(UNCOMPRESSED) && \
cat $(OUTFILE) >> $(UNCOMPRESSED); \
fi
.PHONY: doc utils