Fix win32 nif compilation

This commit is contained in:
Tino Breddin 2019-08-20 14:37:55 +02:00
parent 344ca0c986
commit b3b64213d0
2 changed files with 19 additions and 8 deletions

2
.gitignore vendored
View File

@ -5,3 +5,5 @@ Cargo.lock
/parity-ethereum /parity-ethereum
/_build /_build
/ebin /ebin
/priv/ecrecover.dll
/priv/ecrecover.so

View File

@ -1,22 +1,31 @@
UNAME := $(shell uname) UNAME := $(shell uname)
ifeq ($(OS),Windows_NT)
nif_lib_src = ecrecover.dll
nif_lib = ecrecover.dll
else
ifeq ($(UNAME), Linux) ifeq ($(UNAME), Linux)
artefact = libecrecover.so nif_lib_src = libecrecover.so
nif_lib = ecrecover.so
endif endif
ifeq ($(UNAME), Darwin) ifeq ($(UNAME), Darwin)
artefact = libecrecover.dylib nif_lib_src = libecrecover.dylib
nif_lib = ecrecover.so
endif
endif endif
all: priv/$(nif_lib) compile
all: priv/ecrecover.so compile:
./rebar3 compile
priv/ecrecover.so: src/lib.rs parity-ethereum/ priv/$(nif_lib): src/lib.rs parity-ethereum/
cargo build --release cargo build --release
cp target/release/$(artefact) priv/ecrecover.so cp target/release/$(nif_lib_src) $@
clean: clean:
rm -f priv/ecrecover.so target/release/$(artefact) rm -f priv/$(nif_lib) target/release/$(nif_lib_src)
./rebar3 clean
parity-ethereum/: parity-ethereum/:
git clone https://github.com/johnsnewby/parity-ethereum.git git clone https://github.com/aeternity/parity-ethereum.git