Skip to content

Commit 51292e4

Browse files
authored
Makefile: allow for gotip (#928)
This allows `make GO=gotip build` to work.
1 parent ff1dab4 commit 51292e4

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Makefile

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
all: build
22

33
GO111MODULE=on
4+
MYSQL_VERSION ?= 8.0
5+
GO ?= go
46

57
build:
6-
go build -o bin/go-mysqlbinlog cmd/go-mysqlbinlog/main.go
7-
go build -o bin/go-mysqldump cmd/go-mysqldump/main.go
8-
go build -o bin/go-canal cmd/go-canal/main.go
9-
go build -o bin/go-binlogparser cmd/go-binlogparser/main.go
8+
${GO} build -o bin/go-mysqlbinlog cmd/go-mysqlbinlog/main.go
9+
${GO} build -o bin/go-mysqldump cmd/go-mysqldump/main.go
10+
${GO} build -o bin/go-canal cmd/go-canal/main.go
11+
${GO} build -o bin/go-binlogparser cmd/go-binlogparser/main.go
1012

1113
test:
12-
go test --race -timeout 2m ./...
14+
${GO} test --race -timeout 2m ./...
1315

14-
MYSQL_VERSION ?= 8.0
1516
test-local:
1617
docker run --rm -d --network=host --name go-mysql-server \
1718
-e MYSQL_ALLOW_EMPTY_PASSWORD=true \
1819
-e MYSQL_DATABASE=test \
1920
-v $${PWD}/docker/resources/replication.cnf:/etc/mysql/conf.d/replication.cnf \
2021
mysql:$(MYSQL_VERSION)
2122
docker/resources/waitfor.sh 127.0.0.1 3306 \
22-
&& go test -race -v -timeout 2m ./...
23+
&& ${GO} test -race -v -timeout 2m ./...
2324
docker stop go-mysql-server
2425

2526
fmt:
2627
golangci-lint run --fix
2728

2829
clean:
29-
go clean -i ./...
30+
${GO} clean -i ./...
3031
@rm -rf ./bin

0 commit comments

Comments
 (0)