
#
# This Makefile is adopted from 
#    http://www.cs.arizona.edu/classes/cs433/spring02/opengl/code/Makefile
#
# I have adjusted it so that it works on the grapics lab Red Hat Linux machines.
# This mostly involved erasing stuff, since OpenGL is installed in a relatively
# standard place on those machines. 
#
# Kobus. 
#

# LPATH tells the linker where to find libraries (default locations work OK in
# graphics lab)
LPATH = -L/usr/X11R6/lib

# IPATH tells the compiler where to look for include files(default locations OK
# in graphics lab (and elsewhere?)).
IPATH = 

# GLLIBS are the GLUT and OpenGL (or Mesa) libraries needed by the linker.
GLLIBS = -lglut -lGLU -lGL

# XLIBS are the X libraries needed by the linker because GLUT and OpenGL
#       call X routines (not needed on graphics lab linux machines). 
XLIBS = -lXi -lXmu

# MISCLIBS are miscellaneous libs that are needed by the linker.
# -lm denotes the math library.
MISCLIBS = -lm

LIBS = $(LPATH) $(GLLIBS) $(XLIBS) $(MISCLIBS)

# compiler
CC = gcc

# compiler flags:
# -c    tells the compiler to only compile (don't link). 
# -g    tells the compiler to produce symbolic information that a debugger
#       (like gdb) needs.
# "-Wall  -Wmissing-prototypes -W" specifies which warnings we want
CFLAGS = -c -g -Wall -Wmissing-prototypes -W

# linker--let gcc pass it on to the right place
LD = gcc

# linker flags:
# -g    tells the compiler to produce symbolic information that a debugger
#       (like gdb) needs.
LFLAGS = -g

# delete command
RM = -/bin/rm -f

TRIANGLE_OBS = triangle.o

all : triangle 

triangle : triangle.o
	$(LD) $(LFLAGS) -o $@ $(TRIANGLE_OBS) $(LIBS)


# The default way to convert .c files into .o files.
.c.o: ; $(CC) -c $(CFLAGS) $(IPATH) $<


clean:
	$(RM) $(TRIANGLE_OBS) triangle 


