| 1 | 
greg | 
1.1 | 
# SCCSid "$SunId$ LBL" | 
| 2 | 
  | 
  | 
 | 
| 3 | 
  | 
  | 
# | 
| 4 | 
  | 
  | 
#  Compiles for ray tracing programs. | 
| 5 | 
  | 
  | 
# | 
| 6 | 
  | 
  | 
 | 
| 7 | 
greg | 
1.27 | 
OPT = -O -pipe | 
| 8 | 
greg | 
1.39 | 
MACH = -DSTRUCTASSIGN -DBSD -DIEEE -f68881 /usr/lib/libm.il | 
| 9 | 
greg | 
1.11 | 
CFLAGS = $(MACH) $(OPT) | 
| 10 | 
greg | 
1.26 | 
CC = cc | 
| 11 | 
greg | 
1.35 | 
LINT = lint | 
| 12 | 
  | 
  | 
LINTFLAGS = -DSTRUCTASSIGN -DBSD -DIEEE -DVARIABLE -DFUNCTION \ | 
| 13 | 
  | 
  | 
-DINCHAN -DRCONST -DREDEFW -DBIGLIB -DINVXF  | 
| 14 | 
greg | 
1.1 | 
 | 
| 15 | 
  | 
  | 
# | 
| 16 | 
  | 
  | 
# The following are user-definable: | 
| 17 | 
  | 
  | 
# | 
| 18 | 
  | 
  | 
DESTDIR = . | 
| 19 | 
greg | 
1.39 | 
INSTDIR = /lumen/lumen/ray/bin.sun3 | 
| 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 | 
1.2 | 
LIBS = -lm | 
| 32 | 
greg | 
1.45 | 
COMPAT = bmalloc.o | 
| 33 | 
greg | 
1.1 | 
 | 
| 34 | 
  | 
  | 
# | 
| 35 | 
  | 
  | 
# Device drivers for rview (see also devtable.c): | 
| 36 | 
  | 
  | 
# | 
| 37 | 
greg | 
1.39 | 
DOBJS = devtable.o devcomm.o editline.o x11.o x11twind.o \ | 
| 38 | 
  | 
  | 
        colortab.o | 
| 39 | 
greg | 
1.46 | 
DSRC = devtable.c devcomm.c editline.c x11.c x11twind.c \ | 
| 40 | 
greg | 
1.39 | 
        colortab.c | 
| 41 | 
  | 
  | 
DLIBS = -lX11 | 
| 42 | 
greg | 
1.1 | 
 | 
| 43 | 
  | 
  | 
# | 
| 44 | 
  | 
  | 
# Standard object files: | 
| 45 | 
  | 
  | 
# | 
| 46 | 
  | 
  | 
 | 
| 47 | 
  | 
  | 
RTOBJS = rtmain.o rtrace.o $(ROBJS) | 
| 48 | 
greg | 
1.35 | 
RTSRC = rmain.c rtrace.c $(RSRC) | 
| 49 | 
greg | 
1.1 | 
 | 
| 50 | 
  | 
  | 
RPOBJS = rpmain.o rpict.o image.o $(ROBJS) | 
| 51 | 
greg | 
1.35 | 
RPSRC = rmain.c rpict.c image.c $(RSRC) | 
| 52 | 
greg | 
1.1 | 
 | 
| 53 | 
  | 
  | 
RVOBJS = rvmain.o rview.o rv2.o rv3.o image.o $(DOBJS) $(ROBJS) | 
| 54 | 
greg | 
1.35 | 
RVSRC = rmain.c rview.c rv2.c rv3.c image.c $(DSRC) $(RSRC) | 
| 55 | 
greg | 
1.1 | 
 | 
| 56 | 
  | 
  | 
ROBJS = $(OCTOBJS) $(RAYOBJS) $(SURFOBJS) $(MATOBJS) \ | 
| 57 | 
  | 
  | 
        $(MODOBJS) $(SUPPOBJS) $(MISCOBJS) $(COMPAT) | 
| 58 | 
greg | 
1.35 | 
RSRC = $(OCTSRC) $(RAYSRC) $(SURFSRC) $(MATSRC) \ | 
| 59 | 
  | 
  | 
        $(MODSRC) $(SUPPSRC) $(MISCSRC) | 
| 60 | 
greg | 
1.1 | 
 | 
| 61 | 
greg | 
1.36 | 
OCTOBJS = octree.o readobj.o readoct.o objset.o otypes.o initotypes.o | 
| 62 | 
  | 
  | 
