Skip to content

Commit

Permalink
adjust godeps for multiarch builds
Browse files Browse the repository at this point in the history
  • Loading branch information
morph027 committed Dec 18, 2020
1 parent 64cccab commit 25b2722
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ all: build

GO := $(shell which go)
GOPATH := "$(CURDIR)/vendor:$(CURDIR)"
GOOS ?= linux
GOARCH ?= amd64
BINDIR := "$(CURDIR)/bin"
VERSION := $(shell "$(CURDIR)/scripts/get-version.sh")
TARVERSION := $(shell "$(CURDIR)/scripts/get-version.sh" --tar)
Expand Down Expand Up @@ -35,6 +37,12 @@ ifneq ($(COUNT),)
TESTARGS := $(TESTARGS) -count $(COUNT)
endif

ifeq ($(GOARCH), amd64)
VENDORBIN := $(CURDIR)/vendor/bin
else
VENDORBIN := $(CURDIR)/vendor/bin/$(GOOS)_$(GOARCH)
endif

hook:
[ ! -d "$(CURDIR)/.git/hooks" ] || ln -sf "$(CURDIR)/scripts/pre-commit.hook" "$(CURDIR)/.git/hooks/pre-commit"

Expand All @@ -46,14 +54,14 @@ easyjson: dependencies
GOPATH=$(GOPATH) $(GO) build -o ./vendor/bin/easyjson ./vendor/src/github.com/mailru/easyjson/easyjson/main.go

dependencies: hook godeps
GOPATH=$(GOPATH) ./vendor/bin/godeps -u dependencies.tsv
GOPATH=$(GOPATH) "$(VENDORBIN)/godeps" -u dependencies.tsv

dependencies.tsv: godeps
set -e ;\
TMP=$$(mktemp -d) ;\
echo Make sure to remove $$TMP on error ;\
cp -r "$(CURDIR)/vendor" $$TMP ;\
GOPATH=$$TMP/vendor:"$(CURDIR)" "$(CURDIR)/vendor/bin/godeps" ./src/... > "$(CURDIR)/dependencies.tsv" ;\
GOPATH=$$TMP/vendor:"$(CURDIR)" "$(VENDORBIN)/godeps" ./src/... > "$(CURDIR)/dependencies.tsv" ;\
rm -rf $$TMP

src/signaling/continentmap.go:
Expand Down

0 comments on commit 25b2722

Please sign in to comment.