#
# Makefile
#
# Example 2 of the Debian package diploma
#
# Copyright (C) 1999 Andreas Franzen
#
# See the file copyright for details.
#
# The final target is the print file fig.eps.

# fig.eps depends on fig.meta and pic.meta. fig.meta is the diagram produced
# by graph and pic.meta is a hand-made additional picture to be included.
fig.eps : fig.meta pic.meta h.meta
	plot -T ps -s fig.meta h.meta pic.meta > fig.eps

# The diagram produced by graph contains the processed measurement data in
# data.dat and two points of the regression-line in regdata.dat.
fig.meta : data.dat regdata.dat
	graph -O -F HersheySans -X "frequency \*n in 10\sp15\eps\sp-1" \
          -Y "voltage \f2U\f1 in V" -S 1 -m 0 -I e data.dat \
          -m 1 -I a regdata.dat > fig.meta

# In the raw measurement data there are 4 individual measurements for each
# wavelength. These are converted by use of prog into single values with the
# corresponding statistical error.
data.dat : prog rawdata.dat
	./prog < rawdata.dat > data.dat

# From the data points in data.dat a regression line is computed. Two points
# on this line are then saved in regdata.dat.
regdata.dat h.meta : prog2 data.dat
	./prog2 < data.dat > regdata.dat

prog : prog.c
	gcc -Wall -o prog prog.c -lm

prog2 : prog2.c
	gcc -Wall -o prog2 prog2.c -lm
