#
# Makefile for the Voodoo demos
#
# Add -DXMESA to the COPTS if you want to enable the "on the fly"
# 3Dfx window/full-screen toggle.
#

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

all: tunnel teapot fire terrain paltex glbpaltx gltest ray

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

gltest: gltest.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 teapot fire terrain paltex glbpaltx gltest ray

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