# Makefile for book programs for BeOS contributed by Tinic Urou
# (5uro@informatik.uni-hamburg.de)

# Mesa 3-D graphics library
# Version:  2.0
# Copyright (C) 1995  Brian Paul  (brianp@ssec.wisc.edu)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

# $Id: Makefile.BeOS,v 1.0 1996/01/31 07:43:20 tinic Exp $

# Revision 1.0  1997/01/31  07:43:20 tinic urou
# Initial revision
#

##### MACROS #####

STDDIR = ./
INCDIR = ../../include
CC = mwcc -i /boot/home/include/glide -nosyspath
GL_LIBS = -L../../lib -lMesaGL -lMesaGLU -lMesaaux -lMesatk

ifdef FX
CFLAGS = -DFX
endif

#LIB_DEP = ../lib/libMesaGL.so ../lib/libMesaGLU.so

PROGS = gears teapot fire terrain tunnel wave isosurf


##### RULES #####
# 	../src-glu/*.o ../src-tk/*.o ../src-aux/*.o

$(LIB_DEP):
	$(MAKELIB) $(GL_LIB) -map $(GL_LIB).xMAP ../src/*.o 
	cp $(GL_LIB)* /boot/home/config/lib
	mv $(GL_LIB)* ../lib
	
teapot: $(LIB_DEP) teapot.c image.c dteapot.c shadow.c 
	$(CC) $(CFLAGS) teapot.c image.c dteapot.c shadow.c $(GL_LIBS) -o $@ -i- -I$(INCDIR) -I$(STDDIR)

fire: $(LIB_DEP) fire.c image.c 
	$(CC) $(CFLAGS) fire.c image.c $(GL_LIBS) -o $@ -i- -I$(INCDIR) -I$(STDDIR)

terrain: $(LIB_DEP) mesaland.c
	$(CC) $(CFLAGS) mesaland.c $(GL_LIBS) -o $@ -i- -I$(INCDIR) -I$(STDDIR)

gears: $(LIB_DEP) gears.c 
	$(CC) $(CFLAGS) gears.c $(GL_LIBS) -o $@ -i- -I$(INCDIR) -I$(STDDIR)

tunnel: $(LIB_DEP) tunnel.c sources.c image.c 
	$(CC) $(CFLAGS) tunnel.c sources.c image.c $(GL_LIBS) -o $@ -i- -I$(INCDIR) -I$(STDDIR)

wave: $(LIB_DEP) wave.c 
	$(CC) $(CFLAGS) wave.c $(GL_LIBS) -o $@ -i- -I$(INCDIR) -I$(STDDIR)

isosurf: $(LIB_DEP) isosurf.c 
	$(CC) $(CFLAGS) isosurf.c $(GL_LIBS) -o $@ -i- -I$(INCDIR) -I$(STDDIR)


all: $(PROGS)

##### TARGETS #####

default:
	@echo "Specify a target configuration"

clean:
	-rm *.o *~
	-rm -f $(PROGS)

realclean: clean

targets: $(PROGS)

include ../../Make-config
