--- ray/src/rt/Rmakefile 1990/03/08 16:13:41 1.23 +++ ray/src/rt/Rmakefile 2014/04/26 15:59:38 2.72 @@ -1,208 +1,274 @@ -# SCCSid "$SunId$ LBL" - +# RCSid: $Id: Rmakefile,v 2.72 2014/04/26 15:59:38 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 = +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 = -lrtrad $(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) +RCOBJS = rcmain.o rcontrib.o rc2.o rc3.o +RCSRC = rcmain.c rcontrib.c rc2.c rc3.c -OCTOBJS = octree.o readobj.o readoct.o objset.o otypes.o +RLOBJS = raycalls.o raypcalls.o rayfifo.o +RLSRC = raycalls.c raypcalls.c rayfifo.c -RAYOBJS = raytrace.o ambient.o +ROBJS = $(RAYOBJS) $(SURFOBJS) $(MATOBJS) \ + $(MODOBJS) $(SUPPOBJS) +RSRC = $(RAYSRC) $(SURFSRC) $(MATSRC) \ + $(MODSRC) $(SUPPSRC) -SURFOBJS = face.o sphere.o source.o o_face.o cone.o \ - o_cone.o o_instance.o instance.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 -MATOBJS = normal.o dielectric.o m_clip.o glass.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 = 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 m_bsdf.o \ + ashikhmin.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 m_bsdf.c \ + ashikhmin.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)/rcontrib \ +$(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 + cd $(INSTDIR) ; rm -f rtcontrib ; ln -s rcontrib rtcontrib + rm -f $(LIBDIR)/rayinit.cal + cp rayinit.cal $(LIBDIR) +ogl: + clean: - rm -f *.o core + set nonomatch; rm -f $(PROGS) *.o +lint: $(RVSRC) + $(LINT) $(LINTFLAGS) -DRVIEW $(RVSRC) $(LIBS) + # # Links: # -$(DESTDIR)/rtrace: $(RTOBJS) - cc $(CFLAGS) -o $(DESTDIR)/rtrace $(RTOBJS) $(LIBS) +$(DESTDIR)/rtrace: $(RTOBJS) $(RCLIB) $(RLIB) + $(CC) $(CFLAGS) -o $(DESTDIR)/rtrace $(RTOBJS) $(RCLIB) $(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) $(RCLIB) $(RLIB) + $(CC) $(CFLAGS) -o $(DESTDIR)/rvu $(RVOBJS) $(RCLIB) \ +$(RLIB) $(LIBS) $(DLIBS) -$(DESTDIR)/lookamb: lookamb.o - cc $(CFLAGS) -o $(DESTDIR)/lookamb lookamb.o +$(DESTDIR)/rcontrib: $(RCOBJS) $(RLIB) + $(CC) $(CFLAGS) -o $(DESTDIR)/rcontrib $(RCOBJS) $(RLIB) $(LIBS) -$(DEVDIR)/sundev: sundev.o devmain.o colortab.o editline.o - cc $(CFLAGS) -o $(DEVDIR)/sundev devmain.o sundev.o colortab.o \ -editline.o -lsuntool -lsunwindow -lpixrect $(LIBS) +$(DESTDIR)/lookamb: lookamb.o ambio.o + $(CC) $(CFLAGS) -o $(DESTDIR)/lookamb lookamb.o ambio.o $(LIBS) -$(DEVDIR)/sun.com: suncom.o editline.o - cc $(CFLAGS) -o $(DEVDIR)/sun.com suncom.o editline.o +$(RLIB): $(ROBJS) Version.o + rm -f $(RLIB) + ar rc $(RLIB) $(ROBJS) Version.o + -ranlib $(RLIB) -$(DEVDIR)/x11dev: x11.o x11twind.o colortab.o devmain.o editline.o - cc $(CFLAGS) -o $(DEVDIR)/x11dev x11.o x11twind.o devmain.o \ -colortab.o editline.o -lX11 $(LIBS) +$(RCLIB): $(RLOBJS) + rm -f $(RCLIB) + ar rc $(RCLIB) $(RLOBJS) + -ranlib $(RCLIB) # -# Special compiles: +# Uncomment the following to model dispersion: # +dielectric.o: dielectric.c source.h + $(CC) $(CFLAGS) -DDISPERSE -c dielectric.c -rtmain.o: rmain.c - cc $(CFLAGS) -DRTRACE -DNICE=4 -DDEFPATH=\":$(LIBDIR)\" -c rmain.c - mv rmain.o rtmain.o +# end of dispersion compiles. -rpmain.o: rmain.c - cc $(CFLAGS) -DRPICT -DNICE=6 -DDEFPATH=\":$(LIBDIR)\" -c rmain.c - mv rmain.o rpmain.o +devcomm.o: devcomm.c + $(CC) $(CFLAGS) -DDEVPATH=\"$(DEVDIR)\" -c devcomm.c -rvmain.o: rmain.c - cc $(CFLAGS) -DRVIEW -DDEFPATH=\":$(LIBDIR)\" -c rmain.c - mv rmain.o rvmain.o - # -# Uncomment the following to model dispersion: +# Version module: # -#dielectric.o: dielectric.c source.h -# cc $(CFLAGS) -DDISPERSE -c dielectric.c + +Version.c: VERSION $(RSRC) $(HEADERS) + ( cat VERSION ; date ; whoami ; hostname ) > Version.c + ed - Version.c < verscript.ed + # -#color.o: color.c color.h -# cc $(CFLAGS) -DSPEC_RGB -c color.c +# Include dependencies: # -# end of dispersion compiles. -sundev.o: sundev.c - cc $(CFLAGS) -Dsun_init=dinit -c sundev.c +ambio.o colortab.o data.o devcomm.o \ +devmain.o lookamb.o rview.o x11.o: ../common/color.h -x11.o: x11.c - cc $(CFLAGS) -Dx11_init=dinit -c x11.c +freeobjmem.o o_cone.o srcsupp.o: ../common/cone.h -ambient.o: ambient.c - cc $(CFLAGS) -DAMBFLUSH=16 -c ambient.c +data.o freeobjmem.o m_brdf.o mx_data.o \ +p_data.o raycalls.o t_data.o: data.h -calexpr.o: calexpr.c calcomp.h - cc $(CFLAGS) -DVARIABLE -DFUNCTION -DINCHAN -DRCONST -c calexpr.c +devcomm.o devmain.o devtable.o \ +editline.o x11.o: driver.h -caldefn.o: caldefn.c calcomp.h - cc $(CFLAGS) -DFUNCTION -c caldefn.c +freeobjmem.o o_face.o srcsupp.o: ../common/face.h -calfunc.o: calfunc.c calcomp.h - cc $(CFLAGS) -DVARIABLE -DBIGLIB -c calfunc.c +ambient.o raytrace.o rpmain.o rtmain.o \ +rtrace.o rvmain.o rv2.o rv3.o: ../common/octree.h -xf.o: xf.c - cc $(CFLAGS) -DINVXF -c xf.c +o_instance.o: ../common/instance.h -# -# Include dependencies: -# +ambient.o aniso.o ashikhmin.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 \ +srcdraw.o srcobstr.o virtuals.o: ../common/otypes.h -caldefn.o calexpr.o calfunc.o: calcomp.h +ambient.o ambcomp.o aniso.o ashikhmin.o normal.o raycalls.o raytrace.o \ +rpict.o rvmain.o rtmain.o rpmain.o rcmain.o persist.o source.o rv3.o \ +srcsamp.o virtuals.o: ../common/random.h -aed.o color.o colortab.o data.o devcomm.o \ -devmain.o lookamb.o rview.o sundev.o x10.o x11.o: color.h +ambcomp.o ambient.o aniso.o ashikhmin.o dielectric.o freeobjmem.o func.o \ +glass.o m_bsdf.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 rayfifo.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 rcmain.o \ +rcontrib.o rc2.o rc3.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 -cone.o o_cone.o source.o: cone.h +rv2.o rv3.o rview.o: rpaint.h driver.h ../common/view.h ../common/resolu.h -data.o mx_data.o p_data.o t_data.o: data.h +m_direct.o m_mirror.o m_mist.o dielectric.o raycalls.o \ +rpict.o rpmain.o rtmain.o rvmain.o rv2.o source.o srcdraw.o \ +srcobstr.o srcsamp.o srcsupp.o virtuals.o: source.h -aed.o devcomm.o devmain.o devtable.o \ -editline.o sundev.o tty.o x10.o x11.o: driver.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 -face.o o_face.o source.o: face.h +ambio.o: ../common/fvect.h -fvect.o: fvect.h +initotypes.o srcobstr.o raytrace.o: otspecial.h -cone.o face.o objset.o otypes.o readobj.o readoct.o: object.h +rpmain.o rtmain.o rvmain.o rpict.o \ +srcdraw.o: ../common/view.h ../common/resolu.h -ambient.o objset.o octree.o raytrace.o \ -readoct.o rmain.o rv2.o rv3.o source.o: octree.h +rpict.o: ../common/hilbert.h -o_instance.o instance.o: instance.h octree.h +x11.o x11twind.o: x11twind.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 +x11.o: x11icon.h -ambient.o rpict.o rv3.o source.o: random.h +ambient.o ambcomp.o ambio.o lookamb.o raycalls.o: ambient.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 +data.o rpmain.o rtmain.o rvmain.o rpict.o rtrace.o \ +rv2.o: ../common/resolu.h -rv2.o rv3.o rview.o: rpaint.h driver.h view.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 -source.o: source.h +preload.o: data.h func.h ../common/object.h ../common/face.h \ +../common/cone.h ../common/instance.h ../common/mesh.h \ +../common/color.h ../common/bsdf.h ../common/otypes.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 +rtmain.o rpmain.o rvmain.o persist.o duphead.o \ +renderopts.o rpict.o: ../common/paths.h -sundev.o: suntools.icon +freeobjmem.o raycalls.o text.o: ../common/font.h -image.o rmain.o rpict.o: view.h +raypcalls.o: ../common/selcall.h -x10.o xtwind.o: xtwind.h +o_mesh.o: ../common/mesh.h -x11.o x11twind.o: x11twind.h +noise3.o: ../common/calcomp.h + +aniso.o ashikhmin.o dielectric.o freeobjmem.o glass.o initotypes.o \ +m_alias.o m_brdf.o m_clip.o m_direct.o m_mirror.o m_mist.o \ +mx_data.o mx_func.o normal.o o_cone.o o_face.o o_instance.o \ +o_mesh.o p_data.o p_func.o source.o sphere.o t_data.o t_func.o \ +srcobstr.o text.o: rtotypes.h + +m_bsdf.o: ambient.h source.h func.h \ +../common/calcomp.h ../common/bsdf.h ../common/random.h + +rcmain.o rcontrib.o rc2.o rc3.o: rcontrib.h \ +../common/platform.h ../common/paths.h ../common/lookup.h \ +func.h ../common/calcomp.h ../common/rtprocess.h + +rcmain.o: source.h ambient.h + +rcontrib.o: source.h ../common/otypes.h + +rc2.o: ../common/resolu.h + +rc3.o: ../common/selcall.h