#############################################################################
# Makefile for building: msdf
# Generated by qmake (1.07a) (Qt 3.3.4) on: Fri Feb 12 13:42:59 2010
# Project:  multi_sdf.pro
# Template: app
# Command: $(QMAKE) -o Makefile multi_sdf.pro
#############################################################################

####### Compiler, tools and options

CC       = gcc
CXX      = g++
LEX      = flex
YACC     = yacc
CFLAGS   = -pipe -w -O2  
#CXXFLAGS = -pipe -w -O2  
CXXFLAGS = -pipe -w -O2 -fPIC
LEXFLAGS = 
YACCFLAGS= -d
CGAL_DIR = /mgl/devuser1/annao/CGAL/CGAL-3.1
#CGALPLATFORM=i686_Linux-2.4.21-27.0.2.EL_g++-3.2.3

CGALPLATFORM=x86-64_Linux-2.6.27.35-170.2.94.fc10.x86-64_g++-4.3.2

CGALINCLUDE= $(CGAL_DIR)/include
CGALCONFIG = $(CGAL_DIR)/include/CGAL/config/$(CGALPLATFORM)
CGAL_LIB = $(CGAL_DIR)/lib/$(CGALPLATFORM)

INCPATH  = -I/usr/local/mkspecs/default -I. -I$(CGALINCLUDE) -I$(CGALCONFIG)  -I/usr/include -I../VolMagick -I/usr/X11R6/include -I/usr/X11R6/include
LINK     = g++
LFLAGS   = 
LIBS     = $(SUBLIBS) -L/usr/X11R6/lib -L/usr/X11R6/lib -L$(CGAL_LIB) ../VolMagick/libVolMagick.a -lCGAL -lGLU -lGL -lXmu -lXext -lX11 -lm
AR       = ar cqs
RANLIB   = 
MOC      = $(QTDIR)/bin/moc
UIC      = $(QTDIR)/bin/uic
QMAKE    = qmake
TAR      = tar -cf
GZIP     = gzip -9f
COPY     = cp -f
COPY_FILE= $(COPY)
COPY_DIR = $(COPY) -r
INSTALL_FILE= $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)
DEL_FILE = rm -f
SYMLINK  = ln -sf
DEL_DIR  = rmdir
MOVE     = mv -f
CHK_DIR_EXISTS= test -d
MKDIR    = mkdir -p

####### Output directory

OBJECTS_DIR = ./

####### Files

HEADERS = 
SOURCES = main.C \
		mesh_io.C \
		sdf.C \
		kdtree.C \
		matrix.C \
		dt.C \
		init.C \
		robust_cc.C \
		rcocone.C \
		tcocone.C \
		op.C \
		util.C
OBJECTS = main.o \
		mesh_io.o \
		sdf.o \
		kdtree.o \
		matrix.o \
		dt.o \
		init.o \
		robust_cc.o \
		rcocone.o \
		tcocone.o \
		op.o \
		util.o
FORMS = 
UICDECLS = 
UICIMPLS = 
SRCMOC   = 
OBJMOC = 
DIST	   = multi_sdf.pro
QMAKE_TARGET = msdf
DESTDIR  = 
TARGET   = msdf

first: all
####### Implicit rules

.SUFFIXES: .c .o .cpp .cc .cxx .C

.cpp.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.cc.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.cxx.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.C.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.c.o:
	$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<

####### Build rules
staticlib: libSDF.a

#all: Makefile $(TARGET) staticlib
all: Makefile  staticlib

$(TARGET):  $(UICDECLS) $(OBJECTS) $(OBJMOC)  
	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(OBJCOMP) $(LIBS)


libSDF.a : $(UICDECLS) $(OBJECTS) $(OBJMOC)  $(OBJCOMP) 
	$(AR) libSDF.a  $(OBJECTS) $(OBJMOC)


mocables: $(SRCMOC)
uicables: $(UICDECLS) $(UICIMPLS)

$(MOC): 
	( cd $(QTDIR)/src/moc && $(MAKE) )

#Makefile: multi_sdf.pro  /usr/local/mkspecs/default/qmake.conf 
#	$(QMAKE) -o Makefile multi_sdf.pro
#qmake: 
#	@$(QMAKE) -o Makefile multi_sdf.pro

dist: 
	@mkdir -p .tmp/msdf && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .tmp/msdf/ && ( cd `dirname .tmp/msdf` && $(TAR) msdf.tar msdf && $(GZIP) msdf.tar ) && $(MOVE) `dirname .tmp/msdf`/msdf.tar.gz . && $(DEL_FILE) -r .tmp/msdf

mocclean:
uiclean:

yaccclean:
lexclean:
clean:
	-$(DEL_FILE) $(OBJECTS)
	-$(DEL_FILE) *~ core *.core


####### Sub-libraries

distclean: clean
	-$(DEL_FILE) $(TARGET) $(TARGET)


FORCE:

####### Compile

main.o: main.C mesh_io.h \
		sdf.h \
		kdtree.h \
		matrix.h \
		dt.h \
		../VolMagick/VolMagick.h \
		../VolMagick/VolumeCache.h \
		../VolMagick/endians.h \
		mds.h \
		datastruct.h \
		util.h \
		priorityqueue.h \
		init.h \
		rcocone.h \
		tcocone.h \
		robust_cc.h \
		op.h \
		../VolMagick/Exceptions.h \
		../VolMagick/Dimension.h \
		../VolMagick/BoundingBox.h

mesh_io.o: mesh_io.C mesh_io.h \
		mds.h \
		datastruct.h

sdf.o: sdf.C sdf.h \
		mds.h \
		matrix.h \
		kdtree.h \
		util.h \
		datastruct.h \
		priorityqueue.h

kdtree.o: kdtree.C kdtree.h \
		priorityqueue.h \
		matrix.h

matrix.o: matrix.C matrix.h

dt.o: dt.C dt.h \
		datastruct.h \
		init.h \
		rcocone.h \
		tcocone.h \
		util.h \
		robust_cc.h \
		op.h \
		mds.h

init.o: init.C init.h \
		robust_cc.h \
		op.h \
		datastruct.h \
		util.h

robust_cc.o: robust_cc.C robust_cc.h \
		datastruct.h

rcocone.o: rcocone.C rcocone.h \
		datastruct.h \
		util.h \
		robust_cc.h

tcocone.o: tcocone.C tcocone.h \
		datastruct.h \
		util.h \
		robust_cc.h

op.o: op.C op.h \
		datastruct.h \
		util.h

util.o: util.C util.h \
		datastruct.h

####### Install

install:  

uninstall:  

