#
# Copyright (c) 2011-2015, Emulex
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without 
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, 
#    this list of conditions and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright notice, 
#    this list of conditions and the following disclaimer in the documentation 
#    and/or other materials provided with the distribution.
# 
# 3. Neither the name of the copyright holder nor the names of its contributors 
#    may be used to endorse or promote products derived from this software 
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
# POSSIBILITY OF SUCH DAMAGE.
#

PROG_NAME	= "ocs_iscsi_ramd"
DOC_TAR		= $(PROG_NAME)-doc.tgz

OS		= ../common
OCS		= ../../common/ocs
HAL		= ../../common/ihal
XPORT		= ../../common/ocs_iscsi
TARGET		= ../../common/ocs_ramd
INITIATOR	= ../../common/ocs_ini_stub
USPACE		= ../../linux/ocs_uspace

# Enable Electric fence
#LDFLAGS		= -lefence


DEFINES		= -DOCS_INCLUDE_DEBUG

SRCS	 =  \
	ocs_driver.c \
	$(OS)/ocs_impl_uspace.c \
	$(OS)/ocsu_main.c \
	$(OS)/ocs_ocsu.c \
	$(OS)/ocs_socket.c \
	$(OS)/crc32.c \
	$(OCS)/ocsu_ioctl.c \
	$(XPORT)/ocs_debug.c \
	$(XPORT)/ocs_iscsi.c \
	$(XPORT)/ocs_iscsi_api.c \
	$(XPORT)/ocs_isns.c \
	$(XPORT)/ocs_cxn.c \
	$(XPORT)/ocs_login.c \
	$(XPORT)/ocs_scsi.c \
	$(XPORT)/ocs_ddump.c \
	$(XPORT)/ocs_domain.c \
	$(XPORT)/ocs_session.c \
	$(XPORT)/ocs_sport.c \
	$(XPORT)/ocs_io.c \
	$(XPORT)/ocs_mgmt.c \
	$(XPORT)/ocs_xport.c \
	$(XPORT)/ocs_md5.c \
	$(XPORT)/ocs_elxu.c \
	$(HAL)/ocs_hal.c \
	$(HAL)/ocs_sm.c \
	$(HAL)/ocs_hal_workaround.c \
	$(HAL)/sli4.c \
	$(HAL)/sli4_iscsi.c \
	$(HAL)/sli4_be3_iscsi.c \
	$(HAL)/sli4_skh_iscsi.c \
	$(OS)/ocs_os.c \
	$(OS)/dslab.c \
	$(OCS)/ocs_textbuf.c \
	$(OCS)/ocs_dif.c \
	$(OCS)/t10crc16.c \
	$(OCS)/ocs_list.c \
	$(OCS)/ocs_ramlog.c \
	$(OCS)/ocs_ioctl.c \
	$(OCS)/ocs_ioctl_iscsi.c \
	$(OCS)/ocs_ddumplib.c \
	$(OCS)/ocs_cbuf.c \
	$(OCS)/ocs_array.c \
	$(OCS)/ocs_pool.c \
	$(TARGET)/ocs_ramdisc.c \
	$(TARGET)/ocs_ramd.c \
	$(TARGET)/ocs_ramd_thread.c \
	$(TARGET)/mode_sense.c \
	$(INITIATOR)/ocs_ini_stub.c \
	$(OCS)/ocs_mgmt_common.c \

include ../common/Makefile.incl

RELEASE_FILES = \
	Makefile \
	ocs_driver.c \
	ocs.h \
	version.h \
	Doxyfile \
	DoxygenLayout.xml \
	main.doxygen \
	ocs_iscsi_ramd-doc.tgz

docdist:
	@echo "Creating document tar file: ${PROG_NAME}-doc.tgz"
	@doxygen > doxygen.log 2>&1
	@cp ../../common/doxy/images/uspace_ocs_iscsi_ramd/*.jpg doc/html
	@cp ../../common/doxy/images/common/*.png doc/html
	@tar cfz ${DOC_TAR} doc
