#---------------------------------------------------------------------------------------------------
#
# Copyright (C) 2005      University of Toronto
#
#---------------------------------------------------------------------------------------------------
#
#  module     : Makefile (main)
#
#  project    : icaster
#
#---------------------------------------------------------------------------------------------------

#---------------------------------------------------------------------------------------------------
# project basic rules / defines
#---------------------------------------------------------------------------------------------------

export MAYA_LOCATION=/usr/aw/maya7.0/

INCLUDES+= -I./
INCLUDES+= -I$(MAYA_LOCATION)/include
INCLUDES+= -I./include

LIBS =-lGL -lGLU -lGLEW
LIBS += -L$(MAYA_LOCATION)/lib -lOpenMaya -lFoundation -lOpenMayaUI
LIBS += -lCgGL -lCg
LIBS += -L./lib/glew/lib

CXX =c++
CXXFLAGS = -W -Wall -ansi -pedantic -O3 -pthread -pipe -D_BOOL -DLINUX -DREQUIRE_IOSTREAM -fPIC 
CXXFLAGS += -m32 -Wno-deprecated -fno-gnu-keywords
CXXFLAGS_DYNAMIC += -shared -Wl,-Bsymbolic
RM =rm -f

ifeq ($(MAKECMDGOALS), debug)
  CXXFLAGS += -DDEBUG
endif
ifeq ($(MAKECMDGOALS), debug-fbo)
  CXXFLAGS += -DDEBUG_FBO
endif


ARCH_FLAGS = -Dlinux -DBits64_

.SUFFIXES:	.cpp .o

.cpp.o: Makefile $(INLINES)
	-$(RM) $@
	$(CXX) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(ARCH_FLAGS) -o $@ -c $<

#---------------------------------------------------------------------------------------------------
# Files, framework
#---------------------------------------------------------------------------------------------------

HEADERS= \
	include/iquadric_geo.h \
	include/iquadric_ui.h \
	include/iquadric_shading.h \

INLINES= \

SOURCES= \
	source/iquadric_geo.cpp \
	source/iquadric_ui.cpp \
	source/iquadric_shading.cpp \

#---------------------------------------------------------------------------------------------------
# Files, current
#---------------------------------------------------------------------------------------------------

HEADERS+= \
	include/isphere_ui.h \
	include/isphere_shading.h \
	include/isphere_geo.h \
	include/error_checker.h \

INLINES+= \

SOURCES+= \
	source/isphere_geo.cpp \
	source/isphere_ui.cpp \
	source/isphere_shading.cpp \
	source/error_checker.cpp \

#---------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
HEADERS+= \
	include/ishading.h \

SOURCES+= \
	source/imaterial.cpp \
	source/iplugins.cpp \
	source/ishading.cpp \

#---------------------------------------------------------------------------------------------------
# Terminate all file strings
#---------------------------------------------------------------------------------------------------
HEADERS+= $(NULL)
INLINES+= $(NULL)
SOURCES+= $(NULL)

#---------------------------------------------------------------------------------------------------
# Targets
#---------------------------------------------------------------------------------------------------

OBJECTS =$(SOURCES:cpp=o)

default:	isphere

isphere: 	Makefile $(OBJECTS) $(HEADERS) $(INLINES)
	@echo Linking
	$(CXX) $(CXXFLAGS) $(CXXFLAGS_DYNAMIC) $(OBJECTS) $(LIBS) -o icaster.so 
	@echo Compilation Complete

debug-fbo: isphere

debug: isphere

clean:
	@echo Deleting up $(OBJECTS) $(PROJECT)
	-$(RM) $(OBJECTS)
	-$(RM) icaster.so
	-$(RM) *~
