Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0
0002 all: test mod
0003 test: virtio_test vringh_test
0004 virtio_test: virtio_ring.o virtio_test.o
0005 vringh_test: vringh_test.o vringh.o virtio_ring.o
0006 
0007 CFLAGS += -g -O2 -Werror -Wno-maybe-uninitialized -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE -include ../../include/linux/kconfig.h
0008 CFLAGS += -pthread
0009 LDFLAGS += -pthread
0010 vpath %.c ../../drivers/virtio ../../drivers/vhost
0011 mod:
0012         ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test V=${V}
0013 
0014 #oot: build vhost as an out of tree module for a distro kernel
0015 #no effort is taken to make it actually build or work, but tends to mostly work
0016 #if the distro kernel is very close to upstream
0017 #unsupported! this is a development tool only, don't use the
0018 #resulting modules in production!
0019 OOT_KSRC=/lib/modules/$$(uname -r)/build
0020 OOT_VHOST=`pwd`/../../drivers/vhost
0021 #Everyone depends on vhost
0022 #Tweak the below to enable more modules
0023 OOT_CONFIGS=\
0024         CONFIG_VHOST=m \
0025         CONFIG_VHOST_NET=n \
0026         CONFIG_VHOST_SCSI=n \
0027         CONFIG_VHOST_VSOCK=n \
0028         CONFIG_VHOST_RING=n
0029 OOT_BUILD=KCFLAGS="-I "${OOT_VHOST} ${MAKE} -C ${OOT_KSRC} V=${V}
0030 oot-build:
0031         echo "UNSUPPORTED! Don't use the resulting modules in production!"
0032         ${OOT_BUILD} M=`pwd`/vhost_test
0033         ${OOT_BUILD} M=${OOT_VHOST} ${OOT_CONFIGS}
0034 
0035 oot-clean: oot-build
0036 oot: oot-build
0037 oot-clean: OOT_BUILD+=clean
0038 
0039 .PHONY: all test mod clean vhost oot oot-clean oot-build
0040 clean:
0041         ${RM} *.o vringh_test virtio_test vhost_test/*.o vhost_test/.*.cmd \
0042               vhost_test/Module.symvers vhost_test/modules.order *.d
0043 -include *.d