-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (26 loc) · 937 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
26
27
28
29
30
31
32
33
34
35
36
.PHONY: all
OS = linux
AGENT_BUILD_NAME = agent
PATH_MAIN_AGENT_GO = ./cmd/agent/main.go
SERVER_BUILD_NAME = server
PATH_MAIN_SERVER_GO = ./cmd/server/main.go
all: clean get build-agent build-server
build-agent:
@echo " > Building agent"
@CGO_ENABLED=0 GOOS=$(OS) go build -ldflags "-w" -a -o $(AGENT_BUILD_NAME) $(PATH_MAIN_AGENT_GO)
build-server:
@echo " > Building server"
@CGO_ENABLED=0 GOOS=$(OS) go build -ldflags "-w" -a -o $(SERVER_BUILD_NAME) $(PATH_MAIN_SERVER_GO)
gotest:
go test `go list ./... | grep -v test` -count 1
gotestcover:
go test -covermode=count -coverprofile=coverage.out $(shell go list ./... | egrep -v '(/test|/test/mock)$$') && go tool cover -func coverage.out
get:
@echo " > Checking dependencies"
@go mod download
@go install $(PATH_MAIN_AGENT_GO)
@go install $(PATH_MAIN_SERVER_GO)
clean:
@echo " > Clearing folder"
@rm -f ./$(AGENT_BUILD_NAME)
@rm -f ./$(SERVER_BUILD_NAME)