# $LAAS$

# Togl - a Tk OpenGL widget
# Version 1.5
# Copyright (C) 1996-1997  Brian Paul and Ben Bederson
# See the LICENSE file for copyright details.



# Makefile for Togl demos
# You'll probably have to tinker with these macros:


# The C compiler:
CC = cc

# Compiler options:
COPTS = -c -O

# Shared library linker command:
SHLINK = cc -G

# Name for the shared lib:
#SH_LIB = libtogl.so.1.3
SH_LIB = 

# Where to find tcl.h, tk.h, OpenGL/Mesa headers, etc:
INCLUDES = -I/usr/local/include -I/usr/include/tcl

# Where to find libtcl.a, libtk.a, OpenGL/Mesa libraries:
LIBDIRS = -L/usr/local/lib

# Libraries to link with (-ldl for Linux only?):
LIBS = -ltk -ltcl -lGLU -lGL -L/usr/X11/lib -lX11 -lXmu -lXext -lXt -lm -ldl

TK_FLAGS =


#### Shouldn't have to change anything beyond this point ####


CFLAGS = $(COPTS) $(INCLUDES) $(TK_FLAGS)

LFLAGS = $(LIBDIRS)


DEMOS = $(SH_LIB) double texture index overlay gears


default: $(DEMOS)


# double demo
double: double.o togl.o
	$(CC) $(LFLAGS) double.o togl.o $(LIBS) -o $@

double.o: double.c togl.h
	$(CC) $(CFLAGS) double.c


# texture demo
texture: texture.o image.o togl.o
	$(CC) $(LFLAGS) texture.o image.o togl.o $(LIBS) -o $@

texture.o: texture.c togl.h
	$(CC) $(CFLAGS) texture.c

image.o: image.c
	$(CC) $(CFLAGS) image.c


# color index demo
index: index.o togl.o
	$(CC) $(LFLAGS) index.o togl.o $(LIBS) -o $@

index.o: index.c togl.h
	$(CC) $(CFLAGS) index.c


# overlay demo
overlay: overlay.o togl.o
	$(CC) $(LFLAGS) overlay.o togl.o $(LIBS) -o $@

overlay.o: overlay.c togl.h
	$(CC) $(CFLAGS) overlay.c


# gears demo
gears: gears.o togl.o
	$(CC) $(LFLAGS) gears.o togl.o $(LIBS) -o $@

gears.o: gears.c togl.h
	$(CC) $(CFLAGS) gears.c


# the togl widget
togl.o: togl.c togl.h
	$(CC) $(CFLAGS) togl.c


#$(SH_LIB): togl.o
#	$(SHLINK) $(LFLAGS) togl.o $(LIBS) -o $@ 



clean:
	-rm -f *.o *~ core

realclean:
	-rm -f *.o *~ core
	-rm -f $(DEMOS)



TOGL = Togl-1.5

FILES = \
	$(TOGL)/README		\
	$(TOGL)/Togl.html	\
	$(TOGL)/LICENSE		\
	$(TOGL)/Makefile	\
	$(TOGL)/*.[ch]		\
	$(TOGL)/*.tcl		\
	$(TOGL)/tree2.rgba	\
	$(TOGL)/ben.rgb

tar:
	cd .. ; \
	tar -cvf $(TOGL).tar $(FILES) ; \
	gzip $(TOGL).tar ; \
	mv $(TOGL).tar.gz $(TOGL)


zip:
	cd .. ; \
	zip -r $(TOGL).zip $(FILES) ; \
	mv $(TOGL).zip $(TOGL)
