no-op table on par with main dispatcher
[mesa.git] / src / mesa / Makefile.DJ
1 # Mesa 3-D graphics library
2 # Version: 5.1
3 #
4 # Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
5 #
6 # Permission is hereby granted, free of charge, to any person obtaining a
7 # copy of this software and associated documentation files (the "Software"),
8 # to deal in the Software without restriction, including without limitation
9 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 # and/or sell copies of the Software, and to permit persons to whom the
11 # Software is furnished to do so, subject to the following conditions:
12 #
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
15 #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 # BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23 # DOS/DJGPP core makefile v1.4 for Mesa
24 #
25 # Copyright (C) 2002 - Borca Daniel
26 # Email : dborca@users.sourceforge.net
27 # Web : http://www.geocities.com/dborca
28
29
30 #
31 # Available options:
32 #
33 # Environment variables:
34 # CFLAGS
35 #
36 # GLIDE path to Glide3 SDK; used with FX.
37 # default = $(TOP)/glide3
38 # FX=1 build for 3dfx Glide3. Note that this disables
39 # compilation of most DMesa code and requires fxMesa.
40 # As a consequence, you'll need the DJGPP Glide3
41 # library to build any application.
42 # default = no
43 # HAVE_X86=1 optimize for i386.
44 # default = no
45 # HAVE_MMX=1 allow MMX specializations, provided your assembler
46 # supports MMX instruction set. However, the true CPU
47 # capabilities are checked at run-time to avoid crashes.
48 # default = no
49 # HAVE_SSE=1 (see HAVE_MMX)
50 # default = no
51 # HAVE_3DNOW=1 (see HAVE_MMX)
52 # default = no
53 #
54 # Targets:
55 # all: build GL
56 # clean: remove object files
57 #
58
59
60
61 .PHONY: all clean
62 .INTERMEDIATE: x86/gen_matypes.exe
63
64 TOP = ../..
65 GLIDE ?= $(TOP)/glide3
66 LIBDIR = $(TOP)/lib
67 GL_LIB = libgl.a
68 GL_DXE = gl.dxe
69 GL_IMP = libigl.a
70
71 export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
72
73 CC = gcc
74 CFLAGS += -I$(TOP)/include -I. -Imain -Iglapi
75 ifeq ($(FX),1)
76 CFLAGS += -D__DOS__ -DH3
77 CFLAGS += -I$(GLIDE)/include -DFX
78 LIBNAME = "Mesa/FX DJGPP"
79 else
80 LIBNAME = "Mesa DJGPP"
81 endif
82
83 AR = ar
84 ARFLAGS = rus
85
86 HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
87
88 ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
89 UNLINK = del $(subst /,\,$(1))
90 else
91 UNLINK = $(RM) $(1)
92 endif
93
94 MAIN_SOURCES = \
95 main/api_arrayelt.c \
96 main/api_loopback.c \
97 main/api_noop.c \
98 main/api_validate.c \
99 main/accum.c \
100 main/arbparse.c \
101 main/arbprogram.c \
102 main/arbfragparse.c \
103 main/arbvertparse.c \
104 main/attrib.c \
105 main/blend.c \
106 main/bufferobj.c \
107 main/buffers.c \
108 main/clip.c \
109 main/colortab.c \
110 main/context.c \
111 main/convolve.c \
112 main/debug.c \
113 main/depth.c \
114 main/dispatch.c \
115 main/dlist.c \
116 main/drawpix.c \
117 main/enable.c \
118 main/enums.c \
119 main/eval.c \
120 main/extensions.c \
121 main/feedback.c \
122 main/fog.c \
123 main/get.c \
124 main/hash.c \
125 main/hint.c \
126 main/histogram.c \
127 main/image.c \
128 main/imports.c \
129 main/light.c \
130 main/lines.c \
131 main/matrix.c \
132 main/nvprogram.c \
133 main/nvfragparse.c \
134 main/nvvertexec.c \
135 main/nvvertparse.c \
136 main/occlude.c \
137 main/pixel.c \
138 main/points.c \
139 main/polygon.c \
140 main/program.c \
141 main/rastpos.c \
142 main/state.c \
143 main/stencil.c \
144 main/texcompress.c \
145 main/texformat.c \
146 main/teximage.c \
147 main/texobj.c \
148 main/texstate.c \
149 main/texstore.c \
150 main/texutil.c \
151 main/varray.c \
152 main/vtxfmt.c
153
154 GLAPI_SOURCES = \
155 glapi/glapi.c \
156 glapi/glthread.c
157
158 MATH_SOURCES = \
159 math/m_debug_clip.c \
160 math/m_debug_norm.c \
161 math/m_debug_xform.c \
162 math/m_eval.c \
163 math/m_matrix.c \
164 math/m_translate.c \
165 math/m_vector.c \
166 math/m_xform.c
167
168 ARRAY_CACHE_SOURCES = \
169 array_cache/ac_context.c \
170 array_cache/ac_import.c
171
172 SWRAST_SOURCES = \
173 swrast/s_aaline.c \
174 swrast/s_aatriangle.c \
175 swrast/s_accum.c \
176 swrast/s_alpha.c \
177 swrast/s_alphabuf.c \
178 swrast/s_bitmap.c \
179 swrast/s_blend.c \
180 swrast/s_buffers.c \
181 swrast/s_copypix.c \
182 swrast/s_context.c \
183 swrast/s_depth.c \
184 swrast/s_drawpix.c \
185 swrast/s_feedback.c \
186 swrast/s_fog.c \
187 swrast/s_imaging.c \
188 swrast/s_lines.c \
189 swrast/s_logic.c \
190 swrast/s_masking.c \
191 swrast/s_nvfragprog.c \
192 swrast/s_pixeltex.c \
193 swrast/s_points.c \
194 swrast/s_readpix.c \
195 swrast/s_span.c \
196 swrast/s_stencil.c \
197 swrast/s_texture.c \
198 swrast/s_texstore.c \
199 swrast/s_triangle.c \
200 swrast/s_zoom.c
201
202 SWRAST_SETUP_SOURCES = \
203 swrast_setup/ss_context.c \
204 swrast_setup/ss_triangle.c \
205 swrast_setup/ss_vb.c
206
207 TNL_SOURCES = \
208 tnl/t_array_api.c \
209 tnl/t_array_import.c \
210 tnl/t_context.c \
211 tnl/t_pipeline.c \
212 tnl/t_save_api.c \
213 tnl/t_save_loopback.c \
214 tnl/t_save_playback.c \
215 tnl/t_vb_fog.c \
216 tnl/t_vb_light.c \
217 tnl/t_vb_normals.c \
218 tnl/t_vb_points.c \
219 tnl/t_vb_program.c \
220 tnl/t_vb_render.c \
221 tnl/t_vb_texgen.c \
222 tnl/t_vb_texmat.c \
223 tnl/t_vb_vertex.c \
224 tnl/t_vtx_api.c \
225 tnl/t_vtx_eval.c \
226 tnl/t_vtx_exec.c
227
228 X86_SOURCES = \
229 x86/x86.c \
230 x86/glapi_x86.S \
231 x86/common_x86.c \
232 x86/common_x86_asm.S \
233 x86/x86_xform2.S \
234 x86/x86_xform3.S \
235 x86/x86_xform4.S \
236 x86/x86_cliptest.S
237
238 MMX_SOURCES = \
239 x86/mmx_blend.S
240
241 SSE_SOURCES = \
242 x86/sse.c \
243 x86/sse_xform2.S \
244 x86/sse_xform3.S \
245 x86/sse_xform4.S \
246 x86/sse_normal.S
247
248 K3D_SOURCES = \
249 x86/3dnow.c \
250 x86/3dnow_xform2.S \
251 x86/3dnow_xform3.S \
252 x86/3dnow_xform4.S \
253 x86/3dnow_normal.S
254
255 CORE_SOURCES = \
256 $(MAIN_SOURCES) \
257 $(GLAPI_SOURCES) \
258 $(MATH_SOURCES) \
259 $(ARRAY_CACHE_SOURCES) \
260 $(TNL_SOURCES) \
261 $(SWRAST_SOURCES) \
262 $(SWRAST_SETUP_SOURCES)
263
264 ifeq ($(HAVE_MMX),1)
265 X86_SOURCES += $(MMX_SOURCES)
266 CFLAGS += -DUSE_MMX_ASM
267 HAVE_X86 = 1
268 endif
269 ifeq ($(HAVE_SSE),1)
270 X86_SOURCES += $(SSE_SOURCES)
271 CFLAGS += -DUSE_SSE_ASM
272 HAVE_X86 = 1
273 endif
274 ifeq ($(HAVE_3DNOW),1)
275 X86_SOURCES += $(K3D_SOURCES)
276 CFLAGS += -DUSE_3DNOW_ASM
277 HAVE_X86 = 1
278 endif
279 ifeq ($(HAVE_X86),1)
280 CFLAGS += -DUSE_X86_ASM
281 else
282 X86_SOURCES =
283 endif
284
285 DRIVER_SOURCES = \
286 drivers/dos/dmesa.c
287 ifeq ($(FX),1)
288 DRIVER_SOURCES += \
289 drivers/glide/fxapi.c \
290 drivers/glide/fxdd.c \
291 drivers/glide/fxddspan.c \
292 drivers/glide/fxddtex.c \
293 drivers/glide/fxsetup.c \
294 drivers/glide/fxtexman.c \
295 drivers/glide/fxtris.c \
296 drivers/glide/fxvb.c \
297 drivers/glide/fxglidew.c \
298 drivers/glide/fxg.c
299 else
300 DRIVER_SOURCES += \
301 drivers/dos/video.c \
302 drivers/dos/virtual.S \
303 drivers/dos/vesa.c \
304 drivers/dos/blit.S \
305 drivers/dos/vga.c \
306 drivers/dos/dpmi.c
307 endif
308
309 SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(DRIVER_SOURCES)
310
311 OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
312
313 X86_OBJECTS = $(addsuffix .o,$(basename $(X86_SOURCES)))
314
315 .c.o:
316 $(CC) -o $@ $(CFLAGS) -c $<
317 .S.o:
318 $(CC) -o $@ $(CFLAGS) -c $<
319 .s.o:
320 $(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
321
322 all: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP)
323
324 $(LIBDIR)/$(GL_LIB): $(OBJECTS)
325 $(AR) $(ARFLAGS) $@ $^
326
327 $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP): $(OBJECTS)
328 ifeq ($(HAVEDXE3),)
329 $(warning Missing DXE3 package... Skipping $(GL_DXE))
330 else
331 ifeq ($(FX),1)
332 -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -P glide3x.dxe -U $^
333 else
334 -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -U $^
335 endif
336 endif
337
338 $(X86_OBJECTS): x86/matypes.h
339
340 x86/matypes.h: x86/gen_matypes.exe
341 $< > $@
342
343 x86/gen_matypes.exe: x86/gen_matypes.c
344 $(CC) -o $@ $(CFLAGS) -s $<
345
346 clean:
347 -$(call UNLINK,array_cache/*.o)
348 -$(call UNLINK,glapi/*.o)
349 -$(call UNLINK,main/*.o)
350 -$(call UNLINK,math/*.o)
351 -$(call UNLINK,swrast/*.o)
352 -$(call UNLINK,swrast_setup/*.o)
353 -$(call UNLINK,tnl/*.o)
354 -$(call UNLINK,x86/*.o)
355 -$(call UNLINK,drivers/dos/*.o)
356 -$(call UNLINK,drivers/glide/*.o)