From 357934254b04a83a05b28d788322fa5b461dfd74 Mon Sep 17 00:00:00 2001 From: Norio Nomura Date: Wed, 11 Sep 2024 12:13:22 +0900 Subject: [PATCH 1/2] Makefile: Add architecture variations to the artifact targets Signed-off-by: Norio Nomura --- Makefile | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index bad26b01e52..80ff16a9076 100644 --- a/Makefile +++ b/Makefile @@ -265,28 +265,34 @@ install-tools: generate: go generate ./... -.PHONY: artifacts-darwin -artifacts-darwin: - mkdir -p _artifacts - GOOS=darwin GOARCH=amd64 make clean binaries - $(TAR) -C _output/ -czvf _artifacts/lima-$(VERSION_TRIMMED)-Darwin-x86_64.tar.gz ./ - GOOS=darwin GOARCH=arm64 make clean binaries - $(TAR) -C _output -czvf _artifacts/lima-$(VERSION_TRIMMED)-Darwin-arm64.tar.gz ./ +.PHONY: artifacts-darwin artifact-darwin-aarch64 artifact-darwin-arm64 artifact-darwin-x86_64 +artifacts-darwin: artifact-darwin-x86_64 artifact-darwin-arm64 +artifact-darwin-arm64: ENVS=GOOS=darwin GOARCH=arm64 +artifact-darwin-arm64: _artifacts/lima-$(VERSION_TRIMMED)-Darwin-arm64.tar.gz +artifact-darwin-aarch64: artifact-darwin-arm64 +artifact-darwin-x86_64: ENVS=GOOS=darwin GOARCH=amd64 +artifact-darwin-x86_64: _artifacts/lima-$(VERSION_TRIMMED)-Darwin-x86_64.tar.gz + +.PHONY: artifacts-linux artifact-linux-aarch64 artifact-linux-arm64 artifact-linux-x86_64 +artifacts-linux: artifact-linux-x86_64 artifact-linux-aarch64 +artifact-linux-arm64: artifact-linux-aarch64 +artifact-linux-aarch64: ENVS=GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc +artifact-linux-aarch64: _artifacts/lima-$(VERSION_TRIMMED)-Linux-aarch64.tar.gz +artifact-linux-x86_64: ENVS=GOOS=linux GOARCH=amd64 CC=x86_64-linux-gnu-gcc +artifact-linux-x86_64: _artifacts/lima-$(VERSION_TRIMMED)-Linux-x86_64.tar.gz + +.PHONY: artifacts-windows artifact-windows-x86_64 +artifacts-windows: artifact-windows-x86_64 +artifact-windows-x86_64: ENVS=GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc +artifact-windows-x86_64: _artifacts/lima-$(VERSION_TRIMMED)-Windows-x86_64.tar.gz + cd _output && $(ZIP) -r ../_artifacts/lima-$(VERSION_TRIMMED)-Windows-x86_64.zip * -.PHONY: artifacts-linux -artifacts-linux: - mkdir -p _artifacts - GOOS=linux GOARCH=amd64 CC=x86_64-linux-gnu-gcc make clean binaries - $(TAR) -C _output/ -czvf _artifacts/lima-$(VERSION_TRIMMED)-Linux-x86_64.tar.gz ./ - GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc make clean binaries - $(TAR) -C _output/ -czvf _artifacts/lima-$(VERSION_TRIMMED)-Linux-aarch64.tar.gz ./ +_artifacts/lima-%.tar.gz: mkdir-artifacts + $(ENVS) make clean binaries + $(TAR) -C _output/ -czvf $@ ./ -.PHONY: artifacts-windows -artifacts-windows: +mkdir-artifacts: mkdir -p _artifacts - GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc make clean binaries - $(TAR) -C _output/ -czvf _artifacts/lima-$(VERSION_TRIMMED)-Windows-x86_64.tar.gz ./ - cd _output && $(ZIP) -r ../_artifacts/lima-$(VERSION_TRIMMED)-Windows-x86_64.zip * .PHONY: artifacts-misc artifacts-misc: From c47ebee5a62388729c2dfdc10e6a669269da83f5 Mon Sep 17 00:00:00 2001 From: Norio Nomura Date: Thu, 12 Sep 2024 12:25:05 +0900 Subject: [PATCH 2/2] Makefile: remove alias targets `artifact-darwin-aarch64` and `artifact-linux-arm64` Signed-off-by: Norio Nomura --- Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 80ff16a9076..c6a6223a6e2 100644 --- a/Makefile +++ b/Makefile @@ -265,17 +265,15 @@ install-tools: generate: go generate ./... -.PHONY: artifacts-darwin artifact-darwin-aarch64 artifact-darwin-arm64 artifact-darwin-x86_64 +.PHONY: artifacts-darwin artifact-darwin-arm64 artifact-darwin-x86_64 artifacts-darwin: artifact-darwin-x86_64 artifact-darwin-arm64 artifact-darwin-arm64: ENVS=GOOS=darwin GOARCH=arm64 artifact-darwin-arm64: _artifacts/lima-$(VERSION_TRIMMED)-Darwin-arm64.tar.gz -artifact-darwin-aarch64: artifact-darwin-arm64 artifact-darwin-x86_64: ENVS=GOOS=darwin GOARCH=amd64 artifact-darwin-x86_64: _artifacts/lima-$(VERSION_TRIMMED)-Darwin-x86_64.tar.gz -.PHONY: artifacts-linux artifact-linux-aarch64 artifact-linux-arm64 artifact-linux-x86_64 +.PHONY: artifacts-linux artifact-linux-aarch64 artifact-linux-x86_64 artifacts-linux: artifact-linux-x86_64 artifact-linux-aarch64 -artifact-linux-arm64: artifact-linux-aarch64 artifact-linux-aarch64: ENVS=GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc artifact-linux-aarch64: _artifacts/lima-$(VERSION_TRIMMED)-Linux-aarch64.tar.gz artifact-linux-x86_64: ENVS=GOOS=linux GOARCH=amd64 CC=x86_64-linux-gnu-gcc