# SPDX-License-Identifier: GPL-2.0
#
# Copyright (C) 2022-2026, Advanced Micro Devices, Inc.
#

ROOT := $(src)

ccflags-y += -I$(ROOT)/
# uAPI - use -iquote to prioritize local header over in-tree kernel header
ccflags-y += -iquote$(ROOT)/../../../include/uapi
# version.h and trace headers - use -iquote to prioritize over in-tree kernel headers
ccflags-y += -iquote$(ROOT)/../../../include
# For define_trace.h re-inclusion with TRACE_INCLUDE_PATH=.
ccflags-y += -iquote$(ROOT)/../../../include/trace/events
# Make every C file in this dir see config-kernel.h
ccflags-y += -include $(ROOT)/config_kernel.h

# All warning will report as error and debug build
ccflags-y += -g -Werror

ccflags-${UMQ_HELLO_TEST} += -DUMQ_HELLO_TEST

obj-m	+= amdxdna.o
# Only objects that have corresponding .c sources in this directory
amdxdna-y := \
	amdxdna_ctx.o \
	amdxdna_gem.o \
	amdxdna_iommu.o \
	amdxdna_mailbox.o \
	amdxdna_mailbox_helper.o \
	amdxdna_pci_drv.o \
	amdxdna_pm.o \
	amdxdna_sysfs.o \
	amdxdna_ubuf.o \
	amdxdna_cbuf.o \
	amdxdna_xen.o \
	amdxdna_sensors.o

amdxdna-$(OFT_CONFIG_AMDXDNA_PCI) += \
	aie.o \
	aie_psp.o \
	aie_smu.o \
	aie2_ctx.o \
	aie2_error.o \
	aie2_message.o \
	aie2_pci.o \
	aie2_pm.o \
	aie2_solver.o \
	aie2_tdr.o \
	aie4_ctx.o \
	aie4_message.o \
	aie4_pci.o \
	amdxdna_dpt.o \
	npu1_regs.o \
	npu3_regs.o \
	npu4_regs.o \
	npu5_regs.o \
	npu6_regs.o

amdxdna-$(CONFIG_PCI_IOV) += \
	aie4_sriov.o

amdxdna-$(CONFIG_DEBUG_FS) += \
	amdxdna_debugfs.o
