From fb319d56c596114542d8319b8c4f690cf0867ad6 Mon Sep 17 00:00:00 2001 From: wayblink Date: Wed, 14 Aug 2024 15:00:15 +0800 Subject: [PATCH] Add Makefile Signed-off-by: wayblink --- Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..ebdbb2b5 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +# Variables +BINARY_NAME=milvus-backup +VERSION=$(shell git describe --tags --always --dirty) +COMMIT=$(shell git rev-parse --short HEAD) +DATE=$(shell date -u '+%Y-%m-%dT%H:%M:%SZ') + +# Default target +all: gen build + +# Build the binary +build: + @echo "Building binary..." + GO111MODULE=on CGO_ENABLED=0 go build -ldflags "-X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.date=$(DATE)" -o $(BINARY_NAME) + +gen: + ./scripts/gen_swag.sh + ./scripts/gen_proto.sh + +.PHONY: all build gen \ No newline at end of file