# RCSid: $Id: Rmakefile,v 2.19 2016/04/21 00:40:35 greg Exp $
#
#  Compiles for octree conversion program
#
#     The compile define "STRICT" enforces strict intersection calculations
#  so that no cube which does not intersect an object contains that object.
#  Otherwise, a somewhat faster more lax approach is taken by certain routines.
#  This is set to "1" by default, so -DSTRICT=0 now turns it off.
#

OPT = -O
MACH = -DBSD
CFLAGS = -I../common -L../lib $(OPT) $(MACH)
CC = cc
MLIB = -lm

LIBDIR = /usr/local/lib/ray

INSTDIR = /usr/local/bin

PROGS =	oconv getbbox obj2mesh

all:	$(PROGS)

oconv:	oconv.o sphere.o writeoct.o o_face.o \
o_cone.o o_instance.o bbox.o initotypes.o
	$(CC) $(CFLAGS) -o oconv oconv.o writeoct.o sphere.o o_face.o \
o_cone.o o_instance.o bbox.o \
initotypes.o -lrtrad $(MLIB)

getbbox:	getbbox.o readobj2.o bbox.o init2otypes.o
	$(CC) $(CFLAGS) -o getbbox getbbox.o readobj2.o \
bbox.o init2otypes.o -lrtrad $(MLIB)

obj2mesh:	obj2mesh.o cvmesh.o wfconv.o o_face.o writemesh.o
	$(CC) $(CFLAGS) -o obj2mesh obj2mesh.o cvmesh.o wfconv.o \
o_face.o writemesh.o -lrtrad $(MLIB)

install:	$(PROGS)
	cp $(PROGS) $(INSTDIR)

clean:
	set nonomatch; rm -f $(PROGS) *.o

bbox.o initotypes.o o_cone.o o_face.o \
o_instance.o oconv.o sphere.o \
cvmesh.o obj2mesh.o wfconv.o \
writeoct.o:	../common/standard.h ../common/rtmisc.h ../common/rtio.h \
../common/rtmath.h ../common/mat4.h ../common/fvect.h \
../common/rterror.h

initotypes.o o_cone.o o_face.o oconv.o \
sphere.o writeoct.o:	../common/octree.h

bbox.o o_cone.o o_face.o o_instance.o oconv.o \
sphere.o writeoct.o:	../common/object.h

bbox.o initotypes.o oconv.o obj2mesh.o sphere.o:	../common/otypes.h

bbox.o getbbox.o initotypes.o oconv.o readobj2.o writeoct.o: oconv.h

oconv.o:	../common/paths.h

bbox.o o_cone.o:	../common/cone.h

bbox.o o_face.o:	../common/face.h

bbox.o getbbox.o o_instance.o:	../common/instance.h \
../common/mesh.h ../common/octree.h

o_face.o:	../common/plocate.h

clip.o plocate.o:	../common/fvect.h

initotypes.o init2otypes.o:	../common/otypes.h

cvmesh.o obj2mesh.o wfconv.o:	cvmesh.h \
../common/octree.h ../common/object.h ../common/mesh.h

cvmesh.o:	../common/otypes.h ../common/face.h ../common/tmesh.h
