summaryrefslogtreecommitdiff
path: root/mk/internal
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2016-06-17 14:46:23 -0400
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-07-06 23:21:40 +0200
commit3d781ca328743c5c569de02d16bad3d0cad3beda (patch)
tree487d99eb49e627a6e26b59e5dc28eafd90009b1d /mk/internal
parentfef7ff4c2eddb8c08d025229a0833a8187131449 (diff)
downloaddpdk-3d781ca328743c5c569de02d16bad3d0cad3beda.zip
dpdk-3d781ca328743c5c569de02d16bad3d0cad3beda.tar.gz
dpdk-3d781ca328743c5c569de02d16bad3d0cad3beda.tar.xz
mk: do post processing on objects that register a driver
Modify the compilation makefile to identify C files that export PMD information, and use that to trigger execution of the pmdinfo binary. If the execution of pmdinfo is successful, compile the output C file to an object, and use the linker to do relocatable linking on the resultant object file into the parent object that it came from. This effectively just adds the json string into the string table of the object that defines the PMD to the outside world. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Acked-by: Panu Matilainen <pmatilai@redhat.com> Acked-by: Remy Horton <remy.horton@intel.com>
Diffstat (limited to 'mk/internal')
-rw-r--r--mk/internal/rte.compile-pre.mk14
1 files changed, 14 insertions, 0 deletions
diff --git a/mk/internal/rte.compile-pre.mk b/mk/internal/rte.compile-pre.mk
index b9bff4a..5632d6e 100644
--- a/mk/internal/rte.compile-pre.mk
+++ b/mk/internal/rte.compile-pre.mk
@@ -88,10 +88,24 @@ C_TO_O_CMD = 'cmd_$@ = $(C_TO_O_STR)'
C_TO_O_DO = @set -e; \
echo $(C_TO_O_DISP); \
$(C_TO_O) && \
+ sh -c "grep -q \"PMD_REGISTER_DRIVER(.*)\" $<; \
+ if [ \$$? -eq 0 ]; then \
+ echo \" PMDINFOGEN\" $@; \
+ OBJF=`readlink -f $@`; \
+ ${RTE_OUTPUT}/app/pmdinfogen \$$OBJF \$$OBJF.pmd.c; \
+ if [ \$$? -eq 0 ]; \
+ then \
+ echo \" PMDINFOBUILD\" $@; \
+ $(CC) $(CFLAGS) -c -o \$$OBJF.pmd.o \$$OBJF.pmd.c; \
+ $(CROSS)ld $(LDFLAGS) -r -o \$$OBJF.o \$$OBJF.pmd.o \$$OBJF; \
+ mv -f \$$OBJF.o \$$OBJF; \
+ fi; \
+ fi;" && \
echo $(C_TO_O_CMD) > $(call obj2cmd,$(@)) && \
sed 's,'$@':,dep_'$@' =,' $(call obj2dep,$(@)).tmp > $(call obj2dep,$(@)) && \
rm -f $(call obj2dep,$(@)).tmp
+
# return an empty string if string are equal
compare = $(strip $(subst $(1),,$(2)) $(subst $(2),,$(1)))