forked from BonnierNews/logstash_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (33 loc) · 917 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
all: clean format golint
include Makefile.common
TARGET ?= logstash_exporter
GOLINTER ?= $(GOPATH)/bin/golangci-lint
vendor:
@echo ">> installing dependencies on vendor"
@$(GO) mod vendor
test:
@echo ">> running tests"
@$(GO) test -short $(pkgs)
format:
@echo ">> formatting code"
@$(GO) fmt $(pkgs)
golint:
@echo ">> linting code"
@$(GOLINTER) run
build: promu vendor
@echo ">> building binaries"
GO111MODULE=$(GO111MODULE) $(PROMU) build --prefix $(PREFIX)
crossbuild: promu vendor
@echo ">> cross-building binaries"
@$(PROMU) crossbuild
tarball: promu vendor
@echo ">> building release tarball"
@$(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR)
tarballs: promu vendor
@echo ">> building release tarballs"
@$(PROMU) crossbuild tarballs $(BIN_DIR)
clean:
@echo ">> Cleaning up"
@find . -type f -name '*~' -exec rm -fv {} \;
@rm -fv $(TARGET)
.PHONY: all clean format golint build test