1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2018 Intel Corporation
4 kmods = ['contigmem', 'nic_uio']
6 # for building kernel modules, we use kernel build system using make, as
7 # with Linux. We have a skeleton BSDmakefile, which pulls many of its
8 # values from the environment. Each module only has a single source file
9 # right now, which allows us to simplify things. We pull in the sourcer
10 # files from the individual meson.build files, and then use a custom
11 # target to call make, passing in the values as env parameters.
12 kmod_cflags = ['-I' + meson.build_root(),
13 '-I' + join_paths(meson.source_root(), 'config'),
14 '-include rte_config.h']
16 # to avoid warnings due to race conditions with creating the dev_if.h, etc.
17 # files, serialize the kernel module builds. Each module will depend on
22 built_kmods += custom_target(k,
23 input: [files('BSDmakefile.meson'), sources],
25 command: ['make', '-f', '@INPUT0@',
26 'KMOD_OBJDIR=@OUTDIR@',
29 'KMOD_CFLAGS=' + ' '.join(kmod_cflags),
31 depends: built_kmods, # make each module depend on prev
32 build_by_default: get_option('enable_kmods'),
33 install: get_option('enable_kmods'),
34 install_dir: '/boot/modules/')