#
# Makefile for radiosity program. May, 1992.
#
# Comment LIBS, TARGET, and CFILES lines appropriately for machine type,
# and location of executable.
#

#
# Include files
#
HFILES = adj.h bvol.h display.h ff.h geo.h io.h misc.h poly.h rad.h radmisc.h ray.h raymap.h scull.h struct.h vcr.h rtime.h

######################################################################
# Sun executable, remove comments if for sun 
######################################################################
LIBS = -lm
TARGETS = lightR
CFILES = vcrS.c adj.c amb.c args.c display.c draw.c ff.c geo.c hbvol.c hc.c inter.c io.c outp.c pbvol.c poly.c rad.c raybox.c raycone.c raycube.c raycyl.c rayhit.c raypoly.c raysp.c raysphere.c scull.c struct.c trans.c conv.c rtime.c rlog.c

######################################################################
# Iris 4d executable, remove comments if for iris
# Note:  If using ANSI C compiler, this version of code may NOT
#        adhere to ANSI standards, therefore you should add the "-cckr"
#        compilation flag (i.e. standard Kernigan & Ritchie) for no-ANSI 
#        compilation.
######################################################################
# Since the library for the vcr functions (VCRlib.a) is not included 
# in this package, all calls to these functions have been removed.
# 
#LIBS = -lgl_s -lm -limage # /cs/u/vgrlab/lib/4d/VCRlib.a
#TARGETS = 4dlightR
#CFILES = vcrS.c adj.c amb.c args.c display.c drawI.c ff.c geo.c hbvol.c hc.c img.c inter.c io.c outp.c pbvol.c poly.c rad.c raybox.c raycone.c raycube.c raycyl.c rayhit.c raypoly.c raysp.c raysphere.c scull.c struct.c trans.c conv.c rtime.c rlog.c

.SUFFIXES : .c .o
SOURCES = $(CFILES) $(HFILES)
OBJECTS = ${CFILES:.c=.o}
CCFLAGS = -O2 # -cckr

all  : $(TARGETS) 

clean: 
	rm -f *.o 
	rm -f core

clobber: clean
	rm -f $(TARGETS)

$(TARGETS): $(OBJECTS)
	cc  -o $@ $(OBJECTS) $(LIBS) $(CCFLAGS)
