From f795c1e66e344d9c4715b1a617658c16e4644b71 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Tue, 22 Sep 2015 16:49:23 +0200 Subject: [PATCH] mk: show version as a decimal integer 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 --- 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 564a5c3327..a3acfe64f9 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 2424dcef47..55a9d8aeca 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.20.1