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