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 11LIBVFIO_C += lib/drivers/dsa/dsa.c 12endif 13 14LIBVFIO_O := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBVFIO_C)) 15 16LIBVFIO_O_DIRS := $(shell dirname $(LIBVFIO_O) | uniq) 17$(shell mkdir -p $(LIBVFIO_O_DIRS)) 18 19CFLAGS += -I$(VFIO_DIR)/lib/include 20 21$(LIBVFIO_O): $(OUTPUT)/%.o : $(VFIO_DIR)/%.c 22 $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ 23 24EXTRA_CLEAN += $(LIBVFIO_O) 25