| 1 | greg | 2.38 | # RCSid: $Id: Rmakefile,v 2.37 2003/06/27 06:53:22 greg Exp $ | 
| 2 | greg | 1.56 | # | 
| 3 | greg | 2.2 | # Compiles for ray tracing programs. | 
| 4 | greg | 1.1 | # | 
| 5 |  |  |  | 
| 6 | greg | 1.66 | OPT = -O | 
| 7 | greg | 1.68 | MACH = -DBSD | 
| 8 | greg | 2.33 | CFLAGS = -I../common -L../lib $(OPT) $(MACH) | 
| 9 | greg | 1.67 | SPECIAL = aed | 
| 10 | greg | 1.26 | CC = cc | 
| 11 | greg | 2.15 | MLIB = -lm | 
| 12 | greg | 1.35 | LINT = lint | 
| 13 | greg | 2.33 | LINTFLAGS = -DBSD | 
| 14 | greg | 1.1 |  | 
| 15 |  |  | # | 
| 16 |  |  | # The following are user-definable: | 
| 17 |  |  | # | 
| 18 |  |  | DESTDIR = . | 
| 19 | greg | 1.66 | INSTDIR = /usr/local/bin | 
| 20 | greg | 1.5 | INSTALL = cp | 
| 21 | greg | 1.1 |  | 
| 22 |  |  | # | 
| 23 |  |  | # The following paths must exist and be relative to root: | 
| 24 |  |  | # | 
| 25 | greg | 1.33 | DEVDIR = $(INSTDIR)/dev | 
| 26 | greg | 1.1 | LIBDIR = /usr/local/lib/ray | 
| 27 |  |  |  | 
| 28 |  |  | # | 
| 29 | greg | 1.2 | # Library routines: | 
| 30 | greg | 1.1 | # | 
| 31 | greg | 2.33 | RLIB = ../lib/libradiance.a | 
| 32 | greg | 2.36 | RCLIB = libraycalls.a | 
| 33 | greg | 2.15 | LIBS = -lrt $(MLIB) | 
| 34 | greg | 1.1 |  | 
| 35 |  |  | # | 
| 36 |  |  | # Device drivers for rview (see also devtable.c): | 
| 37 |  |  | # | 
| 38 | greg | 1.39 | DOBJS = devtable.o devcomm.o editline.o x11.o x11twind.o \ | 
| 39 |  |  | colortab.o | 
| 40 | greg | 1.46 | DSRC = devtable.c devcomm.c editline.c x11.c x11twind.c \ | 
| 41 | greg | 1.39 | colortab.c | 
| 42 |  |  | DLIBS = -lX11 | 
| 43 | greg | 1.1 |  | 
| 44 |  |  | # | 
| 45 |  |  | # Standard object files: | 
| 46 |  |  | # | 
| 47 |  |  |  | 
| 48 | greg | 2.33 | RTOBJS = rtmain.o rtrace.o duphead.o persist.o | 
| 49 |  |  | RTSRC = rtmain.c rtrace.c duphead.c persist.c | 
| 50 | greg | 1.1 |  | 
| 51 | greg | 2.33 | RPOBJS = rpmain.o rpict.o srcdraw.o duphead.o persist.o | 
| 52 |  |  | RPSRC = rpmain.c rpict.c srcdraw.c duphead.c persist.c | 
| 53 | greg | 1.1 |  | 
| 54 | greg | 2.33 | RVOBJS = rvmain.o rview.o rv2.o rv3.o $(DOBJS) | 
| 55 |  |  | RVSRC = rvmain.c rview.c rv2.c rv3.c $(DSRC) | 
| 56 |  |  |  | 
| 57 |  |  | RLOBJS = raycalls.o raypcalls.o | 
| 58 |  |  | RLSRC = raycalls.c raypcalls.c | 
| 59 | greg | 1.1 |  | 
| 60 | greg | 1.51 | ROBJS = $(RAYOBJS) $(SURFOBJS) $(MATOBJS) \ | 
| 61 | greg | 1.61 | $(MODOBJS) $(SUPPOBJS) | 
| 62 | greg | 1.51 | RSRC = $(RAYSRC) $(SURFSRC) $(MATSRC) \ | 
| 63 |  |  | $(MODSRC) $(SUPPSRC) | 
| 64 | greg | 1.1 |  | 
| 65 | greg | 2.33 | RAYOBJS = ambcomp.o ambient.o ambio.o freeobjmem.o initotypes.o \ | 
| 66 |  |  | preload.o raytrace.o renderopts.o | 
| 67 |  |  | RAYSRC = ambcomp.c ambient.c ambio.c freeobjmem.c initotypes.c \ | 
| 68 |  |  | preload.c raytrace.c renderopts.c | 
| 69 | greg | 1.1 |  | 
| 70 | greg | 1.64 | SURFOBJS = source.o sphere.o srcsupp.o srcsamp.o virtuals.o o_face.o \ | 
| 71 | greg | 2.34 | o_cone.o o_instance.o o_mesh.o | 
| 72 | greg | 1.51 | SURFSRC = sphere.c source.c srcsupp.c virtuals.c o_face.c \ | 
| 73 | greg | 2.34 | srcsamp.c o_cone.c o_instance.c o_mesh.c | 
| 74 | greg | 1.1 |  | 
| 75 | greg | 2.3 | MATOBJS = aniso.o normal.o dielectric.o m_clip.o glass.o m_brdf.o \ | 
| 76 | greg | 2.35 | m_mirror.o m_direct.o m_mist.o fprism.o m_alias.o | 
| 77 | greg | 2.13 | MATSRC = aniso.c normal.c dielectric.c m_clip.c glass.c m_brdf.c \ | 
| 78 | greg | 2.35 | m_mirror.c m_direct.c m_mist.c fprism.c m_alias.c | 
| 79 | greg | 1.1 |  | 
| 80 | greg | 1.3 | MODOBJS = p_func.o t_func.o p_data.o t_data.o text.o mx_func.o mx_data.o | 
| 81 | greg | 1.35 | MODSRC = p_func.c t_func.c p_data.c t_data.c text.c mx_func.c mx_data.c | 
| 82 | greg | 1.1 |  | 
| 83 | greg | 2.33 | SUPPOBJS = func.o noise3.o data.o | 
| 84 |  |  | SUPPSRC = func.c noise3.c data.c | 
| 85 | greg | 1.1 |  | 
| 86 | greg | 1.62 | HEADERS = ambient.h ray.h data.h otspecial.h source.h | 
| 87 |  |  |  | 
| 88 | greg | 1.1 | # | 
| 89 |  |  | # What this makefile produces: | 
| 90 |  |  | # | 
| 91 |  |  |  | 
| 92 |  |  | PROGS = $(DESTDIR)/rtrace $(DESTDIR)/rpict $(DESTDIR)/rview $(DESTDIR)/lookamb | 
| 93 |  |  |  | 
| 94 | greg | 2.36 | all:    $(PROGS) $(RCLIB) $(SPECIAL) | 
| 95 | greg | 1.1 |  | 
| 96 | greg | 2.33 | install:        all rayinit.cal | 
| 97 | greg | 1.1 | $(INSTALL) $(PROGS) $(INSTDIR) | 
| 98 | greg | 2.36 | mv $(RCLIB) ../lib | 
| 99 | greg | 1.58 | rm -f $(LIBDIR)/rayinit.cal | 
| 100 |  |  | cp rayinit.cal $(LIBDIR) | 
| 101 | greg | 1.1 |  | 
| 102 | greg | 1.40 | aed:    $(DEVDIR)/aed | 
| 103 | greg | 1.39 |  | 
| 104 | gwlarson | 2.29 | ogl: | 
| 105 | greg | 1.57 |  | 
| 106 | greg | 1.1 | clean: | 
| 107 | greg | 1.41 | set nonomatch; rm -f $(PROGS) *.o core | 
| 108 | greg | 1.35 |  | 
| 109 |  |  | lint:   $(RVSRC) | 
| 110 |  |  | $(LINT) $(LINTFLAGS) -DRVIEW $(RVSRC) $(LIBS) | 
| 111 | greg | 1.1 |  | 
| 112 |  |  | # | 
| 113 |  |  | # Links: | 
| 114 |  |  | # | 
| 115 |  |  |  | 
| 116 | greg | 2.33 | $(DESTDIR)/rtrace:      $(RTOBJS) $(RLIB) | 
| 117 |  |  | $(CC) $(CFLAGS) -o $(DESTDIR)/rtrace $(RTOBJS) $(RLIB) $(LIBS) | 
| 118 | greg | 1.1 |  | 
| 119 | greg | 2.33 | $(DESTDIR)/rpict:       $(RPOBJS) $(RLIB) | 
| 120 |  |  | $(CC) $(CFLAGS) -o $(DESTDIR)/rpict $(RPOBJS) $(RLIB) $(LIBS) | 
| 121 | greg | 1.1 |  | 
| 122 | greg | 2.33 | $(DESTDIR)/rview:       $(RVOBJS) $(RLIB) | 
| 123 |  |  | $(CC) $(CFLAGS) -o $(DESTDIR)/rview $(RVOBJS) $(RLIB) $(LIBS) $(DLIBS) | 
| 124 | greg | 1.1 |  | 
| 125 | greg | 2.7 | $(DESTDIR)/lookamb:     lookamb.o ambio.o | 
| 126 | gwlarson | 2.31 | $(CC) $(CFLAGS) -o $(DESTDIR)/lookamb lookamb.o ambio.o $(LIBS) | 
| 127 | greg | 1.1 |  | 
| 128 | greg | 1.40 | $(DEVDIR)/aed:  aed.o colortab.o tty.o devmain.o editline.o | 
| 129 |  |  | $(CC) $(CFLAGS) -s -o $(DEVDIR)/aed aed.o colortab.o \ | 
| 130 |  |  | devmain.o tty.o editline.o $(LIBS) | 
| 131 |  |  |  | 
| 132 | greg | 2.33 | $(RLIB):        $(ROBJS) Version.o | 
| 133 |  |  | ar rc $(RLIB) $(ROBJS) Version.o | 
| 134 |  |  | -ranlib $(RLIB) | 
| 135 | greg | 2.36 |  | 
| 136 |  |  | $(RCLIB):       $(RLOBJS) | 
| 137 |  |  | ar rc $(RCLIB) $(RLOBJS) | 
| 138 |  |  | -ranlib $(RCLIB) | 
| 139 | greg | 1.69 |  | 
| 140 | greg | 1.1 | # | 
| 141 |  |  | # Special compiles: | 
| 142 |  |  | # | 
| 143 |  |  |  | 
| 144 | greg | 2.33 | rtmain.o:       rtmain.c | 
| 145 |  |  | $(CC) $(CFLAGS) -DNICE=4 -c rtmain.c | 
| 146 | greg | 1.56 |  | 
| 147 | greg | 2.33 | rpmain.o:       rpmain.c | 
| 148 |  |  | $(CC) $(CFLAGS) -DNICE=6 -c rpmain.c | 
| 149 | greg | 1.60 |  | 
| 150 | greg | 2.33 | rvmain.o:       rvmain.c | 
| 151 |  |  | $(CC) $(CFLAGS) -c rvmain.c | 
| 152 | greg | 1.1 |  | 
| 153 |  |  | # | 
| 154 | greg | 1.51 | # Uncomment the following to model dispersion: | 
| 155 | greg | 1.1 | # | 
| 156 | greg | 1.55 | dielectric.o:   dielectric.c source.h | 
| 157 |  |  | $(CC) $(CFLAGS) -DDISPERSE -c dielectric.c | 
| 158 |  |  |  | 
| 159 | greg | 1.1 | # end of dispersion compiles. | 
| 160 |  |  |  | 
| 161 | greg | 1.33 | devcomm.o:      devcomm.c | 
| 162 |  |  | $(CC) $(CFLAGS) -DDEVPATH=\"$(DEVDIR)\" -c devcomm.c | 
| 163 |  |  |  | 
| 164 | greg | 1.40 | aed.o:  aed.c | 
| 165 |  |  | $(CC) $(CFLAGS) -Daed_init=dinit -c aed.c | 
| 166 | greg | 1.1 |  | 
| 167 | greg | 1.62 | # | 
| 168 |  |  | # Version module: | 
| 169 |  |  | # | 
| 170 |  |  |  | 
| 171 | greg | 1.63 | Version.c:      VERSION $(RSRC) $(HEADERS) | 
| 172 |  |  | ( cat VERSION ; date ; whoami ; hostname ) > Version.c | 
| 173 | greg | 1.62 | ed - Version.c < verscript.ed | 
| 174 | greg | 1.27 |  | 
| 175 | greg | 1.1 | # | 
| 176 |  |  | # Include dependencies: | 
| 177 |  |  | # | 
| 178 |  |  |  | 
| 179 | greg | 2.7 | aed.o ambio.o colortab.o data.o devcomm.o \ | 
| 180 | greg | 2.33 | devmain.o lookamb.o rview.o x11.o:      ../common/color.h | 
| 181 | greg | 1.1 |  | 
| 182 | greg | 2.33 | freeobjmem.o o_cone.o srcsupp.o:        ../common/cone.h | 
| 183 | greg | 1.1 |  | 
| 184 | greg | 2.33 | data.o freeobjmem.o m_brdf.o mx_data.o \ | 
| 185 |  |  | p_data.o raycalls.o t_data.o:   data.h | 
| 186 | greg | 1.1 |  | 
| 187 | greg | 1.19 | aed.o devcomm.o devmain.o devtable.o \ | 
| 188 | greg | 2.33 | editline.o tty.o x11.o: driver.h | 
| 189 | greg | 1.1 |  | 
| 190 | greg | 2.33 | freeobjmem.o o_face.o srcsupp.o:        ../common/face.h | 
| 191 | greg | 1.1 |  | 
| 192 | greg | 1.51 | ambient.o raytrace.o rpmain.o rtmain.o \ | 
| 193 | greg | 1.52 | rtrace.o rvmain.o rv2.o rv3.o source.o: ../common/octree.h | 
| 194 | greg | 1.1 |  | 
| 195 | greg | 2.34 | o_instance.o:   ../common/instance.h | 
| 196 | greg | 1.1 |  | 
| 197 | greg | 2.22 | ambient.o aniso.o dielectric.o freeobjmem.o func.o glass.o initotypes.o \ | 
| 198 |  |  | m_brdf.o m_direct.o m_mirror.o normal.o o_cone.o preload.o \ | 
| 199 | greg | 2.33 | raycalls.o raytrace.o rtrace.o rv2.o source.o sphere.o srcsupp.o text.o \ | 
| 200 | greg | 2.22 | virtuals.o:     ../common/otypes.h | 
| 201 | greg | 1.1 |  | 
| 202 | greg | 2.33 | ambient.o ambcomp.o aniso.o normal.o raycalls.o rpict.o rvmain.o \ | 
| 203 |  |  | rtmain.o rpmain.o persist.o source.o rv3.o \ | 
| 204 |  |  | srcsamp.o virtuals.o:   ../common/random.h | 
| 205 |  |  |  | 
| 206 |  |  | ambcomp.o ambient.o aniso.o dielectric.o freeobjmem.o func.o glass.o \ | 
| 207 | greg | 2.34 | m_brdf.o m_clip.o m_direct.o m_mirror.o m_mist.o mx_data.o o_mesh.o \ | 
| 208 | greg | 2.33 | mx_func.o normal.o o_cone.o o_face.o o_instance.o p_data.o p_func.o \ | 
| 209 |  |  | raycalls.o raypcalls.o raytrace.o rpict.o rtrace.o rv2.o rv3.o rview.o \ | 
| 210 |  |  | source.o sphere.o srcdraw.o srcsamp.o srcsupp.o t_data.o t_func.o text.o \ | 
| 211 | greg | 2.35 | rpmain.o rtmain.o rvmain.o virtuals.o m_alias.o:        ray.h \ | 
| 212 | greg | 2.37 | ../common/standard.h ../common/rtmisc.h ../common/rtio.h ../common/rtmath.h \ | 
| 213 |  |  | ../common/rterror.h ../common/octree.h \ | 
| 214 | greg | 1.65 | ../common/mat4.h ../common/fvect.h ../common/object.h ../common/color.h | 
| 215 | greg | 1.1 |  | 
| 216 | greg | 2.33 | rv2.o rv3.o rview.o:    rpaint.h driver.h ../common/view.h ../common/resolu.h | 
| 217 | greg | 1.1 |  | 
| 218 | greg | 2.33 | m_direct.o m_mirror.o m_mist.o dielectric.o raycalls.o \ | 
| 219 | greg | 2.21 | source.o srcdraw.o srcsamp.o srcsupp.o virtuals.o:      source.h | 
| 220 | greg | 1.1 |  | 
| 221 | greg | 2.33 | cone.o data.o devcomm.o initotypes.o fprism.o preload.o \ | 
| 222 | greg | 2.37 | duphead.o octree.o:     ../common/standard.h ../common/rtmisc.h \ | 
| 223 |  |  | ../common/rtio.h ../common/rtmath.h \ | 
| 224 |  |  | ../common/rterror.h ../common/mat4.h ../common/fvect.h | 
| 225 | greg | 1.38 |  | 
| 226 | greg | 2.23 | ambio.o:        ../common/fvect.h | 
| 227 |  |  |  | 
| 228 | greg | 1.44 | initotypes.o raytrace.o:        otspecial.h | 
| 229 |  |  |  | 
| 230 | greg | 2.33 | rpmain.o rtmain.o rvmain.o rpict.o \ | 
| 231 |  |  | srcdraw.o:      ../common/view.h ../common/resolu.h | 
| 232 | greg | 1.15 |  | 
| 233 |  |  | x11.o x11twind.o: x11twind.h | 
| 234 | greg | 1.42 |  | 
| 235 |  |  | x11.o:  x11icon.h | 
| 236 | greg | 1.47 |  | 
| 237 | greg | 2.33 | ambient.o ambcomp.o ambio.o lookamb.o raycalls.o:       ambient.h | 
| 238 | greg | 1.70 |  | 
| 239 | gregl | 2.26 | data.o rpmain.o rtmain.o rvmain.o rpict.o rtrace.o \ | 
| 240 |  |  | rv2.o:  ../common/resolu.h | 
| 241 | greg | 2.2 |  | 
| 242 | greg | 2.3 | aniso.o func.o m_brdf.o m_direct.o mx_data.o mx_func.o p_data.o \ | 
| 243 | greg | 2.38 | p_func.o t_data.o t_func.o:     func.h ../common/calcomp.h | 
| 244 | greg | 2.25 |  | 
| 245 |  |  | preload.o:      ../common/object.h ../common/face.h ../common/cone.h \ | 
| 246 | greg | 2.34 | ../common/instance.h ../common/mesh.h ../common/color.h data.h | 
| 247 | greg | 2.12 |  | 
| 248 | greg | 2.5 | devcomm.o:      ../common/vfork.h | 
| 249 | greg | 2.9 |  | 
| 250 | greg | 2.11 | rtmain.o rpmain.o rvmain.o persist.o duphead.o rpict.o: ../common/paths.h | 
| 251 | greg | 2.33 |  | 
| 252 |  |  | freeobjmem.o raycalls.o text.o: ../common/font.h | 
| 253 |  |  |  | 
| 254 |  |  | raypcalls.o:    ../common/selcall.h | 
| 255 | greg | 2.34 |  | 
| 256 |  |  | o_mesh.o:       ../common/mesh.h | 
| 257 | greg | 2.38 |  | 
| 258 |  |  | noise3.o:       ../common/calcomp.h |