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.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 |
|
|
INSTDIR = /usr/local/ray |
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.32 |
COMPAT = malloc.o |
33 |
greg |
1.1 |
|
34 |
|
|
# |
35 |
|
|
# Device drivers for rview (see also devtable.c): |
36 |
|
|
# |
37 |
greg |
1.13 |
DOBJS = devtable.o devcomm.o aed.o tty.o editline.o x10.o xtwind.o \ |
38 |
greg |
1.27 |
colortab.o nwsdev.o |
39 |
greg |
1.35 |
DSRC = devtable.c devcomm.c aed.c tty.c editline.c x10.c xtwind.c \ |
40 |
|
|
colortab.c nwsdev.c |
41 |
greg |
1.27 |
DLIBS = -lX -lcps |
42 |
greg |
1.33 |
DRIVERS = $(DEVDIR)/sun $(DEVDIR)/sun.com $(DEVDIR)/x11 |
43 |
greg |
1.1 |
|
44 |
|
|
# |
45 |
|
|
# Standard object files: |
46 |
|
|
# |
47 |
|
|
|
48 |
|
|
RTOBJS = rtmain.o rtrace.o $(ROBJS) |
49 |
greg |
1.35 |
RTSRC = rmain.c rtrace.c $(RSRC) |
50 |
greg |
1.1 |
|
51 |
|
|
RPOBJS = rpmain.o rpict.o image.o $(ROBJS) |
52 |
greg |
1.35 |
RPSRC = rmain.c rpict.c image.c $(RSRC) |
53 |
greg |
1.1 |
|
54 |
|
|
RVOBJS = rvmain.o rview.o rv2.o rv3.o image.o $(DOBJS) $(ROBJS) |
55 |
greg |
1.35 |
RVSRC = rmain.c rview.c rv2.c rv3.c image.c $(DSRC) $(RSRC) |
56 |
greg |
1.1 |
|
57 |
|
|
ROBJS = $(OCTOBJS) $(RAYOBJS) $(SURFOBJS) $(MATOBJS) \ |
58 |
|
|
$(MODOBJS) $(SUPPOBJS) $(MISCOBJS) $(COMPAT) |
59 |
greg |
1.35 |
RSRC = $(OCTSRC) $(RAYSRC) $(SURFSRC) $(MATSRC) \ |
60 |
|
|
$(MODSRC) $(SUPPSRC) $(MISCSRC) |
61 |
greg |
1.1 |
|
62 |
greg |
1.36 |
OCTOBJS = octree.o readobj.o readoct.o objset.o otypes.o initotypes.o |
63 |
|
|
OCTSRC = octree.c readobj.c readoct.c objset.c otypes.c initotypes.c |
64 |
greg |
1.1 |
|
65 |
|
|
RAYOBJS = raytrace.o ambient.o |
66 |
greg |
1.35 |
RAYSRC = raytrace.c ambient.c |
67 |
greg |
1.1 |
|
68 |
|
|
SURFOBJS = face.o sphere.o source.o o_face.o cone.o \ |
69 |
|
|
o_cone.o o_instance.o instance.o |
70 |
greg |
1.35 |
SURFSRC = face.c sphere.c source.c o_face.c cone.c \ |
71 |
|
|
o_cone.c o_instance.c instance.c |
72 |
greg |
1.1 |
|
73 |
greg |
1.34 |
MATOBJS = normal.o dielectric.o m_clip.o glass.o m_brdf.o |
74 |
greg |
1.35 |
MATSRC = normal.c dielectric.c m_clip.c glass.c m_brdf.c |
75 |
greg |
1.1 |
|
76 |
greg |
1.3 |
MODOBJS = p_func.o t_func.o p_data.o t_data.o text.o mx_func.o mx_data.o |
77 |
greg |
1.35 |
MODSRC = p_func.c t_func.c p_data.c t_data.c text.c mx_func.c mx_data.c |
78 |
greg |
1.1 |
|
79 |
|
|
SUPPOBJS = zeroes.o calexpr.o caldefn.o calfunc.o func.o noise3.o data.o |
80 |
greg |
1.35 |
SUPPSRC = zeroes.c calexpr.c caldefn.c calfunc.c func.c noise3.c data.c |
81 |
greg |
1.1 |
|
82 |
greg |
1.31 |
MISCOBJS = misc.o header.o mat4.o xf.o fvect.o savestr.o fgetline.o ealloc.o \ |
83 |
|
|
color.o resolu.o |
84 |
greg |
1.35 |
MISCSRC = misc.c header.c mat4.c xf.c fvect.c savestr.c fgetline.c ealloc.c \ |
85 |
|
|
color.c resolu.c |
86 |
greg |
1.1 |
|
87 |
|
|
# |
88 |
|
|
# What this makefile produces: |
89 |
|
|
# |
90 |
|
|
|
91 |
|
|
PROGS = $(DESTDIR)/rtrace $(DESTDIR)/rpict $(DESTDIR)/rview $(DESTDIR)/lookamb |
92 |
|
|
|
93 |
|
|
all: $(PROGS) $(DRIVERS) |
94 |
|
|
|
95 |
|
|
install: all |
96 |
|
|
$(INSTALL) $(PROGS) $(INSTDIR) |
97 |
|
|
|
98 |
|
|
clean: |
99 |
|
|
rm -f *.o core |
100 |
greg |
1.35 |
|
101 |
|
|
lint: $(RVSRC) |
102 |
|
|
$(LINT) $(LINTFLAGS) -DRVIEW $(RVSRC) $(LIBS) |
103 |
greg |
1.1 |
|
104 |
|
|
# |
105 |
|
|
# Links: |
106 |
|
|
# |
107 |
|
|
|
108 |
|
|
$(DESTDIR)/rtrace: $(RTOBJS) |
109 |
greg |
1.26 |
$(CC) $(CFLAGS) -o $(DESTDIR)/rtrace $(RTOBJS) $(LIBS) |
110 |
greg |
1.1 |
|
111 |
|
|
$(DESTDIR)/rpict: $(RPOBJS) |
112 |
greg |
1.26 |
$(CC) $(CFLAGS) -o $(DESTDIR)/rpict $(RPOBJS) $(LIBS) |
113 |
greg |
1.1 |
|
114 |
|
|
$(DESTDIR)/rview: $(RVOBJS) |
115 |
greg |
1.26 |
$(CC) $(CFLAGS) -o $(DESTDIR)/rview $(RVOBJS) $(DLIBS) $(LIBS) |
116 |
greg |
1.1 |
|
117 |
|
|
$(DESTDIR)/lookamb: lookamb.o |
118 |
greg |
1.26 |
$(CC) $(CFLAGS) -o $(DESTDIR)/lookamb lookamb.o |
119 |
greg |
1.1 |
|
120 |
greg |
1.33 |
$(DEVDIR)/sun: sundev.o devmain.o colortab.o editline.o |
121 |
|
|
$(CC) $(CFLAGS) -s -o $(DEVDIR)/sun devmain.o sundev.o colortab.o \ |
122 |
greg |
1.22 |
editline.o -lsuntool -lsunwindow -lpixrect $(LIBS) |
123 |
greg |
1.1 |
|
124 |
|
|
$(DEVDIR)/sun.com: suncom.o editline.o |
125 |
greg |
1.33 |
$(CC) $(CFLAGS) -s -o $(DEVDIR)/sun.com suncom.o editline.o |
126 |
greg |
1.1 |
|
127 |
greg |
1.33 |
$(DEVDIR)/x11: x11.o x11twind.o colortab.o devmain.o editline.o |
128 |
|
|
$(CC) $(CFLAGS) -s -o $(DEVDIR)/x11 x11.o x11twind.o devmain.o \ |
129 |
greg |
1.21 |
colortab.o editline.o -lX11 $(LIBS) |
130 |
greg |
1.15 |
|
131 |
greg |
1.1 |
# |
132 |
|
|
# Special compiles: |
133 |
|
|
# |
134 |
|
|
|
135 |
|
|
rtmain.o: rmain.c |
136 |
greg |
1.26 |
$(CC) $(CFLAGS) -DRTRACE -DNICE=4 -DDEFPATH=\":$(LIBDIR)\" -c rmain.c |
137 |
greg |
1.1 |
mv rmain.o rtmain.o |
138 |
|
|
|
139 |
|
|
rpmain.o: rmain.c |
140 |
greg |
1.26 |
$(CC) $(CFLAGS) -DRPICT -DNICE=6 -DDEFPATH=\":$(LIBDIR)\" -c rmain.c |
141 |
greg |
1.1 |
mv rmain.o rpmain.o |
142 |
|
|
|
143 |
|
|
rvmain.o: rmain.c |
144 |
greg |
1.26 |
$(CC) $(CFLAGS) -DRVIEW -DDEFPATH=\":$(LIBDIR)\" -c rmain.c |
145 |
greg |
1.1 |
mv rmain.o rvmain.o |
146 |
|
|
|
147 |
|
|
# |
148 |
greg |
1.31 |
# Uncomment the following and add spec_rgb.o to MISCOBJS to model dispersion: |
149 |
greg |
1.1 |
# |
150 |
|
|
#dielectric.o: dielectric.c source.h |
151 |
greg |
1.26 |
# $(CC) $(CFLAGS) -DDISPERSE -c dielectric.c |
152 |
greg |
1.1 |
# |
153 |
|
|
# end of dispersion compiles. |
154 |
|
|
|
155 |
greg |
1.33 |
devcomm.o: devcomm.c |
156 |
|
|
$(CC) $(CFLAGS) -DDEVPATH=\"$(DEVDIR)\" -c devcomm.c |
157 |
|
|
|
158 |
greg |
1.1 |
sundev.o: sundev.c |
159 |
greg |
1.33 |
$(CC) $(CFLAGS) -DTTYPROG=\"$(DEVDIR)/sun.com\" -Dsun_init=dinit -c sundev.c |
160 |
greg |
1.1 |
|
161 |
greg |
1.21 |
x11.o: x11.c |
162 |
greg |
1.26 |
$(CC) $(CFLAGS) -Dx11_init=dinit -c x11.c |
163 |
greg |
1.1 |
|
164 |
|
|
ambient.o: ambient.c |
165 |
greg |
1.26 |
$(CC) $(CFLAGS) -DAMBFLUSH=16 -c ambient.c |
166 |
greg |
1.1 |
|
167 |
|
|
calexpr.o: calexpr.c calcomp.h |
168 |
greg |
1.26 |
$(CC) $(CFLAGS) -DVARIABLE -DFUNCTION -DINCHAN -DRCONST -c calexpr.c |
169 |
greg |
1.1 |
|
170 |
|
|
caldefn.o: caldefn.c calcomp.h |
171 |
greg |
1.26 |
$(CC) $(CFLAGS) -DFUNCTION -DREDEFW -c caldefn.c |
172 |
greg |
1.1 |
|
173 |
|
|
calfunc.o: calfunc.c calcomp.h |
174 |
greg |
1.26 |
$(CC) $(CFLAGS) -DVARIABLE -DBIGLIB -c calfunc.c |
175 |
greg |
1.1 |
|
176 |
|
|
xf.o: xf.c |
177 |
greg |
1.26 |
$(CC) $(CFLAGS) -DINVXF -c xf.c |
178 |
greg |
1.1 |
|
179 |
greg |
1.27 |
nwsdev.o: nwsdev.c nwsdev.h newsconstants.h |
180 |
|
|
$(CC) $(CFLAGS) -c nwsdev.c |
181 |
|
|
|
182 |
|
|
nwsdev.h: nwsdev.cps newsconstants.h |
183 |
|
|
cps nwsdev.cps |
184 |
|
|
|
185 |
greg |
1.1 |
# |
186 |
|
|
# Include dependencies: |
187 |
|
|
# |
188 |
|
|
|
189 |
|
|
caldefn.o calexpr.o calfunc.o: calcomp.h |
190 |
|
|
|
191 |
greg |
1.31 |
aed.o color.o colortab.o data.o devcomm.o spec_rgb.o \ |
192 |
|
|
devmain.o lookamb.o resolu.o rview.o sundev.o x10.o x11.o: color.h |
193 |
greg |
1.1 |
|
194 |
|
|
cone.o o_cone.o source.o: cone.h |
195 |
|
|
|
196 |
greg |
1.37 |
data.o m_brdf.o mx_data.o p_data.o t_data.o: data.h |
197 |
greg |
1.1 |
|
198 |
greg |
1.19 |
aed.o devcomm.o devmain.o devtable.o \ |
199 |
greg |
1.27 |
editline.o nwsdev.o sundev.o tty.o x10.o x11.o: driver.h |
200 |
greg |
1.1 |
|
201 |
|
|
face.o o_face.o source.o: face.h |
202 |
|
|
|
203 |
|
|
fvect.o: fvect.h |
204 |
|
|
|
205 |
|
|
cone.o face.o objset.o otypes.o readobj.o readoct.o: object.h |
206 |
|
|
|
207 |
greg |
1.28 |
ambient.o objset.o octree.o raytrace.o readoct.o \ |
208 |
|
|
rpmain.o rtmain.o rtrace.o rvmain.o rv2.o rv3.o source.o: octree.h |
209 |
greg |
1.1 |
|
210 |
|
|
o_instance.o instance.o: instance.h octree.h |
211 |
|
|
|
212 |
greg |
1.37 |
ambient.o cone.o dielectric.o func.o initotypes.o m_brdf.o normal.o o_cone.o \ |
213 |
greg |
1.36 |
objset.o otypes.o text.o raytrace.o readobj.o readoct.o rtrace.o \ |
214 |
greg |
1.1 |
rv2.o source.o sphere.o: otypes.h |
215 |
|
|
|
216 |
|
|
ambient.o rpict.o rv3.o source.o: random.h |
217 |
|
|
|
218 |
greg |
1.12 |
ambient.o dielectric.o func.o glass.o m_clip.o \ |
219 |
greg |
1.37 |
m_brdf.o mx_data.o mx_func.o normal.o o_cone.o o_face.o o_instance.o \ |
220 |
greg |
1.24 |
p_data.o p_func.o text.o raytrace.o rpmain.o rtmain.o rvmain.o rpict.o \ |
221 |
greg |
1.1 |
rtrace.o rv2.o rv3.o source.o \ |
222 |
greg |
1.3 |
sphere.o t_data.o t_func.o: ray.h standard.h fvect.h object.h color.h |
223 |
greg |
1.1 |
|
224 |
|
|
rv2.o rv3.o rview.o: rpaint.h driver.h view.h |
225 |
|
|
|
226 |
greg |
1.7 |
source.o: source.h |
227 |
greg |
1.1 |
|
228 |
greg |
1.36 |
cone.o data.o devcomm.o face.o image.o initotypes.o misc.o objset.o \ |
229 |
|
|
octree.o otypes.o readobj.o readoct.o rview.o: standard.h fvect.h |
230 |
greg |
1.1 |
|
231 |
|
|
sundev.o: suntools.icon |
232 |
|
|
|
233 |
greg |
1.24 |
image.o rpmain.o rtmain.o rvmain.o rpict.o: view.h |
234 |
greg |
1.1 |
|
235 |
|
|
x10.o xtwind.o: xtwind.h |
236 |
greg |
1.15 |
|
237 |
|
|
x11.o x11twind.o: x11twind.h |