--- ray/src/rt/Rmakefile 1990/02/22 11:35:45 1.19 +++ ray/src/rt/Rmakefile 2004/10/21 21:44:59 2.46 @@ -1,208 +1,258 @@ -# SCCSid "$SunId$ LBL" - +# RCSid: $Id: Rmakefile,v 2.46 2004/10/21 21:44:59 greg Exp $ # -# Compiles for ray tracing programs. +# Compiles for ray tracing programs. # OPT = -O -MACH = -DSTRUCTASSIGN -DBSD -DIEEE -f68881 /usr/lib/f68881.il -CFLAGS = $(MACH) $(OPT) +MACH = -DBSD +CFLAGS = -I../common -L../lib $(OPT) $(MACH) +SPECIAL = aed +CC = cc +MLIB = -lm +LINT = lint +LINTFLAGS = -DBSD # # The following are user-definable: # DESTDIR = . -INSTDIR = /usr/local/ray +INSTDIR = /usr/local/bin INSTALL = cp # # The following paths must exist and be relative to root: # -DEVDIR = $(INSTDIR) +DEVDIR = $(INSTDIR)/dev LIBDIR = /usr/local/lib/ray # # Library routines: # -LIBS = -lm -COMPAT = malloc.o +RLIB = ../lib/libradiance.a +RCLIB = ../lib/libraycalls.a +LIBS = -lrt $(MLIB) # -# Device drivers for rview (see also devtable.c): +# Device drivers for rvu (see also devtable.c): # -DOBJS = devtable.o devcomm.o aed.o tty.o editline.o x10.o xtwind.o \ +DOBJS = devtable.o devcomm.o editline.o x11.o x11twind.o \ colortab.o -DLIBS = -lX -DRIVERS = $(DEVDIR)/sundev $(DEVDIR)/sun.com # $(DEVDIR)/X11dev +DSRC = devtable.c devcomm.c editline.c x11.c x11twind.c \ + colortab.c +DLIBS = -lX11 # # Standard object files: # -RTOBJS = rtmain.o rtrace.o $(ROBJS) +RTOBJS = rtmain.o rtrace.o duphead.o persist.o +RTSRC = rtmain.c rtrace.c duphead.c persist.c -RPOBJS = rpmain.o rpict.o image.o $(ROBJS) +RPOBJS = rpmain.o rpict.o srcdraw.o duphead.o persist.o +RPSRC = rpmain.c rpict.c srcdraw.c duphead.c persist.c -RVOBJS = rvmain.o rview.o rv2.o rv3.o image.o $(DOBJS) $(ROBJS) +RVOBJS = rvmain.o rview.o rv2.o rv3.o $(DOBJS) +RVSRC = rvmain.c rview.c rv2.c rv3.c $(DSRC) -ROBJS = $(OCTOBJS) $(RAYOBJS) $(SURFOBJS) $(MATOBJS) \ - $(MODOBJS) $(SUPPOBJS) $(MISCOBJS) $(COMPAT) +RLOBJS = raycalls.o raypcalls.o +RLSRC = raycalls.c raypcalls.c -OCTOBJS = octree.o readobj.o readoct.o objset.o otypes.o +ROBJS = $(RAYOBJS) $(SURFOBJS) $(MATOBJS) \ + $(MODOBJS) $(SUPPOBJS) +RSRC = $(RAYSRC) $(SURFSRC) $(MATSRC) \ + $(MODSRC) $(SUPPSRC) -RAYOBJS = raytrace.o ambient.o +RAYOBJS = ambcomp.o ambient.o ambio.o freeobjmem.o initotypes.o \ + preload.o raytrace.o renderopts.o +RAYSRC = ambcomp.c ambient.c ambio.c freeobjmem.c initotypes.c \ + preload.c raytrace.c renderopts.c -SURFOBJS = face.o sphere.o source.o o_face.o cone.o \ - o_cone.o o_instance.o instance.o +SURFOBJS = source.o sphere.o srcobstr.o srcsupp.o srcsamp.o virtuals.o \ + o_face.o o_cone.o o_instance.o o_mesh.o +SURFSRC = sphere.c source.c srcobstr.c srcsupp.c srcsamp.c virtuals.c \ + o_face.c srcsamp.c o_cone.c o_instance.c o_mesh.c -MATOBJS = normal.o dielectric.o m_clip.o glass.o +MATOBJS = aniso.o normal.o dielectric.o m_clip.o glass.o m_brdf.o \ + m_mirror.o m_direct.o m_mist.o fprism.o m_alias.o +MATSRC = aniso.c normal.c dielectric.c m_clip.c glass.c m_brdf.c \ + m_mirror.c m_direct.c m_mist.c fprism.c m_alias.c MODOBJS = p_func.o t_func.o p_data.o t_data.o text.o mx_func.o mx_data.o +MODSRC = p_func.c t_func.c p_data.c t_data.c text.c mx_func.c mx_data.c -SUPPOBJS = zeroes.o calexpr.o caldefn.o calfunc.o func.o noise3.o data.o +SUPPOBJS = func.o noise3.o data.o +SUPPSRC = func.c noise3.c data.c -MISCOBJS = misc.o color.o header.o mat4.o xf.o fvect.o savestr.o \ - fgetline.o ealloc.o +HEADERS = ambient.h ray.h data.h otspecial.h source.h # # What this makefile produces: # -PROGS = $(DESTDIR)/rtrace $(DESTDIR)/rpict $(DESTDIR)/rview $(DESTDIR)/lookamb +PROGS = $(DESTDIR)/rtrace $(DESTDIR)/rpict $(DESTDIR)/rvu $(DESTDIR)/lookamb -all: $(PROGS) $(DRIVERS) +all: $(PROGS) $(RCLIB) $(SPECIAL) -install: all +install: all rayinit.cal $(INSTALL) $(PROGS) $(INSTDIR) + cd $(INSTDIR) ; rm -f rview ; ln -s rvu rview + rm -f $(LIBDIR)/rayinit.cal + cp rayinit.cal $(LIBDIR) +aed: $(DEVDIR)/aed + +ogl: + clean: - rm -f *.o core + set nonomatch; rm -f $(PROGS) *.o core +lint: $(RVSRC) + $(LINT) $(LINTFLAGS) -DRVIEW $(RVSRC) $(LIBS) + # # Links: # -$(DESTDIR)/rtrace: $(RTOBJS) - cc $(CFLAGS) -o $(DESTDIR)/rtrace $(RTOBJS) $(LIBS) +$(DESTDIR)/rtrace: $(RTOBJS) $(RLIB) + $(CC) $(CFLAGS) -o $(DESTDIR)/rtrace $(RTOBJS) $(RLIB) $(LIBS) -$(DESTDIR)/rpict: $(RPOBJS) - cc $(CFLAGS) -o $(DESTDIR)/rpict $(RPOBJS) $(LIBS) +$(DESTDIR)/rpict: $(RPOBJS) $(RLIB) + $(CC) $(CFLAGS) -o $(DESTDIR)/rpict $(RPOBJS) $(RLIB) $(LIBS) -$(DESTDIR)/rview: $(RVOBJS) - cc $(CFLAGS) -o $(DESTDIR)/rview $(RVOBJS) $(DLIBS) $(LIBS) +$(DESTDIR)/rvu: $(RVOBJS) $(RLIB) + $(CC) $(CFLAGS) -o $(DESTDIR)/rvu $(RVOBJS) $(RLIB) $(LIBS) $(DLIBS) -$(DESTDIR)/lookamb: lookamb.o - cc $(CFLAGS) -o $(DESTDIR)/lookamb lookamb.o +$(DESTDIR)/lookamb: lookamb.o ambio.o + $(CC) $(CFLAGS) -o $(DESTDIR)/lookamb lookamb.o ambio.o $(LIBS) -$(DEVDIR)/sundev: sundev.o devmain.o colortab.o - cc $(CFLAGS) -o $(DEVDIR)/sundev devmain.o sundev.o colortab.o \ --lsuntool -lsunwindow -lpixrect $(LIBS) +$(DEVDIR)/aed: aed.o colortab.o tty.o devmain.o editline.o + $(CC) $(CFLAGS) -s -o $(DEVDIR)/aed aed.o colortab.o \ +devmain.o tty.o editline.o $(LIBS) -$(DEVDIR)/sun.com: suncom.o editline.o - cc $(CFLAGS) -o $(DEVDIR)/sun.com suncom.o editline.o +$(RLIB): $(ROBJS) Version.o + ar rc $(RLIB) $(ROBJS) Version.o + -ranlib $(RLIB) -$(DEVDIR)/X11dev: x11.o x11twind.o colortab.o - cc $(CFLAGS) -o $(DEVDIR)/x11dev devmain.o sundev.o colortab.o \ --lX11 $(LIBS) +$(RCLIB): $(RLOBJS) + ar rc $(RCLIB) $(RLOBJS) + -ranlib $(RCLIB) # # Special compiles: # -rtmain.o: rmain.c - cc $(CFLAGS) -DRTRACE -DNICE=4 -DDEFPATH=\":$(LIBDIR)\" -c rmain.c - mv rmain.o rtmain.o +rtmain.o: rtmain.c + $(CC) $(CFLAGS) -DNICE=4 -c rtmain.c -rpmain.o: rmain.c - cc $(CFLAGS) -DRPICT -DNICE=6 -DDEFPATH=\":$(LIBDIR)\" -c rmain.c - mv rmain.o rpmain.o +rpmain.o: rpmain.c + $(CC) $(CFLAGS) -DNICE=6 -c rpmain.c -rvmain.o: rmain.c - cc $(CFLAGS) -DRVIEW -DDEFPATH=\":$(LIBDIR)\" -c rmain.c - mv rmain.o rvmain.o +rvmain.o: rvmain.c + $(CC) $(CFLAGS) -c rvmain.c # # Uncomment the following to model dispersion: # -#dielectric.o: dielectric.c source.h -# cc $(CFLAGS) -DDISPERSE -c dielectric.c -# -#color.o: color.c color.h -# cc $(CFLAGS) -DSPEC_RGB -c color.c -# +dielectric.o: dielectric.c source.h + $(CC) $(CFLAGS) -DDISPERSE -c dielectric.c + # end of dispersion compiles. -sundev.o: sundev.c - cc $(CFLAGS) -c sundev.c - devcomm.o: devcomm.c - cc $(CFLAGS) -c devcomm.c + $(CC) $(CFLAGS) -DDEVPATH=\"$(DEVDIR)\" -c devcomm.c -ambient.o: ambient.c - cc $(CFLAGS) -DAMBFLUSH=16 -c ambient.c +aed.o: aed.c + $(CC) $(CFLAGS) -Daed_init=dinit -c aed.c -calexpr.o: calexpr.c calcomp.h - cc $(CFLAGS) -DVARIABLE -DFUNCTION -DINCHAN -DRCONST -c calexpr.c +# +# Version module: +# -caldefn.o: caldefn.c calcomp.h - cc $(CFLAGS) -DFUNCTION -c caldefn.c +Version.c: VERSION $(RSRC) $(HEADERS) + ( cat VERSION ; date ; whoami ; hostname ) > Version.c + ed - Version.c < verscript.ed -calfunc.o: calfunc.c calcomp.h - cc $(CFLAGS) -DVARIABLE -DBIGLIB -c calfunc.c - -xf.o: xf.c - cc $(CFLAGS) -DINVXF -c xf.c - # # Include dependencies: # -caldefn.o calexpr.o calfunc.o: calcomp.h +aed.o ambio.o colortab.o data.o devcomm.o \ +devmain.o lookamb.o rview.o x11.o: ../common/color.h -aed.o color.o colortab.o data.o devcomm.o \ -devmain.o lookamb.o rview.o sundev.o x10.o: color.h +freeobjmem.o o_cone.o srcsupp.o: ../common/cone.h -cone.o o_cone.o source.o: cone.h +data.o freeobjmem.o m_brdf.o mx_data.o \ +p_data.o raycalls.o t_data.o: data.h -data.o mx_data.o p_data.o t_data.o: data.h - aed.o devcomm.o devmain.o devtable.o \ -editline.o sundev.o tty.o x10.o: driver.h +editline.o tty.o x11.o: driver.h -face.o o_face.o source.o: face.h +freeobjmem.o o_face.o srcsupp.o: ../common/face.h -fvect.o: fvect.h +ambient.o raytrace.o rpmain.o rtmain.o \ +rtrace.o rvmain.o rv2.o rv3.o: ../common/octree.h -cone.o face.o objset.o otypes.o readobj.o readoct.o: object.h +o_instance.o: ../common/instance.h -ambient.o objset.o octree.o raytrace.o \ -readoct.o rmain.o rv2.o rv3.o source.o: octree.h +ambient.o aniso.o dielectric.o freeobjmem.o func.o glass.o initotypes.o \ +m_brdf.o m_direct.o m_mirror.o normal.o o_cone.o preload.o \ +raycalls.o raytrace.o rtrace.o rv2.o source.o sphere.o srcsupp.o text.o \ +srcobstr.o virtuals.o: ../common/otypes.h -o_instance.o instance.o: instance.h octree.h +ambient.o ambcomp.o aniso.o normal.o raycalls.o rpict.o rvmain.o \ +rtmain.o rpmain.o persist.o source.o rv3.o \ +srcsamp.o virtuals.o: ../common/random.h -ambient.o cone.o dielectric.o func.o normal.o o_cone.o otypes.o \ -text.o raytrace.o readobj.o readoct.o rtrace.o \ -rv2.o source.o sphere.o: otypes.h +ambcomp.o ambient.o aniso.o dielectric.o freeobjmem.o func.o glass.o \ +m_brdf.o m_clip.o m_direct.o m_mirror.o m_mist.o mx_data.o o_mesh.o \ +mx_func.o normal.o o_cone.o o_face.o o_instance.o p_data.o p_func.o \ +raycalls.o raypcalls.o raytrace.o rpict.o rtrace.o rv2.o rv3.o rview.o \ +source.o sphere.o srcdraw.o srcobstr.o srcsamp.o srcsupp.o t_data.o t_func.o \ +text.o rpmain.o rtmain.o rvmain.o virtuals.o m_alias.o: ray.h \ +../common/standard.h ../common/rtmisc.h ../common/rtio.h ../common/rtmath.h \ +../common/rterror.h ../common/octree.h \ +../common/mat4.h ../common/fvect.h ../common/object.h ../common/color.h -ambient.o rpict.o rv3.o source.o: random.h +rv2.o rv3.o rview.o: rpaint.h driver.h ../common/view.h ../common/resolu.h -ambient.o dielectric.o func.o glass.o m_clip.o \ -mx_data.o mx_func.o normal.o o_cone.o o_face.o o_instance.o \ -p_data.o p_func.o text.o raytrace.o rmain.o rpict.o \ -rtrace.o rv2.o rv3.o source.o \ -sphere.o t_data.o t_func.o: ray.h standard.h fvect.h object.h color.h +m_direct.o m_mirror.o m_mist.o dielectric.o raycalls.o \ +rpict.o rpmain.o rtmain.o rvmain.o source.o srcdraw.o \ +srcobstr.o srcsamp.o srcsupp.o virtuals.o: source.h -rv2.o rv3.o rview.o: rpaint.h driver.h view.h +cone.o data.o devcomm.o initotypes.o fprism.o preload.o \ +duphead.o octree.o: ../common/standard.h ../common/rtmisc.h \ +../common/rtio.h ../common/rtmath.h \ +../common/rterror.h ../common/mat4.h ../common/fvect.h -source.o: source.h +ambio.o: ../common/fvect.h -cone.o data.o devcomm.o face.o image.o misc.o objset.o octree.o otypes.o \ -readobj.o readoct.o rview.o: standard.h fvect.h +initotypes.o srcobstr.o raytrace.o: otspecial.h -sundev.o: suntools.icon +rpmain.o rtmain.o rvmain.o rpict.o \ +srcdraw.o: ../common/view.h ../common/resolu.h -image.o rmain.o rpict.o: view.h +x11.o x11twind.o: x11twind.h -x10.o xtwind.o: xtwind.h +x11.o: x11icon.h -x11.o x11twind.o: x11twind.h +ambient.o ambcomp.o ambio.o lookamb.o raycalls.o: ambient.h + +data.o rpmain.o rtmain.o rvmain.o rpict.o rtrace.o \ +rv2.o: ../common/resolu.h + +aniso.o func.o m_brdf.o m_direct.o mx_data.o mx_func.o p_data.o \ +p_func.o t_data.o t_func.o: func.h ../common/calcomp.h + +preload.o: ../common/object.h ../common/face.h ../common/cone.h \ +../common/instance.h ../common/mesh.h ../common/color.h data.h + +rtmain.o rpmain.o rvmain.o persist.o duphead.o \ +renderopts.o rpict.o: ../common/paths.h + +freeobjmem.o raycalls.o text.o: ../common/font.h + +raypcalls.o: ../common/selcall.h + +o_mesh.o: ../common/mesh.h + +noise3.o: ../common/calcomp.h