1 # Mesa 3-D graphics library
4 # Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
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:
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
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.
23 # MinGW core makefile v1.0 for Mesa
25 # Copyright (C) 2002 - Borca Daniel
26 # Email : dborca@users.sourceforge.net
27 # Web : http://www.geocities.com/dborca
33 # Environment variables:
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 WMesa code and requires fxMesa.
40 # As a consequence, you'll need the Win32 Glide3
41 # library to build any application.
43 # HAVE_X86=1 optimize for i386.
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.
49 # HAVE_SSE=1 (see HAVE_MMX)
51 # HAVE_3DNOW=1 (see HAVE_MMX)
56 # clean: remove object files
62 .INTERMEDIATE: x86/gen_matypes.exe
65 GLIDE ?= $(TOP)/glide3
68 GL_IMP = libopengl32.a
73 CFLAGS += -DBUILD_GL32 -D_OPENGL32_ -D_MSC_VER
74 CFLAGS += -I$(TOP)/include -I. -Imain -Iglapi
77 CFLAGS += -I$(GLIDE)/include -DFX
78 LDLIBS += -L$(GLIDE)/lib -lglide3
79 GL_DEF = drivers/glide/fxopengl.def
81 GL_DEF = drivers/windows/gdi/mesa.def
87 ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
88 UNLINK = del $(subst /,\,$(1))
100 main/arbfragparse.c \
101 main/arbvertparse.c \
156 math/m_debug_clip.c \
157 math/m_debug_norm.c \
158 math/m_debug_xform.c \
165 ARRAY_CACHE_SOURCES = \
166 array_cache/ac_context.c \
167 array_cache/ac_import.c
171 swrast/s_aatriangle.c \
174 swrast/s_alphabuf.c \
182 swrast/s_feedback.c \
188 swrast/s_nvfragprog.c \
189 swrast/s_pixeltex.c \
195 swrast/s_texstore.c \
196 swrast/s_triangle.c \
199 SWRAST_SETUP_SOURCES = \
200 swrast_setup/ss_context.c \
201 swrast_setup/ss_triangle.c \
206 tnl/t_array_import.c \
232 x86/common_x86_asm.S \
259 $(ARRAY_CACHE_SOURCES) \
261 $(SWRAST_SETUP_SOURCES) \
265 X86_SOURCES += $(MMX_SOURCES)
266 CFLAGS += -DUSE_MMX_ASM
270 X86_SOURCES += $(SSE_SOURCES)
271 CFLAGS += -DUSE_SSE_ASM
274 ifeq ($(HAVE_3DNOW),1)
275 X86_SOURCES += $(K3D_SOURCES)
276 CFLAGS += -DUSE_3DNOW_ASM
280 CFLAGS += -DUSE_X86_ASM
287 drivers/glide/fxapi.c \
288 drivers/glide/fxdd.c \
289 drivers/glide/fxddspan.c \
290 drivers/glide/fxddtex.c \
291 drivers/glide/fxsetup.c \
292 drivers/glide/fxtexman.c \
293 drivers/glide/fxtris.c \
294 drivers/glide/fxvb.c \
295 drivers/glide/fxglidew.c \
296 drivers/glide/fxwgl.c
299 drivers/windows/gdi/wmesa.c \
300 drivers/windows/gdi/wgl.c
303 SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(DRIVER_SOURCES)
305 OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
307 X86_OBJECTS = $(addsuffix .o,$(basename $(X86_SOURCES)))
310 $(CC) -o $@ $(CFLAGS) -c $<
312 $(CC) -o $@ $(CFLAGS) -c $<
314 $(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
316 all: $(LIBDIR)/$(GL_DLL) $(LIBDIR)/$(GL_IMP)
318 $(LIBDIR)/$(GL_DLL) $(LIBDIR)/$(GL_IMP): $(OBJECTS)
319 dllwrap -o $(LIBDIR)/$(GL_DLL) --output-lib $(LIBDIR)/$(GL_IMP) --target i386-mingw32 --def $(GL_DEF) $^ $(LDLIBS)
321 $(X86_OBJECTS): x86/matypes.h
323 x86/matypes.h: x86/gen_matypes.exe
326 x86/gen_matypes.exe: x86/gen_matypes.c
327 $(CC) -o $@ $(CFLAGS) -s $<
330 -$(call UNLINK,array_cache/*.o)
331 -$(call UNLINK,glapi/*.o)
332 -$(call UNLINK,main/*.o)
333 -$(call UNLINK,math/*.o)
334 -$(call UNLINK,swrast/*.o)
335 -$(call UNLINK,swrast_setup/*.o)
336 -$(call UNLINK,tnl/*.o)
337 -$(call UNLINK,x86/*.o)
338 -$(call UNLINK,drivers/windows/gdi/*.o)
339 -$(call UNLINK,drivers/glide/*.o)