From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43])
 by dpdk.org (Postfix) with ESMTP id CBE795A4E
 for <dev@dpdk.org>; Fri,  8 Jul 2016 12:14:22 +0200 (CEST)
Received: by mail-wm0-f43.google.com with SMTP id z126so10200372wme.0
 for <dev@dpdk.org>; Fri, 08 Jul 2016 03:14:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=6wind-com.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:date:message-id:in-reply-to:references;
 bh=Fx/WCoDwNA3xvhMph4GkIMRf16fzJyTBtXe9Xbm7vic=;
 b=vdSnMqTseP8iebiIJuNkiOGKt/1RNfXWJ2CQQLMY1ocX+Ld3ErDG80c8qPii5mfYlN
 fipdvr2rMK+Z6DW0v1yh8ULQnldBMaTxgJ48d/ARltNmEGMODZziv434Oe34R8PllvUR
 c8/X9ivXseSS6rcConp4MywzOVDEAap4oqh6H+xzm1QdmwBCA1uoaLI+SxcQxvyhInU/
 raKmdZ+otpVpjrKJmLnM6B+3iUUAXrtC442CfEUv4tC7yddtV+tuTzmbygN0V5MBJzGZ
 i6Zr9VWrSRpN92xwsgJE9wdc+SfAg2pvbEVY4blU/gqH4CCrUizemB7Lp0WXtk2UhjKp
 CFSQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references;
 bh=Fx/WCoDwNA3xvhMph4GkIMRf16fzJyTBtXe9Xbm7vic=;
 b=SWFFYXwn/mBH9NfI/NA+f0hsBywVwmYR1kqgG1YHZmNFmrs7k6NZW/Xoq+2KP9H/vY
 nMu20hSYINUcfELmieZL9uMcYH0R2JZcRZPZr1js8NoY2IXOIk/THnlUY5NKbf2uWYRs
 M2f0sIrqBNRaDib6ZwZLY6e8qOPItGZqABZi7TXJgCqpwwNfwxaEy4Zo15PnvhjlB2ZS
 AOH1iEJXjcXt7P3qFruJva1vCQcbnl3rb/I5eHd3c8xpesIYD7VOVq7b+mbU2uDwbzNM
 DGkTetrchxzmpxoskhnraPIFdyZ6RQeOapeyl43saJrufI5J4gxYn9XBvu8fE93C+Gab
 BFbg==
X-Gm-Message-State: ALyK8tLMZ2sy1IOIXukuJ4L5e/lp6KOYIjx+2V0J0dvqzaS5VtS2L2xaeohyLZVvpjn6Sqjs
X-Received: by 10.194.120.135 with SMTP id lc7mr4473255wjb.42.1467972862594;
 Fri, 08 Jul 2016 03:14:22 -0700 (PDT)
Received: from XPS13.localdomain (184.203.134.77.rev.sfr.net. [77.134.203.184])
 by smtp.gmail.com with ESMTPSA id d4sm8146wjb.47.2016.07.08.03.14.21
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
 Fri, 08 Jul 2016 03:14:22 -0700 (PDT)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: dev@dpdk.org
Date: Fri,  8 Jul 2016 12:14:09 +0200
Message-Id: <1467972855-21873-5-git-send-email-thomas.monjalon@6wind.com>
X-Mailer: git-send-email 2.7.0
In-Reply-To: <1467972855-21873-1-git-send-email-thomas.monjalon@6wind.com>
References: <1467905790-10597-1-git-send-email-thomas.monjalon@6wind.com>
 <1467972855-21873-1-git-send-email-thomas.monjalon@6wind.com>
Subject: [dpdk-dev] [PATCH v2 04/10] mk: fix driver build with installed SDK
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 08 Jul 2016 10:14:23 -0000

The tool pmdinfogen was called from RTE_OUTPUT/app/ which does not exist
if building a driver outside of the SDK build.
When building DPDK, RTE_SDK_BIN is RTE_OUTPUT. When building an external
driver, RTE_SDK_BIN must point to the installed DPDK directory containing
includes, libs, etc.

That's why pmdinfogen must be installed in the SDK directory and be part
of the SDK installation.

Fixes: 3d781ca32874 ("mk: do post processing on objects that register a driver")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/internal/rte.compile-pre.mk | 2 +-
 mk/rte.sdkinstall.mk           | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/mk/internal/rte.compile-pre.mk b/mk/internal/rte.compile-pre.mk
index 5632d6e..87d2d93 100644
--- a/mk/internal/rte.compile-pre.mk
+++ b/mk/internal/rte.compile-pre.mk
@@ -92,7 +92,7 @@ C_TO_O_DO = @set -e; \
 	if [ \$$? -eq 0 ]; then \
 		echo \"  PMDINFOGEN\" $@; \
 		OBJF=`readlink -f $@`; \
-		${RTE_OUTPUT}/app/pmdinfogen \$$OBJF \$$OBJF.pmd.c; \
+		$(RTE_SDK_BIN)/app/pmdinfogen \$$OBJF \$$OBJF.pmd.c; \
 		if [ \$$? -eq 0 ]; \
 		then \
 			echo \"  PMDINFOBUILD\" $@; \
diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index b0d985c..7cd352c 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -117,6 +117,7 @@ install-runtime:
 	$(Q)cp -a    $O/lib/* $(DESTDIR)$(libdir)
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(bindir))
 	$(Q)tar -cf -      -C $O --exclude 'app/*.map' \
+		--exclude app/pmdinfogen \
 		--exclude 'app/cmdline*' --exclude app/test \
 		--exclude app/testacl --exclude app/testpipeline app | \
 	    tar -xf -      -C $(DESTDIR)$(bindir) --strip-components=1 \
@@ -126,10 +127,8 @@ install-runtime:
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(sbindir))
 	$(Q)$(call rte_symlink,    $(DESTDIR)$(datadir)/tools/dpdk_nic_bind.py, \
 	                           $(DESTDIR)$(sbindir)/dpdk_nic_bind)
-	$(Q)$(call rte_symlink,    $(DESTDIR)$(bindir)/pmdinfogen, \
-				   $(DESTDIR)$(bindir)/dpdk_pmdinfogen)
 	$(Q)$(call rte_symlink,    $(DESTDIR)$(datadir)/tools/pmdinfo.py, \
-				   $(DESTDIR)$(bindir)/dpdk_pmdinfo)
+	                           $(DESTDIR)$(bindir)/dpdk_pmdinfo)
 
 install-kmod:
 ifneq ($(wildcard $O/kmod/*),)
@@ -145,8 +144,9 @@ install-sdk:
 	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
 	$(Q)cp -a               $(RTE_SDK)/mk            $(DESTDIR)$(sdkdir)
 	$(Q)cp -a               $(RTE_SDK)/scripts       $(DESTDIR)$(sdkdir)
-	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(targetdir))
+	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(targetdir)/app)
 	$(Q)cp -a               $O/.config               $(DESTDIR)$(targetdir)
+	$(Q)cp -a               $O/app/pmdinfogen        $(DESTDIR)$(targetdir)/app
 	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(targetdir)/include)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(targetdir)/lib)
 
-- 
2.7.0