How to add custom C-flags to kernel depend?

From: Hans Petter Selasky <hps_at_selasky.org>
Date: Tue, 26 Jan 2016 12:13:34 +0100
Hi,

I would like to remove the no-depend keyword from drivers using the 
LINUXKPI_C in the kernel. Currently it fails like this:

> sys/ofed/drivers/infiniband/core/mad.c:36:10: fatal error: 'linux/dma-mapping.h' file not found
> #include <linux/dma-mapping.h>
>          ^
> 1 error generated.

That's very easy to fix, by simply adding the correct include path to 
the C-flags of depend, though then all kernel files will have that 
include path added. What is the best way to fix this?

I see ZFS has made a solution and can we extend this scheme?

> # We have "special" -I include paths for zfs/dtrace files in 'depend'.
> CFILES_NOCDDL=  ${CFILES:N*/cddl/*:N*fs/nfsclient/nfs_clkdtrace*}
> SFILES_NOCDDL=  ${SFILES:N*/cddl/*}
> CFILES_CDDL=    ${CFILES:M*/cddl/*}
> SFILES_CDDL=    ${SFILES:M*/cddl/*}

--HPS
Received on Tue Jan 26 2016 - 10:11:17 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:02 UTC