]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tools/virtio: pass KCFLAGS to module build
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 4 Dec 2025 17:22:43 +0000 (12:22 -0500)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 24 Dec 2025 13:02:56 +0000 (08:02 -0500)
Update the mod target to pass KCFLAGS with the in-tree vhost driver
include path. This way vhost_test can find vhost headers.

Created using Cursor CLI.

Message-ID: <5473e5a5dfd2fcd261a778f2017cac669c031f23.1764873799.git.mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
tools/virtio/Makefile

index e25e99c1c3b7b98fef989b1f73115fdf885ba93b..a60316211df6b982f52466832ddc2a8e4aab403a 100644 (file)
@@ -20,8 +20,9 @@ CFLAGS += -g -O2 -Werror -Wno-maybe-uninitialized -Wall -I. -I../include/ -I ../
 CFLAGS += -pthread
 LDFLAGS += -pthread
 vpath %.c ../../drivers/virtio ../../drivers/vhost
+BUILD=KCFLAGS="-I "`pwd`/../../drivers/vhost ${MAKE} -C `pwd`/../.. V=${V}
 mod:
-       ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test V=${V}
+       ${BUILD} M=`pwd`/vhost_test
 
 #oot: build vhost as an out of tree module for a distro kernel
 #no effort is taken to make it actually build or work, but tends to mostly work