Create binaries for armv7 and arm64 ()

This commit is contained in:
Antonio Navarro Perez 2021-12-19 03:00:51 -08:00 committed by GitHub
parent 36cc016f9d
commit a1b8cd1c7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 28 deletions

View file

@ -5,10 +5,6 @@ BUILD := $(shell git rev-parse --short HEAD)
BIN_OUTPUT ?= bin/distribyted-$(VERSION)-`go env GOOS`-`go env GOARCH``go env GOEXE`
PROJECTNAME := $(shell basename "$(PWD)")
go-cross-compile: GOPATH=~/go
go-cross-compile: ORGPATH=$(GOPATH)/src/github.com/distribyted
go-cross-compile: REPOPATH=$(ORGPATH)/distribyted
# Use linker flags to provide version/build settings
LDFLAGS=-X=main.Version=$(VERSION) -X=main.Build=$(BUILD) -linkmode external
@ -30,9 +26,6 @@ test-race:
test:
CGO_ENABLED=1 go test -v -coverprofile=coverage.out ./...
## cross-compile: compile for other platforms using xgo.
cross-compile: go-generate go-cross-compile
go-build:
@echo " > Building binary on $(BIN_OUTPUT)..."
go build -o $(BIN_OUTPUT) -tags "release" -ldflags='$(LDFLAGS)' cmd/distribyted/main.go
@ -41,15 +34,6 @@ go-generate:
@echo " > Generating code files..."
go generate ./...
go-cross-compile:
@echo " > Compiling for several platforms..."
go install src.techknowlogick.com/xgo@latest
docker build ./build_tools/ -t distribyted/xgo-cgofuse
mkdir -p $(ORGPATH)
ln -sfrnT . $(REPOPATH)
GOPATH=$(GOPATH) xgo -out bin/distribyted-$(VERSION) -image=distribyted/xgo-cgofuse -ldflags='$(LDFLAGS)' -tags="release" -targets=linux/arm-7 $(REPOPATH)
.PHONY: help
all: help
help: Makefile