# Project: GlGtk-demo
#
# Makefile
# 
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program 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 General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Author: Ivo Clarysse <soggie@riv.be>
#

GTK_INCLUDE = -I/usr/local/include
GTK_LIBS = -L/usr/local/lib -lgtk -lgdk -lglib
X11_LIBS = -L/usr/X11R6/lib -lX11 -lXext -lXt
MESA_LIBS  = -lMesaGL -lMesaGLU
GL_LIBS  = -lGL -lGLU

GTK_CFLAGS = $(GTK_INCLUDE)
GTK_LDFLAGS = $(GTK_LIB) $(X11_LIB) -lX11 -lXext -lm -lMesaGL -lMesaGLU -lXt
CFLAGS = -g

# --- IRIX/MIPS + OpenGL
#LDFLAGS = -Wl,-rpath /usr/local/lib -g $(X11_LIBS) $(GTK_LIBS) $(GL_LIBS) -lm
#LDFLAGS = -Wl,-v
#CC = gcc -Wall

# --- Linux/Intel + Mesa
LDFLAGS =  -g $(X11_LIBS) $(GTK_LIBS) $(MESA_LIBS) -lm
CC = gcc -Wall

# --- No user-serviceable parts below this line
OBJS = glgtk.o
BINS = glgtk

all: $(BINS)

glgtk.o: glgtk.c
	$(CC) -c $(CFLAGS) $(GTK_CFLAGS) glgtk.c


clean:
	rm -f core *.o $(OBJS) $(BINS) nohup.out

distclean: clean
	rm -f *~
	
.c.o:
	$(CC) -c $(CFLAGS) $<
