# Makefile
# Please read NOTE1, NOTE2, NOTE3, NOTE4

#########################################################
# NOTE 1: If your GLUT installation is not in /usr/local,
# change the next *two* macros as appropriate:
#########################################################
GLUTINCLUDEDIR  = /usr/local/include/GL
GLUTLIBDIR      = /usr/local/lib/

XLIBS           = -lX11 -lXmu
GLLIBS          = -lGL -lGLU
GLUTLIB         = -lglut

INCLUDEDIRS     = -I$(GLUTINCLUDEDIR) -I.
LIBDIRS         = -L$(GLUTLIBDIR) -L.

########################################################
# NOTE 2: If your C++ compiler is not in /usr/local/bin,
# change the next macro to the path to your C++ compiler 
########################################################
CC      = /usr/local/bin/g++

CCFLAGS = -O3 -c
LIBS    = $(XLIBS) $(GLLIBS) $(GLUTLIB)

# all of our OpenGL programs will be named "main"
TARGET = main

###########################################################
# NOTE 3: List all source files (not header files) required
#         to build this lab:
###########################################################
SRCS = $(TARGET).cpp \
	init.cpp keyboard.cpp menu.cpp mouse.cpp \
	pick.cpp render.cpp view.cpp \
	Lagrange.cpp splines.cpp

################################################
# NOTE 4: DO NOT CHANGE ANYTHING BELOW THIS LINE
################################################

# list of header files (one for each .cpp file)
HDRS = $(SRCS:.cpp=.h)

# list of object files (one for each .cpp file)
OBJS = $(SRCS:.cpp=.o)

# rule for making a .o file from a .cpp file
.cpp.o:
	$(CC) $(INCLUDEDIRS) $(CCFLAGS) $<

# rule for making the final executable
$(TARGET): $(OBJS) $(HDRS)
	$(CC) $(LIBDIRS) -o $(TARGET) $(OBJS) $(LIBS)

# rule for cleaning up the directory
clean:
	rm -f $(OBJS) $(TARGET)

# rule for building everything
over:
	make clean
	make
