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
|
FILES=$(shell bzr ls -RV -k file | grep -v assets/ | grep -v app/templates.js | grep -v server.js)
NODE_TARGETS=node_modules/chai node_modules/d3 node_modules/jshint \
node_modules/yui node_modules/yuidoc
TEMPLATE_TARGETS=$(shell bzr ls -k file app/templates)
DATE=$(shell date -u)
APPCACHE=app/assets/manifest.appcache
all: install
app/templates.js: $(TEMPLATE_TARGETS) bin/generateTemplates
@./bin/generateTemplates
yuidoc: $(FILES)
@node_modules/.bin/yuidoc -o yuidoc -x assets app
$(NODE_TARGETS): package.json
@npm install
@#link depends
@ln -sf `pwd`/node_modules/yui ./app/assets/javascripts/
@ln -sf `pwd`/node_modules/d3/d3.v2* ./app/assets/javascripts/
install: appcache $(NODE_TARGETS) app/templates.js yuidoc
gjslint: virtualenv/bin/gjslint
@virtualenv/bin/gjslint --strict --nojsdoc --jslint_error=all \
--custom_jsdoc_tags \
property,default,since,method,module,submodule,namespace \
$(FILES)
jshint: node_modules/jshint
@node_modules/jshint/bin/hint $(FILES)
lint: gjslint jshint
virtualenv/bin/gjslint virtualenv/bin/fixjsstyle:
@virtualenv virtualenv
@virtualenv/bin/easy_install archives/closure_linter-latest.tar.gz
beautify: virtualenv/bin/fixjsstyle
@virtualenv/bin/fixjsstyle --strict --nojsdoc --jslint_error=all $(FILES)
prep: beautify lint
test: install
@./test-server.sh
server: install
@echo "Customize config.js to modify server settings"
@node server.js
clean:
@rm -rf node_modules virtualenv
@make -C docs clean
$(APPCACHE): manifest.appcache.in
@cp manifest.appcache.in $(APPCACHE)
@sed -re 's/^\# TIMESTAMP .+$$/\# TIMESTAMP $(DATE)/' -i $(APPCACHE)
appcache: $(APPCACHE)
# A target used only for forcibly updating the appcache.
appcache-touch:
@touch manifest.appcache.in
# This is the real target. appcache-touch needs to be executed before
# appcache, and this provides the correct order.
appcache-force: appcache-touch appcache
.PHONY: test lint beautify server install clean prep jshint gjslint \
appcache appcache-touch appcache-force
|