From d7994e7a02e4f045093d8d617924c162dbe3be06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Sat, 26 Oct 2024 10:15:17 +0200 Subject: [PATCH] Makefile: allow for gotip This allows `make GO=gotip build` to work. --- Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 480b6a874..90930f3b2 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,18 @@ all: build GO111MODULE=on +MYSQL_VERSION ?= 8.0 +GO ?= go build: - go build -o bin/go-mysqlbinlog cmd/go-mysqlbinlog/main.go - go build -o bin/go-mysqldump cmd/go-mysqldump/main.go - go build -o bin/go-canal cmd/go-canal/main.go - go build -o bin/go-binlogparser cmd/go-binlogparser/main.go + ${GO} build -o bin/go-mysqlbinlog cmd/go-mysqlbinlog/main.go + ${GO} build -o bin/go-mysqldump cmd/go-mysqldump/main.go + ${GO} build -o bin/go-canal cmd/go-canal/main.go + ${GO} build -o bin/go-binlogparser cmd/go-binlogparser/main.go test: - go test --race -timeout 2m ./... + ${GO} test --race -timeout 2m ./... -MYSQL_VERSION ?= 8.0 test-local: docker run --rm -d --network=host --name go-mysql-server \ -e MYSQL_ALLOW_EMPTY_PASSWORD=true \ @@ -19,12 +20,12 @@ test-local: -v $${PWD}/docker/resources/replication.cnf:/etc/mysql/conf.d/replication.cnf \ mysql:$(MYSQL_VERSION) docker/resources/waitfor.sh 127.0.0.1 3306 \ - && go test -race -v -timeout 2m ./... + && ${GO} test -race -v -timeout 2m ./... docker stop go-mysql-server fmt: golangci-lint run --fix clean: - go clean -i ./... + ${GO} clean -i ./... @rm -rf ./bin