forked from edgexfoundry/export-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (40 loc) · 1.4 KB
/
Makefile
File metadata and controls
57 lines (40 loc) · 1.4 KB
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
47
48
49
50
51
52
53
54
55
56
57
# Copyright 2017 Cavium
#
# SPDX-License-Identifier: Apache-2.0
BUILD_DIR := build
.PHONY: buildall test vet prepare $(BUILD_DIR)/client $(BUILD_DIR)/distro \
$(BUILD_DIR)/distro_zmq docker
# Make exec targets phony to not track changes in go files. Compilation is fast
.PHONY: client distro distro_zmq
default: buildall
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
client: $(BUILD_DIR)
go build -o $(BUILD_DIR)/client cmd/client/main.go
distro: $(BUILD_DIR)
go build -o $(BUILD_DIR)/distro cmd/distro/main.go
distro_zmq: $(BUILD_DIR)
go build -o $(BUILD_DIR)/distro_zmq -tags zeromq cmd/distro/main.go
buildall: client distro distro_zmq
docker:
docker build -f Dockerfile.client .
docker build -f Dockerfile.distro .
test:
go test `glide novendor`
vet:
go vet `glide novendor`
coverage: $(BUILD_DIR)
go test -covermode=count -coverprofile=$(BUILD_DIR)/cov.out ./distro
go tool cover -html=$(BUILD_DIR)/cov.out -o $(BUILD_DIR)/distroCoverage.html
go test -covermode=count -coverprofile=$(BUILD_DIR)/cov.out ./client
go tool cover -html=$(BUILD_DIR)/cov.out -o $(BUILD_DIR)/clientCoverage.html
rm $(BUILD_DIR)/cov.out
bench: $(BUILD_DIR)
go test -run=XXX -bench=. ./distro
profile: $(BUILD_DIR)
go test -run=XXX -bench=. -cpuprofile $(BUILD_DIR)/distro.cpu ./distro
go test -run=XXX -bench=. -memprofile $(BUILD_DIR)/distro.mem ./distro
prepare:
glide install
clean:
rm -rf $(BUILD_DIR) distro.test