Use nim + clang by default.

This commit is contained in:
Jacques Wagener 2019-08-26 20:16:15 +02:00
parent d8b25fd50b
commit ef6de6e4f6
No known key found for this signature in database
GPG Key ID: C294D1025DA0E923
2 changed files with 17 additions and 13 deletions

View File

@ -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
DOCKER_NLVM_C=$(DOCKER_NLVM) $(PATH_PARAMS) $(NLVM_WAMS32_FLAGS) c
# 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" \
--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_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
all: get-nlvm-docker tools examples
all: tools examples
.PHONY: get-nlvm-docker
get-nlvm-docker:
@ -29,8 +37,8 @@ get-wabt:
.PHONY: tools
tools:
$(DOCKER_NLVM_C) -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/k256_sig tools/k256_sig.nim
$(NIMC) -d:release --out:tools/abi_gen tools/abi_gen.nim
.PHONY: clean
clean:
@ -48,12 +56,8 @@ vendors:
.PHONY: 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
# .PHONY: examples
# 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
.PHONY: examples
examples: king_of_the_hill

Binary file not shown.