forked from travist/jsencrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
49 lines (43 loc) · 1.31 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
48
49
# Create the list of files
files = jsbn/jsbn.js\
jsbn/jsbn2.js\
jsbn/prng4.js\
jsbn/rng.js\
jsbn/rsa.js\
jsbn/rsa2.js\
jsbn/rsa-async.js\
jsbn/base64.js\
jsrsasign/asn1-1.0.js\
asn1js/hex.js\
asn1js/hex.js\
asn1js/base64.js\
asn1js/asn1.js\
src/jsencrypt.js
licenses = src/LICENSE.txt\
jsrsasign/LICENSE.txt\
jsbn/LICENSE.txt\
asn1js/LICENSE.txt
.DEFAULT_GOAL := all
all: js
# Perform a jsLint on all the files.
jslint: ${files}
gjslint $^
# Create an aggregated js file and a compressed js file.
js: ${files}
@echo "Generating aggregated jsencrypt.js file"
@echo "var JSEncryptExports = {};" > bin/jsencrypt.js
@echo "(function(exports) {" >> bin/jsencrypt.js
@cat $^ >> bin/jsencrypt.js
@echo "exports.JSEncrypt = JSEncrypt;" >> bin/jsencrypt.js
@echo "})(JSEncryptExports);" >> bin/jsencrypt.js
@echo "var JSEncrypt = JSEncryptExports.JSEncrypt;" >> bin/jsencrypt.js
@echo "Generating compressed jsencrypt.min.js file"
curl -s \
-d compilation_level=SIMPLE_OPTIMIZATIONS \
-d output_format=text \
-d output_info=compiled_code \
--data-urlencode "js_code@bin/jsencrypt.js" \
http://closure-compiler.appspot.com/compile \
> bin/jsencrypt.min.js
licenses: ${licenses}
@cat $^ > LICENSE.txt