forked from sorccu/cufon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
30 lines (28 loc) · 945 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
tag = $(shell git describe --abbrev=0)
orig_branch = master
build_branch = build-$(tag)
versioned = generate/index.html generate/view/header.php js/cufon.js
yui_compressor = yuicompressor.jar
build:
if test -z '$(tag)'; then \
echo "Something's terribly wrong; no tag matches this commit."; \
exit 1; \
fi
if test ! -f '$(yui_compressor)'; then \
echo "$(yui_compressor) is missing; download the latest YUI compressor and symlink it."; \
exit 2; \
fi
git checkout -qf $(orig_branch)
git branch -f $(build_branch) $(tag)
git checkout -q $(build_branch)
if sed --in-place --version 1> /dev/null 2> /dev/null; then \
sed --in-place -e 's/$${Version}/$(tag)/' $(versioned); \
else \
sed -i '' -e 's/$${Version}/$(tag)/' $(versioned); \
fi
java -jar $(yui_compressor) js/cufon.js -o js/cufon-yui.js
git add $(versioned) js/cufon-yui.js
git commit -a -m 'Built $(tag)'
clean:
git reset HEAD
git checkout -qf $(orig_branch)