xref: /linux/drivers/iommu/generic_pt/fmt/Makefile (revision ce5cfb0fa20dc6454da039612e34325b7b4a8243)
1# SPDX-License-Identifier: GPL-2.0
2
3iommu_pt_fmt-$(CONFIG_IOMMU_PT_AMDV1) += amdv1
4iommu_pt_fmt-$(CONFIG_IOMMUFD_TEST) += mock
5
6iommu_pt_fmt-$(CONFIG_IOMMU_PT_VTDSS) += vtdss
7
8iommu_pt_fmt-$(CONFIG_IOMMU_PT_X86_64) += x86_64
9
10IOMMU_PT_KUNIT_TEST :=
11define create_format
12obj-$(2) += iommu_$(1).o
13iommu_pt_kunit_test-y += kunit_iommu_$(1).o
14CFLAGS_kunit_iommu_$(1).o += -DGENERIC_PT_KUNIT=1
15IOMMU_PT_KUNIT_TEST := iommu_pt_kunit_test.o
16
17endef
18
19$(eval $(foreach fmt,$(iommu_pt_fmt-y),$(call create_format,$(fmt),y)))
20$(eval $(foreach fmt,$(iommu_pt_fmt-m),$(call create_format,$(fmt),m)))
21
22# The kunit objects are constructed by compiling the main source
23# with -DGENERIC_PT_KUNIT
24$(obj)/kunit_iommu_%.o: $(src)/iommu_%.c FORCE
25	$(call rule_mkdir)
26	$(call if_changed_dep,cc_o_c)
27
28obj-$(CONFIG_IOMMU_PT_KUNIT_TEST) += $(IOMMU_PT_KUNIT_TEST)
29