Skip to content

Commit

Permalink
Add Makefile
Browse files Browse the repository at this point in the history
Signed-off-by: wayblink <[email protected]>
  • Loading branch information
wayblink committed Aug 14, 2024
1 parent cd087e4 commit fb319d5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fb319d5

Please sign in to comment.