mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-cbc.git
synced 2025-10-23 00:12:21 +00:00
Generate a version.h file
Related: OS#6626 Change-Id: Ia4ccdc833b95cd60fc27e7d73b55c99c1a0a8d7d
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -62,3 +62,4 @@ doc/manuals/vty/cbc_vty_reference.xml
|
||||
|
||||
contrib/osmo-cbc.spec
|
||||
libosmo-sbcap.pc
|
||||
include/osmocom/sbcap/version.h
|
||||
|
@@ -1,3 +1,16 @@
|
||||
version.h: version.h.tpl
|
||||
$(AM_V_GEN)$(MKDIR_P) $(dir $@)
|
||||
$(AM_V_GEN)sed \
|
||||
-e "s/{{VERSION}}/$$(echo '@VERSION@' | cut -d. -f1-3)/g" \
|
||||
-e "s/{{VERSION_MAJOR}}/$$(echo '@VERSION@' | cut -d. -f1)/g" \
|
||||
-e "s/{{VERSION_MINOR}}/$$(echo '@VERSION@' | cut -d. -f2)/g" \
|
||||
-e "s/{{VERSION_PATCH}}/$$(echo '@VERSION@' | cut -d. -f3)/g" \
|
||||
$< > $@
|
||||
|
||||
EXTRA_DIST = \
|
||||
version.h.tpl \
|
||||
$(NULL)
|
||||
|
||||
sbcap_HEADERS = \
|
||||
sbcap_common.h \
|
||||
sbcap_internal.h \
|
||||
@@ -115,6 +128,7 @@ sbcap_HEADERS = \
|
||||
SBcAP_Write-Replace-Warning-Indication.h \
|
||||
SBcAP_Write-Replace-Warning-Request.h \
|
||||
SBcAP_Write-Replace-Warning-Response.h \
|
||||
version.h \
|
||||
$(NULL)
|
||||
|
||||
sbcapdir = $(includedir)/osmocom/sbcap
|
||||
|
16
include/osmocom/sbcap/version.h.tpl
Normal file
16
include/osmocom/sbcap/version.h.tpl
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#define LIBOSMO_SBCAP_VERSION {{VERSION}}
|
||||
#define LIBOSMO_SBCAP_VERSION_STR "{{VERSION}}"
|
||||
|
||||
#define LIBOSMO_SBCAP_VERSION_MAJOR {{VERSION_MAJOR}}
|
||||
#define LIBOSMO_SBCAP_VERSION_MINOR {{VERSION_MINOR}}
|
||||
#define LIBOSMO_SBCAP_VERSION_PATCH {{VERSION_PATCH}}
|
||||
|
||||
#define LIBOSMO_SBCAP_VERSION_GREATER_EQUAL(major, minor, patch) \
|
||||
(LIBOSMO_SBCAP_VERSION_MAJOR > (major) || \
|
||||
(LIBOSMO_SBCAP_VERSION_MAJOR == (major) && \
|
||||
LIBOSMO_SBCAP_VERSION_MINOR > (minor)) || \
|
||||
(LIBOSMO_SBCAP_VERSION_MAJOR == (major) && \
|
||||
LIBOSMO_SBCAP_VERSION_MINOR == (minor) && \
|
||||
LIBOSMO_SBCAP_VERSION_PATCH >= (patch)))
|
Reference in New Issue
Block a user