summaryrefslogtreecommitdiffstats
path: root/lib/version.mk
diff options
context:
space:
mode:
Diffstat (limited to 'lib/version.mk')
-rw-r--r--lib/version.mk19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/version.mk b/lib/version.mk
new file mode 100644
index 0000000..66ddca8
--- /dev/null
+++ b/lib/version.mk
@@ -0,0 +1,19 @@
+# Copyright 2022 Alejandro Colomar <alx@kernel.org>
+# SPDX-License-Identifier: LGPL-3.0-or-later WITH LGPL-3.0-linking-exception
+
+
+ifndef LIB_VERSION_MK_
+LIB_VERSION_MK_ := 1
+
+
+include $(srcdir)/lib/cmd.mk
+include $(srcdir)/lib/verbose.mk
+
+
+libname := libc-str-len
+DISTVERSION := $(patsubst v%,%,$(shell $(GIT) describe $(HIDE_ERR) || $(ECHO) unreleased))
+DISTNAME := $(libname)-$(DISTVERSION)
+MAJOR_VERSION := $(shell $(ECHO) $(DISTVERSION) | $(CUT) -f1 -d. )
+
+
+endif # include guard