forked from brownplt/code.pyret.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
155 lines (104 loc) · 3.97 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# NOTE: Needs TWO blank lines here, dunno why
define \n
endef
ifneq ($(findstring .exe,$(SHELL)),)
override SHELL:=$(COMSPEC)$(ComSpec)
MKDIR = $(foreach dir,$1,if not exist "$(dir)". (md "$(dir)".)$(\n))
RMDIR = $(foreach dir,$1,if exist "$(dir)". (rd /S /Q "$(dir)".)$(\n))
RM = if exist "$1". (del $1)
else
MKDIR = mkdir -p $1
RMDIR = rm -rf $1
RM = rm -f $1
endif
CM=node_modules/codemirror
build/web/js/pyret.js.gz:
gzip -9 node_modules/pyret-lang/build/phase0/pyret.js -c > build/web/js/pyret.js.gz
.PHONY : post-install
post-install: compress-pyret
install-link:
npm link pyret-lang
.PHONY : selenium-test-local
selenium-test-local:
TEST_LOC="local" node node_modules/jasmine-node/lib/jasmine-node/cli.js test/browser/
.PHONY : selenium-test-sauce
selenium-test-sauce:
TEST_LOC="sauce" node node_modules/jasmine-node/lib/jasmine-node/cli.js test/browser/
OUT_HTML := $(patsubst src/web/%.template.html,build/web/views/%.html,$(wildcard src/web/*.template.html))
build/web/views/%.html: src/web/%.template.html
node make-template.js $< > $@
COPY_HTML := $(patsubst src/web/%.html,build/web/views/%.html,$(wildcard src/web/*.html))
build/web/views/%.html: src/web/%.html
cp $< $@
OUT_CSS := $(patsubst src/web/%.template.css,build/web/%.css,$(wildcard src/web/css/*.template.css))
build/web/css/%.css: src/web/css/%.template.css
node make-template.js $< > $@
COPY_CSS := $(patsubst src/web/%.css,build/web/%.css,$(wildcard src/web/css/*.css))
build/web/css/%.css: src/web/css/%.css
cp $< $@
COPY_NEW_CSS := $(patsubst src/web/%.css,build/web/%.css,$(wildcard src/web/neweditor/css/*.css))
build/web/neweditor/css/%.css: src/web/neweditor/css/%.css
cp $< $@
COPY_NEW_JS := $(patsubst src/web/%.js,build/web/%.js,$(wildcard src/web/neweditor/js/*.js))
build/web/neweditor/js/%.js: src/web/neweditor/js/%.js
cp $< $@
build/web/css/codemirror.css: $(CM)/lib/codemirror.css
cp $< $@
MISC_CSS = build/web/css/codemirror.css
COPY_GIF := $(patsubst src/web/img/%.gif,build/web/img/%.gif,$(wildcard src/web/img/*.gif))
build/web/img/%.gif: src/web/img/%.gif
cp $< $@
COPY_JS := $(patsubst src/web/js/%.js,build/web/js/%.js,$(wildcard src/web/js/*.js))
build/web/js/%.js: src/web/js/%.js
cp $< $@
build/web/js/q.js: node_modules/q/q.js
cp $< $@
build/web/js/s-expression-lib.js: node_modules/s-expression/index.js
cp $< $@
build/web/js/seedrandom.js: node_modules/seedrandom/seedrandom.js
cp $< $@
build/web/js/url.js: node_modules/url.js/url.js
cp $< $@
build/web/js/require.js: node_modules/requirejs/require.js
cp $< $@
build/web/js/codemirror.js: node_modules/codemirror/lib/codemirror.js
cp $< $@
build/web/js/pyret-fold.js: src/web/js/codemirror/pyret-fold.js
cp $< $@
build/web/js/matchkw.js: src/web/js/codemirror/matchkw.js
cp $< $@
build/web/js/pyret-mode.js: src/web/js/codemirror/pyret-mode.js
cp $< $@
MISC_JS = build/web/js/q.js build/web/js/url.js build/web/js/require.js \
build/web/js/codemirror.js \
build/web/js/pyret-mode.js build/web/js/s-expression-lib.js \
build/web/js/seedrandom.js \
build/web/js/pyret-fold.js \
build/web/js/matchkw.js
MISC_IMG = build/web/img/pyret-icon.png build/web/img/pyret-logo.png build/web/img/pyret-spin.gif build/web/img/up-arrow.png build/web/img/down-arrow.png
build/web/img/%: node_modules/pyret-lang/img/%
cp $< $@
WEB = build/web
WEBV = build/web/views
WEBJS = build/web/js
WEBCSS = build/web/css
WEBIMG = build/web/img
NEWCSS = build/web/neweditor/css
NEWJS = build/web/neweditor/js
$(WEBV):
@$(call MKDIR,$(WEBV))
$(WEB):
@$(call MKDIR,$(WEB))
$(WEBJS):
@$(call MKDIR,$(WEBJS))
$(WEBCSS):
@$(call MKDIR,$(WEBCSS))
$(WEBIMG):
@$(call MKDIR,$(WEBIMG))
$(NEWCSS):
@$(call MKDIR,$(NEWCSS))
$(NEWJS):
@$(call MKDIR,$(NEWJS))
web: $(WEB) $(WEBV) $(WEBJS) $(WEBCSS) $(WEBIMG) $(NEWCSS) $(NEWJS) $(OUT_HTML) $(COPY_HTML) $(OUT_CSS) $(COPY_CSS) $(COPY_JS) $(COPY_GIF) build/web/js/pyret.js.gz $(MISC_JS) $(MISC_CSS) $(MISC_IMG) $(COPY_NEW_CSS) $(COPY_NEW_JS)
clean:
rm -rf build/web