-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
54 lines (38 loc) · 1.37 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
RM=rm -f
MKDIR=mkdir -p
PERL=perl
COFFEE=coffee
# Requires closure-compiler (https://developers.google.com/closure/compiler/)
COMPILER_JAR=compiler.jar
MINIFY=java -jar $(COMPILER_JAR) --compilation_level=ADVANCED_OPTIMIZATIONS --formatting=SINGLE_QUOTES --output_wrapper "(function(){%output%}).call(this);"
BUILD=build
TEST=test
SPEC=spec
SPECOUTPUT=$(TEST)/spec
LOADER=speedread-loader
SPEEDREAD=speedread
UNITTESTS=unittests
.PHONY: all builddir specs test clean
all: builddir $(BUILD)/$(LOADER)-mini.js $(BUILD)/$(SPEEDREAD)-mini.js $(TEST)/$(SPEEDREAD).js $(TEST)/$(UNITTESTS).js specs index.html
builddir:
$(MKDIR) $(BUILD)
$(BUILD)/$(LOADER).js: $(LOADER).coffee
$(COFFEE) -o $(BUILD) -c $<
$(BUILD)/$(LOADER)-mini.js: $(BUILD)/$(LOADER).js
$(MINIFY) --js=$< > $@
$(BUILD)/$(SPEEDREAD).js: $(SPEEDREAD).coffee
$(COFFEE) -o $(BUILD) -c $<
$(BUILD)/$(SPEEDREAD)-mini.js: $(BUILD)/$(SPEEDREAD).js
$(MINIFY) --js=$< > $@
index.html: index_template.html $(BUILD)/$(SPEEDREAD)-mini.js $(BUILD)/$(LOADER).js index_generator.pl
$(PERL) index_generator.pl > $@
$(TEST)/$(SPEEDREAD).js: $(SPEEDREAD).coffee
$(COFFEE) -o $(TEST) -b -c $<
$(TEST)/$(UNITTESTS).js: $(UNITTESTS).coffee
$(COFFEE) -o $(TEST) -b -c $<
specs:
$(COFFEE) -o $(SPECOUTPUT) -c $(SPEC)
test:
jasmine-node --coffee --verbose spec/
clean:
$(RM) $(BUILD)/*.js $(TEST)/*.js $(SPECOUTPUT)/*.spec.js index.html