forked from neufeldtech/secretmessage-go
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
25 lines (17 loc) · 807 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
M = $(shell printf "\033[34;1m▶\033[0m")
PROJECT_NAME ?= secretmessage
OS := $(shell uname -s)
GOOS ?= $(shell echo $(OS) | tr '[:upper:]' '[:lower:]')
BUILD_OPTS = -gcflags="-trimpath=$(GOPATH)/src"
lint: ; $(info $(M) running linter…) @
golangci-lint run -v
tidy: ; $(info $(M) Cleaning up dependencies…) @
GOPRIVATE=github.com/contentsquare/* go mod tidy
deps: ; $(info $(M) Fetching dependencies…) @
$(info $(PROJECT_NAME))
go mod download
build: deps tidy ; $(info $(M) Building $(PROJECT_NAME)…) @
GOOS=$(GOOS) go build -tags static -o $(PROJECT_NAME) $(BUILD_OPTS) cmd/$(PROJECT_NAME)/*.go
test: deps tidy ; $(info $(M) Testing $(PROJECT_NAME)…) @
GOOS=$(GOOS) go test -v -cover -coverprofile=coverage.out ./...
.PHONY: lint tidy deps build test