OCTSRC = octree.c readobj.c readoct.c objset.c otypes.c initotypes.c | 
| 63 | 
greg | 
1.1 | 
 | 
| 64 | 
  | 
  | 
RAYOBJS = raytrace.o ambient.o | 
| 65 | 
greg | 
1.35 | 
RAYSRC = raytrace.c ambient.c | 
| 66 | 
greg | 
1.1 | 
 | 
| 67 | 
  | 
  | 
SURFOBJS = face.o sphere.o source.o o_face.o cone.o \ | 
| 68 | 
  | 
  | 
                o_cone.o o_instance.o instance.o | 
| 69 | 
greg | 
1.35 | 
SURFSRC = face.c sphere.c source.c o_face.c cone.c \ | 
| 70 | 
  | 
  | 
                o_cone.c o_instance.c instance.c | 
| 71 | 
greg | 
1.1 | 
 | 
| 72 | 
greg | 
1.34 | 
MATOBJS = normal.o dielectric.o m_clip.o glass.o m_brdf.o | 
| 73 | 
greg | 
1.35 | 
MATSRC = normal.c dielectric.c m_clip.c glass.c m_brdf.c | 
| 74 | 
greg | 
1.1 | 
 | 
| 75 | 
greg | 
1.3 | 
MODOBJS = p_func.o t_func.o p_data.o t_data.o text.o mx_func.o mx_data.o | 
| 76 | 
greg | 
1.35 | 
MODSRC = p_func.c t_func.c p_data.c t_data.c text.c mx_func.c mx_data.c | 
| 77 | 
greg | 
1.1 | 
 | 
| 78 | 
  | 
  | 
SUPPOBJS = zeroes.o calexpr.o caldefn.o calfunc.o func.o noise3.o data.o | 
| 79 | 
greg | 
1.35 | 
SUPPSRC = zeroes.c calexpr.c caldefn.c calfunc.c func.c noise3.c data.c | 
| 80 | 
greg | 
1.1 | 
 | 
| 81 | 
greg | 
1.31 | 
MISCOBJS = misc.o header.o mat4.o xf.o fvect.o savestr.o fgetline.o ealloc.o \ | 
| 82 | 
greg | 
1.46 | 
                color.o resolu.o urand.o | 
| 83 | 
greg | 
1.35 | 
MISCSRC = misc.c header.c mat4.c xf.c fvect.c savestr.c fgetline.c ealloc.c \ | 
| 84 | 
greg | 
1.46 | 
                color.c resolu.c urand.c | 
| 85 | 
greg | 
1.1 | 
 | 
| 86 | 
  | 
  | 
# | 
| 87 | 
  | 
  | 
# What this makefile produces: | 
| 88 | 
  | 
  | 
# | 
| 89 | 
  | 
  | 
 | 
| 90 | 
  | 
  | 
PROGS = $(DESTDIR)/rtrace $(DESTDIR)/rpict $(DESTDIR)/rview $(DESTDIR)/lookamb | 
| 91 | 
  | 
  | 
 | 
| 92 | 
greg | 
1.39 | 
all:    $(PROGS) | 
| 93 | 
greg | 
1.1 | 
 | 
| 94 | 
greg | 
1.39 | 
install:        $(PROGS) | 
| 95 | 
greg | 
1.1 | 
        $(INSTALL) $(PROGS) $(INSTDIR) | 
| 96 | 
  | 
  | 
 | 
| 97 | 
greg | 
1.39 | 
sun:    $(DEVDIR)/sun $(DEVDIR)/sun.com | 
| 98 | 
  | 
  | 
 | 
| 99 | 
  | 
  | 
x10:    $(DEVDIR)/x10 | 
| 100 | 
  | 
  | 
 | 
| 101 | 
greg | 
1.40 | 
aed:    $(DEVDIR)/aed | 
| 102 | 
greg | 
1.39 | 
 | 
| 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 | 
  | 
  | 
$(DESTDIR)/rtrace:      $(RTOBJS) | 
| 114 | 
greg | 
1.26 | 
        $(CC) $(CFLAGS) -o $(DESTDIR)/rtrace $(RTOBJS) $(LIBS) | 
| 115 | 
greg | 
1.1 | 
 | 
| 116 | 
  | 
  | 
