summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
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)" .