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