forked from psd/pivotal-cards
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (28 loc) · 963 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
36
37
38
TEST_LOCATION="http://localhost/pivotal-cards/"
LIVE_LOCATION="http://stevedonie.github.com/pivotal-cards/"
all:: dependencies
all:: bookmarklet test-bookmarklet
#
# build bookmarklets
#
bookmarklet: bookmarklet.js Makefile
( echo "javascript:\\c" ; sed -e "s+location = '+location='$(LIVE_LOCATION)+" < bookmarklet.js | uglifyjs ) > $@
test-bookmarklet: bookmarklet.js Makefile
( echo "javascript:\\c" ; sed -e "s+location = '+location='$(TEST_LOCATION)+" -e "s/nocache = ''/nocache='?nocache='+Math.random()/" < bookmarklet.js | uglifyjs ) > $@
#
# dependencies
#
dependencies: jquery.js underscore.js
jquery.js:
curl -s 'http://code.jquery.com/jquery-1.7.2.min.js' > jquery.js
underscore.js:
curl -s 'http://documentcloud.github.com/underscore/underscore-min.js' > underscore.js
uglifyjs::
npm install -g uglify-js
#
# prune back to source code
#
clean:: clobber
rm -f jquery.js underscore.js
clobber::;
rm -f bookmarklet test-bookmarklet