CFLAGS += -Wall -std=gnu1x $$(gsl-config --cflags) -Ofast
LDLIBS += $$(gsl-config --libs)

Out.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
	./$< 1> $@ 2>log

main:main.o ann.o qnewton.o amoeba.o

clean:
	rm -f main *.o out* log*
