Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Trivial] Fix makefile targets to use PHONY #1743

Merged
merged 1 commit into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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