Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Commit

Permalink
Merge pull request #43 from dweomer/arm/v7
Browse files Browse the repository at this point in the history
for GOARCH=arm set GOARM=7 by default
  • Loading branch information
dweomer committed May 10, 2020
2 parents 498f9ea + f45ca0a commit 405e010
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ else
endif
endif

_GO_ENV := GOOS=$(GOOS) GOARCH=$(GOARCH)
ifeq ($(GOARCH),arm)
ifndef GOARM
GOARM ?= 7
endif
_GO_ENV += GOARM=$(GOARM)
endif
GO := $(_GO_ENV) go

ifndef GODEBUG
EXTRA_LDFLAGS += -s -w
DEBUG_GO_GCFLAGS :=
Expand Down Expand Up @@ -90,7 +99,7 @@ ci-shell: clean .dapper ## Launch a shell in the CI environment
dapper-ci: .ci ## Used by Drone CI, does the same as "ci" but in a Drone way

build: ## Build using host go tools
go build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILDFLAGS} -o ${GOBIN}/${PROG} -ldflags "${GO_LDFLAGS}" ${GO_TAGS}
$(GO) build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILDFLAGS} -o ${GOBIN}/${PROG} -ldflags "${GO_LDFLAGS}" ${GO_TAGS}

build-debug: ## Debug build using host go tools
$(MAKE) GODEBUG=y build
Expand All @@ -102,8 +111,8 @@ bin/golangci-lint:
curl -fsL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s ${GOLANGCI_VERSION}

validate: ## Run go fmt/vet
go fmt ./...
go vet ./...
$(GO) fmt ./...
$(GO) vet ./...

validate-ci: validate bin/golangci-lint ## Run more validation for CI
[ "${GOARCH}" != "amd64" ] || ./bin/golangci-lint run
Expand All @@ -112,7 +121,7 @@ run: build-debug
./bin/${PROG} server

bin/dlv:
go build -o bin/dlv github.com/go-delve/delve/cmd/dlv
$(GO) build -o bin/dlv github.com/go-delve/delve/cmd/dlv

remote-debug: build-debug bin/dlv ## Run with remote debugging listening on :2345
./bin/dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec ./bin/${PROG} server
Expand Down

0 comments on commit 405e010

Please sign in to comment.