-
Notifications
You must be signed in to change notification settings - Fork 38
/
Makefile
53 lines (40 loc) · 908 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
48
49
50
51
52
53
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)
GORELEASER ?= goreleaser
TEST_ARGS ?=
# ------------------
# Internal variables
# ------------------
binary_name = rabbitmq-cli-consumer
cover_file = c.out
# -------
# Targets
# -------
.PHONY: deps
deps:
go mod download
.PHONY: test
test: $(cover_file) $(binary_name)
$(cover_file): $(wildcard **/*_test.go)
go test -covermode=atomic -coverprofile=$@ $(TEST_ARGS) ./...
.PHONY: build
build: $(binary_name)
$(binary_name): $(wildcard **/*.go)
go build
.PHONY: release
release:
$(GORELEASER) --rm-dist
.PHONY: snapshot
snapshot:
$(GORELEASER) --rm-dist --snapshot
.PHONY: clean
clean:
rm -rf $(binary_name) $(cover_file) *.log **/*.log