1 |
+ |
# |
2 |
|
# SCCSid "$SunId$ LBL" |
3 |
< |
|
3 |
> |
# Compiles for ray tracing programs. |
4 |
|
# |
4 |
– |
# Compiles for ray tracing programs. |
5 |
– |
# |
5 |
|
|
6 |
< |
OPT = -O -pipe |
7 |
< |
MACH = -DSTRUCTASSIGN -DBSD -DIEEE -f68881 /usr/lib/f68881.il |
8 |
< |
CFLAGS = $(MACH) $(OPT) |
6 |
> |
OPT = -O |
7 |
> |
MACH = -DBSD |
8 |
> |
CFLAGS = $(MACH) $(OPT) -I../common -L../lib |
9 |
> |
SPECIAL = aed |
10 |
|
CC = cc |
11 |
+ |
MLIB = -lm |
12 |
+ |
LINT = lint |
13 |
+ |
LINTFLAGS = -DBSD -DVARIABLE -DFUNCTION \ |
14 |
+ |
-DINCHAN -DRCONST -DREDEFW |
15 |
|
|
16 |
|
# |
17 |
|
# The following are user-definable: |
18 |
|
# |
19 |
|
DESTDIR = . |
20 |
< |
INSTDIR = /usr/local/ray |
20 |
> |
INSTDIR = /usr/local/bin |
21 |
|
INSTALL = cp |
22 |
|
|
23 |
|
# |
29 |
|
# |
30 |
|
# Library routines: |
31 |
|
# |
32 |
< |
LIBS = -lm |
29 |
< |
COMPAT = malloc.o |
32 |
> |
LIBS = -lrt $(MLIB) |
33 |
|
|
34 |
|
# |
35 |
|
# Device drivers for rview (see also devtable.c): |
36 |
|
# |
37 |
< |
DOBJS = devtable.o devcomm.o aed.o tty.o editline.o x10.o xtwind.o \ |
38 |
< |
colortab.o nwsdev.o |
39 |
< |
DLIBS = -lX -lcps |
40 |
< |
DRIVERS = $(DEVDIR)/sun $(DEVDIR)/sun.com $(DEVDIR)/x11 |
37 |
> |
DOBJS = devtable.o devcomm.o editline.o x11.o x11twind.o \ |
38 |
> |
colortab.o |
39 |
> |
DSRC = devtable.c devcomm.c editline.c x11.c x11twind.c \ |
40 |
> |
colortab.c |
41 |
> |
DLIBS = -lX11 |
42 |
|
|
43 |
|
# |
44 |
|
# Standard object files: |
45 |
|
# |
46 |
|
|
47 |
< |
RTOBJS = rtmain.o rtrace.o $(ROBJS) |
47 |
> |
RTOBJS = rtmain.o rtrace.o duphead.o persist.o preload.o $(ROBJS) Version.o |
48 |
> |
RTSRC = rmain.c rtrace.c $(RSRC) Version.c |
49 |
|
|
50 |
< |
RPOBJS = rpmain.o rpict.o image.o $(ROBJS) |
50 |
> |
RPOBJS = rpmain.o rpict.o duphead.o persist.o preload.o $(ROBJS) Version.o |
51 |
> |
RPSRC = rmain.c rpict.c $(RSRC) Version.c |
52 |
|
|
53 |
< |
RVOBJS = rvmain.o rview.o rv2.o rv3.o image.o $(DOBJS) $(ROBJS) |
53 |
> |
RVOBJS = rvmain.o rview.o rv2.o rv3.o freeobjmem.o $(DOBJS) $(ROBJS) Version.o |
54 |
> |
RVSRC = rmain.c rview.c rv2.c rv3.c freeobjmem.c $(DSRC) $(RSRC) Version.c |
55 |
|
|
56 |
< |
ROBJS = $(OCTOBJS) $(RAYOBJS) $(SURFOBJS) $(MATOBJS) \ |
57 |
< |
$(MODOBJS) $(SUPPOBJS) $(MISCOBJS) $(COMPAT) |
56 |
> |
ROBJS = $(RAYOBJS) $(SURFOBJS) $(MATOBJS) \ |
57 |
> |
$(MODOBJS) $(SUPPOBJS) |
58 |
> |
RSRC = $(RAYSRC) $(SURFSRC) $(MATSRC) \ |
59 |
> |
$(MODSRC) $(SUPPSRC) |
60 |
|
|
61 |
< |
OCTOBJS = octree.o readobj.o readoct.o objset.o otypes.o |
61 |
> |
RAYOBJS = initotypes.o raytrace.o ambient.o ambcomp.o ambio.o |
62 |
> |
RAYSRC = initotypes.c raytrace.c ambient.c ambcomp.c ambio.c |
63 |
|
|
64 |
< |
RAYOBJS = raytrace.o ambient.o |
64 |
> |
SURFOBJS = source.o sphere.o srcsupp.o srcsamp.o virtuals.o o_face.o \ |
65 |
> |
o_cone.o o_instance.o |
66 |
> |
SURFSRC = sphere.c source.c srcsupp.c virtuals.c o_face.c \ |
67 |
> |
srcsamp.c o_cone.c o_instance.c |
68 |
|
|
69 |
< |
SURFOBJS = face.o sphere.o source.o o_face.o cone.o \ |
70 |
< |
o_cone.o o_instance.o instance.o |
69 |
> |
MATOBJS = aniso.o normal.o dielectric.o m_clip.o glass.o m_brdf.o \ |
70 |
> |
m_mirror.o m_direct.o fprism.o |
71 |
> |
MATSRC = aniso.c normal.c dielectric.c m_clip.c glass.c m_brdf.c \ |
72 |
> |
m_mirror.c m_direct.c fprism.c |
73 |
|
|
59 |
– |
MATOBJS = normal.o dielectric.o m_clip.o glass.o m_brdf.o |
60 |
– |
|
74 |
|
MODOBJS = p_func.o t_func.o p_data.o t_data.o text.o mx_func.o mx_data.o |
75 |
+ |
MODSRC = p_func.c t_func.c p_data.c t_data.c text.c mx_func.c mx_data.c |
76 |
|
|
77 |
< |
SUPPOBJS = zeroes.o calexpr.o caldefn.o calfunc.o func.o noise3.o data.o |
77 |
> |
SUPPOBJS = zeroes.o calexpr.o caldefn.o func.o noise3.o malloc.o data.o \ |
78 |
> |
readfargs.o |
79 |
> |
SUPPSRC = zeroes.c calexpr.c caldefn.c func.c noise3.c data.c malloc.c \ |
80 |
> |
readfargs.c |
81 |
|
|
82 |
< |
MISCOBJS = misc.o header.o mat4.o xf.o fvect.o savestr.o fgetline.o ealloc.o \ |
66 |
< |
color.o resolu.o |
82 |
> |
HEADERS = ambient.h ray.h data.h otspecial.h source.h |
83 |
|
|
84 |
|
# |
85 |
|
# What this makefile produces: |
87 |
|
|
88 |
|
PROGS = $(DESTDIR)/rtrace $(DESTDIR)/rpict $(DESTDIR)/rview $(DESTDIR)/lookamb |
89 |
|
|
90 |
< |
all: $(PROGS) $(DRIVERS) |
90 |
> |
all: $(PROGS) $(SPECIAL) |
91 |
|
|
92 |
< |
install: all |
92 |
> |
install: $(PROGS) $(SPECIAL) rayinit.cal |
93 |
|
$(INSTALL) $(PROGS) $(INSTDIR) |
94 |
+ |
rm -f $(LIBDIR)/rayinit.cal |
95 |
+ |
cp rayinit.cal $(LIBDIR) |
96 |
|
|
97 |
+ |
sun: $(DEVDIR)/sun $(DEVDIR)/sun.com |
98 |
+ |
|
99 |
+ |
x10: $(DEVDIR)/x10 |
100 |
+ |
|
101 |
+ |
aed: $(DEVDIR)/aed |
102 |
+ |
|
103 |
+ |
sgi: $(DEVDIR)/news |
104 |
+ |
|
105 |
+ |
tiff: |
106 |
+ |
|
107 |
|
clean: |
108 |
< |
rm -f *.o core |
108 |
> |
set nonomatch; rm -f $(PROGS) *.o core |
109 |
|
|
110 |
+ |
lint: $(RVSRC) |
111 |
+ |
$(LINT) $(LINTFLAGS) -DRVIEW $(RVSRC) $(LIBS) |
112 |
+ |
|
113 |
|
# |
114 |
|
# Links: |
115 |
|
# |
123 |
|
$(DESTDIR)/rview: $(RVOBJS) |
124 |
|
$(CC) $(CFLAGS) -o $(DESTDIR)/rview $(RVOBJS) $(DLIBS) $(LIBS) |
125 |
|
|
126 |
< |
$(DESTDIR)/lookamb: lookamb.o |
127 |
< |
$(CC) $(CFLAGS) -o $(DESTDIR)/lookamb lookamb.o |
126 |
> |
$(DESTDIR)/lookamb: lookamb.o ambio.o |
127 |
> |
$(CC) $(CFLAGS) -o $(DESTDIR)/lookamb lookamb.o ambio.o -lrt |
128 |
|
|
129 |
|
$(DEVDIR)/sun: sundev.o devmain.o colortab.o editline.o |
130 |
|
$(CC) $(CFLAGS) -s -o $(DEVDIR)/sun devmain.o sundev.o colortab.o \ |
133 |
|
$(DEVDIR)/sun.com: suncom.o editline.o |
134 |
|
$(CC) $(CFLAGS) -s -o $(DEVDIR)/sun.com suncom.o editline.o |
135 |
|
|
136 |
< |
$(DEVDIR)/x11: x11.o x11twind.o colortab.o devmain.o editline.o |
137 |
< |
$(CC) $(CFLAGS) -s -o $(DEVDIR)/x11 x11.o x11twind.o devmain.o \ |
138 |
< |
colortab.o editline.o -lX11 $(LIBS) |
136 |
> |
$(DEVDIR)/x10: x10.o xtwind.o colortab.o devmain.o editline.o |
137 |
> |
$(CC) $(CFLAGS) -s -o $(DEVDIR)/x10 x10.o xtwind.o devmain.o \ |
138 |
> |
colortab.o editline.o -lX $(LIBS) |
139 |
|
|
140 |
+ |
$(DEVDIR)/aed: aed.o colortab.o tty.o devmain.o editline.o |
141 |
+ |
$(CC) $(CFLAGS) -s -o $(DEVDIR)/aed aed.o colortab.o \ |
142 |
+ |
devmain.o tty.o editline.o $(LIBS) |
143 |
+ |
|
144 |
+ |
$(DEVDIR)/news: nwsdev.o devmain.o editline.o |
145 |
+ |
$(CC) $(CFLAGS) -s -o $(DEVDIR)/news nwsdev.o devmain.o editline.o \ |
146 |
+ |
-lcps $(LIBS) |
147 |
+ |
|
148 |
|
# |
149 |
|
# Special compiles: |
150 |
|
# |
151 |
|
|
152 |
|
rtmain.o: rmain.c |
153 |
< |
$(CC) $(CFLAGS) -DRTRACE -DNICE=4 -DDEFPATH=\":$(LIBDIR)\" -c rmain.c |
153 |
> |
$(CC) $(CFLAGS) -DRTRACE -DNICE=4 -c rmain.c |
154 |
|
mv rmain.o rtmain.o |
155 |
|
|
156 |
|
rpmain.o: rmain.c |
157 |
< |
$(CC) $(CFLAGS) -DRPICT -DNICE=6 -DDEFPATH=\":$(LIBDIR)\" -c rmain.c |
157 |
> |
$(CC) $(CFLAGS) -DRPICT -DNICE=6 -c rmain.c |
158 |
|
mv rmain.o rpmain.o |
159 |
|
|
160 |
|
rvmain.o: rmain.c |
161 |
< |
$(CC) $(CFLAGS) -DRVIEW -DDEFPATH=\":$(LIBDIR)\" -c rmain.c |
161 |
> |
$(CC) $(CFLAGS) -DRVIEW -c rmain.c |
162 |
|
mv rmain.o rvmain.o |
163 |
|
|
164 |
+ |
readfargs.o: readfargs.c ../common/object.h |
165 |
+ |
$(CC) $(CFLAGS) -DMEMHOG -c readfargs.c |
166 |
+ |
|
167 |
+ |
malloc.o: malloc.c |
168 |
+ |
$(CC) $(CFLAGS) -DMCOMP -c malloc.c |
169 |
+ |
|
170 |
|
# |
171 |
< |
# Uncomment the following and add spec_rgb.o to MISCOBJS to model dispersion: |
171 |
> |
# Uncomment the following to model dispersion: |
172 |
|
# |
173 |
< |
#dielectric.o: dielectric.c source.h |
174 |
< |
# $(CC) $(CFLAGS) -DDISPERSE -c dielectric.c |
175 |
< |
# |
173 |
> |
dielectric.o: dielectric.c source.h |
174 |
> |
$(CC) $(CFLAGS) -DDISPERSE -c dielectric.c |
175 |
> |
|
176 |
|
# end of dispersion compiles. |
177 |
|
|
178 |
|
devcomm.o: devcomm.c |
181 |
|
sundev.o: sundev.c |
182 |
|
$(CC) $(CFLAGS) -DTTYPROG=\"$(DEVDIR)/sun.com\" -Dsun_init=dinit -c sundev.c |
183 |
|
|
184 |
< |
x11.o: x11.c |
185 |
< |
$(CC) $(CFLAGS) -Dx11_init=dinit -c x11.c |
184 |
> |
x10.o: x10.c |
185 |
> |
$(CC) $(CFLAGS) -Dx_init=dinit -c x10.c |
186 |
|
|
187 |
< |
ambient.o: ambient.c |
188 |
< |
$(CC) $(CFLAGS) -DAMBFLUSH=16 -c ambient.c |
187 |
> |
aed.o: aed.c |
188 |
> |
$(CC) $(CFLAGS) -Daed_init=dinit -c aed.c |
189 |
|
|
190 |
< |
calexpr.o: calexpr.c calcomp.h |
190 |
> |
calexpr.o: calexpr.c ../common/calcomp.h |
191 |
|
$(CC) $(CFLAGS) -DVARIABLE -DFUNCTION -DINCHAN -DRCONST -c calexpr.c |
192 |
|
|
193 |
< |
caldefn.o: caldefn.c calcomp.h |
193 |
> |
caldefn.o: caldefn.c ../common/calcomp.h |
194 |
|
$(CC) $(CFLAGS) -DFUNCTION -DREDEFW -c caldefn.c |
195 |
|
|
151 |
– |
calfunc.o: calfunc.c calcomp.h |
152 |
– |
$(CC) $(CFLAGS) -DVARIABLE -DBIGLIB -c calfunc.c |
153 |
– |
|
154 |
– |
xf.o: xf.c |
155 |
– |
$(CC) $(CFLAGS) -DINVXF -c xf.c |
156 |
– |
|
196 |
|
nwsdev.o: nwsdev.c nwsdev.h newsconstants.h |
197 |
< |
$(CC) $(CFLAGS) -c nwsdev.c |
197 |
> |
$(CC) $(CFLAGS) -Dnws_init=dinit -c nwsdev.c |
198 |
|
|
199 |
|
nwsdev.h: nwsdev.cps newsconstants.h |
200 |
|
cps nwsdev.cps |
201 |
|
|
202 |
|
# |
203 |
< |
# Include dependencies: |
203 |
> |
# Version module: |
204 |
|
# |
205 |
|
|
206 |
< |
caldefn.o calexpr.o calfunc.o: calcomp.h |
206 |
> |
Version.c: VERSION $(RSRC) $(HEADERS) |
207 |
> |
( cat VERSION ; date ; whoami ; hostname ) > Version.c |
208 |
> |
ed - Version.c < verscript.ed |
209 |
|
|
210 |
< |
aed.o color.o colortab.o data.o devcomm.o spec_rgb.o \ |
211 |
< |
devmain.o lookamb.o resolu.o rview.o sundev.o x10.o x11.o: color.h |
210 |
> |
# |
211 |
> |
# Include dependencies: |
212 |
> |
# |
213 |
|
|
214 |
< |
cone.o o_cone.o source.o: cone.h |
214 |
> |
aed.o ambio.o colortab.o data.o devcomm.o \ |
215 |
> |
devmain.o lookamb.o rview.o sundev.o x10.o x11.o: ../common/color.h |
216 |
|
|
217 |
< |
data.o mx_data.o p_data.o t_data.o: data.h |
217 |
> |
o_cone.o srcsupp.o: ../common/cone.h |
218 |
|
|
219 |
+ |
data.o m_brdf.o mx_data.o p_data.o t_data.o: data.h |
220 |
+ |
|
221 |
|
aed.o devcomm.o devmain.o devtable.o \ |
222 |
|
editline.o nwsdev.o sundev.o tty.o x10.o x11.o: driver.h |
223 |
|
|
224 |
< |
face.o o_face.o source.o: face.h |
224 |
> |
o_face.o srcsupp.o: ../common/face.h |
225 |
|
|
226 |
< |
fvect.o: fvect.h |
226 |
> |
ambient.o raytrace.o rpmain.o rtmain.o \ |
227 |
> |
rtrace.o rvmain.o rv2.o rv3.o source.o: ../common/octree.h |
228 |
|
|
229 |
< |
cone.o face.o objset.o otypes.o readobj.o readoct.o: object.h |
229 |
> |
o_instance.o: ../common/instance.h ../common/octree.h |
230 |
|
|
231 |
< |
ambient.o objset.o octree.o raytrace.o readoct.o \ |
232 |
< |
rpmain.o rtmain.o rtrace.o rvmain.o rv2.o rv3.o source.o: octree.h |
231 |
> |
ambient.c aniso.c dielectric.c freeobjmem.c func.c initotypes.c \ |
232 |
> |
m_brdf.c m_direct.c m_mirror.c normal.c o_cone.c preload.c \ |
233 |
> |
raytrace.c rtrace.c rv2.c source.c sphere.c srcsupp.c text.c \ |
234 |
> |
virtuals.c: ../common/otypes.h |
235 |
|
|
236 |
< |
o_instance.o instance.o: instance.h octree.h |
236 |
> |
ambient.o ambcomp.o aniso.o normal.o rpict.o \ |
237 |
> |
rv3.o srcsamp.o virtuals.o: ../common/random.h |
238 |
|
|
239 |
< |
ambient.o cone.o dielectric.o func.o normal.o o_cone.o objset.o \ |
240 |
< |
otypes.o text.o raytrace.o readobj.o readoct.o rtrace.o \ |
192 |
< |
rv2.o source.o sphere.o: otypes.h |
193 |
< |
|
194 |
< |
ambient.o rpict.o rv3.o source.o: random.h |
195 |
< |
|
196 |
< |
ambient.o dielectric.o func.o glass.o m_clip.o \ |
197 |
< |
mx_data.o mx_func.o normal.o o_cone.o o_face.o o_instance.o \ |
239 |
> |
ambient.o ambcomp.o aniso.o dielectric.o func.o glass.o m_clip.o m_mirror.o \ |
240 |
> |
m_brdf.o mx_data.o mx_func.o normal.o o_cone.o o_face.o o_instance.o \ |
241 |
|
p_data.o p_func.o text.o raytrace.o rpmain.o rtmain.o rvmain.o rpict.o \ |
242 |
< |
rtrace.o rv2.o rv3.o source.o \ |
243 |
< |
sphere.o t_data.o t_func.o: ray.h standard.h fvect.h object.h color.h |
242 |
> |
rtrace.o rview.o rv2.o rv3.o source.o srcsamp.o srcsupp.o virtuals.o \ |
243 |
> |
sphere.o t_data.o t_func.o persist.o duphead.o: ray.h ../common/standard.h \ |
244 |
> |
../common/mat4.h ../common/fvect.h ../common/object.h ../common/color.h |
245 |
|
|
246 |
< |
rv2.o rv3.o rview.o: rpaint.h driver.h view.h |
246 |
> |
rv2.o rv3.o rview.o: rpaint.h driver.h ../common/view.h |
247 |
|
|
248 |
< |
source.o: source.h |
248 |
> |
m_direct.o m_mirror.o \ |
249 |
> |
source.o srcsamp.o srcsupp.o virtuals.o: source.h |
250 |
|
|
251 |
< |
cone.o data.o devcomm.o face.o image.o misc.o objset.o octree.o otypes.o \ |
252 |
< |
readobj.o readoct.o rview.o: standard.h fvect.h |
251 |
> |
cone.o data.o devcomm.o freeobjmem.o initotypes.o fprism.o \ |
252 |
> |
octree.o: ../common/standard.h ../common/mat4.h ../common/fvect.h |
253 |
|
|
254 |
+ |
initotypes.o raytrace.o: otspecial.h |
255 |
+ |
|
256 |
|
sundev.o: suntools.icon |
257 |
|
|
258 |
< |
image.o rpmain.o rtmain.o rvmain.o rpict.o: view.h |
258 |
> |
rpmain.o rtmain.o rvmain.o rpict.o: ../common/view.h |
259 |
|
|
260 |
|
x10.o xtwind.o: xtwind.h |
261 |
|
|
262 |
|
x11.o x11twind.o: x11twind.h |
263 |
+ |
|
264 |
+ |
x11.o: x11icon.h |
265 |
+ |
|
266 |
+ |
ambient.o ambcomp.o ambio.o lookamb.o: ambient.h |
267 |
+ |
|
268 |
+ |
data.o rmain.o rpict.o rtrace.o rv2.o: ../common/resolu.h |
269 |
+ |
|
270 |
+ |
aniso.o func.o m_brdf.o m_direct.o mx_data.o mx_func.o p_data.o \ |
271 |
+ |
p_func.o t_data.o t_func.o: func.h |
272 |
+ |
|
273 |
+ |
freeobjmem.o: ../common/object.h |
274 |
+ |
|
275 |
+ |
devcomm.o: ../common/vfork.h |
276 |
+ |
|
277 |
+ |
rtmain.o rpmain.o rvmain.o persist.o duphead.o rpict.o: ../common/paths.h |