forked from peak/s5cmd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (31 loc) · 780 Bytes
/
Makefile
File metadata and controls
43 lines (31 loc) · 780 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
SRCDIR ?= .
default: all
.PHONY: all
all: clean build test vet staticcheck check-fmt
.PHONY: dist
dist: generate all
.PHONY: fmt
fmt:
@find ${SRCDIR} ! -path "*/vendor/*" -type f -name '*.go' -exec gofmt -l -s -w {} \;
.PHONY: generate
generate:
@go generate ${SRCDIR}
.PHONY: build
build:
@go build ${GCFLAGS} -ldflags "${LDFLAGS}" ${SRCDIR}
.PHONY: test
test:
@go test -mod=vendor ./...
.PHONY: staticcheck
staticcheck:
@staticcheck -checks 'inherit,-SA4009,-U1000' ./...
.PHONY: vet
vet:
@go vet -mod=vendor ./...
.PHONY: check-fmt
check-fmt:
@sh -c 'unfmt_files="$$(go fmt ./...)"; if [ -n "$$unfmt_files" ]; then echo "$$unfmt_files"; echo "Go code is not formatted, run <make fmt>"; exit 1; fi'
.PHONY: clean
clean:
@rm -f ${SRCDIR}/s5cmd
.NOTPARALLEL: