-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
93 lines (71 loc) · 1.32 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
USE_UTF8=2
USE_AES=1
USE_SHA=1
USE_RSA=1
USE_JSON=1
USE_JOSE=1
P_USE_JOSE=$(USE_JOSE)
P_USE_JSON=$(USE_JSON)
P_USE_RSA=$(USE_RSA)
P_USE_AES=$(USE_AES)
P_USE_UTF8=$(USE_UTF8)
P_USE_SHA=$(USE_SHA)
JSDOCSTYLE=default
JSTEMPLATEDIR=tools/jsdoc/templates/$(JSDOCSTYLE)/
YUICOMPRESSOR=tools/yuicompress.jar
SOURCES= src/encoding.js
ifeq ($(USE_JSON),0)
P_USE_JOSE=0
endif
ifeq ($(USE_UTF8),0)
P_USE_JSON=0
P_USE_JOSE=0
endif
ifeq ($(USE_SHA),0)
P_USE_RSA=0
P_USE_JOSE=0
endif
ifeq ($(USE_RSA),0)
P_USE_JOSE=0
endif
ifeq ($(USE_AES),0)
P_USE_JOSE=0
endif
ifneq ($(P_USE_SHA),0)
SOURCES += src/hashing.js
endif
ifneq ($(P_USE_RSA),0)
SOURCES += src/bn.js src/rsa.js
endif
ifneq ($(P_USE_AES),0)
SOURCES += src/aes.js
endif
ifneq ($(P_USE_JOSE),0)
SOURCES += src/jose.js
endif
ifneq ($(P_USE_JSON),0)
SOURCES += src/djson.js
endif
ifneq ($(P_USE_UTF8),0)
ifeq ($(P_USE_UTF8),1)
SOURCES+= src/utf8.js
else
SOURCES+= src/utf8_fast.js
endif
endif
.PHONY: all test doc src/*.js
all: djcl.js
djcl.js: $(SOURCES)
cat $^ | java -jar $(YUICOMPRESSOR) --type js >djcl.js
# cp $^ $@
doc:
rm -fr doc
mkdir doc
tools/jsdoc/jsdoc.js src/*.js -d doc -t $(JSTEMPLATEDIR) --private
test: djcl.js
node test/run_tests.js
tidy:
find . -name '*~' -delete
rm -f core.js core_*.js
clean: tidy
rm -fr sjcl.js doc