1879ced2bSJason Gunthorpe# SPDX-License-Identifier: GPL-2.0 2879ced2bSJason Gunthorpe 3879ced2bSJason Gunthorpeiommu_pt_fmt-$(CONFIG_IOMMU_PT_AMDV1) += amdv1 4e5359dccSJason Gunthorpeiommu_pt_fmt-$(CONFIG_IOMMUFD_TEST) += mock 5879ced2bSJason Gunthorpe 6*5448c155SJason Gunthorpeiommu_pt_fmt-$(CONFIG_IOMMU_PT_VTDSS) += vtdss 7*5448c155SJason Gunthorpe 8aef5de75SJason Gunthorpeiommu_pt_fmt-$(CONFIG_IOMMU_PT_X86_64) += x86_64 9aef5de75SJason Gunthorpe 101dd4187fSJason GunthorpeIOMMU_PT_KUNIT_TEST := 11879ced2bSJason Gunthorpedefine create_format 12879ced2bSJason Gunthorpeobj-$(2) += iommu_$(1).o 131dd4187fSJason Gunthorpeiommu_pt_kunit_test-y += kunit_iommu_$(1).o 141dd4187fSJason GunthorpeCFLAGS_kunit_iommu_$(1).o += -DGENERIC_PT_KUNIT=1 151dd4187fSJason GunthorpeIOMMU_PT_KUNIT_TEST := iommu_pt_kunit_test.o 16879ced2bSJason Gunthorpe 17879ced2bSJason Gunthorpeendef 18879ced2bSJason Gunthorpe 19879ced2bSJason Gunthorpe$(eval $(foreach fmt,$(iommu_pt_fmt-y),$(call create_format,$(fmt),y))) 20879ced2bSJason Gunthorpe$(eval $(foreach fmt,$(iommu_pt_fmt-m),$(call create_format,$(fmt),m))) 211dd4187fSJason Gunthorpe 221dd4187fSJason Gunthorpe# The kunit objects are constructed by compiling the main source 231dd4187fSJason Gunthorpe# with -DGENERIC_PT_KUNIT 241dd4187fSJason Gunthorpe$(obj)/kunit_iommu_%.o: $(src)/iommu_%.c FORCE 251dd4187fSJason Gunthorpe $(call rule_mkdir) 261dd4187fSJason Gunthorpe $(call if_changed_dep,cc_o_c) 271dd4187fSJason Gunthorpe 281dd4187fSJason Gunthorpeobj-$(CONFIG_IOMMU_PT_KUNIT_TEST) += $(IOMMU_PT_KUNIT_TEST) 29