add goarm handling in makefile

This commit is contained in:
Robert Kaussow 2023-01-14 14:56:35 +01:00
parent 3327233207
commit c33cee03dc
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
2 changed files with 4 additions and 2 deletions

View File

@ -37,5 +37,4 @@ RUN apk --update add --virtual .build-deps curl && \
rm -rf /tmp/* rm -rf /tmp/*
COPY --from=build /src/dist/drone-docker-buildx /bin/drone-docker-buildx COPY --from=build /src/dist/drone-docker-buildx /bin/drone-docker-buildx
ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "drone-docker-buildx"] ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "drone-docker-buildx"]

View File

@ -24,6 +24,9 @@ XGO_TARGETS ?= linux/amd64,linux/arm64
TARGETOS ?= linux TARGETOS ?= linux
TARGETARCH ?= amd64 TARGETARCH ?= amd64
ifneq ("$(TARGETVARIANT)","")
GOARM ?= $(subst v,,$(TARGETVARIANT))
endif
TAGS ?= netgo TAGS ?= netgo
ifndef VERSION ifndef VERSION
@ -71,7 +74,7 @@ test:
build: $(DIST)/$(EXECUTABLE) build: $(DIST)/$(EXECUTABLE)
$(DIST)/$(EXECUTABLE): $(SOURCES) $(DIST)/$(EXECUTABLE): $(SOURCES)
GOOS=${TARGETOS} GOARCH=${TARGETARCH} $(GO) build -v -tags '$(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -o $@ ./cmd/$(EXECUTABLE) GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOARM=$(GOARM) $(GO) build -v -tags '$(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -o $@ ./cmd/$(EXECUTABLE)
$(DIST_DIRS): $(DIST_DIRS):
mkdir -p $(DIST_DIRS) mkdir -p $(DIST_DIRS)