summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorThomas Monjalon <thomas.monjalon@6wind.com>2013-07-19 15:53:08 +0200
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-01-15 18:08:43 +0100
commitcbac73ddef565295a122ab509c9c0a19ecf04af3 (patch)
treeb3d094a570933a461743215ebd764bc41cf3e214 /mk
parent4b6cf935333ffee2c0865faf0924f513b2a1d892 (diff)
downloaddpdk-cbac73ddef565295a122ab509c9c0a19ecf04af3.zip
dpdk-cbac73ddef565295a122ab509c9c0a19ecf04af3.tar.gz
dpdk-cbac73ddef565295a122ab509c9c0a19ecf04af3.tar.xz
mk: add rule to print version number
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> Acked-by: Vincent Jardin <vincent.jardin@6wind.com>
Diffstat (limited to 'mk')
-rw-r--r--mk/rte.sdkconfig.mk6
-rw-r--r--mk/rte.sdkroot.mk4
2 files changed, 8 insertions, 2 deletions
diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk
index 552ba69..7c3e32c 100644
--- a/mk/rte.sdkconfig.mk
+++ b/mk/rte.sdkconfig.mk
@@ -29,6 +29,12 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.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 40a5a6e..e6300e2 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
-config:
+.PHONY: config showversion
+config showversion:
$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk $@
.PHONY: test fast_test ring_test mempool_test perf_test coverage