JS = /usr/users/wwwifa/docs/subatom/nucltheo/bin/js
GRAPH = /usr/users/wwwifa/docs/subatom/nucltheo/bin/graph

rkfiles = rkstep.js rkdrive.js rkmain.js
pcfiles = pcstep.js pcdrive.js pcmain.js

all: rk-graph.png pc-graph.png pi.out.txt

rk-graph.png: $(rkfiles) makefile
	$(JS) rkmain.js > rk.points
	$(GRAPH) \
		--display-type png \
		--x-label "x" \
		--y-label "y" \
		--top-label "Runge-Kutta midpoint: sin(x)" \
		rk.points > rk-graph.png

pc-graph.png: $(pcfiles) makefile
	$(JS) pcmain.js > pc.points
	$(GRAPH) \
		--display-type png \
		--x-label "x" \
		--y-label "y" \
		--top-label 'Predictor-Corrector: sin(x)' \
		pc.points > pc-graph.png

pi.out.txt: main.js $(pcfiles) $(rkfiles)
	$(JS) main.js > pi.out.txt
