Skip to content

Commit debea64

Browse files
authored
Merge pull request #550 from CosmWasm/sw/makefile-build-commands
Cleanup build commands in Makefile
2 parents 44e2980 + ce32bc1 commit debea64

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ jobs:
279279
- cargocache-v3-build_shared_library-rust:1.74.0-
280280
- run:
281281
name: Create release build of libwasmvm
282-
command: make build-rust
282+
command: make build-libwasmvm
283283
- persist_to_workspace:
284284
root: ./internal/api
285285
paths:

Makefile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.PHONY: all build build-rust build-go test
2-
31
# Builds the Rust library libwasmvm
42
BUILDERS_PREFIX := cosmwasm/libwasmvm-builder:0100
53
# Contains a full Go dev environment including CGO support in order to run Go tests on the built shared library
@@ -30,33 +28,37 @@ test-filenames:
3028
echo $(SHARED_LIB_DST)
3129
echo $(SHARED_LIB_SRC)
3230

33-
all: build test
34-
35-
build: build-rust build-go
36-
37-
build-rust: build-rust-release
31+
.PHONY: build
32+
build:
33+
make build-libwasmvm
34+
make build-go
3835

3936
# Use debug build for quick testing.
4037
# In order to use "--features backtraces" here we need a Rust nightly toolchain, which we don't have by default
41-
build-rust-debug:
38+
.PHONY: build-libwasmvm-debug
39+
build-libwasmvm-debug:
4240
(cd libwasmvm && cargo build)
4341
cp libwasmvm/target/debug/$(SHARED_LIB_SRC) internal/api/$(SHARED_LIB_DST)
4442
make update-bindings
4543

4644
# use release build to actually ship - smaller and much faster
47-
build-rust-release:
45+
.PHONY: build-libwasmvm
46+
build-libwasmvm:
4847
(cd libwasmvm && cargo build --release)
4948
cp libwasmvm/target/release/$(SHARED_LIB_SRC) internal/api/$(SHARED_LIB_DST)
5049
make update-bindings
5150

51+
.PHONY: build-go
5252
build-go:
5353
go build ./...
5454
go build -o build/demo ./cmd/demo
5555

56+
.PHONY: test
5657
test:
5758
# Use package list mode to include all subdirectores. The -count=1 turns off caching.
5859
RUST_BACKTRACE=1 go test -v -count=1 ./...
5960

61+
.PHONY: test-safety
6062
test-safety:
6163
# Use package list mode to include all subdirectores. The -count=1 turns off caching.
6264
GOEXPERIMENT=cgocheck2 go test -race -v -count=1 ./...

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ library that can be used via FFI. It is compiled like this:
2626

2727
# Create release build for your current system. Uses whatever default Rust
2828
# version you have installed.
29-
make build-rust
29+
make build-libwasmvm
3030

3131
# Create reproducible release builds for other systems (slow, don't use for development)
3232
make release-build-alpine
@@ -135,7 +135,7 @@ which for example excludes all 32 bit systems.
135135
| macOS | x86_64 | static | ✅​libwasmvmstatic_darwin.a | Fat/universal library with multiple archs ([#407]) |
136136
| macOS | aarch64 | shared | ✅​libwasmvm.dylib | Fat/universal library with multiple archs ([#294]) |
137137
| macOS | aarch64 | static | ✅​libwasmvmstatic_darwin.a | Fat/universal library with multiple archs ([#407]) |
138-
| Windows (mingw) | x86_64 | shared | 🏗​wasmvm.dll | Shared library linking not working on Windows ([#389]) |
138+
| Windows (mingw) | x86_64 | shared | 🏗​wasmvm.dll | Shared library linking not working on Windows ([#389]) |
139139
| Windows (mingw) | x86_64 | static | 🚫​ | Unclear if this can work using a cross compiler; needs research on .lib (MSVC toolchain) vs. .a (GNU toolchain). ([#389]) |
140140
| Windows (mingw) | aarch64 | shared | 🚫​ | Shared library linking not working on Windows ([#389]) |
141141
| Windows (mingw) | aarch64 | static | 🚫​ | Unclear if this can work using a cross compiler; needs research on .lib (MSVC toolchain) vs. .a (GNU toolchain). ([#389]) |
@@ -171,6 +171,6 @@ import this code freely. If it is not present you will have to build it for your
171171
system, and ideally add it to this repo with a PR (on your fork). We will set up
172172
a proper CI system for building these binaries, but we are not there yet.
173173

174-
To build the rust side, try `make build-rust` and wait for it to compile. This
175-
depends on `cargo` being installed with `rustc` version 1.47+. Generally, you
176-
can just use `rustup` to install all this with no problems.
174+
To build the rust side, try `make build-libwasmvm` and wait for it to compile.
175+
This depends on `cargo` being installed with `rustc` version 1.47+. Generally,
176+
you can just use `rustup` to install all this with no problems.

0 commit comments

Comments
 (0)