Interp.svg:out.txt Makefile
	echo '\
	set term svg size 640,480 background rgb "white";\
	set out "$@";\
	set key out;\
	set tics out;\
	set title "neural network curve fitting";\
	set xlabel "x";\
	set ylabel "y";\
	plot\
	 "$<" index 0 with points pointtype 6 title "data"\
	,"$<" index 1 with lines title "fit"\
	'|gnuplot

out.txt:main.exe
	mono $< 1>$@ 2>log

out2.txt:main2.exe
	mono $< 1>$@ 2>log2

LIBDIR=../../matlib
LIBSRC=\
	$(LIBDIR)/extensions.cs\
	$(LIBDIR)/matrix/vector.cs\
	$(LIBDIR)/matrix/matrix.cs\
	$(LIBDIR)/minim/simplex.cs\
	$(LIBDIR)/minim/qnewton.cs\
	$(LIBDIR)/optim/rndstart.cs\
	$(LIBDIR)/optim/prernd.cs\
	$(LIBDIR)/optim/bbpso.cs\
	$(LIBDIR)/optim/swarm.cs

main.exe: main.cs ann.cs matlib.dll
	mcs $(filter %.cs,$^) $(addprefix -reference:,$(filter %.dll,$^))

main2.exe: main2.cs ann2.cs matlib.dll
	mcs $(filter %.cs,$^) $(addprefix -reference:,$(filter %.dll,$^))

matlib.dll: $(LIBSRC)
	mcs -target:library -out:$@ $^

clean:
	$(RM) *.exe *.dll [Oo]out* [Ll]og* *.svg
