#	common/Makefile
#
#	vi: set autoindent tabstop=4 shiftwidth=4 :
#
#	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

CFLAGS = $(COMMON_CFLAGS) $(EXTRA_CFLAGS)

SECURITY_DIR = ../security

all: common_functions.o initiator_negotiate.o target_negotiate.o lun_packing.o
 
initiator_negotiate.o:	initiator_negotiate.c initiator_negotiate.h \
			iscsi_common.h debug.h my_memory.h crc.h \
			$(SECURITY_DIR)/chap/chap.h $(SECURITY_DIR)/misc/misc_func.h \
			$(SECURITY_DIR)/srp/srp.h \
			text_param.h
	$(CC)	$(CFLAGS) -c initiator_negotiate.c

target_negotiate.o:	target_negotiate.c target_negotiate.h \
			iscsi_common.h debug.h my_memory.h crc.h \
			$(SECURITY_DIR)/chap/chap.h $(SECURITY_DIR)/misc/misc_func.h \
			text_param.h
	$(CC)	$(CFLAGS) -c target_negotiate.c

lun_packing.o:	lun_packing.c lun_packing.h
	$(CC)	$(CFLAGS) -c lun_packing.c

text_param.o:	text_param.c iscsi_common.h debug.h my_memory.h \
			crc.h \
			$(SECURITY_DIR)/chap/chap.h $(SECURITY_DIR)/srp/srp.h
	$(CC)	$(CFLAGS) -c text_param.c

iscsi_common.o:	iscsi_common.c iscsi_common.h debug.h
	$(CC)	$(CFLAGS) -c iscsi_common.c

my_memory.o:	my_memory.c my_memory.h iscsi_common.h debug.h
	$(CC)	$(CFLAGS) -c my_memory.c

range.o:	range.c range.h iscsi_common.h debug.h my_memory.h
	$(CC)	$(CFLAGS) -c range.c

debug.o:	debug.c debug.h
	$(CC)	$(CFLAGS) -c debug.c

crc.o:	crc.c crc.h
	$(CC)	$(CFLAGS) -c crc.c

tcp_utilities.o:	tcp_utilities.c tcp_utilities.h debug.h my_memory.h
	$(CC)	$(CFLAGS) -c tcp_utilities.c

common_functions.o:		iscsi_common.o my_memory.o range.o debug.o crc.o \
						tcp_utilities.o text_param.o 
	$(LD)	$(LDFLAGS) -r -o common_functions.o \
						iscsi_common.o my_memory.o range.o debug.o crc.o \
						tcp_utilities.o text_param.o

.PHONY: clean

clean:
	$(RM) *.o

