From: Thomas Monjalon Date: Fri, 19 Jul 2013 13:53:08 +0000 (+0200) Subject: mk: add rule to print version number X-Git-Tag: spdx-start~10986 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=beae4ff0a5df86f20bbdfc18ec766e25a0c39af6;p=dpdk.git 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 Acked-by: Vincent Jardin --- diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk index 1a508f78b4..68bf547f26 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 22e88176f7..e2fb91ff5a 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