Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

vfio: selftests: Store libvfio build outputs in $(OUTPUT)/libvfio

Store the tools/testing/selftests/vfio/lib outputs (e.g. object files)
in $(OUTPUT)/libvfio rather than in $(OUTPUT)/lib. This is in
preparation for building the VFIO selftests library into the KVM
selftests (see Link below).

Specifically this will avoid name conflicts between
tools/testing/selftests/{vfio,kvm/lib and also avoid leaving behind
empty directories under tools/testing/selftests/kvm after a make clean.

Link: https://lore.kernel.org/kvm/20250912222525.2515416-2-dmatlack@google.com/
Signed-off-by: David Matlack <dmatlack@google.com>
Link: https://lore.kernel.org/r/20250922224857.2528737-1-dmatlack@google.com
Signed-off-by: Alex Williamson <alex@shazbot.org>

authored by

David Matlack and committed by
Alex Williamson
a52b1a71 6146a0f1

+11 -9
+11 -9
tools/testing/selftests/vfio/lib/libvfio.mk
··· 1 1 include $(top_srcdir)/scripts/subarch.include 2 2 ARCH ?= $(SUBARCH) 3 3 4 - VFIO_DIR := $(selfdir)/vfio 4 + LIBVFIO_SRCDIR := $(selfdir)/vfio/lib 5 5 6 - LIBVFIO_C := lib/vfio_pci_device.c 7 - LIBVFIO_C += lib/vfio_pci_driver.c 6 + LIBVFIO_C := vfio_pci_device.c 7 + LIBVFIO_C += vfio_pci_driver.c 8 8 9 9 ifeq ($(ARCH:x86_64=x86),x86) 10 - LIBVFIO_C += lib/drivers/ioat/ioat.c 11 - LIBVFIO_C += lib/drivers/dsa/dsa.c 10 + LIBVFIO_C += drivers/ioat/ioat.c 11 + LIBVFIO_C += drivers/dsa/dsa.c 12 12 endif 13 13 14 - LIBVFIO_O := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBVFIO_C)) 14 + LIBVFIO_OUTPUT := $(OUTPUT)/libvfio 15 + 16 + LIBVFIO_O := $(patsubst %.c, $(LIBVFIO_OUTPUT)/%.o, $(LIBVFIO_C)) 15 17 16 18 LIBVFIO_O_DIRS := $(shell dirname $(LIBVFIO_O) | uniq) 17 19 $(shell mkdir -p $(LIBVFIO_O_DIRS)) 18 20 19 - CFLAGS += -I$(VFIO_DIR)/lib/include 21 + CFLAGS += -I$(LIBVFIO_SRCDIR)/include 20 22 21 - $(LIBVFIO_O): $(OUTPUT)/%.o : $(VFIO_DIR)/%.c 23 + $(LIBVFIO_O): $(LIBVFIO_OUTPUT)/%.o : $(LIBVFIO_SRCDIR)/%.c 22 24 $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ 23 25 24 - EXTRA_CLEAN += $(LIBVFIO_O) 26 + EXTRA_CLEAN += $(LIBVFIO_OUTPUT)