# Makefile for Ray Tracing

CFlags=

all:	SpheresWithImag SpheresWithImagAnime Pentagon Sphere6 \
	SphereInside RefractionAnime RefractionAnimeLog

NumTest:	NumTest.cc raytrace.h makefile
	g++ -o $@  $@.cc -lm  ${CFlags}

ImageTest:	ImageTest.cc raytrace.h makefile
	g++ -o $@  $@.cc -lm  ${CFlags}

SpheresWithImag:	SpheresWithImag.cc raytrace.h makefile
	g++ -o $@  $@.cc -lm  ${CFlags}

SpheresWithImagAnime:	SpheresWithImag.cc raytrace.h makefile
	g++ -o SpheresWithImagAnime  SpheresWithImag.cc \
		-lm  ${CFlags} -DANIMATION

Pentagon:	Pentagon.cc raytrace.h makefile
	g++ -o $@  $@.cc -lm  ${CFlags}

Sphere6:	Sphere6.cc raytrace.h makefile
	g++ -o $@  $@.cc -lm  ${CFlags}

SphereInside:	SphereInside.cc raytrace.h timerecord.h makefile
	g++ -o $@  $@.cc -lm  ${CFlags}

RefractionAnime:	RefractionAnime.cc raytrace.h makefile
	g++ -o $@  $@.cc -lm  ${CFlags}

RefractionAnimeLog:	RefractionAnime.cc raytrace.h makefile
	g++ -o RefractionAnimeLog  RefractionAnime.cc \
		-lm  ${CFlags} -DLOG_SCALE


nagatani.ppm:	nagatani.eps
	gs -sDEVICE=ppmraw -r144 -g1280x1024 -q -dNOPAUSE \
		-sOutputFile=./nagatani.ppm -- ./nagatani.eps

backup:
	lha a raytrace071.lzh *.cc *.h  makefile *.sh *.dat *.doc \
		nagatani.eps

clean:
	rm -f NumTest ImageTest \
		SphersWithImag SphersWithImagAnime Pentagon Sphere6 \
		SphereInside RefractionAnime RefractionAnimeLog