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