1*2223587dSDavid Matlackinclude $(top_srcdir)/scripts/subarch.include 2*2223587dSDavid MatlackARCH ?= $(SUBARCH) 3*2223587dSDavid Matlack 419faf6fdSDavid MatlackVFIO_DIR := $(selfdir)/vfio 519faf6fdSDavid Matlack 619faf6fdSDavid MatlackLIBVFIO_C := lib/vfio_pci_device.c 71b197032SDavid MatlackLIBVFIO_C += lib/vfio_pci_driver.c 819faf6fdSDavid Matlack 9*2223587dSDavid Matlackifeq ($(ARCH:x86_64=x86),x86) 10*2223587dSDavid MatlackLIBVFIO_C += lib/drivers/ioat/ioat.c 11*2223587dSDavid Matlackendif 12*2223587dSDavid Matlack 1319faf6fdSDavid MatlackLIBVFIO_O := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBVFIO_C)) 1419faf6fdSDavid Matlack 1519faf6fdSDavid MatlackLIBVFIO_O_DIRS := $(shell dirname $(LIBVFIO_O) | uniq) 1619faf6fdSDavid Matlack$(shell mkdir -p $(LIBVFIO_O_DIRS)) 1719faf6fdSDavid Matlack 1819faf6fdSDavid MatlackCFLAGS += -I$(VFIO_DIR)/lib/include 1919faf6fdSDavid Matlack 2019faf6fdSDavid Matlack$(LIBVFIO_O): $(OUTPUT)/%.o : $(VFIO_DIR)/%.c 2119faf6fdSDavid Matlack $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ 2219faf6fdSDavid Matlack 2319faf6fdSDavid MatlackEXTRA_CLEAN += $(LIBVFIO_O) 24