forked from corvus-ch/rabbitmq-cli-consumer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (35 loc) · 924 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
47
MAKEFLAGS += --warn-undefined-variables
SHELL := bash
.SHELLFLAGS := -eu -o pipefail -c
.DEFAULT_GOAL := test
.DELETE_ON_ERROR:
.SUFFIXES:
# ---------------------
# Environment variables
# ---------------------
GOPATH ?= $(shell go env GOPATH)
TEST_ARGS ?=
# ------------------
# Internal variables
# ------------------
package_name = rabbitmq-cli-consumer
test_pkgs = $(dir $(wildcard **/*_test.go))
# -------
# Targets
# -------
.PHONY: install
install:
go get -t -d -tags=integration ./...
go get -u github.com/AlekSi/gocoverutil
build: ${package_name}
.PHONY: test
test: c.out
c.out: main.cov $(addsuffix pkg.cov,${test_pkgs})
find . -name '*.cov' -exec gocoverutil -coverprofile=c.out merge {} +
%.cov:
go test -coverprofile $@ -covermode atomic ${TEST_ARGS} ./$(@D)
${package_name}: **/*.go *.go
go build
.PHONY: clean
clean:
rm -rf ${package_name} *.log **/*.log *.cov **/*.cov *.out **/*.out