-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (34 loc) · 741 Bytes
/
Makefile
File metadata and controls
45 lines (34 loc) · 741 Bytes
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
GO ?= go
GOLANGCI_LINT ?= golangci-lint
GOLANGCI_LINT_VERSION ?= v2.5.0
.PHONY: binary
binary: dist FORCE
$(GO) version
ifeq ($(OS),Windows_NT)
$(GO) build -o dist/batch-export.exe .
else
$(GO) build -o dist/batch-export .
endif
dist:
mkdir $@
.PHONY: lint
lint: linter
$(GOLANGCI_LINT) run
.PHONY: linter
linter:
which $(GOLANGCI_LINT) || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$($(GO) env GOPATH)/bin $(GOLANGCI_LINT_VERSION)
.PHONY: vet
vet:
$(GO) vet ./...
.PHONY: build
build: export CGO_ENABLED=0
build:
$(GO) build -trimpath -ldflags "$(LDFLAGS)" ./...
.PHONY: clean
clean:
$(GO) clean
rm -rf dist/
.PHONY: test
test:
$(GO) test -v ./pkg/...
FORCE: