summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authors <[email protected]>2025-11-04 11:06:35 -0500
committers <[email protected]>2025-11-04 11:06:35 -0500
commit4486b6659640102dd542fea007f4c33ac02511ff (patch)
tree3e991f3722e3b0062a6078078ff6aa1478c3ab00 /Makefile
parent3c06eede8ac8cb79272601aad3b2d3359657443a (diff)
downloaddborg-4486b6659640102dd542fea007f4c33ac02511ff.tar.gz
dborg-4486b6659640102dd542fea007f4c33ac02511ff.zip
feat: add version checking and auto-update functionality
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 7 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 04e7e39..acb2961 100644
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,19 @@
.PHONY: build build-admin clean install install-admin
+VERSION := $(shell git describe --tags --abbrev=0 2>/dev/null || echo "v0.1.0")
+LDFLAGS := -X git.db.org.ai/dborg/internal/utils.Version=$(VERSION)
+
build:
- go build -o dborg .
+ go build -ldflags "$(LDFLAGS)" -o dborg .
build-admin:
- go build -tags admin -o dborg .
+ go build -tags admin -ldflags "$(LDFLAGS)" -o dborg .
clean:
rm -f dborg
install:
- go install .
+ go install -ldflags "$(LDFLAGS)" .
install-admin:
- go install -tags admin .
+ go install -tags admin -ldflags "$(LDFLAGS)" .