DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] mk: show version as a decimal integer
@ 2016-03-24 21:26 Thomas Monjalon
  2016-04-07 21:09 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Monjalon @ 2016-03-24 21:26 UTC (permalink / raw)
  To: dev

In order to ease packaging support of changes in DPDK build system,
introduce a decimal integer to compare version numbers.
It does not show the minor numbers as it is not meaningful for packaging.

Usage for DPDK 16.04:
% make showversionum
1604

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/rte.sdkconfig.mk | 7 +++++++
 mk/rte.sdkroot.mk   | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk
index 564a5c3..a3acfe6 100644
--- a/mk/rte.sdkconfig.mk
+++ b/mk/rte.sdkconfig.mk
@@ -42,6 +42,13 @@ showversion:
 			else echo $$(($$5 - 16)); fi; \
 		fi
 
+.PHONY: showversionum
+showversionum:
+	@set -- \
+		$$(sed -rne 's,^#define RTE_VER_[A-Z_]*[[:space:]]+([0-9]+).*,\1,p' \
+			$(RTE_SRCDIR)/lib/librte_eal/common/include/rte_version.h); \
+		printf '%02d%02d\n' "$$1" "$$2"
+
 INSTALL_CONFIGS := $(sort $(filter-out %~,\
 	$(patsubst $(RTE_SRCDIR)/config/defconfig_%,%,\
 	$(wildcard $(RTE_SRCDIR)/config/defconfig_*))))
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 2424dce..55a9d8a 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -85,8 +85,8 @@ export ROOTDIRS-y ROOTDIRS- ROOTDIRS-n
 .PHONY: default
 default: all
 
-.PHONY: config showconfigs showversion
-config showconfigs showversion:
+.PHONY: config showconfigs showversion showversionum
+config showconfigs showversion showversionum:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk $@
 
 .PHONY: test fast_test ring_test mempool_test perf_test coverage
-- 
2.7.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-07 21:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-24 21:26 [dpdk-dev] [PATCH] mk: show version as a decimal integer Thomas Monjalon
2016-04-07 21:09 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).