updates from Daniel Borca
[mesa.git] / src / mesa / main / Makefile.DJ
1 # Mesa 3-D graphics library
2 # Version: 4.0
3 #
4 # Copyright (C) 1999 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.1 for Mesa 4.0
24 #
25 # Copyright (C) 2002 - Borca Daniel
26 # Email : dborca@yahoo.com
27 # Web : http://www.geocities.com/dborca
28
29
30 #
31 # Available options:
32 #
33 # Environment variables:
34 # CFLAGS
35 #
36 # GLIDE absolute path to Glide SDK; used with FX.
37 # default = $(TOP)/include/glide3
38 # FX=1 build for 3dfx Glide3; use it if you have the glide
39 # SDK (designed for your platform), and, of course, a
40 # 3dfx card... Note that this disables compilation of
41 # actual DMesa code, as Glide does all the stuff!
42 # default = no
43 # HAVE_X86=1 optimize for i386.
44 # default = no
45 # HAVE_MMX=1 MMX instructions; use only if you assembler/compiler
46 # supports MMX instruction set; backwards compatibility
47 # with older processors is still preserved.
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
63 TOP = ..
64 GLIDE ?= $(TOP)/include/glide3
65 LIBDIR = $(TOP)/lib
66 GL_LIB = libgl.a
67 GL_DXE = gl.dxe
68 GL_IMP = libigl.a
69
70 CC = gcc
71 CFLAGS += -I$(TOP)/include -I.
72 ifdef FX
73 CFLAGS += -D__DOS__ -I$(GLIDE) -DFX -DFX_GLIDE3 -DFXMESA_USE_ARGB
74 endif
75
76 AR = ar
77 ARFLAGS = ru
78
79 ifneq ($(wildcard $(DJDIR)/lib/dxe2.ld),)
80 DXE2GEN = $(wildcard $(addsuffix /dxe2gen.exe,$(subst ;, ,$(PATH))))
81 endif
82
83 RM = del
84
85 CORE_SOURCES = \
86 swrast_setup/ss_context.c \
87 swrast_setup/ss_triangle.c \
88 swrast_setup/ss_vb.c \
89 api_arrayelt.c \
90 api_loopback.c \
91 api_noop.c \
92 api_validate.c \
93 accum.c \
94 attrib.c \
95 blend.c \
96 buffers.c \
97 clip.c \
98 colortab.c \
99 config.c \
100 context.c \
101 convolve.c \
102 debug.c \
103 depth.c \
104 dispatch.c \
105 dlist.c \
106 drawpix.c \
107 enable.c \
108 enums.c \
109 eval.c \
110 extensions.c \
111 feedback.c \
112 fog.c \
113 get.c \
114 glapi.c \
115 glthread.c \
116 hash.c \
117 hint.c \
118 histogram.c \
119 image.c \
120 imports.c \
121 light.c \
122 lines.c \
123 matrix.c \
124 mem.c \
125 mmath.c \
126 pixel.c \
127 points.c \
128 polygon.c \
129 rastpos.c \
130 state.c \
131 stencil.c \
132 texformat.c \
133 teximage.c \
134 texobj.c \
135 texstate.c \
136 texstore.c \
137 texutil.c \
138 varray.c \
139 vtxfmt.c \
140 math/m_debug_clip.c \
141 math/m_debug_norm.c \
142 math/m_debug_vertex.c \
143 math/m_debug_xform.c \
144 math/m_eval.c \
145 math/m_matrix.c \
146 math/m_translate.c \
147 math/m_vector.c \
148 math/m_vertices.c \
149 math/m_xform.c \
150 array_cache/ac_context.c \
151 array_cache/ac_import.c \
152 swrast/s_aaline.c \
153 swrast/s_aatriangle.c \
154 swrast/s_accum.c \
155 swrast/s_alpha.c \
156 swrast/s_alphabuf.c \
157 swrast/s_bitmap.c \
158 swrast/s_blend.c \
159 swrast/s_buffers.c \
160 swrast/s_copypix.c \
161 swrast/s_context.c \
162 swrast/s_depth.c \
163 swrast/s_drawpix.c \
164 swrast/s_feedback.c \
165 swrast/s_fog.c \
166 swrast/s_histogram.c \
167 swrast/s_imaging.c \
168 swrast/s_lines.c \
169 swrast/s_logic.c \
170 swrast/s_masking.c \
171 swrast/s_pb.c \
172 swrast/s_pixeltex.c \
173 swrast/s_points.c \
174 swrast/s_readpix.c \
175 swrast/s_scissor.c \
176 swrast/s_span.c \
177 swrast/s_stencil.c \
178 swrast/s_texture.c \
179 swrast/s_texstore.c \
180 swrast/s_triangle.c \
181 swrast/s_zoom.c \
182 tnl/t_array_api.c \
183 tnl/t_array_import.c \
184 tnl/t_context.c \
185 tnl/t_eval_api.c \
186 tnl/t_imm_alloc.c \
187 tnl/t_imm_api.c \
188 tnl/t_imm_debug.c \
189 tnl/t_imm_dlist.c \
190 tnl/t_imm_elt.c \
191 tnl/t_imm_eval.c \
192 tnl/t_imm_exec.c \
193 tnl/t_imm_fixup.c \
194 tnl/t_pipeline.c \
195 tnl/t_vb_fog.c \
196 tnl/t_vb_light.c \
197 tnl/t_vb_normals.c \
198 tnl/t_vb_points.c \
199 tnl/t_vb_render.c \
200 tnl/t_vb_texgen.c \
201 tnl/t_vb_texmat.c \
202 tnl/t_vb_vertex.c
203
204 X86_SOURCES = \
205 X86/x86.c \
206 X86/glapi_x86.S \
207 X86/common_x86.c \
208 X86/common_x86_asm.S \
209 X86/x86_xform2.S \
210 X86/x86_xform3.S \
211 X86/x86_xform4.S \
212 X86/x86_vertex.S \
213 X86/x86_cliptest.S
214
215 MMX_SOURCES = \
216 X86/mmx_blend.S
217
218 SSE_SOURCES = \
219 X86/sse.c \
220 X86/sse_xform2.S \
221 X86/sse_xform3.S \
222 X86/sse_xform4.S \
223 X86/sse_vertex.S \
224 X86/sse_normal.S
225
226 K3D_SOURCES = \
227 X86/3dnow.c \
228 X86/3dnow_xform2.S \
229 X86/3dnow_xform3.S \
230 X86/3dnow_xform4.S \
231 X86/3dnow_vertex.S
232
233 ifdef HAVE_MMX
234 X86_SOURCES += $(MMX_SOURCES)
235 CFLAGS += -DUSE_MMX_ASM
236 HAVE_X86 = 1
237 endif
238 ifdef HAVE_SSE
239 X86_SOURCES += $(SSE_SOURCES)
240 CFLAGS += -DUSE_SSE_ASM
241 HAVE_X86 = 1
242 endif
243 ifdef HAVE_3DNOW
244 X86_SOURCES += $(K3D_SOURCES)
245 CFLAGS += -DUSE_3DNOW_ASM
246 HAVE_X86 = 1
247 endif
248 ifdef HAVE_X86
249 CFLAGS += -DUSE_X86_ASM
250 else
251 X86_SOURCES =
252 endif
253
254 ifndef FX
255 DRIVER_SOURCES = \
256 DOS/dmesa.c \
257 DOS/video.c \
258 DOS/virtual.S \
259 DOS/vesa/vesa.c \
260 DOS/dpmi.c
261 else
262 DRIVER_SOURCES = \
263 FX/fxapi.c \
264 FX/fxdd.c \
265 FX/fxddspan.c \
266 FX/fxddtex.c \
267 FX/fxsetup.c \
268 FX/fxtexman.c \
269 FX/fxtris.c \
270 FX/fxvb.c \
271 FX/fxglidew.c
272 endif
273
274 SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(DRIVER_SOURCES)
275
276 OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
277
278 .c.o:
279 $(CC) -o $@ -c $(CFLAGS) $<
280 .S.o:
281 $(CC) -o $@ -c $(CFLAGS) $<
282 .s.o:
283 $(CC) -o $@ -c $(CFLAGS) -x assembler-with-cpp $<
284
285 all: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP)
286
287 $(LIBDIR)/$(GL_LIB): $(OBJECTS)
288 $(AR) $(ARFLAGS) $(LIBDIR)/$(GL_LIB) $(OBJECTS)
289
290 $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP): $(OBJECTS)
291 ifeq ($(DXE2GEN),)
292 $(warning Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN)
293 $(warning somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.)
294 else
295 -dxe2gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) $(OBJECTS) -E djgpp_ -E gl -E DMesa -E fxMesa -D "Mesa DJGPP GL" -U
296 endif
297
298 clean:
299 -$(RM) $(subst /,\,*.o)
300 -$(RM) $(subst /,\,array_cache/*.o)
301 -$(RM) $(subst /,\,math/*.o)
302 -$(RM) $(subst /,\,swrast/*.o)
303 -$(RM) $(subst /,\,swrast_setup/*.o)
304 -$(RM) $(subst /,\,tnl/*.o)
305 -$(RM) $(subst /,\,X86/*.o)
306 -$(RM) $(subst /,\,DOS/*.o)
307 -$(RM) $(subst /,\,DOS/vesa/*.o)
308 -$(RM) $(subst /,\,FX/*.o)
309
310 -include depend