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 # DOS/DJGPP core makefile v1.4 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 DMesa code and requires fxMesa.
40 # As a consequence, you'll need the DJGPP Glide3
41 # library to build any application.
43 # MATROX=1 build for Matrox Millennium I (MGA2064W) cards.
44 # This is experimental and not intensively tested.
46 # HAVE_X86=1 optimize for i386.
48 # HAVE_MMX=1 allow MMX specializations, provided your assembler
49 # supports MMX instruction set. However, the true CPU
50 # capabilities are checked at run-time to avoid crashes.
52 # HAVE_SSE=1 (see HAVE_MMX)
54 # HAVE_3DNOW=1 (see HAVE_MMX)
59 # clean: remove object files
65 .INTERMEDIATE: x86/gen_matypes.exe
68 GLIDE ?= $(TOP)/glide3
74 export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
77 CFLAGS += -I$(TOP)/include -I. -Imain -Iglapi
79 CFLAGS += -D__DOS__ -DH3
80 CFLAGS += -I$(GLIDE)/include -DFX
81 LIBNAME = "MesaGL/FX DJGPP"
85 LIBNAME = "MesaGL/MGA DJGPP"
87 LIBNAME = "MesaGL DJGPP"
94 HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
96 ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
97 UNLINK = del $(subst /,\,$(1))
103 main/api_arrayelt.c \
104 main/api_loopback.c \
106 main/api_validate.c \
163 math/m_debug_clip.c \
164 math/m_debug_norm.c \
165 math/m_debug_xform.c \
172 ARRAY_CACHE_SOURCES = \
173 array_cache/ac_context.c \
174 array_cache/ac_import.c
178 swrast/s_aatriangle.c \
181 swrast/s_alphabuf.c \
189 swrast/s_feedback.c \
195 swrast/s_nvfragprog.c \
196 swrast/s_pixeltex.c \
202 swrast/s_texstore.c \
203 swrast/s_triangle.c \
206 SWRAST_SETUP_SOURCES = \
207 swrast_setup/ss_context.c \
208 swrast_setup/ss_triangle.c \
213 tnl/t_array_import.c \
239 x86/common_x86_asm.S \
266 $(ARRAY_CACHE_SOURCES) \
268 $(SWRAST_SETUP_SOURCES) \
272 X86_SOURCES += $(MMX_SOURCES)
273 CFLAGS += -DUSE_MMX_ASM
277 X86_SOURCES += $(SSE_SOURCES)
278 CFLAGS += -DUSE_SSE_ASM
281 ifeq ($(HAVE_3DNOW),1)
282 X86_SOURCES += $(K3D_SOURCES)
283 CFLAGS += -DUSE_3DNOW_ASM
287 CFLAGS += -DUSE_X86_ASM
296 drivers/glide/fxapi.c \
297 drivers/glide/fxdd.c \
298 drivers/glide/fxddspan.c \
299 drivers/glide/fxddtex.c \
300 drivers/glide/fxsetup.c \
301 drivers/glide/fxtexman.c \
302 drivers/glide/fxtris.c \
303 drivers/glide/fxvb.c \
304 drivers/glide/fxglidew.c
308 drivers/dos/mga/mga.c \
309 drivers/dos/mga/mga_hw.c \
310 drivers/dos/mga/mga_mode.c \
314 drivers/dos/video.c \
315 drivers/dos/virtual.S \
323 SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(DRIVER_SOURCES)
325 OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
327 X86_OBJECTS = $(addsuffix .o,$(basename $(X86_SOURCES)))
330 $(CC) -o $@ $(CFLAGS) -c $<
332 $(CC) -o $@ $(CFLAGS) -c $<
334 $(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
336 all: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP)
338 $(LIBDIR)/$(GL_LIB): $(OBJECTS)
339 $(AR) $(ARFLAGS) $@ $^
341 $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP): $(OBJECTS)
343 $(warning Missing DXE3 package... Skipping $(GL_DXE))
346 -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -P glid3.dxe -U $^
348 -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -U $^
352 $(X86_OBJECTS): x86/matypes.h
354 x86/matypes.h: x86/gen_matypes.exe
357 x86/gen_matypes.exe: x86/gen_matypes.c
358 $(CC) -o $@ $(CFLAGS) -s $<
361 -$(call UNLINK,array_cache/*.o)
362 -$(call UNLINK,glapi/*.o)
363 -$(call UNLINK,main/*.o)
364 -$(call UNLINK,math/*.o)
365 -$(call UNLINK,swrast/*.o)
366 -$(call UNLINK,swrast_setup/*.o)
367 -$(call UNLINK,tnl/*.o)
368 -$(call UNLINK,x86/*.o)
369 -$(call UNLINK,drivers/dos/*.o)
370 -$(call UNLINK,drivers/dos/mga/*.o)
371 -$(call UNLINK,drivers/glide/*.o)