-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (40 loc) · 952 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
GO ?= go
GOLANGCI_LINT ?= golangci-lint
GOLANGCI_LINT_VERSION ?= v1.30.0
BINARY="faucet-server"
LDFLAGS ?= -s -w
ifdef COMMIT
LDFLAGS += -X github.com/ethersphere/faucet-server.commit="$(COMMIT)"
endif
.PHONY: all
all: build lint vet test binary
.PHONY: binary
binary: export CGO_ENABLED=0
binary: dist
$(GO) version
$(GO) build -trimpath -ldflags "$(LDFLAGS)" -o dist/$(BINARY) ./cmd/faucet-server
dist:
mkdir $@
.PHONY: lint
lint: linter
$(GOLANGCI_LINT) run
.PHONY: linter
linter:
which $(GOLANGCI_LINT) || ( cd /tmp && GO111MODULE=on $(GO) get -u github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) )
.PHONY: vet
vet:
$(GO) vet ./...
.PHONY: test
test:
$(GO) test -v ./...
.PHONY: test-integration
test-integration:
$(GO) test -tags=integration -v ./...
.PHONY: build
build: export CGO_ENABLED=0
build:
$(GO) build -trimpath -ldflags "$(LDFLAGS)" ./...
.PHONY: clean
clean:
$(GO) clean
rm -rf dist/