File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1818 run : |
1919 export GOPATH=$HOME/go && export GOBIN=$(go env GOPATH)/bin && export PATH=$PATH:$GOPATH&& export PATH=$PATH:$GOBIN && mkdir -p $GOBIN
2020
21- make bootstrap build test
21+ make bootstrap build test lint build-cross
Original file line number Diff line number Diff line change @@ -3,6 +3,10 @@ ORG := engineerd
33BINDIR := $(CURDIR ) /bin
44GOFLAGS :=
55LDFLAGS := -w -s
6+ TARGETS := darwin/amd64 linux/amd64 windows/amd64
7+ TAGS :=
8+
9+ GOX = $(GOPATH ) /bin/gox
610
711ifeq ($(OS ) ,Windows_NT)
812 TARGET = $(PROJECT).exe
@@ -22,6 +26,14 @@ build:
2226test :
2327 go test $(TESTFLAGS ) ./...
2428
29+ $(GOX ) :
30+ (cd /; GO111MODULE=on go get -u github.com/mitchellh/gox)
31+
32+ .PHONY : build-cross
33+ build-cross : LDFLAGS += -extldflags "-static"
34+ build-cross : $(GOX )
35+ GO111MODULE=on CGO_ENABLED=0 $(GOX ) -parallel=3 -output=" bin/{{.OS}}-{{.Arch}}/$( PROJECT) " -osarch=' $(TARGETS)' $(GOFLAGS ) -tags ' $(TAGS)' -ldflags ' $(LDFLAGS)' github.com/$(ORG ) /$(PROJECT ) /cmd/...
36+
2537.PHONY : lint
2638lint :
2739 golangci-lint run --config ./golangci.yml
You can’t perform that action at this time.
0 commit comments