fbc5713d03ea6d8b9e52a4bb44e651bb8f046e8f
[mesa.git] / src / mesa / Makefile.X11
1 # Mesa 3-D graphics library
2 # Version: 5.1
3 # Copyright (C) 1995-2003 Brian Paul
4
5 # Makefile for core library
6
7
8 ##### MACROS #####
9
10 TOP = ../..
11
12 GL_MAJOR = 1
13 GL_MINOR = 4
14 GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
15
16 GL_LIB_NAME = "GL" # may be overridden in Make-config
17 OSMESA_LIB_NAME = "OSMesa" # may be overridden in Make-config
18
19 VPATH = RCS
20
21 LIBDIR = $(TOP)/lib
22
23
24
25 CORE_SOURCES = \
26 glapi/glapi.c \
27 glapi/glthread.c \
28 main/api_arrayelt.c \
29 main/api_loopback.c \
30 main/api_noop.c \
31 main/api_validate.c \
32 main/accum.c \
33 main/arbprogram.c \
34 main/attrib.c \
35 main/blend.c \
36 main/bufferobj.c \
37 main/buffers.c \
38 main/clip.c \
39 main/colortab.c \
40 main/context.c \
41 main/convolve.c \
42 main/debug.c \
43 main/depth.c \
44 main/dispatch.c \
45 main/dlist.c \
46 main/drawpix.c \
47 main/enable.c \
48 main/enums.c \
49 main/eval.c \
50 main/extensions.c \
51 main/feedback.c \
52 main/fog.c \
53 main/get.c \
54 main/hash.c \
55 main/hint.c \
56 main/histogram.c \
57 main/image.c \
58 main/imports.c \
59 main/light.c \
60 main/lines.c \
61 main/matrix.c \
62 main/nvprogram.c \
63 main/nvfragparse.c \
64 main/nvvertexec.c \
65 main/nvvertparse.c \
66 main/pixel.c \
67 main/points.c \
68 main/polygon.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 x86/x86.c \
82 x86/common_x86.c \
83 x86/3dnow.c \
84 x86/sse.c \
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 array_cache/ac_context.c \
94 array_cache/ac_import.c \
95 swrast/s_aaline.c \
96 swrast/s_aatriangle.c \
97 swrast/s_accum.c \
98 swrast/s_alpha.c \
99 swrast/s_alphabuf.c \
100 swrast/s_bitmap.c \
101 swrast/s_blend.c \
102 swrast/s_buffers.c \
103 swrast/s_copypix.c \
104 swrast/s_context.c \
105 swrast/s_depth.c \
106 swrast/s_drawpix.c \
107 swrast/s_feedback.c \
108 swrast/s_fog.c \
109 swrast/s_imaging.c \
110 swrast/s_lines.c \
111 swrast/s_logic.c \
112 swrast/s_masking.c \
113 swrast/s_nvfragprog.c \
114 swrast/s_pixeltex.c \
115 swrast/s_points.c \
116 swrast/s_readpix.c \
117 swrast/s_span.c \
118 swrast/s_stencil.c \
119 swrast/s_texture.c \
120 swrast/s_texstore.c \
121 swrast/s_triangle.c \
122 swrast/s_zoom.c \
123 swrast_setup/ss_context.c \
124 swrast_setup/ss_triangle.c \
125 swrast_setup/ss_vb.c \
126 tnl/t_array_api.c \
127 tnl/t_array_import.c \
128 tnl/t_context.c \
129 tnl/t_eval_api.c \
130 tnl/t_imm_alloc.c \
131 tnl/t_imm_api.c \
132 tnl/t_imm_debug.c \
133 tnl/t_imm_dlist.c \
134 tnl/t_imm_elt.c \
135 tnl/t_imm_eval.c \
136 tnl/t_imm_exec.c \
137 tnl/t_imm_fixup.c \
138 tnl/t_pipeline.c \
139 tnl/t_vb_fog.c \
140 tnl/t_vb_light.c \
141 tnl/t_vb_normals.c \
142 tnl/t_vb_points.c \
143 tnl/t_vb_program.c \
144 tnl/t_vb_render.c \
145 tnl/t_vb_texgen.c \
146 tnl/t_vb_texmat.c \
147 tnl/t_vb_vertex.c
148
149
150 DRIVER_SOURCES = \
151 drivers/glide/fxapi.c \
152 drivers/glide/fxdd.c \
153 drivers/glide/fxddspan.c \
154 drivers/glide/fxddtex.c \
155 drivers/glide/fxsetup.c \
156 drivers/glide/fxtexman.c \
157 drivers/glide/fxtris.c \
158 drivers/glide/fxvb.c \
159 drivers/glide/fxglidew.c \
160 drivers/x11/glxapi.c \
161 drivers/x11/fakeglx.c \
162 drivers/x11/xfonts.c \
163 drivers/x11/xm_api.c \
164 drivers/x11/xm_dd.c \
165 drivers/x11/xm_line.c \
166 drivers/x11/xm_span.c \
167 drivers/x11/xm_tri.c \
168 drivers/svga/svgamesa.c \
169 drivers/svga/svgamesa8.c \
170 drivers/svga/svgamesa15.c \
171 drivers/svga/svgamesa16.c \
172 drivers/svga/svgamesa24.c \
173 drivers/svga/svgamesa32.c
174
175
176 ASM_SOURCES =
177
178 ADDITIONAL_OBJ =
179
180 OBJECTS = $(ASM_SOURCES:.S=.o) \
181 $(CORE_SOURCES:.c=.o) \
182 $(DRIVER_SOURCES:.c=.o) \
183 $(ADDITIONAL_OBJ)
184
185 CORE_OBJECTS = $(CORE_SOURCES:.c=.o)
186
187 OSMESA_SOURCES = drivers/osmesa/osmesa.c
188 OSMESA_OBJECTS = drivers/osmesa/osmesa.o
189
190 INCLUDE_DIRS = \
191 -I$(TOP)/include \
192 -I$(TOP)/src/mesa \
193 -I$(TOP)/src/mesa/main \
194 -I$(TOP)/src/mesa/glapi \
195 -I$(TOP)/src/mesa/math \
196 -I$(TOP)/src/mesa/transform \
197 -I$(TOP)/src/mesa/swrast \
198 -I$(TOP)/src/mesa/swrast_setup
199
200
201
202 ##### RULES #####
203
204 .c.o:
205 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
206
207 .S.o:
208 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
209
210
211 X86/x86.o: X86/x86.c
212 $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
213 X86/common_x86.o: X86/common_x86.c
214 $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
215 X86/common_x86_asm.o: X86/common_x86_asm.S X86/matypes.h
216 X86/3dnow.o: X86/3dnow.c
217 $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
218 X86/sse.o: X86/sse.c
219 $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
220 X86/matypes.h: mtypes.h tnl/t_context.h X86/gen_matypes.c
221 $(CC) -I. -I$(INCDIR) $(CFLAGS) X86/gen_matypes.c -o X86/gen_matypes
222 ./X86/gen_matypes > X86/matypes.h
223 rm -f X86/gen_matypes X86/*.o
224
225 # We have X86/matypes.h depend on X86/matypes.h so that if ASM_SOURCES
226 # is empty we don't get an invalid Makefile.
227 $(ASM_SOURCES) X86/matypes.h: X86/matypes.h
228
229
230 ##### TARGETS #####
231
232 #default:
233 # @echo "Specify a target configuration"
234
235 clean:
236 -rm -f *.o *~ */*.o */*~ *.lo *.la
237 -rm -rf .libs
238
239 targets: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(OSMESA_LIB)
240
241 # Make the GL library
242 $(LIBDIR)/$(GL_LIB): $(OBJECTS)
243 $(TOP)/bin/mklib -o $(GL_LIB_NAME) -major $(GL_MAJOR) \
244 -minor $(GL_MINOR) -patch $(GL_TINY) -install $(LIBDIR) \
245 $(GL_LIB_DEPS) $(OBJECTS)
246
247
248 # Make the OSMesa library
249 $(LIBDIR)/$(OSMESA_LIB): $(OSMESA_OBJECTS)
250 if [ ${OSMESA_LIB} ] ; then $(TOP)/bin/mklib -o $(OSMESA_LIB_NAME) \
251 -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(GL_TINY) \
252 -L$(LIBDIR) -l$(GL_LIB_NAME) -install $(LIBDIR) \
253 $(OSMESA_OBJECTS) ; fi
254
255 # Make an optional library with _just_ core objects
256 libmesa: $(LIBDIR)/$(MESA_LIB)
257 if [ ${MESA_LIB} ] ; then $(MAKELIB) $(MESA_LIB) $(MESA_MAJOR) $(MESA_MINOR) $(GL_TINY) $(CORE_OBJECTS) ; fi
258 if [ ${MESA_LIB} ] ; then rm -f $(LIBDIR)/$(MESA_LIB)* ; fi
259 if [ ${MESA_LIB} ] ; then mv $(MESA_LIB)* $(LIBDIR) ; fi
260
261
262 $(LIBDIR)/$(MESA_LIB): $(CORE_OBJECTS)
263
264 include $(TOP)/Make-config
265
266 include depend
267
268
269
270 #
271 # Run 'make dep' to update the dependencies if you change what's included
272 # by any source file.
273 #
274 dep: $(CORE_SOURCES) $(DRIVER_SOURCES) $(OSMESA_SOURCES)
275 makedepend -fdepend -Y -I../include -DGGI -DSVGA -DFX $(CORE_SOURCES) $(DRIVER_SOURCES) $(OSMESA_SOURCES)
276
277 tags:
278 etags `find . -name \*.[ch]` `find ../include`