CSC = mcs
RUN = mono
CODE = $(filter %.cs,$^)
LIBS = $(addprefix -reference:,$(filter %.dll,$^))
MKEXE = $(CSC) -target:exe -out:$@ $(LIBS) $(CODE)
MKLIB = $(CSC) -target:library -out:$@ $(LIBS) $(CODE)

Out.txt:main.exe
	$(RUN) $< > $@ 2>log
	echo "\ntall matrix:" >> $@
	$(RUN) $< -n 4 -m 3 >> $@ 2>>log

main.exe: main.cs matlib.dll; $(MKEXE)

matlib.dll: ../matrix/matrix.cs ../matrix/vector.cs qr.cs
	$(MKLIB);

clean:
	$(RM) Out* *.dll *.exe log*
