From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 353F44A65 for ; Mon, 4 Jul 2016 03:14:19 +0200 (CEST) Received: by mail-wm0-f41.google.com with SMTP id r201so95816534wme.1 for ; Sun, 03 Jul 2016 18:14:19 -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=UEV6hBJgOX7xyJRKOW/nKqwW+6WithfQCB5gC6k5okQ=; b=2JxFo4q+iF+vuQvwky5+AFTlSzAEOwCQU33Ir396oDt6C7X94txGula7U4k/3Xunfz NaAi+jabsL1dmCwnBM8WPVepMaItnza2vGrppbNEDsUV+Mus02n/Jko3goh7zHpnm2dJ ZrkeUOHzpLdn6a6pmimZVQWMOMQB53ZCgUOmGsFtOYTFWnqmTon544uuDlzDL5YE8TO0 HV7+4GQ2tvHUzkLtns8ye9xxhg1KGkOVNhQH97KFDm5mwoImpaH7Jc1mzl2Mi3FyiUob 8f0dL8BmF6riteNmEH/jdzjmyHE0iCDZZ7N2s3OHtqJAttTN793Hs7xeLZqhhR8S5OYD Tp1A== 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=UEV6hBJgOX7xyJRKOW/nKqwW+6WithfQCB5gC6k5okQ=; b=BWV90L3JOiGgPJWIr7yrBiNct5u3k5FkJ6G6/c2n2ZS9nPfyWNHan5IGy16Q3fYvc0 ocz+l7VAhqRgsQiRaQoquJX+45eu8qiuD69n2QSt81N/l6Fq9noEjK0gcyfqxAdWGN/C o7L92exEBtGntrKwSBq2bJrilJrWiddOjXVELjHJ3+XxFubQst3kUQpUnBHbhqc6fAbr YjuznYYIp9CT+W3HicHx8s9LylY+jRmz4PHaxdJsY1FoFeZq6TV0k30ix7uCIIdMw7cP 0aM5O+v9Xceng0A61SIQwu5/vPDdIu2q0R0bnBR8Yr2xLc+91RxpeGVTccv2NqCKqASQ JbLw== X-Gm-Message-State: ALyK8tKuH3Xj9yQxHE8u64+64HVo2CSaRwFJAZf3zGCDOtrGrwr8mIXw+FZhp4oJEczw3XhL X-Received: by 10.194.117.227 with SMTP id kh3mr7806159wjb.28.1467594859035; Sun, 03 Jul 2016 18:14:19 -0700 (PDT) Received: from XPS13.localdomain (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id l4sm5527127wjk.18.2016.07.03.18.14.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 03 Jul 2016 18:14:18 -0700 (PDT) From: Thomas Monjalon To: Neil Horman Cc: dev@dpdk.org, Panu Matilainen Date: Mon, 4 Jul 2016 03:14:03 +0200 Message-Id: <1467594845-3487-6-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1467594845-3487-1-git-send-email-thomas.monjalon@6wind.com> References: <1466189185-21952-1-git-send-email-nhorman@tuxdriver.com> <1467594845-3487-1-git-send-email-thomas.monjalon@6wind.com> Subject: [dpdk-dev] [PATCH v9 5/7] mk: link infos generated by pmdinfogen X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2016 01:14:19 -0000 Generate informations to export from objects which register a driver. The C code generated by dpdk-pmdinfogen is compiled and linked into the original object file. 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 Acked-by: Panu Matilainen Acked-by: Remy Horton Signed-off-by: Thomas Monjalon --- mk/internal/rte.compile-pre.mk | 12 ++++++++++++ mk/rte.sdkbuild.mk | 1 + 2 files changed, 13 insertions(+) diff --git a/mk/internal/rte.compile-pre.mk b/mk/internal/rte.compile-pre.mk index b9bff4a..3967390 100644 --- a/mk/internal/rte.compile-pre.mk +++ b/mk/internal/rte.compile-pre.mk @@ -84,10 +84,22 @@ C_TO_O = $(CC) -Wp,-MD,$(call obj2dep,$(@)).tmp $(CFLAGS) \ C_TO_O_STR = $(subst ','\'',$(C_TO_O)) #'# fix syntax highlight C_TO_O_DISP = $(if $(V),"$(C_TO_O_STR)"," CC $(@)") endif +PMDINFO_GEN = $(RTE_SDK_BIN)/buildtools/dpdk-pmdinfogen $@ $@.pmd.c +PMDINFO_CC = $(CC) $(CFLAGS) -c -o $@.pmd.o $@.pmd.c +PMDINFO_LD = $(CROSS)ld $(LDFLAGS) -r -o $@.o $@.pmd.o $@ +PMDINFO_TO_O = if grep -q 'RTE_REGISTER_DRIVER(.*)' $<; then \ + echo "$(if $V,$(PMDINFO_GEN), PMDINFO $@.pmd.c)" && \ + $(PMDINFO_GEN) && \ + echo "$(if $V,$(PMDINFO_CC), CC $@.pmd.o)" && \ + $(PMDINFO_CC) && \ + echo "$(if $V,$(PMDINFO_LD), LD $@)" && \ + $(PMDINFO_LD) && \ + mv -f $@.o $@; fi C_TO_O_CMD = 'cmd_$@ = $(C_TO_O_STR)' C_TO_O_DO = @set -e; \ echo $(C_TO_O_DISP); \ $(C_TO_O) && \ + $(PMDINFO_TO_O) && \ echo $(C_TO_O_CMD) > $(call obj2cmd,$(@)) && \ sed 's,'$@':,dep_'$@' =,' $(call obj2dep,$(@)).tmp > $(call obj2dep,$(@)) && \ rm -f $(call obj2dep,$(@)).tmp diff --git a/mk/rte.sdkbuild.mk b/mk/rte.sdkbuild.mk index 5edbf50..b6b66bf 100644 --- a/mk/rte.sdkbuild.mk +++ b/mk/rte.sdkbuild.mk @@ -49,6 +49,7 @@ $(1): $(sort $(LOCAL_DEPDIRS-$(1))) endef $(foreach d,$(ROOTDIRS-y),$(eval $(call depdirs_rule,$(d)))) +drivers: | buildtools # # build and clean targets -- 2.7.0