Skip to content

Commit

Permalink
[Trivial] Fix makefile targets to use PHONY
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Fang <[email protected]>
  • Loading branch information
yihuaf committed Mar 29, 2023
1 parent 04de7bf commit 8a8b8e3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,71 @@ ROOT = $(shell git rev-parse --show-toplevel)

# builds

.PHONY:build
build: youki-release

.PHONY: youki
youki: youki-dev # helper

.PHONY: youki-dev
youki-dev:
./scripts/build.sh -o $(ROOT) -c youki

.PHONY: youki-release
youki-release:
./scripts/build.sh -o $(ROOT) -r -c youki

.PHONY: runtimetest
runtimetest:
./scripts/build.sh -o $(ROOT) -r -c runtimetest

.PHONY: rust-oci-tests-bin
rust-oci-tests-bin:
./scripts/build.sh -o $(ROOT) -r -c integration-test

.PHONY: all
all: youki-release rust-oci-tests-bin runtimetest

# Tests

.PHONY: unittest
unittest:
cd ./crates && LD_LIBRARY_PATH=${HOME}/.wasmedge/lib cargo test --all --all-targets --all-features

.PHONY: featuretest
featuretest:
./scripts/features_test.sh

.PHONY: oci-tests
oci-tests: youki-release
./scripts/oci_integration_tests.sh $(ROOT)

.PHONY: rust-oci-tests
rust-oci-tests: youki-release runtimetest rust-oci-tests-bin
./scripts/rust_integration_tests.sh $(ROOT)/youki

.PHONY: validate-rust-oci-runc
validate-rust-oci-runc: runtimetest rust-oci-tests-bin
./scripts/rust_integration_tests.sh runc

.PHONY: containerd-test
containerd-test: youki-dev
VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant up
VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant provision --provision-with test

.PHONY: test-oci
test-oci: oci-tests rust-oci-tests

.PHONY: test-all
test-all: unittest featuretest oci-tests containerd-test # currently not doing rust-oci here

# Misc

.PHONY: lint
lint:
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings

.PHONY: clean
clean:
./scripts/clean.sh $(ROOT)
5 changes: 3 additions & 2 deletions crates/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
.PHONY : debug release

.PHONY: debug
debug:
cargo build && cp ./target/debug/youki ./youki_bin

.PHONY: release
release:
cargo build --release && cp ./target/release/youki ./youki_bin

.PHONY: clean
clean:
rm ./youki_bin
8 changes: 4 additions & 4 deletions tests/rust-integration-tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
.PHONY: runtimetest integration-test


TGT = x86_64-unknown-linux-gnu
FLAG =
ifeq ("$(FLAG)","--release")
Expand All @@ -9,14 +6,17 @@ else
DIR = debug
endif


.PHONY: all
all: runtimetest integration-test

.PHONY: runtimetest
runtimetest:
cd ./runtimetest && cargo build $(FLAG) && cp ./target/$(TGT)/$(DIR)/runtimetest ../runtimetest_bin

.PHONY: integration-test
integration-test:
cd ./integration_test && cargo build $(FLAG) && cp ./target/$(DIR)/integration_test ../integration_test_bin

.PHONY: clean
clean:
rm ./integration_test_bin && rm ./runtimetest_bin

0 comments on commit 8a8b8e3

Please sign in to comment.