-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
37 lines (33 loc) · 871 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
all: nf_pp.php
src/nf_pp.min.js:
@echo Minimizing JS
@curl \
-s \
-d compilation_level=SIMPLE_OPTIMIZATIONS \
-d output_format=text \
-d output_info=compiled_code \
--data-urlencode "js_code@src/nf_pp.js" \
http://closure-compiler.appspot.com/compile \
| sed \
-e 's/\\\\/\\\\\\\\/g' \
-e "s/'/\\'/g" > src/nf_pp.min.js
src/nf_pp.min.css:
@echo Minimizing CSS
@curl \
-s \
--data-urlencode "input@src/nf_pp.css" \
http://cssminifier.com/raw \
| sed \
-e 's/\\\\/\\\\\\\\/g' \
-e "s/'/\\'/g" > src/nf_pp.min.css
nf_pp.php: src/nf_pp.min.js src/nf_pp.min.css
@echo Injecting JS and CSS into PHP
@sed \
-e '/{{nf_pp.js}}/r src/nf_pp.min.js' \
-e '/{{nf_pp.css}}/r src/nf_pp.min.css' \
-e 's/{{nf_pp.js}}//' \
-e 's/{{nf_pp.css}}//' \
src/nf_pp.php > nf_pp.php
clean:
@echo Cleaning
@rm -f src/nf_pp.min.js src/nf_pp.min.css