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