# RCSid: $Id: Rmakefile,v 3.37 2014/04/26 15:59:38 greg Exp $
#
# Radiance makefile for holodeck programs
#

MACH = -DBSD

OPT = -O

CFLAGS = -I../common -L../lib $(OPT) $(MACH) -DDEVPATH=\"$(DEVDIR)\"

MLIB = -lm

CC = cc

LN = ln

SPECIAL =

INSTDIR = /usr/local/bin
DEVDIR = $(INSTDIR)

LIBDIR = /usr/local/lib/ray

PROGS = rholo rhpict rhcopy genrhgrid rhoptimize rhinfo

DEVS = $(DEVDIR)/x11.hdi $(DEVDIR)/x11h.hdi

all:	$(PROGS)

install:	all $(DEVS) $(SPECIAL)
	cp $(PROGS) $(INSTDIR)

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

ogl:	$(DEVDIR)/ogl.hdi $(DEVDIR)/oglh.hdi \
	$(DEVDIR)/oglo.hdi $(DEVDIR)/ogloh.hdi \
	$(DEVDIR)/ogls.hdi $(DEVDIR)/oglsh.hdi \
	$(DEVDIR)/oglso.hdi $(DEVDIR)/oglsoh.hdi \
	$(DEVDIR)/glx1.hdi $(DEVDIR)/glx1h.hdi

x10:

aed:

sgi:

sun:

rholo:	rholo.o rholo2.o rholo2l.o rholo3.o rholo4.o holo.o holofile.o \
viewbeams.o Version.o
	$(CC) $(CFLAGS) -o rholo rholo.o rholo2.o rholo2l.o rholo3.o rholo4.o \
holo.o holofile.o viewbeams.o Version.o -lrtrad $(MLIB)

rhpict:	rhpict.o rhpict2.o holo.o holofile.o viewbeams.o Version.o
	$(CC) $(CFLAGS) -o rhpict rhpict.o rhpict2.o holo.o holofile.o \
viewbeams.o Version.o -lrtrad $(MLIB)

rhcopy:	rhcopy.o clumpbeams.o holo.o holofile.o
	$(CC) $(CFLAGS) -o rhcopy rhcopy.o clumpbeams.o \
holo.o holofile.o -lrtrad $(MLIB)

rhoptimize:	rhoptimize.o clumpbeams.o holo.o holofile.o
	$(CC) $(CFLAGS) -o rhoptimize rhoptimize.o clumpbeams.o \
holo.o holofile.o -lrtrad $(MLIB)

rhinfo:	rhinfo.o holo.o holofile.o
	$(CC) $(CFLAGS) -o rhinfo rhinfo.o holo.o holofile.o -lrtrad $(MLIB)

genrhgrid:	genrhgrid.o holo.o
	$(CC) $(CFLAGS) -o genrhgrid genrhgrid.o holo.o -lrtrad $(MLIB)

$(DEVDIR)/x11h.hdi:	$(DEVDIR)/x11.hdi
	rm -f $(DEVDIR)/x11h.hdi
	$(LN) $(DEVDIR)/x11.hdi $(DEVDIR)/x11h.hdi

$(DEVDIR)/x11.hdi:	rhdisp.o rhdisp2.o viewbeams.o rhd_x11.o rhd_qtree.o \
rhd_qtree2r.o rhd_ctab.o holo.o
	$(CC) $(CFLAGS) -o $(DEVDIR)/x11.hdi rhdisp.o rhdisp2.o viewbeams.o \
rhd_x11.o rhd_qtree.o rhd_qtree2r.o rhd_ctab.o holo.o -lrtrad -lX11 $(MLIB)

$(DEVDIR)/glx1h.hdi:	$(DEVDIR)/glx1.hdi
	rm -f $(DEVDIR)/glx1h.hdi
	$(LN) $(DEVDIR)/glx1.hdi $(DEVDIR)/glx1h.hdi

$(DEVDIR)/glxoh.hdi:	$(DEVDIR)/glxo.hdi
	rm -f $(DEVDIR)/glxoh.hdi
	$(LN) $(DEVDIR)/glxo.hdi $(DEVDIR)/glxoh.hdi

