CC = ccxx
CCDEBUG =
I = /usr/include
I2 = ../includes
LIB = liboops
CFLAGS = ${CCDEBUG} -I${I2}
LFLAGS = ${CCDEBUG} ${OOPSLIB}
# Target Directories
OOPSLIBDIR = /usr/lib
OOPSINCDIR = /usr/include/oops

OBJECTS = Arraychar.o Arrayobid.o Assoc.o AssocInt.o Bag.o BitBoard.o Bitset.o Class.o Collection.o Date.o Dictionary.o Exception.o Float.o Fraction.o Heap.o IdentDict.o Integer.o Link.o LinkedList.o Linkobid.o LookupKey.o Nil.o Object.o OrderedCltn.o Point.o Process.o Random.o Rectangle.o Scheduler.o Semaphore.o SeqCltn.o Set.o SharedQueue.o SortedCltn.o Stack.o String.o Time.o _main.o oopsIO.o oopserrs.o oopsinit.o Point_3d.o

GENERICS = Arraychar.hxx Arraychar.cxx

.SUFFIXES: .s .cxx
.cxx.o:
	${CC} ${CFLAGS} -c $< | grep -v "declared as inline but"
.cxx.s:
	${CC} ${CFLAGS} +i -S -c $<

.PRECIOUS: ${LIB}.a

#all: always oopserrsx.hxx ${LIB}.a
all: always oopserrs.hxx ${LIB}.a

always:
	make -f MAKEFILE generic

#oopserrsx.hxx: oopserrs.err
oopserrs.hxx: oopserrs.err
	csh -c 'if(-e /usr/bin/errcom) errcom oopserrs.err'
	csh -c 'if( ! -e /usr/bin/errcom) ../errfac/errgen oopserrs.err'
#	mv oopserrs.h oopserrs.hxx
#	mv oopserrs.c oopserrs.cxx
	sed -f oopserrs.sed <oopserrs.c >oopserrs.tmp
	mv oopserrs.tmp oopserrs.cxx
	mv oopserrs.h oopserrs.hxx
	sed -n -e "s/^\([A-Z][a-zA-Z]*\).*/int OOPS_\1	= OOPS__\1;/p" <oopserrs.err >oopserrsx.hxx

generic: ${GENERICS}

Arraychar.hxx: Array_h.m4
	echo "ARRAYDECLARE(Arraychar,char,friend SubString;)" | m4 Array_h.m4 - >Arraychar.hxx

Arraychar.cxx: Array_c.m4 Arraychar.proto
	m4 Array_c.m4 Arraychar.proto >Arraychar.cxx

${LIB}.a: ${OBJECTS}
	ar rv $@ $?
	-ranlib ${LIB}.a

