-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
47 lines (31 loc) · 1.16 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
41
42
43
44
45
46
47
JS_COMPILER = closure-compiler
JS_COMPILER_ARGS = \
--compilation_level \
SIMPLE_OPTIMIZATIONS \
--charset utf-8 \
--summary_detail_level 3 \
--warning_level QUIET
CSS_COMPILER = csstidy
CSS_COMPILER_ARGS = --compress_colors=true --compress_font-weight=true --remove_last_\;=true --merge_selectors=2 --optimise_shorthands=2 --template=highest
js_files = jquery.video.js
js_min_files = $(patsubst %.js,%.min.js,$(js_files))
js_min_gz_files = $(patsubst %.js,%.js.gz,$(js_min_files))
css_files = jquery.video.css
css_min_files = $(patsubst %.css,%.min.css,$(css_files))
css_min_gz_files = $(patsubst %.css,%.css.gz,$(css_min_files))
all: minify gzip
minify: $(js_min_files) $(css_min_files)
gzip: $(js_min_gz_files) $(css_min_gz_files)
$(js_min_gz_files): $(js_min_files)
$(css_min_gz_files): $(css_min_files)
%.min.css.gz: %.min.css
cat $< | gzip - > $@
%.min.js.gz: %.min.js
cat $< | gzip - > $@
%.min.js: %.js
$(JS_COMPILER) $(JS_COMPILER_ARGS) --js $< --js_output_file $@
%.min.css: %.css
$(CSS_COMPILER) $< $(CSS_COMPILER_ARGS) $@
clean:
rm -f $(js_min_files) $(js_min_gz_files)
rm -f $(css_min_files) $(css_min_gz_files)