-
Notifications
You must be signed in to change notification settings - Fork 51
/
Makefile
36 lines (27 loc) · 858 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
LIBSODIUMVERSION=1.0.18-stable
LIBSODIUMUNPACKED=libsodium-stable
LIBSODIUM_JS=$(LIBSODIUMUNPACKED)/libsodium-js-sumo/lib/libsodium.js
test: all
npm test
## Builds well with emscripten SDK 1.36.4.
all: lib
clean:
rm -rf lib
$(LIBSODIUM_JS): $(LIBSODIUMUNPACKED)
docker run --rm \
-v $$(pwd)/$(LIBSODIUMUNPACKED):/src \
--user $$(id -u):$$(id -g) \
trzeci/emscripten \
/src/dist-build/emscripten.sh --sumo
[ -f $@ ] && touch $@
lib: $(LIBSODIUM_JS) nacl_cooked_prefix.js nacl_cooked.js nacl_cooked_suffix.js
mkdir -p $@
cat nacl_cooked_prefix.js $(LIBSODIUM_JS) nacl_cooked.js nacl_cooked_suffix.js \
> $@/nacl_factory.js
veryclean: clean
rm -rf subnacl
rm -rf $(LIBSODIUMUNPACKED)
$(LIBSODIUMUNPACKED): libsodium-$(LIBSODIUMVERSION).tar.gz
tar -zxvf $<
patch -p0 < libsodium-memory-configuration.patch
.PRECIOUS: $(LIBSODIUM_JS)