patch to import Jon Smirl's work from Bitkeeper
[mesa.git] / src / mesa / Makefile.X11
1 # Makefile for core Mesa library
2
3
4 ##### MACROS #####
5
6 TOP = ../..
7
8 GL_MAJOR = 1
9 GL_MINOR = 4
10 GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
11
12 GL_LIB_NAME = "GL" # may be overridden in Make-config
13 OSMESA_LIB_NAME = "OSMesa" # may be overridden in Make-config
14
15 VPATH = RCS
16
17 LIBDIR = $(TOP)/lib
18
19
20 ### Lists of source files
21
22 MAIN_SOURCES = \
23 main/api_arrayelt.c \
24 main/api_loopback.c \
25 main/api_noop.c \
26 main/api_validate.c \
27 main/accum.c \
28 main/arbprogram.c \
29 main/arbfragparse.c \
30 main/arbvertparse.c \
31 main/attrib.c \
32 main/blend.c \
33 main/bufferobj.c \
34 main/buffers.c \
35 main/clip.c \
36 main/colortab.c \
37 main/context.c \
38 main/convolve.c \
39 main/debug.c \
40 main/depth.c \
41 main/dispatch.c \
42 main/dlist.c \
43 main/drawpix.c \
44 main/enable.c \
45 main/enums.c \
46 main/eval.c \
47 main/extensions.c \
48 main/feedback.c \
49 main/fog.c \
50 main/get.c \
51 main/hash.c \
52 main/hint.c \
53 main/histogram.c \
54 main/image.c \
55 main/imports.c \
56 main/light.c \
57 main/lines.c \
58 main/matrix.c \
59 main/nvprogram.c \
60 main/nvfragparse.c \
61 main/nvvertexec.c \
62 main/nvvertparse.c \
63 main/occlude.c \
64 main/pixel.c \
65 main/points.c \
66 main/polygon.c \
67 main/rastpos.c \
68 main/state.c \
69 main/stencil.c \
70 main/texcompress.c \
71 main/texformat.c \
72 main/teximage.c \
73 main/texobj.c \
74 main/texstate.c \
75 main/texstore.c \
76 main/texutil.c \
77 main/varray.c \
78 main/vtxfmt.c
79
80 GLAPI_SOURCES = \
81 glapi/glapi.c \
82 glapi/glthread.c
83
84 MATH_SOURCES = \
85 math/m_debug_clip.c \
86 math/m_debug_norm.c \
87 math/m_debug_xform.c \
88 math/m_eval.c \
89 math/m_matrix.c \
90 math/m_translate.c \
91 math/m_vector.c \
92 math/m_xform.c
93
94 ARRAY_CACHE_SOURCES = \
95 array_cache/ac_context.c \
96 array_cache/ac_import.c
97
98 SWRAST_SOURCES = \
99 swrast/s_aaline.c \
100 swrast/s_aatriangle.c \
101 swrast/s_accum.c \
102 swrast/s_alpha.c \
103 swrast/s_alphabuf.c \
104 swrast/s_bitmap.c \
105 swrast/s_blend.c \
106 swrast/s_buffers.c \
107 swrast/s_copypix.c \
108 swrast/s_context.c \
109 swrast/s_depth.c \
110 swrast/s_drawpix.c \
111 swrast/s_feedback.c \
112 swrast/s_fog.c \
113 swrast/s_imaging.c \
114 swrast/s_lines.c \
115 swrast/s_logic.c \
116 swrast/s_masking.c \
117 swrast/s_nvfragprog.c \
118 swrast/s_pixeltex.c \
119 swrast/s_points.c \
120 swrast/s_readpix.c \
121 swrast/s_span.c \
122 swrast/s_stencil.c \
123 swrast/s_texture.c \
124 swrast/s_texstore.c \
125 swrast/s_triangle.c \
126 swrast/s_zoom.c
127
128 SWRAST_SETUP_SOURCES = \
129 swrast_setup/ss_context.c \
130 swrast_setup/ss_triangle.c \
131 swrast_setup/ss_vb.c
132
133 TNL_SOURCES = \
134 tnl/t_array_api.c \
135 tnl/t_array_import.c \
136 tnl/t_context.c \
137 tnl/t_eval_api.c \
138 tnl/t_imm_alloc.c \
139 tnl/t_imm_api.c \
140 tnl/t_imm_debug.c \
141 tnl/t_imm_dlist.c \
142 tnl/t_imm_elt.c \
143 tnl/t_imm_eval.c \
144 tnl/t_imm_exec.c \
145 tnl/t_imm_fixup.c \
146 tnl/t_pipeline.c \
147 tnl/t_vb_fog.c \
148 tnl/t_vb_light.c \
149 tnl/t_vb_normals.c \
150 tnl/t_vb_points.c \
151 tnl/t_vb_program.c \
152 tnl/t_vb_render.c \
153 tnl/t_vb_texgen.c \
154 tnl/t_vb_texmat.c \
155 tnl/t_vb_vertex.c
156
157 ASM_C_SOURCES = \
158 x86/common_x86.c \
159 x86/x86.c \
160 x86/3dnow.c \
161 x86/sse.c \
162 sparc/sparc.c
163
164 X86_SOURCES = \
165 x86/common_x86_asm.S \
166 x86/glapi_x86.S \
167 x86/x86_xform2.S \
168 x86/x86_xform3.S \
169 x86/x86_xform4.S \
170 x86/x86_cliptest.S \
171 x86/mmx_blend.S \
172 x86/3dnow_xform1.S \
173 x86/3dnow_xform2.S \
174 x86/3dnow_xform3.S \
175 x86/3dnow_xform4.S \
176 x86/3dnow_normal.S \
177 x86/sse_xform1.S \
178 x86/sse_xform2.S \
179 x86/sse_xform3.S \
180 x86/sse_xform4.S \
181 x86/sse_normal.S
182
183 SPARC_SOURCES = \
184 sparc/clip.S \
185 sparc/glapi_sparc.S \
186 sparc/norm.S \
187 sparc/xform.S
188
189 X11_DRIVER_SOURCES = \
190 drivers/x11/glxapi.c \
191 drivers/x11/fakeglx.c \
192 drivers/x11/xfonts.c \
193 drivers/x11/xm_api.c \
194 drivers/x11/xm_dd.c \
195 drivers/x11/xm_line.c \
196 drivers/x11/xm_span.c \
197 drivers/x11/xm_tri.c
198
199 OSMESA_DRIVER_SOURCES = \
200 drivers/osmesa/osmesa.c
201
202 GLIDE_DRIVER_SOURCES = \
203 drivers/glide/fxapi.c \
204 drivers/glide/fxdd.c \
205 drivers/glide/fxddspan.c \
206 drivers/glide/fxddtex.c \
207 drivers/glide/fxsetup.c \
208 drivers/glide/fxtexman.c \
209 drivers/glide/fxtris.c \
210 drivers/glide/fxvb.c \
211 drivers/glide/fxglidew.c
212
213 SVGA_DRIVER_SOURCES = \
214 drivers/svga/svgamesa.c \
215 drivers/svga/svgamesa8.c \
216 drivers/svga/svgamesa15.c \
217 drivers/svga/svgamesa16.c \
218 drivers/svga/svgamesa24.c \
219 drivers/svga/svgamesa32.c
220
221
222
223 ### Groups of files
224
225 CORE_SOURCES = \
226 $(MAIN_SOURCES) \
227 $(GLAPI_SOURCES) \
228 $(MATH_SOURCES) \
229 $(ARRAY_CACHE_SOURCES) \
230 $(SWRAST_SOURCES) \
231 $(SWRAST_SETUP_SOURCES) \
232 $(TNL_SOURCES) \
233 $(ASM_C_SOURCES)
234
235 # This will probably get set to $(X86_SOURCES) in Make-config:
236 ASM_SOURCES =
237
238 # This should get set in Make-config someday:
239 DRIVER_SOURCES = \
240 $(X11_DRIVER_SOURCES) \
241 $(GLIDE_DRIVER_SOURCES) \
242 $(SVGA_DRIVER_SOURCES)
243
244
245 ### Object files
246
247 CORE_OBJECTS = $(CORE_SOURCES:.c=.o)
248
249 DRIVER_OBJECTS = $(DRIVER_SOURCES:.c=.o)
250
251 ASM_OBJECTS = $(ASM_SOURCES:.S=.o)
252
253 OSMESA_OBJECTS = $(OSMESA_DRIVER_SOURCES:.c=.o)
254
255 OBJECTS = \
256 $(CORE_OBJECTS) \
257 $(ASM_OBJECTS) \
258 $(DRIVER_OBJECTS)
259
260
261 ### Include directories
262
263 INCLUDE_DIRS = \
264 -I$(TOP)/include \
265 -I$(TOP)/src/mesa \
266 -I$(TOP)/src/mesa/main \
267 -I$(TOP)/src/mesa/glapi \
268 -I$(TOP)/src/mesa/math \
269 -I$(TOP)/src/mesa/transform \
270 -I$(TOP)/src/mesa/swrast \
271 -I$(TOP)/src/mesa/swrast_setup
272
273
274
275 ##### RULES #####
276
277 .c.o:
278 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
279
280 .S.o:
281 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
282
283
284 x86/matypes.h: main/mtypes.h tnl/t_context.h x86/gen_matypes.c
285 $(CC) $(INCLUDE_DIRS) $(CFLAGS) x86/gen_matypes.c -o x86/gen_matypes
286 ./x86/gen_matypes > x86/matypes.h
287 rm -f x86/gen_matypes x86/*.o
288
289 x86/common_x86_asm.o: x86/matypes.h
290
291
292
293 ##### TARGETS #####
294
295 default:
296 @echo "Specify a target configuration"
297
298
299 targets: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(OSMESA_LIB) $(LIBMESA)
300
301
302 # Make the GL library
303 $(LIBDIR)/$(GL_LIB): $(OBJECTS)
304 $(TOP)/bin/mklib -o $(GL_LIB_NAME) -major $(GL_MAJOR) \
305 -minor $(GL_MINOR) -patch $(GL_TINY) -install $(LIBDIR) \
306 $(GL_LIB_DEPS) $(OBJECTS)
307
308
309 # Make the OSMesa library
310 $(LIBDIR)/$(OSMESA_LIB): $(OSMESA_OBJECTS)
311 if [ ${OSMESA_LIB} ] ; then $(TOP)/bin/mklib -o $(OSMESA_LIB_NAME) \
312 -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(GL_TINY) \
313 -L$(LIBDIR) -l$(GL_LIB_NAME) -install $(LIBDIR) \
314 $(OSMESA_OBJECTS) ; fi
315
316 # Make an optional library with _just_ core objects
317 libmesa: $(LIBDIR)/$(MESA_LIB)
318 if [ ${MESA_LIB} ] ; then $(MAKELIB) $(MESA_LIB) $(MESA_MAJOR) $(MESA_MINOR) $(GL_TINY) $(CORE_OBJECTS) ; fi
319 if [ ${MESA_LIB} ] ; then rm -f $(LIBDIR)/$(MESA_LIB)* ; fi
320 if [ ${MESA_LIB} ] ; then mv $(MESA_LIB)* $(LIBDIR) ; fi
321
322 $(LIBDIR)/$(MESA_LIB): $(CORE_OBJECTS)
323
324 mesa.a: $(CORE_OBJECTS)
325 rm -f $@ && ar rcv $@ $(CORE_OBJECTS) && ranlib $@
326
327 # Run 'make -f Makefile.X11 dep' to update the dependencies if you change
328 # what's included by any source file.
329 dep: $(CORE_SOURCES) $(DRIVER_SOURCES) $(OSMESA_DRIVER_SOURCES) $(ASM_SOURCES)
330 makedepend -fdepend -Y -I../include -DGGI -DSVGA -DFX $(CORE_SOURCES) \
331 $(DRIVER_SOURCES) $(OSMESA_DRIVER_SOURCES) $(ASM_SOURCES)
332
333
334 # Emacs tags
335 tags:
336 etags `find . -name \*.[ch]` `find ../include`
337
338
339 # Remove .o and backup files
340 clean:
341 -rm *.a
342 -rm -f */*.o */*~ */*.o */*~
343 -rm -f drivers/*/*.o
344
345
346 include $(TOP)/Make-config
347
348 include depend