e99da96b6176baea50ef56760002fd6b967fc00e
[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/arbparse.c \
29 main/arbprogram.c \
30 main/arbfragparse.c \
31 main/arbvertparse.c \
32 main/attrib.c \
33 main/blend.c \
34 main/bufferobj.c \
35 main/buffers.c \
36 main/clip.c \
37 main/colortab.c \
38 main/context.c \
39 main/convolve.c \
40 main/debug.c \
41 main/depth.c \
42 main/dispatch.c \
43 main/dlist.c \
44 main/drawpix.c \
45 main/enable.c \
46 main/enums.c \
47 main/eval.c \
48 main/extensions.c \
49 main/feedback.c \
50 main/fog.c \
51 main/get.c \
52 main/hash.c \
53 main/hint.c \
54 main/histogram.c \
55 main/image.c \
56 main/imports.c \
57 main/light.c \
58 main/lines.c \
59 main/matrix.c \
60 main/nvprogram.c \
61 main/nvfragparse.c \
62 main/nvvertexec.c \
63 main/nvvertparse.c \
64 main/occlude.c \
65 main/pixel.c \
66 main/points.c \
67 main/polygon.c \
68 main/program.c \
69 main/rastpos.c \
70 main/state.c \
71 main/stencil.c \
72 main/texcompress.c \
73 main/texformat.c \
74 main/teximage.c \
75 main/texobj.c \
76 main/texstate.c \
77 main/texstore.c \
78 main/texutil.c \
79 main/varray.c \
80 main/vtxfmt.c
81
82 GLAPI_SOURCES = \
83 glapi/glapi.c \
84 glapi/glthread.c
85
86 MATH_SOURCES = \
87 math/m_debug_clip.c \
88 math/m_debug_norm.c \
89 math/m_debug_xform.c \
90 math/m_eval.c \
91 math/m_matrix.c \
92 math/m_translate.c \
93 math/m_vector.c \
94 math/m_xform.c
95
96 ARRAY_CACHE_SOURCES = \
97 array_cache/ac_context.c \
98 array_cache/ac_import.c
99
100 SWRAST_SOURCES = \
101 swrast/s_aaline.c \
102 swrast/s_aatriangle.c \
103 swrast/s_accum.c \
104 swrast/s_alpha.c \
105 swrast/s_alphabuf.c \
106 swrast/s_bitmap.c \
107 swrast/s_blend.c \
108 swrast/s_buffers.c \
109 swrast/s_copypix.c \
110 swrast/s_context.c \
111 swrast/s_depth.c \
112 swrast/s_drawpix.c \
113 swrast/s_feedback.c \
114 swrast/s_fog.c \
115 swrast/s_imaging.c \
116 swrast/s_lines.c \
117 swrast/s_logic.c \
118 swrast/s_masking.c \
119 swrast/s_nvfragprog.c \
120 swrast/s_pixeltex.c \
121 swrast/s_points.c \
122 swrast/s_readpix.c \
123 swrast/s_span.c \
124 swrast/s_stencil.c \
125 swrast/s_texture.c \
126 swrast/s_texstore.c \
127 swrast/s_triangle.c \
128 swrast/s_zoom.c
129
130 SWRAST_SETUP_SOURCES = \
131 swrast_setup/ss_context.c \
132 swrast_setup/ss_triangle.c \
133 swrast_setup/ss_vb.c
134
135 TNL_SOURCES = \
136 tnl/t_array_api.c \
137 tnl/t_array_import.c \
138 tnl/t_context.c \
139 tnl/t_pipeline.c \
140 tnl/t_save_api.c \
141 tnl/t_save_loopback.c \
142 tnl/t_save_playback.c \
143 tnl/t_vb_fog.c \
144 tnl/t_vb_light.c \
145 tnl/t_vb_normals.c \
146 tnl/t_vb_points.c \
147 tnl/t_vb_program.c \
148 tnl/t_vb_render.c \
149 tnl/t_vb_texgen.c \
150 tnl/t_vb_texmat.c \
151 tnl/t_vb_vertex.c \
152 tnl/t_vtx_api.c \
153 tnl/t_vtx_eval.c \
154 tnl/t_vtx_exec.c
155
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 drivers/glide/fxg.c
213
214 SVGA_DRIVER_SOURCES = \
215 drivers/svga/svgamesa.c \
216 drivers/svga/svgamesa8.c \
217 drivers/svga/svgamesa15.c \
218 drivers/svga/svgamesa16.c \
219 drivers/svga/svgamesa24.c \
220 drivers/svga/svgamesa32.c
221
222 FBDEV_DRIVER_SOURCES = \
223 drivers/fbdev/glfbdev.c
224
225
226 ### Groups of files
227
228 CORE_SOURCES = \
229 $(MAIN_SOURCES) \
230 $(GLAPI_SOURCES) \
231 $(MATH_SOURCES) \
232 $(ARRAY_CACHE_SOURCES) \
233 $(TNL_SOURCES) \
234 $(SWRAST_SOURCES) \
235 $(SWRAST_SETUP_SOURCES) \
236 $(ASM_C_SOURCES)
237
238 # This will probably get set to $(X86_SOURCES) in Make-config:
239 ASM_SOURCES =
240
241 ifndef SOLO
242 # This should get set in Make-config someday:
243 DRIVER_SOURCES = \
244 $(X11_DRIVER_SOURCES) \
245 $(GLIDE_DRIVER_SOURCES) \
246 $(SVGA_DRIVER_SOURCES) \
247 $(FBDEV_DRIVER_SOURCES)
248 endif
249
250
251 ### Object files
252
253 CORE_OBJECTS = $(CORE_SOURCES:.c=.o)
254
255 DRIVER_OBJECTS = $(DRIVER_SOURCES:.c=.o)
256
257 ASM_OBJECTS = $(ASM_SOURCES:.S=.o)
258
259 OSMESA_OBJECTS = $(OSMESA_DRIVER_SOURCES:.c=.o)
260
261 OBJECTS = \
262 $(CORE_OBJECTS) \
263 $(ASM_OBJECTS) \
264 $(DRIVER_OBJECTS)
265
266
267 ### Include directories
268
269 INCLUDE_DIRS = \
270 -I$(TOP)/include \
271 -I$(TOP)/src/mesa \
272 -I$(TOP)/src/mesa/main \
273 -I$(TOP)/src/mesa/glapi \
274 -I$(TOP)/src/mesa/math \
275 -I$(TOP)/src/mesa/transform \
276 -I$(TOP)/src/mesa/swrast \
277 -I$(TOP)/src/mesa/swrast_setup
278
279
280
281 ##### RULES #####
282
283 .c.o:
284 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
285
286 .S.o:
287 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
288
289
290 x86/matypes.h: main/mtypes.h tnl/t_context.h x86/gen_matypes.c
291 $(CC) $(INCLUDE_DIRS) $(CFLAGS) x86/gen_matypes.c -o x86/gen_matypes
292 ./x86/gen_matypes > x86/matypes.h
293 rm -f x86/gen_matypes x86/*.o
294
295 x86/common_x86_asm.o: x86/matypes.h
296
297
298
299 ##### TARGETS #####
300
301 default:
302 @echo "Specify a target configuration"
303
304
305 targets: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(OSMESA_LIB) $(LIBMESA)
306
307
308 # Make the GL library
309 $(LIBDIR)/$(GL_LIB): $(OBJECTS)
310 $(TOP)/bin/mklib -o $(GL_LIB_NAME) -major $(GL_MAJOR) \
311 -minor $(GL_MINOR) -patch $(GL_TINY) -install $(LIBDIR) \
312 $(MKLIB_OPTIONS) $(GL_LIB_DEPS) $(OBJECTS)
313
314
315 # Make the OSMesa library
316 $(LIBDIR)/$(OSMESA_LIB): $(OSMESA_OBJECTS)
317 if [ ${OSMESA_LIB} ] ; then \
318 $(TOP)/bin/mklib -o $(OSMESA_LIB_NAME) -major $(MESA_MAJOR) \
319 -minor $(MESA_MINOR) -patch $(GL_TINY) -L$(LIBDIR) \
320 -l$(GL_LIB_NAME) -install $(LIBDIR) \
321 $(MKLIB_OPTIONS) $(OSMESA_OBJECTS) ; \
322 fi
323
324
325 # Make an optional library with _just_ core objects
326 libmesa: $(LIBDIR)/$(MESA_LIB)
327 if [ ${MESA_LIB} ] ; then \
328 $(MAKELIB) $(MESA_LIB) $(MESA_MAJOR) \
329 $(MESA_MINOR) $(GL_TINY) $(CORE_OBJECTS) ; \
330 fi
331 if [ ${MESA_LIB} ] ; then rm -f $(LIBDIR)/$(MESA_LIB)* ; fi
332 if [ ${MESA_LIB} ] ; then mv $(MESA_LIB)* $(LIBDIR) ; fi
333
334 $(LIBDIR)/$(MESA_LIB): $(CORE_OBJECTS)
335
336 mesa.a: $(CORE_OBJECTS)
337 rm -f $@ && ar rcv $@ $(CORE_OBJECTS) && ranlib $@
338
339
340
341 # Run 'make -f Makefile.X11 dep' to update the dependencies if you change
342 # what's included by any source file.
343 dep: $(CORE_SOURCES) $(DRIVER_SOURCES) $(OSMESA_DRIVER_SOURCES) $(ASM_SOURCES)
344 makedepend -fdepend -Y $(INCLUDE_DIRS) -DGGI -DSVGA -DFX \
345 $(CORE_SOURCES) $(DRIVER_SOURCES) $(OSMESA_DRIVER_SOURCES) \
346 $(ASM_SOURCES)
347
348
349 # Emacs tags
350 tags:
351 etags `find . -name \*.[ch]` `find ../include`
352
353
354 # Remove .o and backup files
355 clean:
356 -rm -f *.a
357 -rm -f */*.o */*~ */*.o */*~
358 -rm -f drivers/*/*.o drivers/*/*/*.o
359
360
361 include $(TOP)/Make-config
362
363 include depend