On 01/26/16 12:13, Hans Petter Selasky wrote:

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*}
CFILES_CDDL=    ${CFILES:M*/cddl/*}
SFILES_CDDL=    ${SFILES:M*/cddl/*}

Does the following look OK?

Index: kern.post.mk
--- kern.post.mk        (revision 294311)
+++ kern.post.mk        (working copy)
@@ -186,12 +186,20 @@

 ${SYSTEM_OBJS} genassym.o vers.o: opt_global.h

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

+# We have "special" -I include paths for LinuxKPI.
+# We have "special" -I include paths for OFED.
 kernel-depend: .depend
 # The argument list can be very long, so use make -V and xargs to
 # pass it to mkdep.
@@ -219,12 +227,20 @@
 .depend: .PRECIOUS ${SRCS}
 .if ${MK_FAST_DEPEND} == "no"
        rm -f ${.TARGET}.tmp
+# C files
            CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${CFLAGS}
        ${MAKE} -V CFILES_CDDL | \
            CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ZFS_CFLAGS} \
            ${FBT_CFLAGS} ${DTRACE_CFLAGS}
-       ${MAKE} -V SFILES_NOCDDL | \
+       ${MAKE} -V CFILES_LINUXKPI | \
+           CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp \
+               ${CFLAGS} ${LINUXKPI_INCLUDES}
+       ${MAKE} -V CFILES_OFED | \
+           CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp \
+               ${CFLAGS} ${OFEDINCLUDES}
+# Assembly files
+       ${MAKE} -V SFILES_NORMAL | \
            CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ASM_CFLAGS}
        ${MAKE} -V SFILES_CDDL | \
            CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ZFS_ASM_CFLAGS}

freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to