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

all:report.pdf plot.svg

report.pdf:report.tex figure.tex
	latex report
	latex report
	dvipdf report

figure.tex: figure.gpi out.txt
	gnuplot $<

plot.svg: plot.gpi higgs.data out.txt
	rm -f fit.log
	gnuplot $<

out.txt:main
	./$< $$(wc -l higgs.data) <higgs.data 1>$@ 2>log

clean:
	find . -type f -executable -delete
	rm --force *.o *log out.txt *.svg
