#INCLUDEPATH=-I. -I/udir/detlefs/include
INCLUDEPATH=-I.
#LIBPATH=-L/udir/detlefs/lib
LIBPATH=-L.

#CCFLAGS=${INCLUDEPATH} ${LIBPATH} -O -Olimit 600 -DNO_ARRAY_BOUNDS -DPRINTTIME=1 -DULTRASAFE
#CCFLAGS=${INCLUDEPATH} ${LIBPATH} -O -Olimit 600 -DNO_ARRAY_BOUNDS -DPRINTTIME=1
#CCFLAGS=${INCLUDEPATH} ${LIBPATH}

#CCFLAGS=${INCLUDEPATH} ${LIBPATH} -g -DDEBUG=2 -noinline
#CCFLAGS=${INCLUDEPATH} ${LIBPATH} -g -DDEBUG=1
CCFLAGS=${INCLUDEPATH} ${LIBPATH} -g

CC=cxx ${CCFLAGS}

all: testNarrow testRC test1

test1:	test1.o test1_templates.o libRef.a
	${CC} -o test1 test1.o test1_templates.o -lRef -lc


test1.o: ZCL.h FOS.h Ref_inline.h RefArray.h Ref.h test1.h test1.cxx
	${CC} -c test1.cxx

testNarrow:	testNarrow.o libRef.a
	${CC} -o testNarrow testNarrow.o -lRef -lc


testNarrow.o: ZCL.h FOS.h Ref_inline.h RefArray.h Ref.h RefWiden.h \
		testNarrow.cxx 
	${CC} -c testNarrow.cxx

testRC:	testRC.o libRef.a
	${CC} -o testRC testRC.o -lRef -lc


testRC.o: ZCL.h FOS.h Ref_inline.h RefArray.h Ref.h RefImpl.cxx testRC.cxx 
	${CC} -c testRC.cxx


bug4:	bug4.o libRef.a
	${CC} -o bug4 bug4.o -lc


bug4.o: ZCL.h FOS.h Ref_inline.h RefArray.h Ref.h test1.h bug4.cxx
	${CC} -c bug4.cxx

test1_templates.o: \
	test1_templates.cxx Ref.h ZCL.h \
	FOS.h Ref_inline.h RefImpl.cxx RefArray.h \
	RefArrayImpl.cxx test1.h Heap.h RCMapper.h
	${CC} -c test1_templates.cxx

libRef.a:	Heap.o Ref.o FOS.o ZCL.o RefArray.o RCMap.o
	ar cr libRef.a Heap.o Ref.o FOS.o ZCL.o RefArray.o RCMap.o \
		/udir/detlefs/lib/Time.o
	ar ts libRef.a

FOS.o:		FOS.cxx FOS.h
	${CC} -c FOS.cxx

ZCL.o:		ZCL.cxx ZCL.h
	${CC} -c ZCL.cxx

Ref.o: \
	Ref.cxx Ref.h Heap.h ZCL.h FOS.h Ref_inline.h
	${CC} -c Ref.cxx

RefArray.o:	RefArray.cxx RefArray.h Ref.h Heap.h ZCL.h FOS.h Ref_inline.h
	${CC} -c RefArray.cxx

Heap.o:	Heap.cxx Ref.h Heap.h ZCL.h FOS.h Ref_inline.h Heap.h
	${CC} -c Heap.cxx

RCMap.o:	RCMap.cxx RCMap.h
	${CC} -c RCMap.cxx


