all:A.txt

A.txt: mainA.exe ; mono $< > $@

DLLS = roots.dll matlib.dll
mainA.exe: mainA.cs $(DLLS)
	mcs $< -reference:$(call clist,$(DLLS))

LIBDIR = $(HOME)/public_html/prog/matlib
LIBSRC = \
	$(LIBDIR)/qr/qr.cs\
	$(LIBDIR)/matrix/vector.cs\
	$(LIBDIR)/matrix/matrix.cs
matlib.dll: $(LIBSRC)
	mcs $^ -target:library -out:$@

SRC=broyden.cs newton.cs jacobian.cs
roots.dll:$(SRC) matlib.dll
	mcs $(SRC) -target:library -out:$@ -reference:$(lastword $^)

clean:
	$(RM) *.dll *.exe out* log* [Oo]ut* A* B* C*

comma:=,
empty:=
space:=$(empty) $(empty)
clist = $(subst $(space),$(comma),$(1))
