forked from tonyg/js-nacl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (29 loc) · 799 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
NACLRAW=nacl_raw.js
NACLVERSION=20110221
NACLUNPACKED=nacl-$(NACLVERSION)
PYTHON=python
EMCC=`which emcc`
all: lib
$(NACLRAW): subnacl
$(PYTHON) $(EMCC) \
-s LINKABLE=1 \
-s EXPORTED_FUNCTIONS="$$(cat subnacl/naclexports.sh)" \
-s ALLOW_MEMORY_GROWTH=1 \
--js-library nacl_randombytes_emscripten.js \
--post-js subnacl/naclapi.js \
-O1 --closure 1 -o $@ \
-I subnacl/include \
keys.c \
$$(find subnacl -name '*.c')
clean:
rm -f $(NACLRAW)
rm -rf lib
lib: $(NACLRAW) nacl_cooked_prefix.js nacl_cooked.js nacl_cooked_suffix.js
mkdir -p $@
cat nacl_cooked_prefix.js $(NACLRAW) nacl_cooked.js nacl_cooked_suffix.js > $@/nacl.js
veryclean: clean
rm -rf subnacl
rm -rf $(NACLUNPACKED)
subnacl: import.py
tar -jxvf $(NACLUNPACKED).tar.bz2
python import.py $(NACLUNPACKED)