$(DEVDIR)/glxsh.hdi:	$(DEVDIR)/glxs.hdi
	rm -f $(DEVDIR)/glxsh.hdi
	$(LN) $(DEVDIR)/glxs.hdi $(DEVDIR)/glxsh.hdi

$(DEVDIR)/glxsoh.hdi:	$(DEVDIR)/glxso.hdi
	rm -f $(DEVDIR)/glxsoh.hdi
	$(LN) $(DEVDIR)/glxso.hdi $(DEVDIR)/glxsoh.hdi

$(DEVDIR)/oglh.hdi:	$(DEVDIR)/ogl.hdi
	rm -f $(DEVDIR)/oglh.hdi
	$(LN) $(DEVDIR)/ogl.hdi $(DEVDIR)/oglh.hdi

$(DEVDIR)/ogloh.hdi:	$(DEVDIR)/oglo.hdi
	rm -f $(DEVDIR)/ogloh.hdi
	$(LN) $(DEVDIR)/oglo.hdi $(DEVDIR)/ogloh.hdi

$(DEVDIR)/oglsh.hdi:	$(DEVDIR)/ogls.hdi
	rm -f $(DEVDIR)/oglsh.hdi
	$(LN) $(DEVDIR)/ogls.hdi $(DEVDIR)/oglsh.hdi

$(DEVDIR)/oglsoh.hdi:	$(DEVDIR)/oglso.hdi
	rm -f $(DEVDIR)/oglsoh.hdi
	$(LN) $(DEVDIR)/oglso.hdi $(DEVDIR)/oglsoh.hdi

$(DEVDIR)/glx1.hdi:	rhd_glx1.o rhdisp.o rhdisp2.o viewbeams.o \
rhd_qtree.o rhd_qtree2c.o holo.o
	rm -f $(DEVDIR)/glx1.hdi
	$(CC) $(CFLAGS) -o $(DEVDIR)/glx1.hdi rhd_glx1.o rhdisp.o rhdisp2.o \
viewbeams.o holo.o rhd_qtree.o rhd_qtree2c.o -lrtrad -lGLU -lGL -lX11 $(MLIB)

$(DEVDIR)/ogl.hdi:	rhd_ogl0.o rhdisp.o rhdisp2.o viewbeams.o \
rhd_odraw.o rhd_geom.o holo.o
	$(CC) $(CFLAGS) -o $(DEVDIR)/ogl.hdi rhd_ogl0.o rhdisp.o rhdisp2.o \
viewbeams.o holo.o rhd_odraw.o rhd_geom.o -lrgl -lrtrad -lGLU -lGL -lX11 $(MLIB)

$(DEVDIR)/oglo.hdi:	rhd_oglo.o rhdisp.o rhdisp2.o viewbeams.o \
rhd_odraw.o rhd_geom.o holo.o rhdobj.o
	$(CC) $(CFLAGS) -o $(DEVDIR)/oglo.hdi rhd_oglo.o rhdisp.o \
rhdisp2.o viewbeams.o holo.o rhd_odraw.o rhd_geom.o rhdobj.o \
-lrgl -lrtrad -lGLU -lGL -lX11 $(MLIB)

$(DEVDIR)/ogls.hdi:	rhd_ogls.o rhdisp.o rhdisp2.o viewbeams.o \
rhd_odraw.o rhd_geom.o holo.o
	$(CC) $(CFLAGS) -o $(DEVDIR)/ogls.hdi rhd_ogls.o rhdisp.o rhdisp2.o \
viewbeams.o holo.o rhd_odraw.o rhd_geom.o \
-lrgl -lrtrad -lGLU -lGL -lX11 -lXext $(MLIB)

$(DEVDIR)/oglso.hdi:	rhd_oglso.o rhdisp.o rhdisp2.o viewbeams.o \
rhd_odraw.o rhd_geom.o holo.o rhdobj.o
	$(CC) $(CFLAGS) -o $(DEVDIR)/oglso.hdi rhd_oglso.o rhdisp.o rhdisp2.o \
viewbeams.o holo.o rhd_odraw.o rhd_geom.o rhdobj.o \
-lrgl -lrtrad -lGLU -lGL -lX11 -lXext $(MLIB)

rhd_ogl0.o:	rhd_ogl.c
	$(CC) $(CFLAGS) -o rhd_ogl0.o -c rhd_ogl.c

rhd_oglo.o:	rhd_ogl.c
	$(CC) $(CFLAGS) -DDOBJ -o rhd_oglo.o -c rhd_ogl.c

rhd_ogls.o:	rhd_ogl.c
	$(CC) $(CFLAGS) -DSTEREO -o rhd_ogls.o -c rhd_ogl.c

rhd_oglso.o:	rhd_ogl.c
	$(CC) $(CFLAGS) -DDOBJ -DSTEREO -o rhd_oglso.o -c rhd_ogl.c

rholo.o rholo2.o rholo2l.o rholo3.o rholo4.o \
rhdisp.o rhdisp2.o rhpict.o viewbeams.o:	rholo.h

rholo2l.o:	../common/paths.h

rhpict2.o rholo3.o:	../common/view.h

rholo4.o:	rhdisp.h

rhdisp.o rhdisp2.o:	rhdisp.h rhdriver.h ../common/view.h

viewbeams.o:	../common/view.h ../common/random.h

rhpict.o:	../common/view.h ../common/resolu.h

holo.o holofile.o rhdisp.o rhdisp2.o viewbeams.o genrhgrid.o \
rhcopy.o rholo.o rholo2.o rholo2l.o rholo3.o rholo4.o \
rhinfo.o clumpbeams.o rhoptimize.o rhpict.o rhpict2.o:	holo.h \
../common/vars.h ../common/color.h \
../common/standard.h ../common/rtmisc.h ../common/rtio.h \
../common/rtmath.h ../common/mat4.h ../common/fvect.h \
../common/rterror.h

rhcopy.o:	../common/resolu.h ../common/view.h

rhd_x11.o rhd_qtree.o rhd_sets.o rhd_qtree2r.o rhd_odraw.o rhd_ogl0.o \
rhd_oglo.o rhd_ogls.o rhd_oglso.o:	../common/standard.h \
../common/rtmisc.h ../common/rtio.h \
../common/rtmath.h ../common/mat4.h ../common/fvect.h \
../common/rterror.h

rhd_x11.o rhd_qtree.o rhd_qtree2r.o:	rhd_qtree.h rhdriver.h \
../common/view.h ../common/tonemap.h ../common/color.h

rhd_x11.o:	x11icon.h

rhd_glxo.o rhd_glxso.o rhdobj.o:	rhdobj.h

rhdobj.o:	rhdisp.h rhdriver.h ../common/view.h ../common/tonemap.h \
../common/radogl.h  ../common/standard.h \
../common/rtmisc.h ../common/rtio.h \
../common/rtmath.h ../common/mat4.h ../common/fvect.h \
../common/rterror.h \
../common/object.h ../common/otypes.h ../common/lookup.h

rhd_glx1.o:	rhd_qtree.h rhdriver.h x11icon.h ../common/view.h \
../common/color.h ../common/tonemap.h \
../common/standard.h ../common/rtmisc.h ../common/rtio.h \
../common/rtmath.h ../common/mat4.h ../common/fvect.h \
../common/rterror.h

rhd_odraw.o rhd_ogl0.o rhd_oglo.o rhd_ogls.o rhd_oglso.o:	rhd_odraw.h \
rhdriver.h ../common/view.h ../common/color.h ../common/tonemap.h

rhd_ogl0.o rhd_oglo.o rhd_ogls.o rhd_oglso.o:	x11icon.h

rhd_oglo.o rhd_oglso.o:	rhdobj.h

rhd_geom.o:	rhdriver.h ../common/view.h \
../common/radogl.h ../common/standard.h ../common/rtmisc.h ../common/rtio.h \
../common/rtmath.h ../common/mat4.h ../common/fvect.h \
../common/rterror.h ../common/object.h ../common/otypes.h ../common/lookup.h

Version.c:	../rt/Version.c
	cp ../rt/Version.c .
