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.6 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 # 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
71 export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
74 CFLAGS += -I$(TOP)/include -I. -Imain -Iglapi
76 CFLAGS += -D__DOS__ -DH3
77 CFLAGS += -I$(GLIDE)/include -DFX
78 LIBNAME = "Mesa/FX DJGPP"
80 LIBNAME = "Mesa DJGPP"
86 HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
88 ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
89 UNLINK = del $(subst /,\,$(1))
100 x86/common_x86_asm.S \
127 $(ARRAY_CACHE_SOURCES) \
130 $(SWRAST_SETUP_SOURCES)
133 X86_SOURCES += $(MMX_SOURCES)
134 CFLAGS += -DUSE_MMX_ASM
138 X86_SOURCES += $(SSE_SOURCES)
139 CFLAGS += -DUSE_SSE_ASM
142 ifeq ($(HAVE_3DNOW),1)
143 X86_SOURCES += $(K3D_SOURCES)
144 CFLAGS += -DUSE_3DNOW_ASM
148 CFLAGS += -DUSE_X86_ASM
157 drivers/glide/fxapi.c \
158 drivers/glide/fxdd.c \
159 drivers/glide/fxddspan.c \
160 drivers/glide/fxddtex.c \
161 drivers/glide/fxsetup.c \
162 drivers/glide/fxtexman.c \
163 drivers/glide/fxtris.c \
164 drivers/glide/fxvb.c \
165 drivers/glide/fxglidew.c \
169 drivers/dos/video.c \
170 drivers/dos/virtual.S \
178 SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(COMMON_DRIVER_SOURCES) $(DRIVER_SOURCES)
180 OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
182 X86_OBJECTS = $(addsuffix .o,$(basename $(X86_SOURCES)))
185 $(CC) -o $@ $(CFLAGS) -c $<
187 $(CC) -o $@ $(CFLAGS) -c $<
189 $(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
191 all: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP)
193 $(LIBDIR)/$(GL_LIB): $(OBJECTS)
194 $(AR) $(ARFLAGS) $@ $^
196 $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP): $(OBJECTS)
198 $(warning Missing DXE3 package... Skipping $(GL_DXE))
201 -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -P glide3x.dxe -U $^
203 -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -U $^
207 $(X86_OBJECTS): x86/matypes.h
209 x86/matypes.h: x86/gen_matypes.exe
212 x86/gen_matypes.exe: x86/gen_matypes.c
213 $(CC) -o $@ $(CFLAGS) -s $<
216 -$(call UNLINK,array_cache/*.o)
217 -$(call UNLINK,glapi/*.o)
218 -$(call UNLINK,main/*.o)
219 -$(call UNLINK,math/*.o)
220 -$(call UNLINK,swrast/*.o)
221 -$(call UNLINK,swrast_setup/*.o)
222 -$(call UNLINK,tnl/*.o)
223 -$(call UNLINK,x86/*.o)
224 -$(call UNLINK,drivers/common/*.o)
225 -$(call UNLINK,drivers/dos/*.o)
226 -$(call UNLINK,drivers/glide/*.o)