mirror of https://github.com/status-im/nimplay.git
Use nim + clang by default.
This commit is contained in:
parent
d8b25fd50b
commit
ef6de6e4f6
30
Makefile
30
Makefile
|
@ -8,15 +8,23 @@ DOCKER_NLVM_C=$(DOCKER_NLVM) $(PATH_PARAMS) c
|
||||||
NLVM_WAMS32_FLAGS= --nlvm.target=wasm32 --gc:none -l:--no-entry -l:--allow-undefined -d:clang
|
NLVM_WAMS32_FLAGS= --nlvm.target=wasm32 --gc:none -l:--no-entry -l:--allow-undefined -d:clang
|
||||||
DOCKER_NLVM_C=$(DOCKER_NLVM) $(PATH_PARAMS) $(NLVM_WAMS32_FLAGS) c
|
DOCKER_NLVM_C=$(DOCKER_NLVM) $(PATH_PARAMS) $(NLVM_WAMS32_FLAGS) c
|
||||||
# Use nim + clang
|
# Use nim + clang
|
||||||
DOCKER_NIM_CLANG=docker run -e HOME='/tmp/' --user $(user_id):$(user_id) -w /code/ -v $(pwd):/code/ --entrypoint="/usr/bin/nim" nimclang --verbosity:2 --d:release
|
DOCKER_NIM_CLANG=docker run -e HOME='/tmp/' --user $(user_id):$(user_id) -w /code/ -v $(pwd):/code/ --entrypoint="/usr/bin/nim" nimclang --verbosity:2
|
||||||
DOCKER_NIM_CLANG_PASS_FLAGS = --passC:"--target=wasm32-unknown-unknown-wasm" \
|
DOCKER_NIM_CLANG_PASS_FLAGS = --passC:"--target=wasm32-unknown-unknown-wasm" \
|
||||||
--passL:"--target=wasm32-unknown-unknown-wasm" --passC:"-I./include" --clang.options.linker:"-nostdlib -Wl,--no-entry,--allow-undefined,--strip-all,--export-dynamic"
|
--passL:"--target=wasm32-unknown-unknown-wasm" --passC:"-I./include" --clang.options.linker:"-nostdlib -Wl,--no-entry,--allow-undefined,--strip-all,--export-dynamic"
|
||||||
|
|
||||||
DOCKER_NIM_CLANG_FLAGS=$(DOCKER_NIM_CLANG_PASS_FLAGS) --os:standalone --cpu:i386 --cc:clang --gc:none --nomain
|
DOCKER_NIM_CLANG_FLAGS=$(DOCKER_NIM_CLANG_PASS_FLAGS) --os:standalone --cpu:i386 --cc:clang --gc:none --nomain
|
||||||
DOCKER_NIM_CLANG_C=$(DOCKER_NIM_CLANG) $(DOCKER_NIM_CLANG_FLAGS) $(PATH_PARAMS) c
|
DOCKER_NIM_CLANG_C=$(DOCKER_NIM_CLANG) --cc:clang $(PATH_PARAMS) c
|
||||||
|
DOCKER_NIM_CLANG_WASM32_C=$(DOCKER_NIM_CLANG) $(DOCKER_NIM_CLANG_FLAGS) $(PATH_PARAMS) c
|
||||||
|
|
||||||
|
ifdef USE_NLVM:
|
||||||
|
NIMC=$(DOCKER_NLVM_C)
|
||||||
|
WASM32_NIMC=$(DOCKER_NLVM_C)
|
||||||
|
else
|
||||||
|
NIMC=$(DOCKER_NIM_CLANG_C)
|
||||||
|
WASM32_NIMC=$(DOCKER_NIM_CLANG_WASM32_C)
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: get-nlvm-docker tools examples
|
all: tools examples
|
||||||
|
|
||||||
.PHONY: get-nlvm-docker
|
.PHONY: get-nlvm-docker
|
||||||
get-nlvm-docker:
|
get-nlvm-docker:
|
||||||
|
@ -29,8 +37,8 @@ get-wabt:
|
||||||
|
|
||||||
.PHONY: tools
|
.PHONY: tools
|
||||||
tools:
|
tools:
|
||||||
$(DOCKER_NLVM_C) -d:release --out:tools/k256_sig tools/k256_sig.nim
|
$(NIMC) -d:release --out:tools/k256_sig tools/k256_sig.nim
|
||||||
$(DOCKER_NLVM_C) -d:release --out:tools/abi_gen tools/abi_gen.nim
|
$(NIMC) -d:release --out:tools/abi_gen tools/abi_gen.nim
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
@ -48,12 +56,8 @@ vendors:
|
||||||
|
|
||||||
.PHONY: king_of_the_hill
|
.PHONY: king_of_the_hill
|
||||||
king_of_the_hill:
|
king_of_the_hill:
|
||||||
$(DOCKER_NLVM_C) examples/king_of_the_hill.nim
|
$(WASM32_NIMC) examples/king_of_the_hill.nim
|
||||||
$(POSTPROCESS) examples/king_of_the_hill.wasm
|
$(POSTPROCESS) examples/king_of_the_hill.wasm
|
||||||
|
|
||||||
# .PHONY: examples
|
.PHONY: examples
|
||||||
# examples: king_of_the_hill
|
examples: king_of_the_hill
|
||||||
|
|
||||||
nimexamples:
|
|
||||||
$(DOCKER_NIM_CLANG_C) --out:examples/king_of_the_hill.wasm examples/king_of_the_hill.nim
|
|
||||||
$(POSTPROCESS) examples/king_of_the_hill.wasm
|
|
||||||
|
|
BIN
tools/k256_sig
BIN
tools/k256_sig
Binary file not shown.
Loading…
Reference in New Issue