.SUFFIXES : .o .cc .c

CC = g++
CFLAGS = -g
INCLUDES = -I/usr/X11R6/include
LIBS = -L/usr/X11R6/lib -lX11 -lXpm -lXext
# -ljpeg -lpng -L./widget -lPixieWidget -lImlib
OBJS = RayManta.o RayMantaWindow.o WindowManager.o  Xmanager.o RayMantaImage.o RayMantaPoint.o RayMantaMatrix.o RayMantaMatrix3.o RayMantaMatrix4.o RayMantaNet.o RayMantaNetPthread.o RayMantaGA.o RayMantaNetMarkov2.o Boltzman.o RayMantaEngine.o RayMantaModel.o RayMantaSphereModel.o RayMantaPolygon.o RayMantaPolygonModel.o RayMantaRayTracer.o RayMantaImageBase.o RayMantaPixmapImage.o RayMantaTextureModel.o RayMantaPixmapTextureModel.o RayMantaTexture.o RayMantaPixmapTexture.o RayMantaBaseVisit.o RayMantaXNet.o keywords.o

###FIXME add RayMantaNetMarkov.o

###FIXME RayManta: debug xlua $(OBJS) main.o
RayManta: debug xlua $(OBJS) main.o
	@echo "***COMPILER NOTE*** Please include RayMantaNetMarkov.o inside this Makefile for Markov networking (RayMantaNetMarkov2.o is already included.)"
	$(CC) $(CFLAGS) $(INCLUDES) $(OBJS) -o xmantaray  $(LIBS) main.o

debug:
	@echo Constructing config.h
	@rm -f config.h
	@echo '#define	DEBUG' >> config.h
	@echo "***COMPILER NOTE*** The liblua path and link might have to be changed to your liblua install path. There is a liblua.a library inside ./lib which you can overwrite."

xlua : $(OBJS) 
	cd xlua; $(MAKE) $(MFLAGS)

test : $(OBJS) 
	cd test; $(MAKE) $(MFLAGS)

clean: 
	rm *.o xmantaray config.h ./xlua/*.o ./xlua/*.so ./xlua/*.a ./test/*.so ./test/*.o ./test/test1;

.cpp.o:
	$(CXX) $(CFLAGS) $< -o $@

.cc.o :
	$(CC) $(CFLAGS) $(INLCUDES) -c $<
