Skip to content

Commit 1630159

Browse files
committed
version: improve version tagging on release
1 parent 6f939eb commit 1630159

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

libzdb/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ endif
1313

1414
# grab version from git, if possible
1515
REVISION := $(shell git describe --abbrev=8 --dirty --always --tags)
16-
ifneq ($(REVISION),)
17-
CFLAGS += -DZDB_REVISION=\"$(REVISION)\"
16+
ifeq ($(REVISION),)
17+
REVISION := $(shell grep ZDB_VERSION libzdb.h | awk '{ print $$3 }' | sed s/'"'//g)
1818
endif
1919

20+
# add revision to build
21+
CFLAGS += -DZDB_REVISION=\"$(REVISION)\"
22+
2023
ifeq ($(STATIC),1)
2124
LDFLAGS += -static
2225
endif

zdbd/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ endif
1313

1414
# grab version from git, if possible
1515
REVISION := $(shell git describe --abbrev=8 --dirty --always --tags)
16-
ifneq ($(REVISION),)
17-
CFLAGS += -DZDBD_REVISION=\"$(REVISION)\"
16+
ifeq ($(REVISION),)
17+
REVISION := $(shell grep ZDBD_VERSION zdbd.h | awk '{ print $$3 }' | sed s/'"'//g)
1818
endif
1919

20+
CFLAGS += -DZDBD_REVISION=\"$(REVISION)\"
21+
2022
ifeq ($(STATIC),1)
2123
LDFLAGS += -static
2224
endif

0 commit comments

Comments
 (0)