-GOPATH := $(shell realpath "$(PWD)/../../")
+GOPATH := $(shell realpath "$(CURDIR)/../../")
BINARY := sms
-DEPENDENCIES := github.com/golang/dep/cmd/dep
+PLATFORM := linux
export GOPATH ...
+export GO111MODULE=on
-all: build test
-deploy: build test
+all: test build
+deploy: test build
-build: deps format
- $(GOPATH)/bin/dep ensure
- go build -o $(GOPATH)/target/$(BINARY) -v sms.go
+build: clean
+ CGO_ENABLED=0 GOOS=$(PLATFORM) go build -a \
+ -ldflags '-extldflags "-static"' \
+ -o $(GOPATH)/target/$(BINARY) -v sms.go
clean:
go clean
rm -f $(GOPATH)/target/$(BINARY)
test:
- go test -v ./...
+ go test -cover ./...
format:
go fmt ./...
-deps:
- go get -u $(DEPENDENCIES)
\ No newline at end of file
+.PHONY: test