Add multiarch targets
This commit is contained in:
parent
c057514cb7
commit
4e05f18091
11
Makefile
11
Makefile
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user