forked from backbone-paginator/backbone-pageable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (32 loc) · 1.03 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
PROJECT_NAME = $(notdir $(CURDIR))
PROJECT_URL = http://github.com/wyuenho/backbone-pageable
AUTHOR = Jimmy Yuen Ho Wong
JS_FILE = lib/$(PROJECT_NAME).js
JS_OUTFILE = lib/$(PROJECT_NAME).min.js
all: clean test doc build
FORCE:
%.js: FORCE
echo "/*\n\
$(PROJECT_NAME)\n\
$(PROJECT_URL)\n\n\
Copyright (c) `date +%Y` $(AUTHOR)\n\
Licensed under the MIT @license.\n\
*/" | cat - $@ > "/tmp/`basename $@`" && mv -f "/tmp/`basename $@`" $@
build:
uglifyjs $(JS_FILE) --compress --mangle --comments --output $(JS_OUTFILE)
clean:
rm -f $(JS_OUTFILE)
doc:
jsduck $(JS_FILE) \
--external=Backbone.Model,Backbone.Collection,XMLHttpRequest \
--title=backbone-pageable \
--no-source \
--categories=categories.json \
--warnings=-no_doc \
--pretty-json \
--output api
test: FORCE
phantomjs test/runner.js test/index.html?noglobals=true
phantomjs test/runner.js test/test-zepto.html?noglobals=true
phantomjs test/runner.js test/index.0.9.10.html?noglobals=true
phantomjs test/runner.js test/index.0.9.9.html?noglobals=true