1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-18 12:28:09 +00:00
trezor-firmware/emscripten/Makefile

30 lines
803 B
Makefile
Raw Normal View History

EMFLAGS = \
-Os --closure 1 \
--memory-init-file 0 \
--pre-js pre.js --post-js post.js \
2016-05-12 17:29:24 +00:00
-I ../ed25519-donna \
-s EXPORTED_FUNCTIONS='["_hdnode_public_ckd_address_optimized", "_ecdsa_read_pubkey"]'
SRC = ../bignum.c ../ecdsa.c ../secp256k1.c ../hmac.c ../bip32.c \
../base58.c ../ripemd160.c ../sha2.c ../rand.c
2016-05-12 17:57:22 +00:00
trezor-crypto.js: $(SRC)
emcc $(EMFLAGS) -o $@ $^
test-node: node_modules trezor-crypto.js test.js
node test.js
test-browserify.js: node_modules trezor-crypto.js test.js
2016-05-12 17:57:22 +00:00
$(shell npm bin)/browserify test.js -o $@ --noparse=`pwd`/trezor-crypto.js
@echo "open test.html in your favourite browser"
2015-06-16 22:06:53 +00:00
node_modules:
npm install
2016-05-12 17:57:22 +00:00
npm install browserify
2015-06-16 22:06:53 +00:00
clean:
rm -f trezor-crypto.js test-browserify.js
2016-05-12 17:29:24 +00:00
docker:
docker run --rm -i -v $(shell pwd)/..:/src -t apiaryio/emcc /bin/bash