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

ROOT := $(src)

ccflags-y += -I$(ROOT)/
# uAPI
ccflags-y += -I$(ROOT)/../../include/uapi
# version.h
ccflags-y += -I$(ROOT)/../../include

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

obj-m	+= amdxdna.o
amdxdna-y := \
	amdxdna_ctx.o \
	amdxdna_dpt.o \
	amdxdna_drm.o \
	amdxdna_pm.o \
	amdxdna_sysfs.o \
	amdxdna_mailbox.o \
	amdxdna_mailbox_helper.o \
	amdxdna_mgmt.o \
	amdxdna_ubuf.o \
	amdxdna_carvedout_buf.o \
	amdxdna_gem.o \
	amdxdna_cma_buf.o \

amdxdna-$(OFT_CONFIG_AMDXDNA_PCI) += \
	aie2_smu.o \
	aie2_psp.o \
	aie2_ctx.o \
	aie2_hwctx.o \
	aie2_error.o \
	aie2_debugfs.o \
	aie2_tdr.o \
	aie2_dpt.o \
	aie2_message.o \
	aie2_ctx_runqueue.o \
	aie2_pm.o \
	aie2_pci.o \
	npu1_regs.o \
	npu2_regs.o \
	npu4_regs.o \
	npu5_regs.o \
	npu6_regs.o \
	amdxdna_pci_drv.o

amdxdna-$(OFT_CONFIG_AMDXDNA_OF) += \
	ve2_of.o \
	ve2_regs.o \
	amdxdna_of_drv.o \
	ve2_res_solver.o \
	ve2_mgmt.o \
	ve2_hwctx.o \
	ve2_fw.o \
	ve2_debug.o

# Helper functions for amdxdna development, but not for upstreaming
amdxdna-y += amdxdna_devel.o

-include $(src)/extra_drv.mk
