Add multiarch targets
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
IamTheFij 2024-10-18 15:59:17 -07:00
parent c057514cb7
commit 4e05f18091

View File

@ -12,6 +12,17 @@ TARGETS = $(addprefix dist/,$(TARGET_ALIAS))
.PHONY: all
all: $(TARGETS)
## Multi-arch targets
$(TARGETS): $(GOFILES)
mkdir -p ./dist
GOOS=$(word 2, $(subst -, ,$(@))) GOARCH=$(word 3, $(subst -, ,$(@))) CGO_ENABLED=0 \
go build -ldflags '-X "main.version=${VERSION}"' -a -installsuffix nocgo \
-o $@
.PHONY: $(TARGET_ALIAS)
$(TARGET_ALIAS):
$(MAKE) $(addprefix dist/,$@)
# Build app for the current machine
$(APP_NAME): $(GOFILES)
@echo Version: $(VERSION)