-
Notifications
You must be signed in to change notification settings - Fork 136
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (47 loc) · 1.42 KB
/
Copy pathMakefile
File metadata and controls
62 lines (47 loc) · 1.42 KB
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
# Basic Go makefile
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
DIRS=`go list ./...`
PYTHON=python3
PIP=$(PYTHON) -m pip
GIT_COMMIT=`git rev-parse --short HEAD`
VERS_DATE=`date -u +%Y-%m-%d\ %H:%M`
LDFLAGS=-X 'main.GitCommit=$(GIT_COMMIT)' -X 'main.VersionDate=$(VERS_DATE) UTC'
all: build
build:
@echo "GO111MODULE = $(value GO111MODULE)"
$(GOBUILD) -v -ldflags "$(LDFLAGS)" $(DIRS)
test:
@echo "GO111MODULE = $(value GO111MODULE)"
$(GOTEST) -v $(DIRS)
clean:
@echo "GO111MODULE = $(value GO111MODULE)"
$(GOCLEAN) ./...
fmts:
gofmt -s -w .
vet:
@echo "GO111MODULE = $(value GO111MODULE)"
$(GOCMD) vet $(DIRS) | grep -v unkeyed
tidy: export GO111MODULE = on
tidy:
@echo "GO111MODULE = $(value GO111MODULE)"
go mod tidy
mod-update: export GO111MODULE = on
mod-update:
@echo "GO111MODULE = $(value GO111MODULE)"
go get -u ./...
go mod tidy
prereq:
@echo "Installing python prerequisites -- ignore err if already installed:"
- $(PIP) install -r requirements.txt
@echo
@echo "if this fails, you may see errors like this:"
@echo " Undefined symbols for architecture x86_64:"
@echo " _PyInit__gi, referenced from:..."
@echo
# Releases are managed by release-please (.github/workflows/release-please.yml):
# merging its release PR to master bumps version.go, tags the commit, and
# publishes the GitHub Release. GoReleaser then builds & uploads binaries to it.