forked from pingcap/dumpling
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
21 lines (16 loc) · 762 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
LDFLAGS += -X "github.com/pingcap/dumpling/v4/cli.ReleaseVersion=$(shell git describe --tags --dirty="-dev")"
LDFLAGS += -X "github.com/pingcap/dumpling/v4/cli.BuildTimestamp=$(shell date -u '+%Y-%m-%d %I:%M:%S')"
LDFLAGS += -X "github.com/pingcap/dumpling/v4/cli.GitHash=$(shell git rev-parse HEAD)"
LDFLAGS += -X "github.com/pingcap/dumpling/v4/cli.GitBranch=$(shell git rev-parse --abbrev-ref HEAD)"
LDFLAGS += -X "github.com/pingcap/dumpling/v4/cli.GoVersion=$(shell go version)"
GO = go
GOFLAGS = -ldflags '$(LDFLAGS)'
ifeq ("$(WITH_RACE)", "1")
GOFLAGS += -race
endif
.PHONY: build test
build: bin/dumpling
bin/%: cmd/%/main.go $(wildcard v4/**/*.go)
$(GO) build $(GOFLAGS) -tags codes -o $@ $<
test:
$(GO) list ./... | xargs $(GO) test $(GOFLAGS)