-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
35 lines (26 loc) · 877 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
ifndef CLOSURE_ROOT
$(error "Must define CLOSURE_ROOT")
endif
goog := $(CLOSURE_ROOT)/closure/goog
js := $(shell find $(goog) -name '*.js')
css := $(shell find $(goog)/css -name '*.css')
calcdeps := $(CLOSURE_ROOT)/closure/bin/calcdeps.py
compiler_url := \
http://closure-compiler.googlecode.com/files/compiler-latest.zip
compiler := obj/compiler.jar
all: obj out out/goog_editor.js out/goog_editor.css
obj out:
mkdir -p $@
out/goog_editor.js: obj/requires.js $(compiler)
$(calcdeps) -p $(CLOSURE_ROOT) -i $< -o compiled -c $(compiler) > $@
out/goog_editor.css: css.deps $(css)
cat $(shell sed -e "s|\(.*\)|$(goog)/css/\1.css|" $<) > $@
$(compiler): obj/compiler.zip
cd obj && unzip -o compiler.zip $(@F)
touch $@
obj/compiler.zip:
curl $(compiler_url) > $@
obj/requires.js: js.deps $(js)
sed -e 's/\(.*\)/goog.require("\1");/' $< > $@
clean:
rm -rf obj out