Skip to content

Commit 9c3edd3

Browse files
committed
Makefile: Use GOARCH for linux-release target
This is the target which is used as part of `release` and currently hardcoded to `amd64` which means even this target is run on `arm64` machine it will still create the `amd64` binary. In spec file also `release` target is used and for `arm64` builds `amd64` binary is used without this fix.
1 parent 5b4318e commit 9c3edd3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ gen_release_info:
297297

298298
.PHONY: linux-release-binary macos-release-binary windows-release-binary
299299
linux-release-binary: LDFLAGS+= $(RELEASE_VERSION_VARIABLES)
300-
linux-release-binary: $(BUILD_DIR)/linux-amd64/crc
300+
linux-release-binary: $(BUILD_DIR)/linux-${GOARCH}/crc
301301

302302
macos-release-binary: LDFLAGS+= -X '$(MODULEPATH)/pkg/crc/version.installerBuild=true' $(RELEASE_VERSION_VARIABLES)
303303
macos-release-binary: $(BUILD_DIR)/macos-universal/crc
@@ -310,20 +310,20 @@ release: clean linux-release macos-release-binary windows-release-binary check
310310
linux-release: clean lint linux-release-binary embed_crc_helpers gen_release_info
311311
mkdir $(RELEASE_DIR)
312312

313-
@mkdir -p $(BUILD_DIR)/crc-linux-$(CRC_VERSION)-amd64
314-
@cp LICENSE $(BUILD_DIR)/linux-amd64/crc $(BUILD_DIR)/crc-linux-$(CRC_VERSION)-amd64
315-
tar cJSf $(RELEASE_DIR)/crc-linux-amd64.tar.xz -C $(BUILD_DIR) crc-linux-$(CRC_VERSION)-amd64 --owner=0 --group=0
313+
@mkdir -p $(BUILD_DIR)/crc-linux-$(CRC_VERSION)-${GOARCH}
314+
@cp LICENSE $(BUILD_DIR)/linux-amd64/crc $(BUILD_DIR)/crc-linux-$(CRC_VERSION)-${GOARCH}
315+
tar cJSf $(RELEASE_DIR)/crc-linux-${GOARCH}.tar.xz -C $(BUILD_DIR) crc-linux-$(CRC_VERSION)-${GOARCH} --owner=0 --group=0
316316

317317
@cp $(RELEASE_INFO) $(RELEASE_DIR)/$(RELEASE_INFO)
318318

319319
cd $(RELEASE_DIR) && sha256sum * > sha256sum.txt
320320

321321
.PHONY: embed_crc_helpers
322-
embed_crc_helpers: $(BUILD_DIR)/linux-amd64/crc $(HOST_BUILD_DIR)/crc-embedder
322+
embed_crc_helpers: $(BUILD_DIR)/linux-${GOARCH}/crc $(HOST_BUILD_DIR)/crc-embedder
323323
ifeq ($(CUSTOM_EMBED),false)
324-
$(HOST_BUILD_DIR)/crc-embedder embed --log-level debug --goos=linux $(BUILD_DIR)/linux-amd64/crc
324+
$(HOST_BUILD_DIR)/crc-embedder embed --log-level debug --goos=linux $(BUILD_DIR)/linux-${GOARCH}/crc
325325
else
326-
$(HOST_BUILD_DIR)/crc-embedder embed --log-level debug --cache-dir=$(EMBED_DOWNLOAD_DIR) --no-download --goos=linux $(BUILD_DIR)/linux-amd64/crc
326+
$(HOST_BUILD_DIR)/crc-embedder embed --log-level debug --cache-dir=$(EMBED_DOWNLOAD_DIR) --no-download --goos=linux $(BUILD_DIR)/linux-${GOARCH}/crc
327327
endif
328328

329329
.PHONY: update-go-version

0 commit comments

Comments
 (0)