-
Notifications
You must be signed in to change notification settings - Fork 196
/
Makefile
executable file
·34 lines (27 loc) · 1017 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
SOURCE=jquery.imgareaselect.dev.js
BASIC=$(SOURCE:.dev.js=.js)
MINIFIED=$(BASIC:.js=.min.js)
PACKED=$(BASIC:.js=.pack.js)
VERSION=$(shell head $(SOURCE) | perl -ne '/version ([0-9.]+)/?{print $$1}:0')
RELEASE=$(BASIC:.js=-$(VERSION))
all: $(BASIC) $(MINIFIED) $(PACKED)
$(BASIC): $(SOURCE)
../../tools/strip-comments-simple.pl $< > $@
$(MINIFIED): $(BASIC)
cat $< | perl -I ../../tools/packer2.perl -- \
../../tools/packer2.perl/jsPacker.michal.pl -q -e0 > $@
$(PACKED): $(BASIC)
java -cp ../../tools -jar ../../tools/shrinksafe.jar $< \
| perl -I ../../tools/packer2.perl -- \
../../tools/packer2.perl/jsPacker.michal.pl -q -e62 > $@
dist: $(BASIC) $(MINIFIED) $(PACKED)
rm -rf "dist/$(RELEASE)" "dist/$(RELEASE).zip"
mkdir -p "dist/$(RELEASE)"
cp -r distfiles/* "dist/$(RELEASE)"
mkdir -p "dist/$(RELEASE)/scripts"
cp "$(BASIC)" "$(MINIFIED)" "$(PACKED)" "dist/$(RELEASE)/scripts"
cd dist && \
zip -r "$(RELEASE).zip" "$(RELEASE)" && \
cd -
clean:
rm "$(BASIC)" "$(MINIFIED)" "$(PACKED)"