mk: fix driver build with installed SDK
authorThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 7 Jul 2016 12:19:54 +0000 (14:19 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 8 Jul 2016 15:06:59 +0000 (17:06 +0200)
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>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
mk/internal/rte.compile-pre.mk
mk/rte.sdkinstall.mk

index 5632d6e..87d2d93 100644 (file)
@@ -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\" $@; \
index b0d985c..7cd352c 100644 (file)
@@ -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)