# SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-only
# Copyright (C) 2023 Engineering Design Team, Inc.

obj-m := edt_pci_pcd.o
edt_pci_pcd-y := chardev_intf.o edt_lnx_alloc.o edt_lnx_kernel.o edt_lnx_mm.o edt_lnx.o edt_mem_tag.o edt_common.o edt_dma.o edt_driver_ioctl.o edt_initdev.o edt_pci_devices.o edt_set.o edt_sg_list.o edt_timeout.o pcd.o edt_driver_version.o

ccflags-y += -I$(src) -I/opt/EDTpcd
ccflags-y += -D__KERNEL__  -D_KERNEL=1 -D_LINUX -DMODULE
ccflags-y += -DPCD=1
ccflags-y += -DEDT_MODULE_VERSION="\"6.2.1\"" -DEDT_MODULE_VERSION_LONG="\"6.2.1+903c0119\""

ccflags-$(CONFIG_SMP) += -D__SMP__
asflags-$(CONFIG_SMP) += -D__SMP__

# Print warnings/errors in color, if compiler supports it & stderr is a terminal
ccflags-y += $(call cc-option,-fdiagnostics-color=auto,)

# We use "/* FALLTHROUGH */" comments. Need the GCC warning set at level 3 to
# match them.
ccflags-y += $(call cc-option,-Wimplicit-fallthrough=3,)

# x86 / x86-64
ccflags-$(CONFIG_X86_64) += -mcmodel=kernel -mno-red-zone

# AARCH64
ccflags-$(CONFIG_ARM64) += $(call cc-disable-warning, missing-include-dirs)


