#
# Makefile to build the be2iscsi driver as part of Linix kernel source
# with all source under drivers/be2iscsi.
#
#
# -DBE2ISCSI_DEBUG -DSA_DEBUG

EXTRA_CFLAGS += -D_ACIT_LINUX_ -D_SA_LINUXK -D_SA_MODULE_NAME="\"acit\"" \
	-DPOWER_MANAGEMENT -DBUS_FIRST_MAPPING -DLOSM_BUILD  \
	-DDBG=0 -DACIT_CFG_SAVE_STATE=0 -DACIT_IO_PERFORMANCE=0 \
	-DACIT_LUN_PERFORMANCE=0 -DACIT_LUN_PERFORMANCE=0 -DACIT_TARGET_PERFORMANCE=0 \
	-DACIT_CFG_SAVE_CMD_STATE=0 \
	-DSA_OMIT_TEST_CODE -I$(src) -I$(src)/sa -I$(src)/beclib \
	-I$(src)/acit  -I$(src)/fw/cloaked_amap -I$(src)/fw/bmap_no_postfix \
	-I$(src)/fw/enum -I$(src)/sa/system -I$(src)/sa/system/linuxk \
	-I$(src)/sa/runtime

#special situation with rhel6
EXTRA_CFLAGS   += $(shell if [ ! -z "$(shell cat /etc/redhat-release 2>/dev/null |grep Santiago)" -o "$(shell cat /etc/issue 2>/dev/null |grep "SUSE Linux Enterprise Server 11 SP2")" ] ; then \
                   echo "-DNEW_BLK_API"; else echo ""; fi)
EXTRA_CFLAGS   += $(shell if [ ! -z "$(shell cat /etc/issue 2>/dev/null |grep "SUSE Linux Enterprise Server 11 SP2")" ] ; then \
                   echo "-DNEW_QUEUECMD"; else echo ""; fi)

ifeq ($(ARCH),ia64)
EXTRA_CFLAGS += -D_IA64_
else
EXTRA_CFLAGS += -D_SA_X86
endif

# Adding compilation flag so that warnings are
# also treated as errors.
EXTRA_CFLAGS += -Wno-deprecated-declarations #-Werror

obj-$(CONFIG_BE2ISCSI) += be2iscsi.o

OBJS := \
	be2iscsi_osm.o \
	acit_iface.o \
	be2iscsi_chrdrv.o \
	be2iscsi_debug.o \
	be2iscsi_btl.o \
	be2iscsi_osm26.o 

be2iscsi-y := \
	chipobj_ll.o \
	cq_ll.o \
	emulation_switch_ll.o \
	eq_ll.o \
	ethrx_ll.o \
	ethtx_ll.o \
	flash_ll.o \
	funcobj_ll.o \
	iscsiwrb_ll.o \
	main_ll.o \
	mpu_ll.o \
	ue_ll.o \
	pdudefault_ll.o \
	rxf_ll.o \
	tcptx_ll.o \
	toeconn_ll.o \
	toedq_ll.o \
	sa_log.o \
	sa_tiny_log.o \
	sa_index_allocator.o \
	sa_network_packet.o \
	sa_base2.o \
	sa_mem_linuxk.o \
	sa_runtime_test.o \
	sa_sync_linuxk.o \
	sa_checksum.o \
	sa_crc.o \
	sa_object_allocator.o \
	sa_text.o \
	sa_rand.o \
	sa_bitvector.o \
	sa_md5.o \
	sa_trace.o \
	sa_assert.o \
	sa_output.o \
	sa_dev_linuxk.o \
	sa_mem_debug.o \
	sa_chap.o \
	sa_ring_index_allocator.o \
	iscsiapi.o \
	acitapi.o \
	vase.o \
	hwiasync.o \
	acitmain.o \
	mgmtapi.o \
	hwi.o \
	iscsipvt.o \
	hwiwrb.o \
	hwiasync.o \
	mgmtpvt.o \
	$(OBJS)
