# Compile and run examples to test gcc 3.0's compilation.
#
# Written by Jeffrey D. Oldham, CodeSourcery LLC, 2001Feb26.

# Run the examples.
all:	Tiny/Tiny.output Field/ScalarAdvection1D/ScalarAdvection1D.output Particles/Bounce/Bounce.output GKPoisson/GKPoisson.output Doof2d/Doof2d.output

%.output:
	$(MAKE) -C $(@D) 
	./$(*D)/${ARCH}/$(*F) < $(*D)/$(*F).in > $(*F).output
	diff $(*F).output $(*D)/$(*F).out > $(*F).output.diff
	echo $(*F) succeeded

# Clean the output and difference files.
clean:
	rm -f *.diff
	rm -f *.output

# Remove the output and difference files and also object files so the
# files will be recompiled.
realclean: clean
	$(MAKE) -C Tiny clean
	$(MAKE) -C Field/ScalarAdvection1D clean
	$(MAKE) -C Particles/Bounce clean
	$(MAKE) -C GKPoisson clean
	$(MAKE) -C Doof2d clean

# Revert the directory to its distribution state.
realcleansuite:
	$(MAKE) -C Tiny realcleansuite
	$(MAKE) -C Field/ScalarAdvection1D realcleansuite
	$(MAKE) -C Particles/Bounce realcleansuite
	$(MAKE) -C GKPoisson realcleansuite
	$(MAKE) -C Doof2d realcleansuite
