Skip to content

Commit

Permalink
added current platform build rule
Browse files Browse the repository at this point in the history
  • Loading branch information
Shai Nagar committed Jun 17, 2021
1 parent 10d48ec commit c9675c4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ PROJECTNAME := "bert"
PROGRAMNAME := $(PROJECTNAME)

# Go related variables.
GOHOSTOS := $(shell go env GOHOSTOS)
GOHOSTARCH := $(shell go env GOHOSTARCH)
GOBASE := $(shell pwd)
GOBIN := $(GOBASE)/bin
GOBUILD := $(GOBASE)/build
Expand Down Expand Up @@ -62,6 +64,10 @@ go-format:
@echo " > Formating source files..."
gofmt -s -w $(GOFILES)

go-build-current:
@echo " > Building $(GOHOSTOS)/$(GOHOSTARCH) binaries..."
@GOPATH=$(GOPATH) GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) GOBIN=$(GOBIN) go build $(MODFLAGS) $(LDFLAGS) -o $(GOBIN)/$(PROGRAMNAME) $(GOBASE)/cmd

go-build: go-get go-build-linux-amd64 go-build-linux-arm64 go-build-linux-arm go-build-darwin-amd64 go-build-darwin-arm64 go-build-windows-amd64 go-build-windows-arm

go-test:
Expand Down

0 comments on commit c9675c4

Please sign in to comment.