Skip to content

Commit b1b5f76

Browse files
authored
Merge pull request #5 from nephroflow/kv/arch-switcheroo
make aarch64 package when specified arm64
2 parents 422f90d + 273762d commit b1b5f76

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,15 @@ build: ## Build the Go binary for the specified architecture (e.g., make build A
3636
.PHONY: rpm
3737
rpm: ## Build the RPM package for the specified architecture (e.g., make rpm ARCH=amd64)
3838
@if [ -z "$(ARCH)" ]; then \
39-
echo "ARCH is not set. Using local architecture: $(LOCAL_ARCH)"; \
40-
rpmbuild -bb --define "_topdir $(PWD)/rpmbuild" --define "ARCH $(LOCAL_ARCH)" --define "VERSION $(VERSION)" --target $(LOCAL_ARCH) aproxy.spec; \
39+
echo "ARCH is not set. Using local architecture: $(LOCAL_ARCH)"; \
40+
ARCH="$(LOCAL_ARCH)"; \
41+
elif [ "$(ARCH)" = "arm64" ]; then \
42+
echo "Copying .arm64 binary to .aarch64"; \
43+
cp $(OUT_DIR)/$(BINARY_NAME).arm64 $(OUT_DIR)/$(BINARY_NAME).aarch64; \
44+
rpmbuild -bb --define "_topdir $(PWD)/rpmbuild" --define "ARCH aarch64" --define "VERSION $(VERSION)" --target aarch64 aproxy.spec; \
4145
else \
42-
echo "Using specified architecture: $(ARCH)"; \
43-
rpmbuild -bb --define "_topdir $(PWD)/rpmbuild" --define "ARCH $(ARCH)" --define "VERSION $(VERSION)" --target $(ARCH) aproxy.spec; \
46+
echo "Using specified architecture: $(ARCH)"; \
47+
rpmbuild -bb --define "_topdir $(PWD)/rpmbuild" --define "ARCH $(ARCH)" --define "VERSION $(VERSION)" --target "$(ARCH)" aproxy.spec; \
4448
fi
4549

4650

0 commit comments

Comments
 (0)