| 1 | greg | 1.56 | # | 
| 2 | greg | 1.1 | # SCCSid "$SunId$ LBL" | 
| 3 |  |  | #  Compiles for ray tracing programs. | 
| 4 |  |  | # | 
| 5 |  |  |  | 
| 6 | greg | 1.27 | OPT = -O -pipe | 
| 7 | greg | 1.39 | MACH = -DSTRUCTASSIGN -DBSD -DIEEE -f68881 /usr/lib/libm.il | 
| 8 | greg | 1.59 | CFLAGS = $(MACH) $(OPT) -I../common -L../lib | 
| 9 | greg | 1.26 | CC = cc | 
| 10 | greg | 1.35 | LINT = lint | 
| 11 |  |  | LINTFLAGS = -DSTRUCTASSIGN -DBSD -DIEEE -DVARIABLE -DFUNCTION \ | 
| 12 | greg | 1.51 | -DINCHAN -DRCONST -DREDEFW -DBIGLIB | 
| 13 | greg | 1.1 |  | 
| 14 |  |  | # | 
| 15 |  |  | # The following are user-definable: | 
| 16 |  |  | # | 
| 17 |  |  | DESTDIR = . | 
| 18 | greg | 1.39 | INSTDIR = /lumen/lumen/ray/bin.sun3 | 
| 19 | greg | 1.5 | INSTALL = cp | 
| 20 | greg | 1.1 |  | 
| 21 |  |  | # | 
| 22 |  |  | # The following paths must exist and be relative to root: | 
| 23 |  |  | # | 
| 24 | greg | 1.33 | DEVDIR = $(INSTDIR)/dev | 
| 25 | greg | 1.1 | LIBDIR = /usr/local/lib/ray | 
| 26 |  |  |  | 
| 27 |  |  | # | 
| 28 | greg | 1.2 | # Library routines: | 
| 29 | greg | 1.1 | # | 
| 30 | greg | 1.59 | LIBS = -lrt -lm | 
| 31 | greg | 1.1 |  | 
| 32 |  |  | # | 
| 33 |  |  | # Device drivers for rview (see also devtable.c): | 
| 34 |  |  | # | 
| 35 | greg | 1.39 | DOBJS = devtable.o devcomm.o editline.o x11.o x11twind.o \ | 
| 36 |  |  | colortab.o | 
| 37 | greg | 1.46 | DSRC = devtable.c devcomm.c editline.c x11.c x11twind.c \ | 
| 38 | greg | 1.39 | colortab.c | 
| 39 |  |  | DLIBS = -lX11 | 
| 40 | greg | 1.1 |  | 
| 41 |  |  | # | 
| 42 |  |  | # Standard object files: | 
| 43 |  |  | # | 
| 44 |  |  |  | 
| 45 | greg | 1.62 | RTOBJS = rtmain.o rtrace.o $(ROBJS) Version.o | 
| 46 |  |  | RTSRC = rmain.c rtrace.c $(RSRC) Version.c | 
| 47 | greg | 1.1 |  | 
| 48 | greg | 1.62 | RPOBJS = rpmain.o rpict.o $(ROBJS) Version.o | 
| 49 |  |  | RPSRC = rmain.c rpict.c $(RSRC) Version.c | 
| 50 | greg | 1.1 |  | 
| 51 | greg | 1.62 | RVOBJS = rvmain.o rview.o rv2.o rv3.o $(DOBJS) $(ROBJS) Version.o | 
| 52 |  |  | RVSRC = rmain.c rview.c rv2.c rv3.c $(DSRC) $(RSRC) Version.c | 
| 53 | greg | 1.1 |  | 
| 54 | greg | 1.51 | ROBJS = $(RAYOBJS) $(SURFOBJS) $(MATOBJS) \ | 
| 55 | greg | 1.61 | $(MODOBJS) $(SUPPOBJS) | 
| 56 | greg | 1.51 | RSRC = $(RAYSRC) $(SURFSRC) $(MATSRC) \ | 
| 57 |  |  | $(MODSRC) $(SUPPSRC) | 
| 58 | greg | 1.1 |  | 
| 59 | greg | 1.51 | RAYOBJS = initotypes.o raytrace.o ambient.o ambcomp.o | 
| 60 |  |  | RAYSRC = initotypes.c raytrace.c ambient.c ambcomp.c | 
| 61 | greg | 1.1 |  | 
| 62 | greg | 1.51 | SURFOBJS = source.o sphere.o srcsupp.o virtuals.o o_face.o o_cone.o \ | 
| 63 |  |  | o_instance.o | 
| 64 |  |  | SURFSRC = sphere.c source.c srcsupp.c virtuals.c o_face.c \ | 
| 65 |  |  | o_cone.c o_instance.c | 
| 66 | greg | 1.1 |  | 
| 67 | greg | 1.54 | MATOBJS = normal.o dielectric.o m_clip.o glass.o m_brdf.o m_mirror.o \ | 
| 68 |  |  | m_direct.o | 
| 69 |  |  | MATSRC = normal.c dielectric.c m_clip.c glass.c m_brdf.c m_mirror.c \ | 
| 70 |  |  | m_direct.c | 
| 71 | greg | 1.1 |  | 
| 72 | greg | 1.3 | MODOBJS = p_func.o t_func.o p_data.o t_data.o text.o mx_func.o mx_data.o | 
| 73 | greg | 1.35 | MODSRC = p_func.c t_func.c p_data.c t_data.c text.c mx_func.c mx_data.c | 
| 74 | greg | 1.1 |  | 
| 75 | greg | 1.61 | SUPPOBJS = zeroes.o calexpr.o caldefn.o func.o noise3.o data.o readfargs.o \ | 
| 76 |  |  | malloc.o | 
| 77 |  |  | SUPPSRC = zeroes.c calexpr.c caldefn.c func.c noise3.c data.c readfargs.c \ | 
| 78 |  |  | malloc.c | 
| 79 | greg | 1.1 |  | 
| 80 | greg | 1.62 | HEADERS = ambient.h ray.h data.h otspecial.h source.h | 
| 81 |  |  |  | 
| 82 | greg | 1.1 | # | 
| 83 |  |  | # What this makefile produces: | 
| 84 |  |  | # | 
| 85 |  |  |  | 
| 86 |  |  | PROGS = $(DESTDIR)/rtrace $(DESTDIR)/rpict $(DESTDIR)/rview $(DESTDIR)/lookamb | 
| 87 |  |  |  | 
| 88 | greg | 1.39 | all:    $(PROGS) | 
| 89 | greg | 1.1 |  | 
| 90 | greg | 1.58 | install:        $(PROGS) rayinit.cal | 
| 91 | greg | 1.1 | $(INSTALL) $(PROGS) $(INSTDIR) | 
| 92 | greg | 1.58 | rm -f $(LIBDIR)/rayinit.cal | 
| 93 |  |  | cp rayinit.cal $(LIBDIR) | 
| 94 | greg | 1.1 |  | 
| 95 | greg | 1.39 | sun:    $(DEVDIR)/sun $(DEVDIR)/sun.com | 
| 96 |  |  |  | 
| 97 |  |  | x10:    $(DEVDIR)/x10 | 
| 98 |  |  |  | 
| 99 | greg | 1.40 | aed:    $(DEVDIR)/aed | 
| 100 | greg | 1.39 |  | 
| 101 | greg | 1.57 | tiff: | 
| 102 |  |  |  | 
| 103 | greg | 1.1 | clean: | 
| 104 | greg | 1.41 | set nonomatch; rm -f $(PROGS) *.o core | 
| 105 | greg | 1.35 |  | 
| 106 |  |  | lint:   $(RVSRC) | 
| 107 |  |  | $(LINT) $(LINTFLAGS) -DRVIEW $(RVSRC) $(LIBS) | 
| 108 | greg | 1.1 |  | 
| 109 |  |  | # | 
| 110 |  |  | # Links: | 
| 111 |  |  | # | 
| 112 |  |  |  | 
| 113 | greg | 1.59 | $(DESTDIR)/rtrace:      $(RTOBJS) | 
| 114 | greg | 1.26 | $(CC) $(CFLAGS) -o $(DESTDIR)/rtrace $(RTOBJS) $(LIBS) | 
| 115 | greg | 1.1 |  | 
| 116 | greg | 1.59 | $(DESTDIR)/rpict:       $(RPOBJS) | 
| 117 | greg | 1.26 | $(CC) $(CFLAGS) -o $(DESTDIR)/rpict $(RPOBJS) $(LIBS) | 
| 118 | greg | 1.1 |  | 
| 119 | greg | 1.59 | $(DESTDIR)/rview:       $(RVOBJS) | 
| 120 | greg | 1.26 | $(CC) $(CFLAGS) -o $(DESTDIR)/rview $(RVOBJS) $(DLIBS) $(LIBS) | 
| 121 | greg | 1.1 |  | 
| 122 |  |  | $(DESTDIR)/lookamb:     lookamb.o | 
| 123 | greg | 1.26 | $(CC) $(CFLAGS) -o $(DESTDIR)/lookamb lookamb.o | 
| 124 | greg | 1.1 |  | 
| 125 | greg | 1.33 | $(DEVDIR)/sun:  sundev.o devmain.o colortab.o editline.o | 
| 126 |  |  | $(CC) $(CFLAGS) -s -o $(DEVDIR)/sun devmain.o sundev.o colortab.o \ | 
| 127 | greg | 1.22 | editline.o -lsuntool -lsunwindow -lpixrect $(LIBS) | 
| 128 | greg | 1.1 |  | 
| 129 |  |  | $(DEVDIR)/sun.com:      suncom.o editline.o | 
| 130 | greg | 1.33 | $(CC) $(CFLAGS) -s -o $(DEVDIR)/sun.com suncom.o editline.o | 
| 131 | greg | 1.1 |  | 
| 132 | greg | 1.39 | $(DEVDIR)/x10:  x10.o xtwind.o colortab.o devmain.o editline.o | 
| 133 |  |  | $(CC) $(CFLAGS) -s -o $(DEVDIR)/x10 x10.o xtwind.o devmain.o \ | 
| 134 |  |  | colortab.o editline.o -lX $(LIBS) | 
| 135 | greg | 1.15 |  | 
| 136 | greg | 1.40 | $(DEVDIR)/aed:  aed.o colortab.o tty.o devmain.o editline.o | 
| 137 |  |  | $(CC) $(CFLAGS) -s -o $(DEVDIR)/aed aed.o colortab.o \ | 
| 138 |  |  | devmain.o tty.o editline.o $(LIBS) | 
| 139 |  |  |  | 
| 140 | greg | 1.1 | # | 
| 141 |  |  | # Special compiles: | 
| 142 |  |  | # | 
| 143 |  |  |  | 
| 144 |  |  | rtmain.o:       rmain.c | 
| 145 | greg | 1.26 | $(CC) $(CFLAGS) -DRTRACE -DNICE=4 -DDEFPATH=\":$(LIBDIR)\" -c rmain.c | 
| 146 | greg | 1.1 | mv rmain.o rtmain.o | 
| 147 |  |  |  | 
| 148 |  |  | rpmain.o:       rmain.c | 
| 149 | greg | 1.26 | $(CC) $(CFLAGS) -DRPICT -DNICE=6 -DDEFPATH=\":$(LIBDIR)\" -c rmain.c | 
| 150 | greg | 1.1 | mv rmain.o rpmain.o | 
| 151 |  |  |  | 
| 152 |  |  | rvmain.o:       rmain.c | 
| 153 | greg | 1.26 | $(CC) $(CFLAGS) -DRVIEW -DDEFPATH=\":$(LIBDIR)\" -c rmain.c | 
| 154 | greg | 1.1 | mv rmain.o rvmain.o | 
| 155 | greg | 1.56 |  | 
| 156 |  |  | readfargs.o:    readfargs.c ../common/object.h | 
| 157 |  |  | $(CC) $(CFLAGS) -DMEMHOG -c readfargs.c | 
| 158 | greg | 1.60 |  | 
| 159 |  |  | malloc.o:       malloc.c | 
| 160 |  |  | $(CC) $(CFLAGS) -DMCOMP -c malloc.c | 
| 161 | greg | 1.1 |  | 
| 162 |  |  | # | 
| 163 | greg | 1.51 | # Uncomment the following to model dispersion: | 
| 164 | greg | 1.1 | # | 
| 165 | greg | 1.55 | dielectric.o:   dielectric.c source.h | 
| 166 |  |  | $(CC) $(CFLAGS) -DDISPERSE -c dielectric.c | 
| 167 |  |  |  | 
| 168 | greg | 1.1 | # end of dispersion compiles. | 
| 169 |  |  |  | 
| 170 | greg | 1.33 | devcomm.o:      devcomm.c | 
| 171 |  |  | $(CC) $(CFLAGS) -DDEVPATH=\"$(DEVDIR)\" -c devcomm.c | 
| 172 |  |  |  | 
| 173 | greg | 1.1 | sundev.o:       sundev.c | 
| 174 | greg | 1.33 | $(CC) $(CFLAGS) -DTTYPROG=\"$(DEVDIR)/sun.com\" -Dsun_init=dinit -c sundev.c | 
| 175 | greg | 1.1 |  | 
| 176 | greg | 1.39 | x10.o:  x10.c | 
| 177 |  |  | $(CC) $(CFLAGS) -Dx_init=dinit -c x10.c | 
| 178 | greg | 1.40 |  | 
| 179 |  |  | aed.o:  aed.c | 
| 180 |  |  | $(CC) $(CFLAGS) -Daed_init=dinit -c aed.c | 
| 181 | greg | 1.1 |  | 
| 182 |  |  | ambient.o:      ambient.c | 
| 183 | greg | 1.26 | $(CC) $(CFLAGS) -DAMBFLUSH=16 -c ambient.c | 
| 184 | greg | 1.1 |  | 
| 185 | greg | 1.53 | calexpr.o:      calexpr.c ../common/calcomp.h | 
| 186 | greg | 1.26 | $(CC) $(CFLAGS) -DVARIABLE -DFUNCTION -DINCHAN -DRCONST -c calexpr.c | 
| 187 | greg | 1.1 |  | 
| 188 | greg | 1.53 | caldefn.o:      caldefn.c ../common/calcomp.h | 
| 189 |  |  | $(CC) $(CFLAGS) -DFUNCTION -DREDEFW -c caldefn.c | 
| 190 | greg | 1.1 |  | 
| 191 | greg | 1.27 | nwsdev.o:       nwsdev.c nwsdev.h newsconstants.h | 
| 192 |  |  | $(CC) $(CFLAGS) -c nwsdev.c | 
| 193 |  |  |  | 
| 194 |  |  | nwsdev.h:       nwsdev.cps newsconstants.h | 
| 195 |  |  | cps nwsdev.cps | 
| 196 | greg | 1.62 |  | 
| 197 |  |  | # | 
| 198 |  |  | # Version module: | 
| 199 |  |  | # | 
| 200 |  |  |  | 
| 201 |  |  | Version.c:      VERSION $(RSRC) $(HEADERS) verscript.ed | 
| 202 |  |  | cp VERSION Version.c | 
| 203 |  |  | ls -lLt $(RSRC) $(HEADERS) >> Version.c | 
| 204 |  |  | ed - Version.c < verscript.ed | 
| 205 | greg | 1.27 |  | 
| 206 | greg | 1.1 | # | 
| 207 |  |  | # Include dependencies: | 
| 208 |  |  | # | 
| 209 |  |  |  | 
| 210 | greg | 1.51 | aed.o colortab.o data.o devcomm.o \ | 
| 211 | greg | 1.52 | devmain.o lookamb.o rview.o sundev.o x10.o x11.o:       ../common/color.h | 
| 212 | greg | 1.1 |  | 
| 213 | greg | 1.54 | o_cone.o srcsupp.o:     ../common/cone.h | 
| 214 | greg | 1.1 |  | 
| 215 | greg | 1.37 | data.o m_brdf.o mx_data.o p_data.o t_data.o:    data.h | 
| 216 | greg | 1.1 |  | 
| 217 | greg | 1.19 | aed.o devcomm.o devmain.o devtable.o \ | 
| 218 | greg | 1.27 | editline.o nwsdev.o sundev.o tty.o x10.o x11.o: driver.h | 
| 219 | greg | 1.1 |  | 
| 220 | greg | 1.52 | o_face.o srcsupp.o:     ../common/face.h | 
| 221 | greg | 1.1 |  | 
| 222 | greg | 1.51 | ambient.o raytrace.o rpmain.o rtmain.o \ | 
| 223 | greg | 1.52 | rtrace.o rvmain.o rv2.o rv3.o source.o: ../common/octree.h | 
| 224 | greg | 1.1 |  | 
| 225 | greg | 1.52 | o_instance.o:   ../common/instance.h ../common/octree.h | 
| 226 | greg | 1.1 |  | 
| 227 | greg | 1.51 | ambient.o dielectric.o func.o initotypes.o m_brdf.o \ | 
| 228 |  |  | normal.o o_cone.o text.o raytrace.o rtrace.o \ | 
| 229 | greg | 1.52 | rv2.o source.o srcsupp.o virtuals.o sphere.o:   ../common/otypes.h | 
| 230 | greg | 1.1 |  | 
| 231 | greg | 1.52 | ambient.o ambcomp.o rpict.o rv3.o source.o:     ../common/random.h | 
| 232 | greg | 1.1 |  | 
| 233 | greg | 1.50 | ambient.o ambcomp.o dielectric.o func.o glass.o m_clip.o m_mirror.o \ | 
| 234 | greg | 1.37 | m_brdf.o mx_data.o mx_func.o normal.o o_cone.o o_face.o o_instance.o \ | 
| 235 | greg | 1.24 | p_data.o p_func.o text.o raytrace.o rpmain.o rtmain.o rvmain.o rpict.o \ | 
| 236 | greg | 1.50 | rtrace.o rview.o rv2.o rv3.o source.o srcsupp.o virtuals.o sphere.o \ | 
| 237 | greg | 1.52 | t_data.o t_func.o:      ray.h ../common/standard.h ../common/mat4.h \ | 
| 238 |  |  | ../common/fvect.h ../common/object.h ../common/color.h | 
| 239 | greg | 1.1 |  | 
| 240 | greg | 1.52 | rv2.o rv3.o rview.o:    rpaint.h driver.h ../common/view.h | 
| 241 | greg | 1.1 |  | 
| 242 | greg | 1.50 | mirror.o source.o srcsupp.o virtuals.o: source.h | 
| 243 | greg | 1.1 |  | 
| 244 | greg | 1.51 | cone.o data.o devcomm.o initotypes.o \ | 
| 245 | greg | 1.52 | octree.o:       ../common/standard.h ../common/mat4.h ../common/fvect.h | 
| 246 | greg | 1.38 |  | 
| 247 | greg | 1.44 | initotypes.o raytrace.o:        otspecial.h | 
| 248 |  |  |  | 
| 249 | greg | 1.1 | sundev.o:       suntools.icon | 
| 250 |  |  |  | 
| 251 | greg | 1.52 | rpmain.o rtmain.o rvmain.o rpict.o:     ../common/view.h | 
| 252 | greg | 1.1 |  | 
| 253 |  |  | x10.o xtwind.o: xtwind.h | 
| 254 | greg | 1.15 |  | 
| 255 |  |  | x11.o x11twind.o: x11twind.h | 
| 256 | greg | 1.42 |  | 
| 257 |  |  | x11.o:  x11icon.h | 
| 258 | greg | 1.47 |  | 
| 259 |  |  | ambient.o ambcomp.o lookamb.o:  ambient.h |