install:
	-mkdir ${OOPSLIBDIR}
	cp ${LIB}.a ${OOPSLIBDIR}/${LIB}.a
	-ranlib ${OOPSLIBDIR}/${LIB}.a
	-mkdir ${OOPSINCDIR}
	-rm ${OOPSINCDIR}/*.hxx
	cp *.hxx ${OOPSINCDIR}

clean:
#	-rm *.o *..c ${LIB}.a oopserrs.cxx oopserrsx.hxx ${GENERICS}
	-rm *.o *..c ${LIB}.a oopserrs.cxx oopserrs.hxx ${GENERICS}

Arraychar.o: Arraychar.hxx oopsconfig.hxx ${I}/libc.hxx oopsIO.hxx Collection.hxx \
				 Object.hxx ${I2}/osfcn.hxx Arrayobid.hxx 
Assoc.o: Assoc.hxx LookupKey.hxx Object.hxx 
AssocInt.o: AssocInt.hxx oopsIO.hxx LookupKey.hxx Integer.hxx Object.hxx ${I2}/osfcn.hxx
Bag.o: Bag.hxx AssocInt.hxx Integer.hxx oopsIO.hxx LookupKey.hxx Collection.hxx \
		 Dictionary.hxx Object.hxx Set.hxx Arrayobid.hxx ${I2}/osfcn.hxx
BitBoard.o: BitBoard.hxx oopsIO.hxx Object.hxx ${I2}/osfcn.hxx
Bitset.o: Bitset.hxx oopsIO.hxx Object.hxx ${I2}/osfcn.hxx
Class.o: Object.hxx String.hxx Dictionary.hxx Assoc.hxx LookupKey.hxx Set.hxx \
			Collection.hxx Arrayobid.hxx Arraychar.hxx 
Collection.o: Collection.hxx Arrayobid.hxx oopsIO.hxx Object.hxx ${I2}/osfcn.hxx
Date.o: Date.hxx String.hxx oopsIO.hxx Object.hxx Arraychar.hxx Collection.hxx ${I2}/osfcn.hxx
Dictionary.o: Dictionary.hxx LookupKey.hxx Assoc.hxx Set.hxx Object.hxx Collection.hxx \
              Arrayobid.hxx
#Exception.o: ExceptAct.hxx ${I2}/osfcn.hxx ${I}/libc.hxx ${I2}/errlib.hxx oopsconfig.hxx \
#				 oopserrs.hxx oopserrsx.hxx Exception.hxx Object.hxx ${I}/setjmp.h \
#				 ${I}/stdio.h ${I}/stream.hxx
Exception.o: ExceptAct.hxx ${I2}/osfcn.hxx ${I}/libc.hxx ${I2}/errlib.hxx oopsconfig.hxx \
				 oopserrs.hxx Exception.hxx Object.hxx 
Float.o: Float.hxx oopsIO.hxx Object.hxx ${I}/stdio.h ${I2}/osfcn.hxx
Fraction.o: Fraction.hxx ${I}/libc.hxx ${I}/math.h oopsIO.hxx
Fraction.o: Object.hxx ${I}/stdio.h ${I}/stream.hxx
Fraction.o: ${I}/string.h ${I2}/osfcn.hxx
Heap.o: ${I}/libc.hxx Heap.hxx oopsIO.hxx Collection.hxx OrderedCltn.hxx
Heap.o: Arrayobid.hxx Object.hxx ${I}/stdio.h ${I}/stream.hxx
Heap.o: SeqCltn.hxx ${I}/string.h ${I2}/osfcn.hxx
IdentDict.o: IdentDict.hxx LookupKey.hxx Dictionary.hxx Set.hxx Object.hxx
IdentDict.o: ${I}/stdio.h ${I}/stream.hxx Collection.hxx
IdentDict.o: Arrayobid.hxx
Integer.o: Integer.hxx oopsIO.hxx Object.hxx ${I}/stdio.h
Integer.o: ${I}/stream.hxx ${I}/string.h
Integer.o: ${I2}/osfcn.hxx
Link.o: Link.hxx Object.hxx ${I}/stdio.h ${I}/stream.hxx
LinkedList.o: LinkedList.hxx oopsIO.hxx SeqCltn.hxx Link.hxx Object.hxx
LinkedList.o: ${I}/stdio.h ${I}/stream.hxx Collection.hxx
LinkedList.o: ${I}/string.h ${I2}/osfcn.hxx
Linkobid.o: Linkobid.hxx oopsIO.hxx Link.hxx Object.hxx ${I}/stdio.h
Linkobid.o: ${I}/stream.hxx ${I}/string.h
Linkobid.o: ${I2}/osfcn.hxx
LookupKey.o: LookupKey.hxx Object.hxx ${I}/stdio.h
LookupKey.o: ${I}/stream.hxx
Nil.o: Object.hxx ${I}/stdio.h ${I}/stream.hxx
Object.o: ${I}/ctype.h oopsconfig.hxx Object.hxx Dictionary.hxx LookupKey.hxx
Object.o: IdentDict.hxx String.hxx ${I}/string.h Assoc.hxx AssocInt.hxx
Object.o: OrderedCltn.hxx oopsIO.hxx Integer.hxx Set.hxx ${I}/stdio.h
Object.o: ${I}/stream.hxx SeqCltn.hxx Arrayobid.hxx Collection.hxx
Object.o: Arraychar.hxx ${I2}/osfcn.hxx
OrderedCltn.o: ${I}/libc.hxx OrderedCltn.hxx oopsIO.hxx SeqCltn.hxx
OrderedCltn.o: Arrayobid.hxx Collection.hxx Object.hxx ${I}/stdio.h
OrderedCltn.o: ${I}/stream.hxx ${I}/string.h
OrderedCltn.o: ${I2}/osfcn.hxx
Point.o: Point.hxx oopsIO.hxx Object.hxx ${I}/math.h
Point.o: ${I}/stdio.h ${I}/stream.hxx
Point.o: ${I}/string.h ${I2}/osfcn.hxx
Process.o: Process.hxx Scheduler.hxx ExceptAct.hxx Exception.hxx oopserrs.hxx Object.hxx
Process.o: ${I}/setjmp.h ${I}/stdio.h
Process.o: ${I}/stream.hxx Link.hxx oopsconfig.hxx LinkedList.hxx SeqCltn.hxx
Process.o: Collection.hxx
Random.o: Random.hxx oopsconfig.hxx ${I}/time.h oopsIO.hxx Object.hxx
Random.o: ${I}/stdio.h ${I}/stream.hxx
Random.o: ${I}/string.h ${I2}/osfcn.hxx
Rectangle.o: Rectangle.hxx OrderedCltn.hxx oopsIO.hxx SeqCltn.hxx Arrayobid.hxx
Rectangle.o: Collection.hxx Object.hxx ${I}/stdio.h
Rectangle.o: ${I}/stream.hxx Point.hxx ${I}/math.h
Rectangle.o: ${I}/string.h ${I2}/osfcn.hxx
Scheduler.o: Process.hxx Scheduler.hxx ${I2}/osfcn.hxx Link.hxx Exception.hxx
Scheduler.o: oopsconfig.hxx Object.hxx ${I}/setjmp.h
Scheduler.o: ${I}/stdio.h ${I}/stream.hxx LinkedList.hxx
Scheduler.o: SeqCltn.hxx Collection.hxx
Semaphore.o: Semaphore.hxx Process.hxx Scheduler.hxx oopsIO.hxx Link.hxx Exception.hxx
Semaphore.o: oopsconfig.hxx Object.hxx ${I}/setjmp.h
Semaphore.o: ${I}/stdio.h ${I}/stream.hxx LinkedList.hxx
Semaphore.o: SeqCltn.hxx Collection.hxx ${I}/string.h
Semaphore.o: ${I2}/osfcn.hxx
SeqCltn.o: SeqCltn.hxx Collection.hxx Object.hxx ${I}/stdio.h
SeqCltn.o: ${I}/stream.hxx
Set.o: Set.hxx oopsIO.hxx Collection.hxx Arrayobid.hxx Object.hxx ${I}/stdio.h
Set.o: ${I}/stream.hxx ${I}/string.h ${I2}/osfcn.hxx
SharedQueue.o: SharedQueue.hxx oopsIO.hxx Arrayobid.hxx Semaphore.hxx Collection.hxx
SharedQueue.o: Object.hxx ${I}/stdio.h ${I}/stream.hxx
SharedQueue.o: LinkedList.hxx SeqCltn.hxx Link.hxx ${I}/string.h
SharedQueue.o: ${I2}/osfcn.hxx
SortedCltn.o: SortedCltn.hxx oopsIO.hxx OrderedCltn.hxx SeqCltn.hxx Arrayobid.hxx
SortedCltn.o: Collection.hxx Object.hxx ${I}/stdio.h
SortedCltn.o: ${I}/stream.hxx ${I}/string.h
SortedCltn.o: ${I2}/osfcn.hxx
Stack.o: Stack.hxx oopsIO.hxx OrderedCltn.hxx SeqCltn.hxx Arrayobid.hxx Collection.hxx
Stack.o: Object.hxx ${I}/stdio.h ${I}/stream.hxx
Stack.o: ${I}/string.h ${I2}/osfcn.hxx
String.o: String.hxx ${I}/ctype.h oopsIO.hxx Arraychar.hxx
String.o: ${I}/string.h Collection.hxx Object.hxx ${I}/stdio.h
String.o: ${I}/stream.hxx ${I2}/osfcn.hxx
Time.o: Date.hxx Time.hxx oopsconfig.hxx oopsIO.hxx ${I}/time.h Object.hxx
Time.o: ${I}/stdio.h ${I}/stream.hxx
Time.o: ${I}/string.h ${I2}/osfcn.hxx
oopsIO.o: ${I}/ctype.h oopsIO.hxx Object.hxx ${I}/string.h
oopsIO.o: ${I2}/osfcn.hxx ${I}/stdio.h
oopsIO.o: ${I}/stream.hxx
oopserrs.o: oopserrs.hxx
oopsinit.o: Object.hxx ${I2}/errlib.hxx ${I}/stdio.h
oopsinit.o: ${I}/stream.hxx
Point_3d.o: Point_3d.hxx oopsIO.hxx Object.hxx ${I}/math.h
Point_3d.o: ${I}/stdio.h ${I}/stream.hxx
Point_3d.o: ${I}/string.h ${I2}/osfcn.hxx
