1- SHIMS := spin
2- BUILD_TARGETS = $(foreach shim,$(SHIMS ) ,build-$(shim ) -cross-$(TARGET ) )
1+ BUILD_TARGETS = build-spin-cross-$(TARGET )
32
43PREFIX ?= /usr/local
54INSTALL ?= install
@@ -21,7 +20,7 @@ test: unit-tests integration-tests
2120
2221.PHONY : unit-tests
2322unit-tests : build
24- $( foreach shim, $( SHIMS ) , cross test --release --manifest-path=containerd-shim-$( shim ) /Cargo.toml --target $(TARGET ) ; )
23+ cross test --release --manifest-path=containerd-shim-spin /Cargo.toml --target $(TARGET )
2524
2625.PHONY : check-bins
2726check-bins :
7069 cargo clippy --all-targets --all-features --workspace --fix -- --deny=warnings
7170
7271.PHONY : build
73- build : $( foreach shim, $( SHIMS ) , build-$( shim ) -cross-$(TARGET ) )
72+ build : build-spin -cross-$(TARGET )
7473 echo " Build complete"
7574
7675# pin cross to a specific commit to avoid breaking changes
@@ -89,8 +88,8 @@ build-%:
8988 cargo build --release --manifest-path=containerd-shim-$* /Cargo.toml
9089
9190.PHONY : install
92- install : $( foreach shim, $( SHIMS ) , build-$( shim ) )
93- sudo $(INSTALL ) containerd-shim- * /target/release/containerd-shim-* $(PREFIX ) /bin
91+ install : build-spin
92+ sudo $(INSTALL ) . /target/release/containerd-shim-* $(PREFIX ) /bin
9493
9594.PHONY : update-deps
9695update-deps :
@@ -105,16 +104,16 @@ test/out_%/img.tar: images/%/Dockerfile
105104 docker buildx build --provenance=false --platform=wasi/wasm --load -t $(TEST_IMG_NAME_$* ) ./images/$*
106105 docker save -o $@ $(TEST_IMG_NAME_$* )
107106
108- load : $( foreach shim, $( SHIMS ) , test/out_ $( shim ) /img.tar)
109- $( foreach shim, $( SHIMS ) , sudo ctr -n $(CONTAINERD_NAMESPACE ) image import test/out_ $( shim ) /img.tar;)
107+ load : test/out_spin /img.tar
108+ sudo ctr -n $(CONTAINERD_NAMESPACE ) image import test/out_spin /img.tar
110109
111110.PHONY : run_%
112111run_% : install load
113112 sudo ctr run --net-host --rm --runtime=io.containerd.$* .v1 docker.io/library/$(TEST_IMG_NAME_$* ) test$*
114113
115114.PHONY : clean
116- clean : $( addprefix clean-, $( SHIMS ) )
117- $( foreach shim, $( SHIMS ) , test -f $(PREFIX ) /bin/containerd-shim-$( shim ) -* && sudo rm -rf $(PREFIX ) /bin/containerd-shim-$(proj ) -* || true;)
115+ clean : clean-spin
116+ test -f $(PREFIX ) /bin/containerd-shim-spin -* && sudo rm -rf $(PREFIX ) /bin/containerd-shim-$(proj ) -* || true ;
118117 test -d ./test && sudo rm -rf ./test || true
119118
120119.PHONY : clean-%
0 commit comments