| 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.17 |
MACH = -DSTRUCTASSIGN -DBSD -DIEEE -f68881 /usr/lib/f68881.il |
| 9 |
greg |
1.11 |
CFLAGS = $(MACH) $(OPT) |
| 10 |
greg |
1.26 |
CC = cc |
| 11 |
greg |
1.1 |
|
| 12 |
|
|
# |
| 13 |
|
|
# The following are user-definable: |
| 14 |
|
|
# |
| 15 |
|
|
DESTDIR = . |
| 16 |
|
|
INSTDIR = /usr/local/ray |
| 17 |
greg |
1.5 |
INSTALL = cp |
| 18 |
greg |
1.1 |
|
| 19 |
|
|
# |
| 20 |
|
|
# The following paths must exist and be relative to root: |
| 21 |
|
|
# |
| 22 |
greg |
1.8 |
DEVDIR = $(INSTDIR) |
| 23 |
greg |
1.1 |
LIBDIR = /usr/local/lib/ray |
| 24 |
|
|
|
| 25 |
|
|
# |
| 26 |
greg |
1.2 |
# Library routines: |
| 27 |
greg |
1.1 |
# |
| 28 |
greg |
1.2 |
LIBS = -lm |
| 29 |
greg |
1.32 |
COMPAT = malloc.o |
| 30 |
greg |
1.1 |
|
| 31 |
|
|
# |
| 32 |
|
|
# Device drivers for rview (see also devtable.c): |
| 33 |
|
|
# |
| 34 |
greg |
1.13 |
DOBJS = devtable.o devcomm.o aed.o tty.o editline.o x10.o xtwind.o \ |
| 35 |
greg |
1.27 |
colortab.o nwsdev.o |
| 36 |
|
|
DLIBS = -lX -lcps |
| 37 |
greg |
1.21 |
DRIVERS = $(DEVDIR)/sundev $(DEVDIR)/sun.com $(DEVDIR)/x11dev |
| 38 |
greg |
1.1 |
|
| 39 |
|
|
# |
| 40 |
|
|
# Standard object files: |
| 41 |
|
|
# |
| 42 |
|
|
|
| 43 |
|
|
RTOBJS = rtmain.o rtrace.o $(ROBJS) |
| 44 |
|
|
|
| 45 |
|
|
RPOBJS = rpmain.o rpict.o image.o $(ROBJS) |
| 46 |
|
|
|
| 47 |
|
|
RVOBJS = rvmain.o rview.o rv2.o rv3.o image.o $(DOBJS) $(ROBJS) |
| 48 |
|
|
|
| 49 |
|
|
ROBJS = $(OCTOBJS) $(RAYOBJS) $(SURFOBJS) $(MATOBJS) \ |
| 50 |
|
|
$(MODOBJS) $(SUPPOBJS) $(MISCOBJS) $(COMPAT) |
| 51 |
|
|
|
| 52 |
|
|
OCTOBJS = octree.o readobj.o readoct.o objset.o otypes.o |
| 53 |
|
|
|
| 54 |
|
|
RAYOBJS = raytrace.o ambient.o |
| 55 |
|
|
|
| 56 |
|
|
SURFOBJS = face.o sphere.o source.o o_face.o cone.o \ |
| 57 |
|
|
o_cone.o o_instance.o instance.o |
| 58 |
|
|
|
| 59 |
|
|
MATOBJS = normal.o dielectric.o m_clip.o glass.o |
| 60 |
|
|
|
| 61 |
greg |
1.3 |
MODOBJS = p_func.o t_func.o p_data.o t_data.o text.o mx_func.o mx_data.o |
| 62 |
greg |
1.1 |
|
| 63 |
|
|
SUPPOBJS = zeroes.o calexpr.o caldefn.o calfunc.o func.o noise3.o data.o |
| 64 |
|
|
|
| 65 |
greg |
1.31 |
MISCOBJS = misc.o header.o mat4.o xf.o fvect.o savestr.o fgetline.o ealloc.o \ |
| 66 |
|
|
color.o resolu.o |
| 67 |
greg |
1.1 |
|
| 68 |
|
|
# |
| 69 |
|
|
# What this makefile produces: |
| 70 |
|
|
# |
| 71 |
|
|
|
| 72 |
|
|
PROGS = $(DESTDIR)/rtrace $(DESTDIR)/rpict $(DESTDIR)/rview $(DESTDIR)/lookamb |
| 73 |
|
|
|
| 74 |
|
|
all: $(PROGS) $(DRIVERS) |
| 75 |
|
|
|
| 76 |
|
|
install: all |
| 77 |
|
|
$(INSTALL) $(PROGS) $(INSTDIR) |
| 78 |
|
|
|
| 79 |
|
|
clean: |
| 80 |
|
|
rm -f *.o core |
| 81 |
|
|
|
| 82 |
|
|
# |
| 83 |
|
|
# Links: |
| 84 |
|
|
# |
| 85 |
|
|
|
| 86 |
|
|
$(DESTDIR)/rtrace: $(RTOBJS) |
| 87 |
greg |
1.26 |
$(CC) $(CFLAGS) -o $(DESTDIR)/rtrace $(RTOBJS) $(LIBS) |
| 88 |
greg |
1.1 |
|
| 89 |
|
|
$(DESTDIR)/rpict: $(RPOBJS) |
| 90 |
greg |
1.26 |
$(CC) $(CFLAGS) -o $(DESTDIR)/rpict $(RPOBJS) $(LIBS) |
| 91 |
greg |
1.1 |
|
| 92 |
|
|
$(DESTDIR)/rview: $(RVOBJS) |
| 93 |
greg |
1.26 |
$(CC) $(CFLAGS) -o $(DESTDIR)/rview $(RVOBJS) $(DLIBS) $(LIBS) |
| 94 |
greg |
1.1 |
|
| 95 |
|
|
$(DESTDIR)/lookamb: lookamb.o |
| 96 |
greg |
1.26 |
$(CC) $(CFLAGS) -o $(DESTDIR)/lookamb lookamb.o |
| 97 |
greg |
1.1 |
|
| 98 |
greg |
1.22 |
$(DEVDIR)/sundev: sundev.o devmain.o colortab.o editline.o |
| 99 |
greg |
1.26 |
$(CC) $(CFLAGS) -o $(DEVDIR)/sundev devmain.o sundev.o colortab.o \ |
| 100 |
greg |
1.22 |
editline.o -lsuntool -lsunwindow -lpixrect $(LIBS) |
| 101 |
greg |
1.1 |
|
| 102 |
|
|
$(DEVDIR)/sun.com: suncom.o editline.o |
| 103 |
greg |
1.26 |
$(CC) $(CFLAGS) -o $(DEVDIR)/sun.com suncom.o editline.o |
| 104 |
greg |
1.1 |
|
| 105 |
greg |
1.21 |
$(DEVDIR)/x11dev: x11.o x11twind.o colortab.o devmain.o editline.o |
| 106 |
greg |
1.26 |
$(CC) $(CFLAGS) -o $(DEVDIR)/x11dev x11.o x11twind.o devmain.o \ |
| 107 |
greg |
1.21 |
colortab.o editline.o -lX11 $(LIBS) |
| 108 |
greg |
1.15 |
|
| 109 |
greg |
1.1 |
# |
| 110 |
|
|
# Special compiles: |
| 111 |
|
|
# |
| 112 |
|
|
|
| 113 |
|
|
rtmain.o: rmain.c |
| 114 |
greg |
1.26 |
$(CC) $(CFLAGS) -DRTRACE -DNICE=4 -DDEFPATH=\":$(LIBDIR)\" -c rmain.c |
| 115 |
greg |
1.1 |
mv rmain.o rtmain.o |
| 116 |
|
|
|
| 117 |
|
|
rpmain.o: rmain.c |
| 118 |
greg |
1.26 |
$(CC) $(CFLAGS) -DRPICT -DNICE=6 -DDEFPATH=\":$(LIBDIR)\" -c rmain.c |
| 119 |
greg |
1.1 |
mv rmain.o rpmain.o |
| 120 |
|
|
|
| 121 |
|
|
rvmain.o: rmain.c |
| 122 |
greg |
1.26 |
$(CC) $(CFLAGS) -DRVIEW -DDEFPATH=\":$(LIBDIR)\" -c rmain.c |
| 123 |
greg |
1.1 |
mv rmain.o rvmain.o |
| 124 |
|
|
|
| 125 |
|
|
# |
| 126 |
greg |
1.31 |
# Uncomment the following and add spec_rgb.o to MISCOBJS to model dispersion: |
| 127 |
greg |
1.1 |
# |
| 128 |
|
|
#dielectric.o: dielectric.c source.h |
| 129 |
greg |
1.26 |
# $(CC) $(CFLAGS) -DDISPERSE -c dielectric.c |
| 130 |
greg |
1.1 |
# |
| 131 |
|
|
# end of dispersion compiles. |
| 132 |
|
|
|
| 133 |
|
|
sundev.o: sundev.c |
| 134 |
greg |
1.26 |
$(CC) $(CFLAGS) -Dsun_init=dinit -c sundev.c |
| 135 |
greg |
1.1 |
|
| 136 |
greg |
1.21 |
x11.o: x11.c |
| 137 |
greg |
1.26 |
$(CC) $(CFLAGS) -Dx11_init=dinit -c x11.c |
| 138 |
greg |
1.1 |
|
| 139 |
|
|
ambient.o: ambient.c |
| 140 |
greg |
1.26 |
$(CC) $(CFLAGS) -DAMBFLUSH=16 -c ambient.c |
| 141 |
greg |
1.1 |
|
| 142 |
|
|
calexpr.o: calexpr.c calcomp.h |
| 143 |
greg |
1.26 |
$(CC) $(CFLAGS) -DVARIABLE -DFUNCTION -DINCHAN -DRCONST -c calexpr.c |
| 144 |
greg |
1.1 |
|
| 145 |
|
|
caldefn.o: caldefn.c calcomp.h |
| 146 |
greg |
1.26 |
$(CC) $(CFLAGS) -DFUNCTION -DREDEFW -c caldefn.c |
| 147 |
greg |
1.1 |
|
| 148 |
|
|
calfunc.o: calfunc.c calcomp.h |
| 149 |
greg |
1.26 |
$(CC) $(CFLAGS) -DVARIABLE -DBIGLIB -c calfunc.c |
| 150 |
greg |
1.1 |
|
| 151 |
|
|
xf.o: xf.c |
| 152 |
greg |
1.26 |
$(CC) $(CFLAGS) -DINVXF -c xf.c |
| 153 |
greg |
1.1 |
|
| 154 |
greg |
1.27 |
nwsdev.o: nwsdev.c nwsdev.h newsconstants.h |
| 155 |
|
|
$(CC) $(CFLAGS) -c nwsdev.c |
| 156 |
|
|
|
| 157 |
|
|
nwsdev.h: nwsdev.cps newsconstants.h |
| 158 |
|
|
cps nwsdev.cps |
| 159 |
|
|
|
| 160 |
greg |
1.1 |
# |
| 161 |
|
|
# Include dependencies: |
| 162 |
|
|
# |
| 163 |
|
|
|
| 164 |
|
|
caldefn.o calexpr.o calfunc.o: calcomp.h |
| 165 |
|
|
|
| 166 |
greg |
1.31 |
aed.o color.o colortab.o data.o devcomm.o spec_rgb.o \ |
| 167 |
|
|
devmain.o lookamb.o resolu.o rview.o sundev.o x10.o x11.o: color.h |
| 168 |
greg |
1.1 |
|
| 169 |
|
|
cone.o o_cone.o source.o: cone.h |
| 170 |
|
|
|
| 171 |
greg |
1.3 |
data.o mx_data.o p_data.o t_data.o: data.h |
| 172 |
greg |
1.1 |
|
| 173 |
greg |
1.19 |
aed.o devcomm.o devmain.o devtable.o \ |
| 174 |
greg |
1.27 |
editline.o nwsdev.o sundev.o tty.o x10.o x11.o: driver.h |
| 175 |
greg |
1.1 |
|
| 176 |
|
|
face.o o_face.o source.o: face.h |
| 177 |
|
|
|
| 178 |
|
|
fvect.o: fvect.h |
| 179 |
|
|
|
| 180 |
|
|
cone.o face.o objset.o otypes.o readobj.o readoct.o: object.h |
| 181 |
|
|
|
| 182 |
greg |
1.28 |
ambient.o objset.o octree.o raytrace.o readoct.o \ |
| 183 |
|
|
rpmain.o rtmain.o rtrace.o rvmain.o rv2.o rv3.o source.o: octree.h |
| 184 |
greg |
1.1 |
|
| 185 |
|
|
o_instance.o instance.o: instance.h octree.h |
| 186 |
|
|
|
| 187 |
greg |
1.29 |
ambient.o cone.o dielectric.o func.o normal.o o_cone.o objset.o \ |
| 188 |
|
|
otypes.o text.o raytrace.o readobj.o readoct.o rtrace.o \ |
| 189 |
greg |
1.1 |
rv2.o source.o sphere.o: otypes.h |
| 190 |
|
|
|
| 191 |
|
|
ambient.o rpict.o rv3.o source.o: random.h |
| 192 |
|
|
|
| 193 |
greg |
1.12 |
ambient.o dielectric.o func.o glass.o m_clip.o \ |
| 194 |
greg |
1.1 |
mx_data.o mx_func.o normal.o o_cone.o o_face.o o_instance.o \ |
| 195 |
greg |
1.24 |
p_data.o p_func.o text.o raytrace.o rpmain.o rtmain.o rvmain.o rpict.o \ |
| 196 |
greg |
1.1 |
rtrace.o rv2.o rv3.o source.o \ |
| 197 |
greg |
1.3 |
sphere.o t_data.o t_func.o: ray.h standard.h fvect.h object.h color.h |
| 198 |
greg |
1.1 |
|
| 199 |
|
|
rv2.o rv3.o rview.o: rpaint.h driver.h view.h |
| 200 |
|
|
|
| 201 |
greg |
1.7 |
source.o: source.h |
| 202 |
greg |
1.1 |
|
| 203 |
greg |
1.17 |
cone.o data.o devcomm.o face.o image.o misc.o objset.o octree.o otypes.o \ |
| 204 |
greg |
1.1 |
readobj.o readoct.o rview.o: standard.h fvect.h |
| 205 |
|
|
|
| 206 |
|
|
sundev.o: suntools.icon |
| 207 |
|
|
|
| 208 |
greg |
1.24 |
image.o rpmain.o rtmain.o rvmain.o rpict.o: view.h |
| 209 |
greg |
1.1 |
|
| 210 |
|
|
x10.o xtwind.o: xtwind.h |
| 211 |
greg |
1.15 |
|
| 212 |
|
|
x11.o x11twind.o: x11twind.h |