$(DESTDIR)/rpict:       $(RPOBJS) | 
| 117 | 
greg | 
1.26 | 
        $(CC) $(CFLAGS) -o $(DESTDIR)/rpict $(RPOBJS) $(LIBS) | 
| 118 | 
greg | 
1.1 | 
 | 
| 119 | 
  | 
  | 
$(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 | 
  | 
  | 
 | 
| 156 | 
  | 
  | 
# | 
| 157 | 
greg | 
1.31 | 
# Uncomment the following and add spec_rgb.o to MISCOBJS to model dispersion: | 
| 158 | 
greg | 
1.1 | 
# | 
| 159 | 
  | 
  | 
#dielectric.o:  dielectric.c source.h | 
| 160 | 
greg | 
1.26 | 
#       $(CC) $(CFLAGS) -DDISPERSE -c dielectric.c | 
| 161 | 
greg | 
1.1 | 
# | 
| 162 | 
  | 
  | 
# end of dispersion compiles. | 
| 163 | 
  | 
  | 
 | 
| 164 | 
greg | 
1.33 | 
devcomm.o:      devcomm.c | 
| 165 | 
  | 
  | 
        $(CC) $(CFLAGS) -DDEVPATH=\"$(DEVDIR)\" -c devcomm.c | 
| 166 | 
  | 
  | 
 | 
| 167 | 
greg | 
1.1 | 
sundev.o:       sundev.c | 
| 168 | 
greg | 
1.33 | 
        $(CC) $(CFLAGS) -DTTYPROG=\"$(DEVDIR)/sun.com\" -Dsun_init=dinit -c sundev.c | 
| 169 | 
greg | 
1.1 | 
 | 
| 170 | 
greg | 
1.39 | 
x10.o:  x10.c | 
| 171 | 
  | 
  | 
        $(CC) $(CFLAGS) -Dx_init=dinit -c x10.c | 
| 172 | 
greg | 
1.40 | 
 | 
| 173 | 
  | 
  | 
aed.o:  aed.c | 
| 174 | 
  | 
  | 
        $(CC) $(CFLAGS) -Daed_init=dinit -c aed.c | 
| 175 | 
greg | 
1.1 | 
 | 
| 176 | 
  | 
  | 
ambient.o:      ambient.c | 
| 177 | 
greg | 
1.26 | 
        $(CC) $(CFLAGS) -DAMBFLUSH=16 -c ambient.c | 
| 178 | 
greg | 
1.1 | 
 | 
| 179 | 
  | 
  | 
calexpr.o:      calexpr.c calcomp.h | 
| 180 | 
greg | 
1.26 | 
        $(CC) $(CFLAGS) -DVARIABLE -DFUNCTION -DINCHAN -DRCONST -c calexpr.c | 
| 181 | 
greg | 
1.1 | 
 | 
| 182 | 
  | 
  | 
caldefn.o:      caldefn.c calcomp.h | 
| 183 | 
greg | 
1.43 | 
        $(CC) $(CFLAGS) -DFUNCTION -DREDEFW -DRCONST -c caldefn.c | 
| 184 | 
greg | 
1.1 | 
 | 
| 185 | 
  | 
  | 
calfunc.o:      calfunc.c calcomp.h | 
| 186 | 
greg | 
1.26 | 
        $(CC) $(CFLAGS) -DVARIABLE -DBIGLIB -c calfunc.c | 
| 187 | 
greg | 
1.1 | 
 | 
| 188 | 
  | 
  | 
xf.o:   xf.c | 
| 189 | 
greg | 
1.26 | 
        $(CC) $(CFLAGS) -DINVXF -c xf.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 | 
  | 
  | 
 | 
| 197 | 
greg | 
1.1 | 
# | 
| 198 | 
  | 
  | 
# Include dependencies: | 
| 199 | 
  | 
  | 
# | 
| 200 | 
  | 
  | 
 | 
| 201 | 
  | 
  | 
caldefn.o calexpr.o calfunc.o:  calcomp.h | 
| 202 | 
  | 
  | 
 | 
| 203 | 
greg | 
1.31 | 
aed.o color.o colortab.o data.o devcomm.o spec_rgb.o \ | 
| 204 | 
  | 
  | 
devmain.o lookamb.o resolu.o rview.o sundev.o x10.o x11.o:      color.h | 
| 205 | 
greg | 
1.1 | 
 | 
| 206 | 
  | 
  | 
cone.o o_cone.o source.o:       cone.h | 
| 207 | 
  | 
  | 
 | 
| 208 | 
greg | 
1.37 | 
data.o m_brdf.o mx_data.o p_data.o t_data.o:    data.h | 
| 209 | 
greg | 
1.1 | 
 | 
| 210 | 
greg | 
1.19 | 
aed.o devcomm.o devmain.o devtable.o \ | 
| 211 | 
greg | 
1.27 | 
editline.o nwsdev.o sundev.o tty.o x10.o x11.o: driver.h | 
| 212 | 
greg | 
1.1 | 
 | 
| 213 | 
  | 
  | 
face.o o_face.o source.o:       face.h | 
| 214 | 
  | 
  | 
 | 
| 215 | 
  | 
  | 
fvect.o:        fvect.h | 
| 216 | 
  | 
  | 
 | 
| 217 | 
  | 
  | 
cone.o face.o objset.o otypes.o readobj.o readoct.o:    object.h | 
| 218 | 
  | 
  | 
 | 
| 219 | 
greg | 
1.28 | 
ambient.o objset.o octree.o raytrace.o readoct.o \ | 
| 220 | 
  | 
  | 
rpmain.o rtmain.o rtrace.o rvmain.o rv2.o rv3.o source.o:       octree.h | 
| 221 | 
greg | 
1.1 | 
 | 
| 222 | 
  | 
  | 
o_instance.o instance.o:        instance.h octree.h | 
| 223 | 
  | 
  | 
 | 
| 224 | 
greg | 
1.37 | 
ambient.o cone.o dielectric.o func.o initotypes.o m_brdf.o normal.o o_cone.o \ | 
| 225 | 
greg | 
1.36 | 
objset.o otypes.o text.o raytrace.o readobj.o readoct.o rtrace.o \ | 
| 226 | 
greg | 
1.1 | 
rv2.o source.o sphere.o:        otypes.h | 
| 227 | 
  | 
  | 
 | 
| 228 | 
  | 
  | 
ambient.o rpict.o rv3.o source.o:       random.h | 
| 229 | 
  | 
  | 
 | 
| 230 | 
greg | 
1.12 | 
ambient.o dielectric.o func.o glass.o m_clip.o \ | 
| 231 | 
greg | 
1.37 | 
m_brdf.o mx_data.o mx_func.o normal.o o_cone.o o_face.o o_instance.o \ | 
| 232 | 
greg | 
1.24 | 
p_data.o p_func.o text.o raytrace.o rpmain.o rtmain.o rvmain.o rpict.o \ | 
| 233 | 
greg | 
1.46 | 
rtrace.o rview.o rv2.o rv3.o source.o sphere.o \ | 
| 234 | 
greg | 
1.38 | 
t_data.o t_func.o:      ray.h standard.h mat4.h fvect.h object.h color.h | 
| 235 | 
greg | 
1.1 | 
 | 
| 236 | 
  | 
  | 
rv2.o rv3.o rview.o:    rpaint.h driver.h view.h | 
| 237 | 
  | 
  | 
 | 
| 238 | 
greg | 
1.7 | 
source.o:       source.h | 
| 239 | 
greg | 
1.1 | 
 | 
| 240 | 
greg | 
1.38 | 
cone.o data.o devcomm.o face.o image.o initotypes.o xf.o misc.o objset.o \ | 
| 241 | 
greg | 
1.46 | 
octree.o otypes.o readobj.o readoct.o:  standard.h mat4.h fvect.h | 
| 242 | 
greg | 
1.38 | 
 | 
| 243 | 
greg | 
1.44 | 
initotypes.o raytrace.o:        otspecial.h | 
| 244 | 
  | 
  | 
 | 
| 245 | 
greg | 
1.38 | 
mat4.o:         mat4.h fvect.h | 
| 246 | 
greg | 
1.1 | 
 | 
| 247 | 
  | 
  | 
sundev.o:       suntools.icon | 
| 248 | 
  | 
  | 
 | 
| 249 | 
greg | 
1.24 | 
image.o rpmain.o rtmain.o rvmain.o rpict.o:     view.h | 
| 250 | 
greg | 
1.1 | 
 | 
| 251 | 
  | 
  | 
x10.o xtwind.o: xtwind.h | 
| 252 | 
greg | 
1.15 | 
 | 
| 253 | 
  | 
  | 
x11.o x11twind.o: x11twind.h | 
| 254 | 
greg | 
1.42 | 
 | 
| 255 | 
  | 
  | 
x11.o:  x11icon.h |