[M] Change in osmo-iuh[master]: Generate version.h files
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-iuh/+/40515?usp=email ) Change subject: Generate version.h files ...................................................................... Generate version.h files Related: OS#6626 Change-Id: I7cba0d32f024797e1360ed250a2e4f2d8ca501ee --- M .gitignore M include/osmocom/hnbap/Makefile.am A include/osmocom/hnbap/version.h.tpl M include/osmocom/ranap/Makefile.am A include/osmocom/ranap/version.h.tpl M include/osmocom/rua/Makefile.am A include/osmocom/rua/version.h.tpl M include/osmocom/sabp/Makefile.am A include/osmocom/sabp/version.h.tpl 9 files changed, 123 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/15/40515/1 diff --git a/.gitignore b/.gitignore index 209421b..48dd415 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,4 @@ doc/manuals/*.pdf contrib/osmo-iuh.spec +include/osmocom/*/version.h diff --git a/include/osmocom/hnbap/Makefile.am b/include/osmocom/hnbap/Makefile.am index 6db9966..7c3469d 100644 --- a/include/osmocom/hnbap/Makefile.am +++ b/include/osmocom/hnbap/Makefile.am @@ -1,3 +1,12 @@ +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" \ + $< > $@ + hnbap_HEADERS = \ hnbap_common.h hnbap_ies_defs.h \ HNBAP_AccessResult.h \ @@ -115,9 +124,13 @@ HNBAP_U-RNTI.h \ HNBAP_U-RNTIQueryRequest.h \ HNBAP_U-RNTIQueryResponse.h \ - HNBAP_UTRANCellID.h + HNBAP_UTRANCellID.h \ + version.h \ + $(NULL) hnbapdir = $(includedir)/osmocom/hnbap DISTCLEANFILES = \ - hnbap_ies_defs.h + hnbap_ies_defs.h \ + version.h \ + $(NULL) diff --git a/include/osmocom/hnbap/version.h.tpl b/include/osmocom/hnbap/version.h.tpl new file mode 100644 index 0000000..4ad1c79 --- /dev/null +++ b/include/osmocom/hnbap/version.h.tpl @@ -0,0 +1,16 @@ +#pragma once + +#define LIBOSMO_HNBAP_VERSION {{VERSION}} +#define LIBOSMO_HNBAP_VERSION_STR "{{VERSION}}" + +#define LIBOSMO_HNBAP_VERSION_MAJOR {{VERSION_MAJOR}} +#define LIBOSMO_HNBAP_VERSION_MINOR {{VERSION_MINOR}} +#define LIBOSMO_HNBAP_VERSION_PATCH {{VERSION_PATCH}} + +#define LIBOSMO_HNBAP_VERSION_GREATER_EQUAL(major, minor, patch) \ + (LIBOSMO_HNBAP_VERSION_MAJOR > (major) || \ + (LIBOSMO_HNBAP_VERSION_MAJOR == (major) && \ + LIBOSMO_HNBAP_VERSION_MINOR > (minor)) || \ + (LIBOSMO_HNBAP_VERSION_MAJOR == (major) && \ + LIBOSMO_HNBAP_VERSION_MINOR == (minor) && \ + LIBOSMO_HNBAP_VERSION_PATCH >= (patch))) diff --git a/include/osmocom/ranap/Makefile.am b/include/osmocom/ranap/Makefile.am index 71e2feb..deb2281 100644 --- a/include/osmocom/ranap/Makefile.am +++ b/include/osmocom/ranap/Makefile.am @@ -6,6 +6,15 @@ ranap_ies_defs.h: $(MAKE) -C $(top_builddir)/src/ gen_ranap.stamp +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" \ + $< > $@ + ranap_HEADERS = \ ranap_ies_defs.h \ ranap_common.h \ @@ -605,9 +614,13 @@ RANAP_VerticalAccuracyCode.h \ RANAP_VerticalSpeedDirection.h \ RANAP_VerticalVelocity.h \ - RANAP_VoiceSupportMatchIndicator.h + RANAP_VoiceSupportMatchIndicator.h \ + version.h \ + $(NULL) ranapdir = $(includedir)/osmocom/ranap DISTCLEANFILES = \ - ranap_ies_defs.h + ranap_ies_defs.h \ + version.h \ + $(NULL) diff --git a/include/osmocom/ranap/version.h.tpl b/include/osmocom/ranap/version.h.tpl new file mode 100644 index 0000000..1a2f117 --- /dev/null +++ b/include/osmocom/ranap/version.h.tpl @@ -0,0 +1,16 @@ +#pragma once + +#define LIBOSMO_RANAP_VERSION {{VERSION}} +#define LIBOSMO_RANAP_VERSION_STR "{{VERSION}}" + +#define LIBOSMO_RANAP_VERSION_MAJOR {{VERSION_MAJOR}} +#define LIBOSMO_RANAP_VERSION_MINOR {{VERSION_MINOR}} +#define LIBOSMO_RANAP_VERSION_PATCH {{VERSION_PATCH}} + +#define LIBOSMO_RANAP_VERSION_GREATER_EQUAL(major, minor, patch) \ + (LIBOSMO_RANAP_VERSION_MAJOR > (major) || \ + (LIBOSMO_RANAP_VERSION_MAJOR == (major) && \ + LIBOSMO_RANAP_VERSION_MINOR > (minor)) || \ + (LIBOSMO_RANAP_VERSION_MAJOR == (major) && \ + LIBOSMO_RANAP_VERSION_MINOR == (minor) && \ + LIBOSMO_RANAP_VERSION_PATCH >= (patch))) diff --git a/include/osmocom/rua/Makefile.am b/include/osmocom/rua/Makefile.am index e85f1e6..b915eed 100644 --- a/include/osmocom/rua/Makefile.am +++ b/include/osmocom/rua/Makefile.am @@ -1,3 +1,12 @@ +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" \ + $< > $@ + rua_HEADERS = \ rua_common.h rua_ies_defs.h rua_msg_factory.h \ RUA_Ansi-41-IDNNS.h \ @@ -35,9 +44,13 @@ RUA_SuccessfulOutcome.h \ RUA_TriggeringMessage.h \ RUA_TypeOfError.h \ - RUA_UnsuccessfulOutcome.h + RUA_UnsuccessfulOutcome.h \ + version.h \ + $(NULL) ruadir = $(includedir)/osmocom/rua DISTCLEANFILES = \ - rua_ies_defs.h + rua_ies_defs.h \ + version.h \ + $(NULL) diff --git a/include/osmocom/rua/version.h.tpl b/include/osmocom/rua/version.h.tpl new file mode 100644 index 0000000..60fe1cd --- /dev/null +++ b/include/osmocom/rua/version.h.tpl @@ -0,0 +1,16 @@ +#pragma once + +#define LIBOSMO_RUA_VERSION {{VERSION}} +#define LIBOSMO_RUA_VERSION_STR "{{VERSION}}" + +#define LIBOSMO_RUA_VERSION_MAJOR {{VERSION_MAJOR}} +#define LIBOSMO_RUA_VERSION_MINOR {{VERSION_MINOR}} +#define LIBOSMO_RUA_VERSION_PATCH {{VERSION_PATCH}} + +#define LIBOSMO_RUA_VERSION_GREATER_EQUAL(major, minor, patch) \ + (LIBOSMO_RUA_VERSION_MAJOR > (major) || \ + (LIBOSMO_RUA_VERSION_MAJOR == (major) && \ + LIBOSMO_RUA_VERSION_MINOR > (minor)) || \ + (LIBOSMO_RUA_VERSION_MAJOR == (major) && \ + LIBOSMO_RUA_VERSION_MINOR == (minor) && \ + LIBOSMO_RUA_VERSION_PATCH >= (patch))) diff --git a/include/osmocom/sabp/Makefile.am b/include/osmocom/sabp/Makefile.am index 848bb39..1de4c1f 100644 --- a/include/osmocom/sabp/Makefile.am +++ b/include/osmocom/sabp/Makefile.am @@ -6,6 +6,15 @@ sabp_ies_defs.h: $(MAKE) -C $(top_builddir)/src/ gen_sabp.stamp +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" \ + $< > $@ + sabp_HEADERS = \ sabp_ies_defs.h \ sabp_common.h \ @@ -72,9 +81,12 @@ SABP_Failure.h \ SABP_Error-Indication.h \ SABP_IE.h \ + version.h \ $(NULL) sabpdir = $(includedir)/osmocom/sabp DISTCLEANFILES = \ - sabp_ies_defs.h + sabp_ies_defs.h \ + version.h \ + $(NULL) diff --git a/include/osmocom/sabp/version.h.tpl b/include/osmocom/sabp/version.h.tpl new file mode 100644 index 0000000..d7487ec --- /dev/null +++ b/include/osmocom/sabp/version.h.tpl @@ -0,0 +1,16 @@ +#pragma once + +#define LIBOSMO_SABP_VERSION {{VERSION}} +#define LIBOSMO_SABP_VERSION_STR "{{VERSION}}" + +#define LIBOSMO_SABP_VERSION_MAJOR {{VERSION_MAJOR}} +#define LIBOSMO_SABP_VERSION_MINOR {{VERSION_MINOR}} +#define LIBOSMO_SABP_VERSION_PATCH {{VERSION_PATCH}} + +#define LIBOSMO_SABP_VERSION_GREATER_EQUAL(major, minor, patch) \ + (LIBOSMO_SABP_VERSION_MAJOR > (major) || \ + (LIBOSMO_SABP_VERSION_MAJOR == (major) && \ + LIBOSMO_SABP_VERSION_MINOR > (minor)) || \ + (LIBOSMO_SABP_VERSION_MAJOR == (major) && \ + LIBOSMO_SABP_VERSION_MINOR == (minor) && \ + LIBOSMO_SABP_VERSION_PATCH >= (patch))) -- To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/40515?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Change-Id: I7cba0d32f024797e1360ed250a2e4f2d8ca501ee Gerrit-Change-Number: 40515 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith@sysmocom.de>
participants (1)
-
osmith