diff --git a/Makefile b/Makefile index 43d30163..fac3d461 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ test: build @go test ./pkg/... ./test clean: + rm codesign-{amd64,arm64}-stamp rm -rf out out/vfkit-amd64 out/vfkit-arm64: out/vfkit-%: force-build @@ -20,7 +21,12 @@ out/vfkit-amd64 out/vfkit-arm64: out/vfkit-%: force-build CGO_ENABLED=1 CGO_CFLAGS=$(CGO_CFLAGS) GOOS=darwin GOARCH=$* go build -o $@ ./cmd/vfkit codesign -f --entitlements vf.entitlements -s - $@ -out/vfkit: out/vfkit-amd64 out/vfkit-arm64 +codesign-amd64-stamp codesign-arm64-stamp: codesign-%-stamp: out/vfkit-% + codesign -f --entitlements vf.entitlements -s - $< + touch $@ + + +out/vfkit: codesign-amd64-stamp codesign-arm64-stamp cd $(@D) && lipo -create $(^F) -output $(@F) # the go compiler is doing a good job at not rebuilding unchanged files