Minor changes to make linux-solo build again
[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/program.c \
68 main/rastpos.c \
69 main/state.c \
70 main/stencil.c \
71 main/texcompress.c \
72 main/texformat.c \
73 main/teximage.c \
74 main/texobj.c \
75 main/texstate.c \
76 main/texstore.c \
77 main/texutil.c \
78 main/varray.c \
79 main/vtxfmt.c
80
81 GLAPI_SOURCES = \
82 glapi/glapi.c \
83 glapi/glthread.c
84
85 MATH_SOURCES = \
86 math/m_debug_clip.c \
87 math/m_debug_norm.c \
88 math/m_debug_xform.c \
89 math/m_eval.c \
90 math/m_matrix.c \
91 math/m_translate.c \
92 math/m_vector.c \
93 math/m_xform.c
94
95 ARRAY_CACHE_SOURCES = \
96 array_cache/ac_context.c \
97 array_cache/ac_import.c
98
99 SWRAST_SOURCES = \
100 swrast/s_aaline.c \
101 swrast/s_aatriangle.c \
102 swrast/s_accum.c \
103 swrast/s_alpha.c \
104 swrast/s_alphabuf.c \
105 swrast/s_bitmap.c \
106 swrast/s_blend.c \
107 swrast/s_buffers.c \
108 swrast/s_copypix.c \
109 swrast/s_context.c \
110 swrast/s_depth.c \
111 swrast/s_drawpix.c \
112 swrast/s_feedback.c \
113 swrast/s_fog.c \
114 swrast/s_imaging.c \
115 swrast/s_lines.c \
116 swrast/s_logic.c \
117 swrast/s_masking.c \
118 swrast/s_nvfragprog.c \
119 swrast/s_pixeltex.c \
120 swrast/s_points.c \
121 swrast/s_readpix.c \
122 swrast/s_span.c \
123 swrast/s_stencil.c \
124 swrast/s_texture.c \
125 swrast/s_texstore.c \
126 swrast/s_triangle.c \
127 swrast/s_zoom.c
128
129 SWRAST_SETUP_SOURCES = \
130 swrast_setup/ss_context.c \
131 swrast_setup/ss_triangle.c \
132 swrast_setup/ss_vb.c
133
134 TNL_SOURCES = \
135 tnl/t_array_api.c \
136 tnl/t_array_import.c \
137 tnl/t_context.c \
138 tnl/t_eval_api.c \
139 tnl/t_imm_alloc.c \
140 tnl/t_imm_api.c \
141 tnl/t_imm_debug.c \
142 tnl/t_imm_dlist.c \
143 tnl/t_imm_elt.c \
144 tnl/t_imm_eval.c \
145 tnl/t_imm_exec.c \
146 tnl/t_imm_fixup.c \
147 tnl/t_pipeline.c \
148 tnl/t_vb_fog.c \
149 tnl/t_vb_light.c \
150 tnl/t_vb_normals.c \
151 tnl/t_vb_points.c \
152 tnl/t_vb_program.c \
153 tnl/t_vb_render.c \
154 tnl/t_vb_texgen.c \
155 tnl/t_vb_texmat.c \
156 tnl/t_vb_vertex.c
157
158 ASM_C_SOURCES = \
159 x86/common_x86.c \
160 x86/x86.c \
161 x86/3dnow.c \
162 x86/sse.c \
163 sparc/sparc.c
164
165 X86_SOURCES = \
166 x86/common_x86_asm.S \
167 x86/glapi_x86.S \
168 x86/x86_xform2.S \
169 x86/x86_xform3.S \
170 x86/x86_xform4.S \
171 x86/x86_cliptest.S \
172 x86/mmx_blend.S \
173 x86/3dnow_xform1.S \
174 x86/3dnow_xform2.S \
175 x86/3dnow_xform3.S \
176 x86/3dnow_xform4.S \
177 x86/3dnow_normal.S \
178 x86/sse_xform1.S \
179 x86/sse_xform2.S \
180 x86/sse_xform3.S \
181 x86/sse_xform4.S \
182 x86/sse_normal.S
183
184 SPARC_SOURCES = \
185 sparc/clip.S \
186 sparc/glapi_sparc.S \
187 sparc/norm.S \
188 sparc/xform.S
189
190 X11_DRIVER_SOURCES = \
191 drivers/x11/glxapi.c \
192 drivers/x11/fakeglx.c \
193 drivers/x11/xfonts.c \
194 drivers/x11/xm_api.c \
195 drivers/x11/xm_dd.c \
196 drivers/x11/xm_line.c \
197 drivers/x11/xm_span.c \
198 drivers/x11/xm_tri.c
199
200 OSMESA_DRIVER_SOURCES = \
201 drivers/osmesa/osmesa.c
202
203 GLIDE_DRIVER_SOURCES = \
204 drivers/glide/fxapi.c \
205 drivers/glide/fxdd.c \
206 drivers/glide/fxddspan.c \
207 drivers/glide/fxddtex.c \
208 drivers/glide/fxsetup.c \
209 drivers/glide/fxtexman.c \
210 drivers/glide/fxtris.c \
211 drivers/glide/fxvb.c \
212 drivers/glide/fxglidew.c \
213 drivers/glide/fxg.c
214
215 SVGA_DRIVER_SOURCES = \
216 drivers/svga/svgamesa.c \
217 drivers/svga/svgamesa8.c \
218 drivers/svga/svgamesa15.c \
219 drivers/svga/svgamesa16.c \
220 drivers/svga/svgamesa24.c \
221 drivers/svga/svgamesa32.c
222
223
224
225 ### Groups of files
226
227 CORE_SOURCES = \
228 $(MAIN_SOURCES) \
229 $(GLAPI_SOURCES) \
230 $(MATH_SOURCES) \
231 $(ARRAY_CACHE_SOURCES) \
232 $(SWRAST_SOURCES) \
233 $(SWRAST_SETUP_SOURCES) \
234 $(TNL_SOURCES) \
235 $(ASM_C_SOURCES)
236
237 # This will probably get set to $(X86_SOURCES) in Make-config:
238 ASM_SOURCES =
239
240 ifndef SOLO
241 # This should get set in Make-config someday:
242 DRIVER_SOURCES = \
243 $(X11_DRIVER_SOURCES) \
244 $(GLIDE_DRIVER_SOURCES) \
245 $(SVGA_DRIVER_SOURCES)
246 endif
247
248
249 ### Object files
250
251 CORE_OBJECTS = $(CORE_SOURCES:.c=.o)
252
253 DRIVER_OBJECTS = $(DRIVER_SOURCES:.c=.o)
254
255 ASM_OBJECTS = $(ASM_SOURCES:.S=.o)
256
257 OSMESA_OBJECTS = $(OSMESA_DRIVER_SOURCES:.c=.o)
258
259 OBJECTS = \
260 $(CORE_OBJECTS) \
261 $(ASM_OBJECTS) \
262 $(DRIVER_OBJECTS)
263
264
265 ### Include directories
266
267 INCLUDE_DIRS = \
268 -I$(TOP)/include \
269 -I$(TOP)/src/mesa \
270 -I$(TOP)/src/mesa/main \
271 -I$(TOP)/src/mesa/glapi \
272 -I$(TOP)/src/mesa/math \
273 -I$(TOP)/src/mesa/transform \
274 -I$(TOP)/src/mesa/swrast \
275 -I$(TOP)/src/mesa/swrast_setup
276
277
278
279 ##### RULES #####
280
281 .c.o:
282 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
283
284 .S.o:
285 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
286
287
288 x86/matypes.h: main/mtypes.h tnl/t_context.h x86/gen_matypes.c
289 $(CC) $(INCLUDE_DIRS) $(CFLAGS) x86/gen_matypes.c -o x86/gen_matypes
290 ./x86/gen_matypes > x86/matypes.h
291 rm -f x86/gen_matypes x86/*.o
292
293 x86/common_x86_asm.o: x86/matypes.h
294
295
296
297 ##### TARGETS #####
298
299 default:
300 @echo "Specify a target configuration"
301
302
303 targets: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(OSMESA_LIB) $(LIBMESA)
304
305
306 # Make the GL library
307 $(LIBDIR)/$(GL_LIB): $(OBJECTS)
308 $(TOP)/bin/mklib -o $(GL_LIB_NAME) -major $(GL_MAJOR) \
309 -minor $(GL_MINOR) -patch $(GL_TINY) -install $(LIBDIR) \
310 $(GL_LIB_DEPS) $(OBJECTS)
311
312
313 # Make the OSMesa library
314 $(LIBDIR)/$(OSMESA_LIB): $(OSMESA_OBJECTS)
315 if [ ${OSMESA_LIB} ] ; then \
316 $(TOP)/bin/mklib -o $(OSMESA_LIB_NAME) -major $(MESA_MAJOR) \
317 -minor $(MESA_MINOR) -patch $(GL_TINY) -L$(LIBDIR) \
318 -l$(GL_LIB_NAME) -install $(LIBDIR) \
319 $(OSMESA_OBJECTS) ; \
320 fi
321
322
323 # Make an optional library with _just_ core objects
324 libmesa: $(LIBDIR)/$(MESA_LIB)
325 if [ ${MESA_LIB} ] ; then \
326 $(MAKELIB) $(MESA_LIB) $(MESA_MAJOR) \
327 $(MESA_MINOR) $(GL_TINY) $(CORE_OBJECTS) ; \
328 fi
329 if [ ${MESA_LIB} ] ; then rm -f $(LIBDIR)/$(MESA_LIB)* ; fi
330 if [ ${MESA_LIB} ] ; then mv $(MESA_LIB)* $(LIBDIR) ; fi
331
332 $(LIBDIR)/$(MESA_LIB): $(CORE_OBJECTS)
333
334 mesa.a: $(CORE_OBJECTS)
335 rm -f $@ && ar rcv $@ $(CORE_OBJECTS) && ranlib $@
336
337
338
339 # Run 'make -f Makefile.X11 dep' to update the dependencies if you change
340 # what's included by any source file.
341 dep: $(CORE_SOURCES) $(DRIVER_SOURCES) $(OSMESA_DRIVER_SOURCES) $(ASM_SOURCES)
342 makedepend -fdepend -Y $(INCLUDE_DIRS) -DGGI -DSVGA -DFX \
343 $(CORE_SOURCES) $(DRIVER_SOURCES) $(OSMESA_DRIVER_SOURCES) \
344 $(ASM_SOURCES)
345
346
347 # Emacs tags
348 tags:
349 etags `find . -name \*.[ch]` `find ../include`
350
351
352 # Remove .o and backup files
353 clean:
354 -rm -f *.a
355 -rm -f */*.o */*~ */*.o */*~
356 -rm -f drivers/*/*.o drivers/*/*/*.o
357
358
359 include $(TOP)/Make-config
360
361 include depend