All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Boccassi <bluca@debian.org>
To: dev@dpdk.org
Cc: bruce.richardson@intel.com, ferruh.yigit@intel.com,
	Luca Boccassi <bluca@debian.org>
Subject: [PATCH] build: add meson.build for kni kernel module
Date: Thu, 11 Oct 2018 20:46:29 +0100	[thread overview]
Message-ID: <20181011194629.4699-1-bluca@debian.org> (raw)

A Kbuild is also included to allow users to use DKMS natively without
additional code.

Signed-off-by: Luca Boccassi <bluca@debian.org>
---
build-tested on debian sid am64

 kernel/linux/kni/Kbuild      |  8 ++++++
 kernel/linux/kni/meson.build | 51 ++++++++++++++++++++++++++++++++++++
 kernel/linux/meson.build     |  2 +-
 3 files changed, 60 insertions(+), 1 deletion(-)
 create mode 100644 kernel/linux/kni/Kbuild
 create mode 100644 kernel/linux/kni/meson.build

diff --git a/kernel/linux/kni/Kbuild b/kernel/linux/kni/Kbuild
new file mode 100644
index 0000000000..de5c27f328
--- /dev/null
+++ b/kernel/linux/kni/Kbuild
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
+
+ccflags-y := $(MODULE_CFLAGS)
+obj-m := rte_kni.o
+rte_kni-y := $(patsubst $(src)/%.c,%.o,$(wildcard $(src)/*.c)) \
+ $(patsubst $(src)/%.c,%.o,$(wildcard $(src)/ethtool/ixgbe/*.c)) \
+ $(patsubst $(src)/%.c,%.o,$(wildcard $(src)/ethtool/igb/*.c))
diff --git a/kernel/linux/kni/meson.build b/kernel/linux/kni/meson.build
new file mode 100644
index 0000000000..cf881b1c1f
--- /dev/null
+++ b/kernel/linux/kni/meson.build
@@ -0,0 +1,51 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
+
+kni_mkfile = custom_target('rte_kni_makefile',
+	output: 'Makefile',
+	command: ['touch', '@OUTPUT@'])
+
+kni_sources = [
+	'kni_ethtool.c',
+	'kni_misc.c',
+	'kni_net.c',
+	'ethtool/igb/e1000_82575.c',
+	'ethtool/igb/e1000_api.c',
+	'ethtool/igb/e1000_i210.c',
+	'ethtool/igb/e1000_mac.c',
+	'ethtool/igb/e1000_manage.c',
+	'ethtool/igb/e1000_mbx.c',
+	'ethtool/igb/e1000_nvm.c',
+	'ethtool/igb/e1000_phy.c',
+	'ethtool/igb/igb_ethtool.c',
+	'ethtool/igb/igb_main.c',
+	'ethtool/igb/igb_param.c',
+	'ethtool/igb/igb_vmdq.c',
+	'ethtool/ixgbe/ixgbe_82598.c',
+	'ethtool/ixgbe/ixgbe_82599.c',
+	'ethtool/ixgbe/ixgbe_api.c',
+	'ethtool/ixgbe/ixgbe_common.c',
+	'ethtool/ixgbe/ixgbe_ethtool.c',
+	'ethtool/ixgbe/ixgbe_main.c',
+	'ethtool/ixgbe/ixgbe_phy.c',
+	'ethtool/ixgbe/ixgbe_x540.c',
+	'ethtool/ixgbe/kcompat.c',
+	'Kbuild']
+
+custom_target('rte_kni',
+	input: kni_sources,
+	output: 'rte_kni.ko',
+	command: ['make', '-C', kernel_dir,
+		'M=' + meson.current_build_dir(),
+		'src=' + meson.current_source_dir(),
+		'MODULE_CFLAGS=-include ' + meson.source_root() + '/config/rte_config.h' +
+		' -I' + meson.source_root() + '/lib/librte_eal/common/include' +
+		' -I' + meson.source_root() + '/lib/librte_eal/linuxapp/eal/include' +
+		' -I' + meson.build_root() +
+		' -I' + meson.current_source_dir() + '/ethtool/ixgbe' +
+		' -I' + meson.current_source_dir() + '/ethtool/igb',
+		'modules'],
+	depends: kni_mkfile,
+	install: true,
+	install_dir: kernel_dir + '/../extra/dpdk',
+	build_by_default: get_option('enable_kmods'))
diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build
index a924c7b6fb..5b7ec06e1d 100644
--- a/kernel/linux/meson.build
+++ b/kernel/linux/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-subdirs = ['igb_uio']
+subdirs = ['igb_uio', 'kni']
 
 WARN_CROSS_COMPILE='Need "kernel_dir" option for kmod compilation when cross-compiling'
 WARN_NO_HEADERS='Cannot compile kernel modules as requested - are kernel headers installed?'
-- 
2.19.1

             reply	other threads:[~2018-10-11 19:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-11 19:46 Luca Boccassi [this message]
2018-10-12 14:09 ` [PATCH] build: add meson.build for kni kernel module Bruce Richardson
2018-10-12 15:13   ` Luca Boccassi
2018-10-12 15:12 ` [PATCH v2] " Luca Boccassi
2018-10-12 16:29   ` Bruce Richardson
2018-10-12 17:06     ` Luca Boccassi
2018-10-29 14:09       ` Ilya Maximets
2018-10-29 15:33         ` Luca Boccassi
2018-10-30 10:38           ` Bruce Richardson
2018-10-12 17:05 ` [PATCH v3] " Luca Boccassi
2018-10-31 10:33   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181011194629.4699-1-bluca@debian.org \
    --to=bluca@debian.org \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.