#
#	target/Makefile
#
#	Makefile for scsi_target.o and iscsi_target.o
#
#	vi: set autoindent tabstop=8 shiftwidth=8 :
#
#
#	Copyright (C) 2001-2003 InterOperability Lab (IOL)
#					University of New Hampshier (UNH)
#					Durham, NH 03824
#
#	This program is free software; you can redistribute it and/or modify
#	it under the terms of the GNU General Public License as published by
#	the Free Software Foundation; either version 2, or (at your option)
#	any later version.
#
#	This program is distributed in the hope that it will be useful,
#	but WITHOUT ANY WARRANTY; without even the implied warranty of
#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#	GNU General Public License for more details.
#
#	You should have received a copy of the GNU General Public License
#	along with this program; if not, write to the Free Software
#	Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
#	USA.
#
#	The name of IOL and/or UNH may not be used to endorse or promote products
#	derived from this software without specific prior written permission.
#


include ../Rules.make

EXTRA_CFLAGS = -DDEBUG_TARGET

CFLAGS = $(COMMON_CFLAGS) $(EXTRA_CFLAGS)

all:	unh_iscsi_target.o unh_scsi_target.o

unh_iscsi_target.o:	iscsi_target.o \
			target_error_rec.o \
			iscsi_portal_group.o \
			../common/common_functions.o \
			../security/security_functions.o \
			../common/target_negotiate.o
	$(LD)	$(LDFLAGS) -r -o unh_iscsi_target.o \
			iscsi_target.o \
			target_error_rec.o \
			iscsi_portal_group.o \
			../common/common_functions.o \
			../security/security_functions.o \
			../common/target_negotiate.o

iscsi_target.o:	iscsi_target.c scsi_target_module.c \
			iscsi_target.h scsi_target.h iscsi_portal_group.h\
			target_error_rec.h \
			../common/iscsi_common.h ../common/debug.h \
			../common/text_param.h \
			../common/target_negotiate.h \
			../common/my_memory.h \
			../common/range.h \
			../common/tcp_utilities.h \
			../common/crc.h \
			../security/chap/chap.h \
			../security/srp/srp.h \
			../security/misc/misc_func.h
	$(CC)	$(CFLAGS) -c iscsi_target.c

iscsi_portal_group.o:	iscsi_portal_group.c iscsi_portal_group.h \
			iscsi_target.h
	$(CC)	$(CFLAGS) -c iscsi_portal_group.c

target_error_rec.o:	target_error_rec.c target_error_rec.h \
			iscsi_target.h iscsi_portal_group.h \
			../common/iscsi_common.h ../common/debug.h \
			../common/text_param.h \
			../common/target_negotiate.h \
			../common/my_memory.h \
			../common/range.h \
			../common/tcp_utilities.h \
			../common/crc.h \
			../security/chap/chap.h \
			../security/srp/srp.h \
			../security/misc/misc_func.h
	$(CC)	$(CFLAGS) -c target_error_rec.c

unh_scsi_target.o:	scsi_target.o ../common/lun_packing.o
	$(LD)	$(LDFLAGS) -r -o unh_scsi_target.o \
			scsi_target.o ../common/lun_packing.o

scsi_target.o:	scsi_target.c scsi_target.h ../common/lun_packing.h
	$(CC)	$(CFLAGS) -c scsi_target.c
	
scsi_target.s:	scsi_target.c scsi_target.h ../common/lun_packing.h
	$(CC)	$(CFLAGS) -S scsi_target.c

.PHONY:	clean

clean:
	$(RM)	*.o *.s scsi_disk_file_0_*
