WIP: use gox for cross platform compiling

This commit is contained in:
Christoph Haas
2021-02-24 22:16:03 +01:00
parent 9b10d099b6
commit 4fe4d93e0d
4 changed files with 39 additions and 8 deletions

View File

@@ -10,15 +10,14 @@ IMAGE=h44z/wg-portal
all: dep build
build: dep $(addsuffix -amd64,$(addprefix $(BUILDDIR)/,$(BINARIES)))
cp scripts/wg-portal.service $(BUILDDIR)
cp scripts/wg-portal.env $(BUILDDIR)
build-cross-plat: dep build $(addsuffix -arm,$(addprefix $(BUILDDIR)/,$(BINARIES))) $(addsuffix -arm64,$(addprefix $(BUILDDIR)/,$(BINARIES)))
build: dep
mkdir -p $(BUILDDIR)
cp scripts/wg-portal.service $(BUILDDIR)
cp scripts/wg-portal.env $(BUILDDIR)
gox -cgo -os="linux" -arch="amd64 arm arm64" -output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags "-X main.Version=`git rev-parse --short HEAD`" -verbose ./...
dep:
$(GOCMD) get github.com/mitchellh/gox
$(GOCMD) mod download
validate: dep