obj-$(CONFIG_ZIJIN_15_NET) += ctzjnet15.o

ctzjnet15-objs +=       common/common.o \
				common/net_sysfs.o \
				channel/channel.o \
				channel/cmdq.o \
				hw/hw_draco/phy_draco.o \
				hw/hw_draco/flow_draco.o \
				hw/hw_draco/port_draco.o \
				hw/hw_draco/resource_draco.o \
				hw/hw_leonis/phy_leonis.o \
				hw/hw_leonis/fc_leonis.o \
				hw/hw_leonis/flow_leonis.o \
				hw/hw_leonis/tc_flow_leonis.o \
				hw/hw_leonis/tc_flow_filter_leonis.o \
				hw/hw_leonis/resource_leonis.o \
				hw/hw_leonis/tc_mcc_leonis.o \
				hw/hw_bootis/phy_bootis.o \
				hw/hw_bootis/flow_bootis.o \
				hw/hw_bootis/queue_bootis.o \
				hw/hw_bootis/resource_bootis.o \
				hw/hw_bootis/interrupt_bootis.o \
				hw/hw_bootis/port_bootis.o \
				hw/hw_virtio/phy_virtio.o \
				hw/hw_virtio/resource_virtio.o \
				hw/fc.o \
				hw/resource.o \
				hw/interrupt.o \
				hw/txrx.o \
				hw/queue.o \
				hw/vsi.o \
				hw/adminq.o \
				hw/accel.o \
				core/lag.o \
				core/dispatch.o \
				core/debugfs.o \
				core/ethtool.o \
				core/service.o \
				core/dev_emp_console.o \
				core/dev_rdma.o \
				core/dev.o \
				core/ktls.o \
				core/ipsec.o \
				core/tc.o \
				core/hwmon.o \
				main.o

# Do not modify include path, unless you are adding a new file which needs some headers in its
# direct upper directory (see the exception part in below).
#
# The structure requires that codes can only access the header files in include, or the .h that
# has the same name as the .c file. The only exception is that the product-specific files can access
# the same headers as the common part, e.g. phy_leonis.c can access phy.h.
# Make sure to put all the things you need to expose to others in def_xxx.h, and make everything
# in your own .h private.
#
# Try not to break these rules, sincerely.
ccflags-y := \
	-I $(srctree)/$(src) \
	-I $(srctree)/$(src)/include \
	-I $(srctree)/$(src)/export \
	-I $(srctree)/$(src)/hw

#ccflags-y+= -g
#ccflags-y+= -DDEBUG
#ccflags-y+= -O1

ccflags-y += -Wno-missing-braces \
	-Wno-missing-prototypes \
	-Wno-missing-declarations \
	-Wno-implicit-function-declaration \
	-Wno-discarded-qualifiers \
	-Wno-incompatible-pointer-types \
	-Wno-format \
	-Wno-int-conversion

#ifndef CONFIG_PLDMFW
ctzjnet15-objs += pldmfw/pldmfw.o
ccflags-y += -I $(src)/pldmfw
#endif

#ifeq ($(RDMA_COMPILE),1)
ccflags-y += -DZIJIN_15_RDMA_COMPILE

#set 0 for kernel > 5.11
#ifeq ($(NEED_AUX_BUS), 1)
#obj-m += aux_bus/
ccflags-y += -I $(src)/aux_bus
#endif
#endif

#ifeq ($(MS_EMP),1)
ccflags-y += -DMS_EMP
#endif

#ifneq ($(NOUSERDEV),1)
ccflags-y += -DZIJIN_15_USERDEV

ctzjnet15-objs += core/dev_user.o
ctzjnet15-objs += common/dma.o
#endif

#ifeq ($(IOMMU_TRANSLATE),1)
ccflags-y += -DZIJIN_15_IOMMU_TRANSLATE
#endif

#ifeq ($(EMP_CONSOLE),1)
ccflags-y += -DZIJIN_15_EMP_CONSOLE
#endif

#ifeq ($(SNIC_PROTO),1)
ccflags-y += -DZIJIN_15_SNIC_PROTO
subdir-ccflags-y += -DZIJIN_15_SNIC_PROTO
#endif

ifneq ($(findstring oe2203,$(KERNELVERSION)),)
ccflags-y += -DOPENEULER2203
endif

obj-$(CONFIG_ZIJIN_15_NET_AUX_BUS) += aux_bus/
