#####################################################################
# Copyright (c) 2003  Claron Technology Inc. All Rights Reserved.
#
# This software is the confidential and proprietary information of Claron`
# Technology , Inc. ("Confidential Information").  You shall not
# disclose such Confidential Information and shall use it only in
# accordance with the terms of the license agreement you entered into
# with Claron Technology Inc..
#
#####################################################################
#
#
#####################################################################

# package top
TOP	= ..

# assume developer has peer level digiclops trees
MTCTOP  = $(TOP)/Dist
MTVIDEOTOP  = $(TOP)/Dist
DIGITOP  = $(TOP)/Dist
TRITOP  = $(TOP)/Dist
FLTKTOP  = $(TOP)/fltk
CPPFLAGS += -I$(TOP)/Dist -I$(FLTKTOP) -I$(MTCTOP)

CPPFLAGS += -I. 
# Only for debugging
#CPPFLAGS += -g -w
CPPFLAGS += -w -O6 -mfpmath=sse  -funroll-loops -mfpmath=sse

# Enable for x86 platforms
#CPPFLAGS += -march=pentium4

LDFLAGS += -L$(TOP)/Dist
LDFLAGS +=  -L$(FLTKTOP)/lib
LDFLAGS	+= -L. -L/usr/X11R6/lib -L/usr/local/lib
# Enable for Only Mac
#LDFLAGS += -framework CoreFoundation -framework Carbon -framework AGL -framework GLUT -framework OpenGL -framework ApplicationServices -framework Cocoa
LIBS    += -lm -lXext -lX11 -lsupc++ -lXft
LIBS    += -lfltk -lfltk_forms  -lfltk_gl -lfltk_images -lGL
#LIBS    += -lfltk2 -lfltk2_glut  -lfltk2_gl -lfltk2_images -lGL
LIBS    += -lMTC 
#LIBS    += -lvnl -lvnl_algo -lnetlib -lv3p_netlib -lvcl -ltestlib
#LIBS    += -ldigiclops -ltriclops -lraw1394 -pthread

# For linux
LIBS    += -lraw1394
# for Mac
#LIBS    += -lIOKit

LIBS    += -lpthread $(TOP)/Dist/libdc1394.a

LIBS    += -lvnl
LIBS    += -lvnl_algo
LIBS    += -lvcl
LIBS    += -lv3p_netlib

# executable name and contents
EXEC1		= MTDemoCPP  
EXECS		= $(EXEC1)

EXEC1SRC	+= MCamera.cpp Cameras.cpp Collection.cpp Facet.cpp GuiGenerator.cpp 
EXEC1SRC	+=  main.cpp Marker.cpp Markers.cpp Persistence.cpp 
EXEC1SRC	+=  UtilityFunctions.cpp Xform3D.cpp Vector.cpp MTXPoint.cpp XPoints.cpp

all:	bin

bin: $(EXECS)

install: $(EXECS)
	install -d $(TOP)/bin
	for exe in $(EXECS) ; do ( install -m 0775 $$exe $(TOP)/bin ) ; done

#	$(CXX) $(LDFLAGS)  -o $@ $^ $(LIBS) $@
$(EXEC1): $(EXEC1SRC:%.cpp=%.o) 
	$(CXX)  $(LDFLAGS) -o $@ $^  $(LIBS)

%.o:%.cpp
	g++ -c $(CXXFLAGS) $(CPPFLAGS) $*.cpp

clean:
	rm -f *~ *.o *.d bin *.ppm $(EXECS)

