DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 1/2] mk: add rule to print version number
Date: Fri, 19 Jul 2013 16:19:51 +0200	[thread overview]
Message-ID: <3bd9ee985e2d0ce0d2780ba0160ecd31bb502878.1374243470.git.thomas.monjalon@6wind.com> (raw)
In-Reply-To: <cover.1374243470.git.thomas.monjalon@6wind.com>
In-Reply-To: <cover.1374243470.git.thomas.monjalon@6wind.com>

The version string is extracted from rte_version.h.
RTE_VER_* macros are concatenated and separators " . . r " are inserted.

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

diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk
index 2c071a2..6eb389c 100644
--- a/mk/rte.sdkconfig.mk
+++ b/mk/rte.sdkconfig.mk
@@ -31,6 +31,12 @@
 # 
 #  version: DPDK.L.1.2.3-3
 
+.PHONY: showversion
+showversion:
+	@sed -rn 's,^#define RTE_VER_[A-Z_]*[[:space:]]+([0-9]+).*,\1,p' \
+		$(RTE_SRCDIR)/lib/librte_eal/common/include/rte_version.h | \
+		tr '\n' '.' | sed -r 's,\.([0-9]+)\.$$,r\1\n,'
+
 INSTALL_CONFIGS := $(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 905b678..b5126c0 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -87,8 +87,8 @@ export ROOTDIRS-y ROOTDIRS- ROOTDIRS-n
 .PHONY: default
 default: all
 
-.PHONY: config showconfigs
-config showconfigs:
+.PHONY: config showconfigs showversion
+config showconfigs showversion:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk $@
 
 .PHONY: test fast_test ring_test mempool_test
-- 
1.7.10.4

  reply	other threads:[~2013-07-19 14:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-19 14:19 [dpdk-dev] [PATCH 0/2] version in doxygen Thomas Monjalon
2013-07-19 14:19 ` Thomas Monjalon [this message]
2013-07-19 19:18   ` [dpdk-dev] [PATCH 1/2] mk: add rule to print version number Vincent JARDIN
2013-07-19 21:16     ` Thomas Monjalon
2013-07-19 14:19 ` [dpdk-dev] [PATCH 2/2] mk: insert version number in doxygen config Thomas Monjalon
2013-07-19 19:17   ` Vincent JARDIN
2013-07-19 21:18     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3bd9ee985e2d0ce0d2780ba0160ecd31bb502878.1374243470.git.thomas.monjalon@6wind.com \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).