#
# Makefile for the Voodoo demos
#

CC=gcc
CXX=g++
LINKER=gcc
#COPTS=-g -m486 -Wall -pipe -I../../include -DFX -DXMESA
COPTS=-O3 -fomit-frame-pointer -m486 -Wall -pipe -I../../include -DFX -DXMESA
LINKOPTS=-L../../lib -L/usr/local/glide/lib -L/usr/X11R6/lib -lglut -lMesaGLU -lMesaGL -lXt -lXi -lXmu -lXext -lX11 -lm

all: tunnel tunnel2 teapot fire terrain paltex glbpaltx gltest ray ipers rain

rain: rain.o particles.o image.o
	$(CXX) $(COPTS) $(OBJS) $^ -o $@ $(LINKOPTS)

ipers: ipers.o image.o
	$(LINKER) $(COPTS) $(OBJS) $^ -o $@ $(LINKOPTS)

ray: ray.o
	$(LINKER) $(COPTS) $(OBJS) $^ -o $@ $(LINKOPTS)

gltest: gltest.o
	$(LINKER) $(COPTS) $(OBJS) $^ -o $@ $(LINKOPTS)

tunnel2: tunnel2.o image.o sources.o
	$(LINKER) $(COPTS) $(OBJS) $^ -o $@ $(LINKOPTS)

tunnel: tunnel.o image.o sources.o
	$(LINKER) $(COPTS) $(OBJS) $^ -o $@ $(LINKOPTS)

paltex: paltex.o
	$(LINKER) $(COPTS) $(OBJS) $^ -o $@ $(LINKOPTS)

glbpaltx: glbpaltx.o
	$(LINKER) $(COPTS) $(OBJS) $^ -o $@ $(LINKOPTS)

teapot: teapot.o image.o dteapot.o shadow.o
	$(LINKER) $(COPTS) $(OBJS) $^ -o $@ $(LINKOPTS)

fire: fire.o image.o
	$(LINKER) $(COPTS) $(OBJS) $^ -o $@ $(LINKOPTS)

terrain: mesaland.o
	$(LINKER) $(COPTS) $(OBJS) $^ -o $@ $(LINKOPTS)

clean:
	rm -f *.o tunnel tunnel2 teapot fire terrain paltex glbpaltx gltest ray ipers rain

%.o: %.c
	$(CC) -c $(COPTS) $< -o $@

%.o: %.cxx
	$(CXX) -c $(COPTS) $< -o $@
