-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (37 loc) · 1021 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
37
38
39
40
41
42
43
44
45
46
# Go settings
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOLINT=golint
GOGET=$(GOCMD) get
# Build settings
BINARY_PATH=./bin/
BINARY_NAME=chaos-proxy
BINARY_LINUX=$(BINARY_NAME)_linux
BINARY_WINDOWS=$(BINARY_NAME).exe
BINARY_MACOS=$(BINARY_NAME)_macos
# Test Settings
TEST_FILES := $(shell $(GOCMD) list ./...)
# Check the OS
UNAME := $(shell uname)
all: deps test
run:
$(GOBUILD) -o $(BINARY_NAME) -v cmd/chaos-proxy/main.go
./$(BINARY_NAME) --config configs/config.yml
build:
$(GOBUILD) -o $(BINARY_PATH)$(BINARY_NAME) -v cmd/chaos-proxy/main.go
test:
mkdir -p report
$(GOTEST) -v -short -covermode=count -coverprofile report/cover.out $(TEST_FILES)
$(GOCMD) tool cover -html=report/cover.out -o report/cover.html
$(GOLINT) -set_exit_status $(TEST_FILES)
ifeq ($(UNAME), Linux)
CC=clang $(GOTEST) -v -msan -short $(TEST_FILES)
endif
staticcheck $(TEST_FILES)
clean:
$(GOCLEAN)
rm -f $(BINARY_PATH)$(BINARY_NAME)
deps:
GO111MODULE=on $(GOCMD) mod vendor