-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (31 loc) · 796 Bytes
/
Makefile
File metadata and controls
43 lines (31 loc) · 796 Bytes
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Makefile for GoDoctor
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_DIR=bin
SERVER_BINARY_NAME=godoctor
SERVER_BINARY=$(BINARY_DIR)/$(SERVER_BINARY_NAME)
# Version
VERSION := 0.14.0
LDFLAGS=-ldflags "-X main.version=$(VERSION)"
all: build
build:
@mkdir -p $(BINARY_DIR)
$(GOBUILD) $(LDFLAGS) -o $(SERVER_BINARY) ./cmd/godoctor
install:
$(GOCMD) install $(LDFLAGS) ./...
clean:
@rm -rf $(BINARY_DIR)
test:
$(GOTEST) -v ./...
test-cov:
$(GOTEST) -v -coverprofile=coverage.out ./...
@echo "to view the coverage report, run: go tool cover -html=coverage.out"
snapshot:
goreleaser release --snapshot --clean
release:
goreleaser release --clean
.PHONY: all build install clean test test-cov snapshot release