From e3ec518996837a011d7639df11fe3d0cb611cbb5 Mon Sep 17 00:00:00 2001
From: lni <30930154+lni@users.noreply.github.com>
Date: Fri, 27 Aug 2021 08:52:10 +0800
Subject: [PATCH] Add debug build target for Makefile (#526)

---
 Makefile | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Makefile b/Makefile
index 18d456ae5..5a1d9dc37 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,13 @@ config: cmd/generate-config/main.go cmd/generate-config/config_template.go cmd/g
 build: cmd/db-server/main.go
 	go build -o mo-server cmd/db-server/main.go
 
+# Building mo-server binary for debugging, it uses the latest MatrixCube from master.
+.PHONY: debug
+debug: cmd/db-server/main.go
+	go get github.com/matrixorigin/matrixcube
+	go mod tidy
+	go build -tags debug -o mo-server cmd/db-server/main.go
+
 # Running unit test cases
 # Set test timeout to 15 minutes
 # Excluding frontend test cases temporarily
-- 
GitLab