forked from YahooArchive/boomerang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (28 loc) · 1.1 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
# Copyright (c) 2011, Yahoo! Inc. All rights reserved.
# Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
PLUGINS :=
VERSION := $(shell sed -ne '/^BOOMR\.version/{s/^.*"\([^"]*\)".*/\1/;p;q;}' boomerang.js)
DATE := $(shell date +%s)
MINIFIER := cat
all: boomerang-$(VERSION).$(DATE).js
usage:
echo "Create a release version of boomerang:"
echo " make"
echo ""
echo "Create a release version of boomerang with the dns plugin:"
echo " make PLUGINS=dns.js"
echo ""
echo "Create a yuicompressor minified release version of boomerang:"
echo " make MINIFIER=\"java -jar /path/to/yuicompressor-2.4.2.jar --type js\""
echo ""
echo "Create a jsmin minified release version of boomerang:"
echo " make MINIFIER=\"/path/to/jsmin\""
echo ""
boomerang-$(VERSION).$(DATE).js: boomerang.js $(PLUGINS)
echo
echo "Making $@ ..."
echo "using plugins: $(PLUGINS)..."
cat boomerang.js $(PLUGINS) | sed -e 's/^\(BOOMR\.version = "\)$(VERSION)\("\)/\1$(VERSION).$(DATE)\2/' | $(MINIFIER) | perl -pe "s/\(window\)\);/\(window\)\);\n/g" > $@ && echo "done"
echo
.PHONY: all
.SILENT: