#invoke with make [-DMI=MI] -ftestfile.mak

# multiple inheritance support
MI=
# use command line -DMI=MI for multilple inheritance else not enabled

# CC=bcc
CC=cl

# named by convention
NIHCLLIB=nihcl$(MI).lib


NIHINC=..\include
NIHLIB=..\lib\$(NIHCLLIB)

# -Vf is far virtual tables (not in DS)
#CFLAGS= -w -ml -Vf -I$(NIHINC) 
CFLAGS=/f- /AL /G3 /Ob1 /OV9 /Gf /Gy /I$(NIHINC) /F dFFF

# build rule
#   $(CC) -D$(MI) $(CFLAGS) $< $(NIHLIB)     
.cpp.exe:
	$(CC) $(CFLAGS) $< /link /SEG:256 $(NIHLIB) 
	del $*.obj

# test programs
PROGS = array.exe bag.exe bitboard.exe bitset.exe class.exe nihdate.exe dep.exe\
		 dict.exe error.exe except.exe fc.exe fraction.exe heap.exe\
		 iddictio.exe identdic.exe identset.exe iterator.exe keysortc.exe\
		 linkedli.exe object.exe orderedc.exe point.exe random.exe\
		 range.exe rectangl.exe regex.exe seqcltn.exe sets.exe signatur.exe\
		 sortedcl.exe stack.exe string.exe substrin.exe tim.exe oio.exe

  
all: $(PROGS)

# dependencies
array.exe: array.cpp $(NIHLIB) $(NIHINC)\Point.h $(NIHINC)\Object.h\
							$(NIHINC)\ArrayOb.h\
							$(NIHINC)\Collecti.h $(NIHINC)\Iterator.h

bag.exe: bag.cpp $(NIHLIB) $(NIHINC)\Point.h $(NIHINC)\Object.h\
			$(NIHINC)\Bag.h $(NIHINC)\Collecti.h\
			$(NIHINC)\Iterator.h $(NIHINC)\Dictiona.h $(NIHINC)\Set.h\
			$(NIHINC)\ArrayOb.h

bitboard.exe: bitboard.cpp $(NIHLIB) $(NIHINC)\BitBoard.h $(NIHINC)\Object.h

bitset.exe: bitset.cpp $(NIHLIB) $(NIHINC)\Bitset.h $(NIHINC)\Object.h

class.exe: class.cpp $(NIHLIB) $(NIHINC)\Dictiona.h $(NIHINC)\Set.h $(NIHINC)\Collecti.h\
							$(NIHINC)\Object.h $(NIHINC)\Iterator.h\
							$(NIHINC)\ArrayOb.h $(NIHINC)\SortedCl.h\
							$(NIHINC)\OrderedC.h $(NIHINC)\SeqCltn.h\
							$(NIHINC)\Range.h

nihdate.exe: nihdate.cpp $(NIHLIB)   $(NIHINC)\Date.h $(NIHINC)\Object.h\
							$(NIHINC)\SortedCl.h\
							$(NIHINC)\OrderedC.h $(NIHINC)\SeqCltn.h\
							$(NIHINC)\Collecti.h $(NIHINC)\Iterator.h\
							$(NIHINC)\ArrayOb.h $(NIHINC)\Range.h

dep.exe: dep.cpp $(NIHLIB) $(NIHINC)\Point.h $(NIHINC)\Object.h $(NIHINC)\OrderedC.h\
					$(NIHINC)\SeqCltn.h $(NIHINC)\Collecti.h $(NIHINC)\Iterator.h\
					$(NIHINC)\ArrayOb.h $(NIHINC)\nihclIO.h $(NIHINC)\OIO.h\
					$(NIHINC)\OIOTbl.h $(NIHINC)\IdentDic.h $(NIHINC)\Dictiona.h\
					$(NIHINC)\Set.h $(NIHINC)\IdentSet.h $(NIHINC)\OIOfd.h

dict.exe: dict.cpp $(NIHLIB) $(NIHINC)\Point.h $(NIHINC)\Object.h\
					$(NIHINC)\Dictiona.h $(NIHINC)\Set.h $(NIHINC)\Collecti.h\
					$(NIHINC)\Iterator.h $(NIHINC)\ArrayOb.h $(NIHINC)\Assoc.h\
					$(NIHINC)\LookUpke.h $(NIHINC)\Bag.h $(NIHINC)\OrderedC.h\
					$(NIHINC)\SeqCltn.h

error.exe: error.cpp $(NIHLIB) $(NIHINC)\Stack.h $(NIHINC)\OrderedC.h\
				$(NIHINC)\SeqCltn.h $(NIHINC)\Collecti.h $(NIHINC)\Object.h\
				$(NIHINC)\Iterator.h $(NIHINC)\ArrayOb.h $(NIHINC)\Exceptio.h\
				$(NIHINC)\nihclIO.h $(NIHINC)\OIO.h $(NIHINC)\OIOTbl.h\
				$(NIHINC)\IdentDic.h $(NIHINC)\Dictiona.h $(NIHINC)\Set.h\
				$(NIHINC)\IdentSet.h $(NIHINC)\OIOfd.h $(NIHINC)\niherrs.h

except.exe: except.cpp $(NIHLIB) $(NIHINC)\Exceptio.h $(NIHINC)\Object.h

fc.exe: fc.cpp $(NIHLIB) $(NIHINC)\Fraction.h $(NIHINC)\Object.h

fraction.exe: fraction.cpp $(NIHLIB) $(NIHINC)\Fraction.h $(NIHINC)\Object.h

heap.exe: heap.cpp $(NIHLIB) $(NIHINC)\Heap.h $(NIHINC)\Collecti.h $(NIHINC)\Object.h\
			$(NIHINC)\Iterator.h $(NIHINC)\OrderedC.h $(NIHINC)\SeqCltn.h\
			$(NIHINC)\ArrayOb.h $(NIHINC)\Integer.h $(NIHINC)\Set.h\
			$(NIHINC)\Point.h

iddictio.exe: iddictio.cpp $(NIHLIB) $(NIHINC)\Assoc.h $(NIHINC)\LookUpke.h\
				$(NIHINC)\Object.h $(NIHINC)\Bitset.h $(NIHINC)\IdentDic.h\
				$(NIHINC)\Dictiona.h $(NIHINC)\Set.h $(NIHINC)\Collecti.h\
				$(NIHINC)\Iterator.h $(NIHINC)\ArrayOb.h $(NIHINC)\OrderedC.h\
				$(NIHINC)\SeqCltn.h $(NIHINC)\Point.h $(NIHINC)\Rectangl.h\
				$(NIHINC)\SortedCl.h $(NIHINC)\Range.h $(NIHINC)\Stack.h\
				$(NIHINC)\NIHStrin.h $(NIHINC)\OIOnih.h $(NIHINC)\OIOstrea.h\
				$(NIHINC)\OIO.h $(NIHINC)\OIOTbl.h $(NIHINC)\IdentSet.h

IdentDic.exe: IdentDic.cpp $(NIHLIB) $(NIHINC)\Point.h $(NIHINC)\Object.h\
				$(NIHINC)\IdentDic.h\
				$(NIHINC)\Dictiona.h $(NIHINC)\Set.h $(NIHINC)\Collecti.h\
				$(NIHINC)\Iterator.h $(NIHINC)\ArrayOb.h $(NIHINC)\Assoc.h\
				$(NIHINC)\LookUpke.h $(NIHINC)\AssocInt.h $(NIHINC)\Integer.h\
				$(NIHINC)\SortedCl.h $(NIHINC)\OrderedC.h $(NIHINC)\SeqCltn.h\
				$(NIHINC)\Range.h

identset.exe: identset.cpp $(NIHLIB) $(NIHINC)\Point.h $(NIHINC)\Object.h\
					$(NIHINC)\IdentSet.h\
					$(NIHINC)\Set.h $(NIHINC)\Collecti.h $(NIHINC)\Iterator.h\
					$(NIHINC)\ArrayOb.h

iterator.exe: iterator.cpp $(NIHLIB) $(NIHINC)\Iterator.h $(NIHINC)\Object.h\
		$(NIHINC)\linkedli.h\
		$(NIHINC)\SeqCltn.h $(NIHINC)\Collecti.h $(NIHINC)\Link.h\
		$(NIHINC)\OrderedC.h $(NIHINC)\ArrayOb.h $(NIHINC)\Set.h $(NIHINC)\Heap.h\
		$(NIHINC)\Point.h $(NIHINC)\LinkOb.h\
		$(NIHINC)\OIOnih.h $(NIHINC)\OIOstrea.h $(NIHINC)\OIO.h $(NIHINC)\OIOTbl.h\
		$(NIHINC)\IdentDic.h $(NIHINC)\Dictiona.h $(NIHINC)\IdentSet.h

keysortc.exe: keysortc.cpp $(NIHLIB) $(NIHINC)\KeySortC.h $(NIHINC)\SortedCl.h\
		$(NIHINC)\OrderedC.h $(NIHINC)\SeqCltn.h $(NIHINC)\Collecti.h $(NIHINC)\Object.h\
		$(NIHINC)\Iterator.h\
		$(NIHINC)\ArrayOb.h $(NIHINC)\Range.h $(NIHINC)\LookUpke.h\
		$(NIHINC)\NIHStrin.h\
		$(NIHINC)\Date.h $(NIHINC)\NIHFloat.h\
		$(NIHINC)\nihtime.h $(NIHINC)\Integer.h

linkedli.exe: linkedli.cpp $(NIHLIB) $(NIHINC)\Point.h $(NIHINC)\Object.h\
		$(NIHINC)\linkedli.h\
		$(NIHINC)\SeqCltn.h $(NIHINC)\Collecti.h $(NIHINC)\Iterator.h\
		$(NIHINC)\Link.h $(NIHINC)\LinkOb.h $(NIHINC)\Set.h $(NIHINC)\ArrayOb.h

object.exe: object.cpp $(NIHLIB)  $(NIHINC)\Point.h $(NIHINC)\Object.h\
								$(NIHINC)\Rectangl.h

oio.exe: oio.cpp $(NIHLIB) $(NIHINC)\nihclcon.h\
		$(NIHINC)\ArrayOb.h $(NIHINC)\Collecti.h $(NIHINC)\Object.h\
		$(NIHINC)\Iterator.h\
		$(NIHINC)\Assoc.h $(NIHINC)\LookUpke.h $(NIHINC)\Bag.h $(NIHINC)\Dictiona.h\
		$(NIHINC)\Set.h $(NIHINC)\Bitset.h $(NIHINC)\Date.h\
		$(NIHINC)\NIHFloat.h $(NIHINC)\Fraction.h $(NIHINC)\Heap.h $(NIHINC)\OrderedC.h\
		$(NIHINC)\SeqCltn.h $(NIHINC)\linkedli.h $(NIHINC)\Link.h $(NIHINC)\LinkOb.h\
		$(NIHINC)\Point.h $(NIHINC)\Range.h\
		$(NIHINC)\Rectangl.h $(NIHINC)\SortedCl.h $(NIHINC)\Stack.h $(NIHINC)\NIHStrin.h\
		$(NIHINC)\nihtime.h $(NIHINC)\OIOnih.h $(NIHINC)\OIOstrea.h $(NIHINC)\OIO.h\
		$(NIHINC)\OIOTbl.h $(NIHINC)\IdentDic.h $(NIHINC)\IdentSet.h $(NIHINC)\OIOfd.h

OrderedC.exe: orderedc.cpp $(NIHLIB) $(NIHINC)\Point.h $(NIHINC)\Object.h\
		$(NIHINC)\OrderedC.h\
		$(NIHINC)\SeqCltn.h $(NIHINC)\Collecti.h $(NIHINC)\Iterator.h\
		$(NIHINC)\ArrayOb.h $(NIHINC)\Set.h

point.o: $(NIHINC)\Point.h $(NIHINC)\Object.h

random.o: $(NIHINC)\Random.h $(NIHINC)\Object.h

range.o: $(NIHINC)\Range.h $(NIHINC)\Object.h

Rectangl.exe: Rectangl.cpp $(NIHLIB) $(NIHINC)\Point.h $(NIHINC)\Object.h\
				$(NIHINC)\Rectangl.h\
				$(NIHINC)\OrderedC.h $(NIHINC)\SeqCltn.h $(NIHINC)\Collecti.h\
				$(NIHINC)\Iterator.h $(NIHINC)\ArrayOb.h

regex.exe: regex.cpp $(NIHLIB) $(NIHINC)\Regex.h $(NIHINC)\NIHStrin.h $(NIHINC)\Object.h\
			$(NIHINC)\Range.h $(NIHINC)\regex.h\
			$(NIHINC)\OIOnih.h $(NIHINC)\OIOstrea.h $(NIHINC)\OIO.h $(NIHINC)\OIOTbl.h\
			$(NIHINC)\IdentDic.h $(NIHINC)\Dictiona.h $(NIHINC)\Set.h\
			$(NIHINC)\Collecti.h $(NIHINC)\Iterator.h $(NIHINC)\ArrayOb.h\
			$(NIHINC)\IdentSet.h $(NIHINC)\OrderedC.h $(NIHINC)\SeqCltn.h

seqcltn.exe: seqcltn.cpp $(NIHLIB) $(NIHINC)\Point.h $(NIHINC)\Object.h\
				$(NIHINC)\OrderedC.h\
				$(NIHINC)\SeqCltn.h $(NIHINC)\Collecti.h $(NIHINC)\Iterator.h\
				$(NIHINC)\ArrayOb.h $(NIHINC)\Set.h

sets.exe: sets.cpp $(NIHLIB) $(NIHINC)\Point.h $(NIHINC)\Object.h $(NIHINC)\Set.h\
			$(NIHINC)\Collecti.h $(NIHINC)\Iterator.h $(NIHINC)\ArrayOb.h\
			$(NIHINC)\OrderedC.h $(NIHINC)\SeqCltn.h

SortedCl.exe: SortedCl.cpp $(NIHLIB) $(NIHINC)\Point.h $(NIHINC)\Object.h\
				$(NIHINC)\SortedCl.h $(NIHINC)\OrderedC.h $(NIHINC)\SeqCltn.h\
				$(NIHINC)\Collecti.h $(NIHINC)\Iterator.h $(NIHINC)\ArrayOb.h\
				$(NIHINC)\Range.h $(NIHINC)\Set.h

stack.exe: stack.cpp $(NIHLIB) $(NIHINC)\Point.h $(NIHINC)\Object.h $(NIHINC)\Rectangl.h\
				$(NIHINC)\Stack.h $(NIHINC)\OrderedC.h $(NIHINC)\SeqCltn.h\
				$(NIHINC)\Collecti.h $(NIHINC)\Iterator.h $(NIHINC)\ArrayOb.h

string.exe: string.cpp $(NIHLIB) $(NIHINC)\nihclcon.h $(NIHINC)\Range.h\
							  $(NIHINC)\Object.h $(NIHINC)\NIHStrin.h

substrin.exe: substrin.cpp $(NIHLIB) $(NIHINC)\NIHStrin.h $(NIHINC)\Object.h

tim.exe: tim.cpp $(NIHLIB) $(NIHINC)\Date.h $(NIHINC)\Object.h\
					  $(NIHINC)\nihtime.h $(NIHINC)\SortedCl.h $(NIHINC)\OrderedC.h\
			$(NIHINC)\SeqCltn.h $(NIHINC)\Collecti.h $(NIHINC)\Iterator.h\
			$(NIHINC)\ArrayOb.h $(NIHINC)\Range.h

clean:
	del *.exe




