SRC=alloc.c bg.c dindex.c initdir.c input.c intersect.c main.c\
	scan.c shade.c shape.c trace.c data.c

OBJ=alloc.o bg.o dindex.o initdir.o input.o intersect.o main.o\
	scan.o shade.o shape.o trace.o data.o

HDR=ray.h

CC=cc
CFLAGS=-O -g

ray:	$(OBJ)
	$(CC) $(CFLAGS) $(OBJ) -o ray -lm

ray.lint:	$(HDR) $(SRC)
	lint -b $(SRC) -lm >ray.lint

$(OBJ):	ray.h

print:
	print Makefile $(HDR) $(SRC)

ray.shar: README Makefile $(HDR) $(SRC) test.v random.c
	shar README Makefile $(HDR) $(SRC) test.v random.c >ray.shar

clean:
	rm -f $(OBJ) ray random test.pic test1000.v test1000.pic lint

random: random.c
	cc -O random.c -o random -lm

test.pic: ray
	ray test.v test.pic

test100.v: random
	echo f 90 >test100.v
	echo l 1 1 -3 >>test100.v
	echo l -4 0 -1 >>test100.v
	random 100 0.07 >>test100.v
	echo e >>test100.v

test100.pic: ray test100.v
	ray -t test100.v test100.pic 
