-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
80 lines (55 loc) · 1.33 KB
/
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#
# Generated by @zondax/cli
#
-include Makefile.settings.mk
# Get all directories under cmd
CMDS=$(shell find cmd -type d)
# Strip cmd/ from directory names and generate output binary names
BINS=$(subst cmd/,output/,$(CMDS))
default: build
mod-tidy:
@go mod tidy
mod-update:
@go get -u ./...
generate: mod-tidy
go generate ./internal/...
output/%: cmd/%
mkdir -p $(dir $@)
go build -o $@ ./$<
build: generate $(BINS)
@[ -e main.go ] && go build -v -o output/$(APP_NAME) || true
run: build
./output/$(APP_NAME) start
version: build
./output/$(APP_NAME) version
clean:
go clean
gitclean:
git clean -xfd
git submodule foreach --recursive git clean -xfd
install_lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin latest
check-modtidy:
go mod tidy
git diff --exit-code -- go.mod go.sum
fmt:
gofmt -l -s -w .
vet:
go vet ./...
lint:
golangci-lint --version
golangci-lint run
test:
go test -v -race ./...
earthly:
earthly +all
docker-bash:
docker run --platform linux/amd64 -it zondax/${APP_NAME}:latest /bin/sh
docker-run:
docker run --platform linux/amd64 -it zondax/${APP_NAME}:latest
########################################
zondax-update:
@npx -y @zondax/cli@latest update
# include if exists
-include Makefile.local.mk
.PHONY: *