# 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_LIB = -L/usr/local/lib
X11_LIB = -L/usr/X11R6/lib
GTK_CFLAGS = $(GTK_INCLUDE)
GTK_LDFLAGS = $(GTK_LIB) -lgtk -lgdk -lglib $(X11_LIB) -lX11 -lXext -lXt -lm
MESA_LDFLAGS = -lMesaGL -lMesaGLU 
GL_LDFLAGS = -lGL -lGLU 
CFLAGS = -g -Wall
CC = gcc

# --- IRIX/MIPS (OpenGL)
#LDFLAGS = -Wl,-rpath /usr/local/lib -g $(X11_LIB) $(GTK_LDFLAGS) $(GL_LDFLAGS)

# --- Linux/Intel (Mesa)
LDFLAGS =  -g $(X11_LIB) $(GTK_LDFLAGS) $(MESA_LDFLAGS) 

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


all: $(BINS)

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

glgtk: glgtk.o
	$(CC) -o glgtk glgtk.o $(LDFLAGS)

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

