plot.svg: out.data Makefile
	echo '\
	set term svg; set out "$@";\
	set xlabel "x";\
	set ylabel "y";\
	plot \
	 "$<" index 0 with points pointtype 5 title "data"\
	,"$<" index 1 with lines title "spline"\
	' | tee log.plot | gnuplot

out.data: main.exe
	mono $< > $@

main.exe: main.cs cspline.dll
	mcs $< -target:exe -reference:cspline.dll

cspline.dll: cspline.cs
	mcs $< -target:library

clean:
	$(RM) *.exe *.dll out.* *.svg log*
