#
# lrt makefile
#
# $Id: Makefile,v 1.14 2002/04/01 23:41:55 humper Exp $
#

ARCH = $(shell uname)

TIFFINCLUDE=-I../libtiff/include
TIFFLIB=

TIFFLIB += -ltiff

%TIFFLIB += -ljpeg -lz -lmsvcrt

LEX=flex
YACC=bison -d -v -t
LEXLIB = -lfl

CXX=g++
OPT=-DNDEBUG -O2 -march=i686 -fomit-frame-pointer -funroll-loops
#OPT=-g -march=i686
INCLUDE=-I. $(TIFFINCLUDE)
WARN=-Wall
DEFINES=
CXXFLAGS=$(OPT) $(INCLUDE) $(WARN)
LIBS=-L/usr/common/lib32 $(TIFFLIB) $(LEXLIB) $(DLLLIB) -lm -lstdc++

.SUFFIXES: .l .y .defs
.PHONY: default check
.SECONDARY: %.cc

# order is key!
LRTCCFILES = riblex.cc ribparse.cc rib.cc util.cc shapes.cc heightfield.cc fastlevelset.cc primitives.cc lrt.cc \
	geometry.cc transform.cc camera.cc api.cc sampling.cc texture.cc  illuminationmap.cc \
	reflection.cc color.cc materials.cc transport.cc tiffio.cc light.cc \
	accel.cc image.cc scene.cc nurbs.cc film.cc mbdofcamera.cc
LRTHFILES = lrt.h ri.h shapes.h heightfield.h primitives.h accel.h texture.h illuminationmap.h \
	camera.h mbdofcamera.h image.h color.h geometry.h light.h \
	reflection.h sampling.h materials.h transport.h transform.h scene.h \
	nurbs.h film.h


default: lrt

# building the executable


clean:
	-rm -f *.o *.tiff *~ core lrt

lrt: $(LRTCCFILES:.cc=.o)
	@echo "Linking $@"
	$(CXX) -o $@ $^ $(LIBS)

include .depend

depend:
	$(CXX) -MM $(LRTCCFILES) > .depend
