forked from sirikata/kataspace
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
90 lines (66 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
88
89
90
### PBJ Vars
PBJDIR=externals/katajs/externals/protojs
PBJBIN=$(PBJDIR)/pbj
# Protocols
## Behaviors
### Chat
CHAT_PROTOCOL_INPUT=scripts/behavior/chat
CHAT_PROTOCOL_OUTPUT=scripts/behavior/chat
THESE_PBJ=$(wildcard $(CHAT_PROTOCOL_INPUT)/*.pbj)
THESE_PBJJS=$(patsubst $(CHAT_PROTOCOL_INPUT)/%,$(CHAT_PROTOCOL_OUTPUT)/%.js,$(THESE_PBJ))
ALL_PBJJS := $(ALL_PBJJS) $(THESE_PBJJS)
### Animated
ANIMATED_PROTOCOL_INPUT=scripts/behavior/animated
ANIMATED_PROTOCOL_OUTPUT=scripts/behavior/animated
THESE_PBJ=$(wildcard $(ANIMATED_PROTOCOL_INPUT)/*.pbj)
THESE_PBJJS=$(patsubst $(ANIMATED_PROTOCOL_INPUT)/%,$(ANIMATED_PROTOCOL_OUTPUT)/%.js,$(THESE_PBJ))
ALL_PBJJS := $(ALL_PBJJS) $(THESE_PBJJS)
### Rules
all : submodules katajs $(ALL_PBJJS) jquery-ui jnotify
### PBJ Rules
$(PBJBIN) :
cd $(PBJDIR) && \
./bootstrap.sh && \
$(MAKE)
$(CHAT_PROTOCOL_OUTPUT)/%.pbj.js: $(CHAT_PROTOCOL_INPUT)/%.pbj
@mkdir $(CHAT_PROTOCOL_OUTPUT) 2>/dev/null || true
$(PBJBIN) $< $@
$(ANIMATED_PROTOCOL_OUTPUT)/%.pbj.js: $(ANIMATED_PROTOCOL_INPUT)/%.pbj
@mkdir $(ANIMATED_PROTOCOL_OUTPUT) 2>/dev/null || true
$(PBJBIN) $< $@
# Submodules intialization
katajs : katajs-submodules
$(MAKE) -C externals/katajs
$(MAKE) -C externals/katajs closure
katajs-submodules : our-submodules
cd externals/katajs && \
git submodule init && \
git submodule update
our-submodules :
git submodule init && \
git submodule update
submodules : our-submodules katajs-submodules
# JQuery initialization
JQUERY_DIR=externals
JQUERY_UI_VERSION=1.8.11
JQUERY_UI_URL=http://jqueryui.com/download/jquery-ui-$(JQUERY_UI_VERSION).custom.zip
JQUERY_UI_ZIP=jquery-ui-$(JQUERY_UI_VERSION).custom.zip
JQUERY_UI_FULL_ZIP=$(JQUERY_DIR)/$(JQUERY_UI_ZIP)
JQUERY_UI_FILE=jquery-ui
jquery-ui : $(JQUERY_UI_FULL_ZIP)
cd $(JQUERY_DIR) && \
unzip -u $(JQUERY_UI_ZIP)
$(JQUERY_UI_FULL_ZIP) :
cd $(JQUERY_DIR) && \
wget -O $(JQUERY_UI_ZIP) $(JQUERY_UI_URL)
JNOTIFY_DIR=externals
JNOTIFY_URL=http://www.givainc.com/labs/downloads/jquery.jnotify.zip
JNOTIFY_ZIP=jnotify.zip
JNOTIFY_FULL_ZIP=$(JNOTIFY_DIR)/$(JNOTIFY_ZIP)
jnotify : $(JNOTIFY_FULL_ZIP)
cd $(JNOTIFY_DIR) && \
unzip -u $(JNOTIFY_ZIP)
$(JNOTIFY_FULL_ZIP) :
cd $(JNOTIFY_DIR) && \
wget -O $(JNOTIFY_ZIP) $(JNOTIFY_URL)
.PHONY : submodules our-submodules katajs-submodules katajs jquery-ui jnotify