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 # Win32/FX core makefile for Mesa
25 # Copyright (c) 2003 - Hiroshi Morii
26 # Email : koolsmoky@users.sourceforge.net
27 # URL : http://www.3dfxzone.it/koolsmoky
29 # Debug build : nmake -f Makefile.fx.win32 DEBUG=1
30 # Optimized build : nmake -f Makefile.fx.win32
31 # Remove objects : nmake -f Makefile.fx.win32 clean
32 # Remove files in bin, lib : nmake -f Makefile.fx.win32 clobber
33 # Remove all generated files : nmake -f Makefile.fx.win32 realclean
36 ##################################
38 ##################################
41 !if "$(GLIDE3SDK)"==""
42 GLIDE3SDK = $(BUILDROOT)\glide3
45 !if "$(GLIDE3SDK)"==""
46 !error GLIDE3SDK undefined! Need to specify Glide3x SDK path!
49 GLIDE3LIB = $(GLIDE3SDK)\lib\glide3x.lib
50 TEXUS2LIB = #$(GLIDE3SDK)\lib\texus2.lib
51 LIBDIR = $(BUILDROOT)\lib
59 ##################################
61 ##################################
62 FLAGS = -DH3 -DFX -DBUILD_GL32
64 !if "$(USE_IEEE)"=="1"
65 FLAGS = $(FLAGS) -D__i386__
68 !if "$(HAVE_MMX)"=="1"
69 FLAGS = $(FLAGS) -DUSE_MMX_ASM
71 !if "$(HAVE_SSE)"=="1"
72 FLAGS = $(FLAGS) -DUSE_SSE_ASM
74 !if "$(HAVE_3DNOW)"=="1"
75 FLAGS = $(FLAGS) -DUSE_3DNOW_ASM
77 !if "$(HAVE_X86)"=="1"
78 FLAGS = $(FLAGS) -DUSE_X86_ASM
82 FLAGS = $(FLAGS) -DMESA_DEBUG -DFX_DEBUG
85 ##################################
87 ##################################
93 CFLAGS = -nologo -Zm300 -G6 -W3 -c -D_MSC_VER=1200 -D__MSC__ -D_WIN32 -DWIN32 -DSTRICT
94 LFLAGS = -nologo /DLL /OPT:WIN98 /MACHINE:IX86 /NODEFAULTLIB
99 CFLAGS = $(CFLAGS) -Od -MTd -Zi -DDEBUG=1 -D_DEBUG -D_MT
100 LFLAGS = $(LFLAGS) -debugtype:both /DEBUG
101 ARFLAGS = $(ARFLAGS) -debugtype:both
102 ASFLAGS = $(ASFLAGS) -g -DDEBUG=1
104 CFLAGS = $(CFLAGS) -Ox -MT -D_MT
105 LFLAGS = $(LFLAGS) -RELEASE
108 #################################
110 #################################
114 #################################
116 #################################
184 math\m_debug_xform.c\
191 ARRAY_CACHE_SOURCES =\
192 array_cache\ac_context.c\
193 array_cache\ac_import.c
197 swrast\s_aatriangle.c\
214 swrast\s_nvfragprog.c\
225 SWRAST_SETUP_SOURCES =\
226 swrast_setup\ss_context.c\
227 swrast_setup\ss_triangle.c
231 tnl\t_array_import.c\
235 tnl\t_save_loopback.c\
236 tnl\t_save_playback.c\
252 drivers\common\driverfuncs.c\
253 drivers\glide\fxapi.c\
254 drivers\glide\fxdd.c\
255 drivers\glide\fxddspan.c\
256 drivers\glide\fxddtex.c\
257 drivers\glide\fxsetup.c\
258 drivers\glide\fxtexman.c\
259 drivers\glide\fxtris.c\
260 drivers\glide\fxvb.c\
261 drivers\glide\fxglidew.c\
262 drivers\glide\fxwgl.c\
269 x86\common_x86_asm.S\
292 !if "$(HAVE_MMX)"=="1"
293 X86_SOURCES = $(X86_SOURCES) $(MMX_SOURCES)
296 !if "$(HAVE_SSE)"=="1"
297 X86_SOURCES = $(X86_SOURCES) $(SSE_SOURCES)
300 !if "$(HAVE_3DNOW)"=="1"
301 X86_SOURCES = $(X86_SOURCES) $(K3D_SOURCES)
304 !if "$(HAVE_X86)"=="1"
309 EXPORTS = drivers\glide\fxopengl.def
311 MAIN_OBJS = $(MAIN_SOURCES:.c=.obj)
312 GLAPI_OBJS = $(GLAPI_SOURCES:.c=.obj)
313 MATH_OBJS = $(MATH_SOURCES:.c=.obj)
314 ARRAY_CACHE_OBJS = $(ARRAY_CACHE_SOURCES:.c=.obj)
315 SWRAST_OBJS = $(SWRAST_SOURCES:.c=.obj)
316 SWRAST_SETUP_OBJS = $(SWRAST_SETUP_SOURCES:.c=.obj)
317 TNL_OBJS = $(TNL_SOURCES:.c=.obj)
318 DRIVER_OBJS = $(DRIVER_SOURCES:.c=.obj)
319 X86_OBJS = $(X86_SOURCES:.c=.obj)
320 X86_OBJS = $(X86_OBJS:.S=.obj)
322 RES = drivers\glide\fx.res
328 $(LIBDIR)\array_cache.lib\
329 $(LIBDIR)\swrast.lib\
330 $(LIBDIR)\swarst_setup.lib\
333 !if "$(X86_SOURCES)"!=""
334 X86_LIB = $(LIBDIR)\x86.lib
339 INCS = -I$(BUILDROOT)\include\
344 -I$(GLIDE3SDK)\include
346 DEP_LIB = user32.lib gdi32.lib kernel32.lib
348 !if "$(DEBUG)" == "1"
349 STD_LIB = MSVCRTD.lib
354 #################################
356 #################################
359 all: $(X86_LIB) $(CORE_LIBS) $(LIBDIR)\$(GL_DLL)
361 $(LIBDIR)\$(GL_DLL): $(DRIVER_OBJS) $(CORE_LIBS) $(X86_LIB) $(RES)
362 $(LINK) -out:$@ -def:$(EXPORTS) $(LFLAGS) $(DRIVER_OBJS) $(CORE_LIBS) $(X86_LIB) $(DEP_LIB) $(STD_LIB) $(TEXUS2LIB) $(GLIDE3LIB) $(RES)
364 $(LIBDIR)\main.lib: $(MAIN_OBJS)
365 $(AR) -out:$@ $(ARFLAGS) $(MAIN_OBJS)
367 $(LIBDIR)\glapi.lib: $(GLAPI_OBJS)
368 $(AR) -out:$@ $(ARFLAGS) $(GLAPI_OBJS)
370 $(LIBDIR)\math.lib: $(MATH_OBJS)
371 $(AR) -out:$@ $(ARFLAGS) $(MATH_OBJS)
373 $(LIBDIR)\array_cache.lib: $(ARRAY_CACHE_OBJS)
374 $(AR) -out:$@ $(ARFLAGS) $(ARRAY_CACHE_OBJS)
376 $(LIBDIR)\swrast.lib: $(SWRAST_OBJS)
377 $(AR) -out:$@ $(ARFLAGS) $(SWRAST_OBJS)
379 $(LIBDIR)\swarst_setup.lib: $(SWRAST_SETUP_OBJS)
380 $(AR) -out:$@ $(ARFLAGS) $(SWRAST_SETUP_OBJS)
382 $(LIBDIR)\tnl.lib: $(TNL_OBJS)
383 $(AR) -out:$@ $(ARFLAGS) $(TNL_OBJS)
385 x86\matypes.h: x86\gen_matypes.exe
386 x86\gen_matypes.exe > $@
388 x86\gen_matypes.exe: x86\gen_matypes.obj
389 $(LINK) -out:$@ -nologo x86\gen_matypes.obj
391 $(LIBDIR)\x86.lib: x86\matypes.h $(X86_OBJS)
392 $(AR) -out:$@ $(ARFLAGS) $(X86_OBJS)
395 $(CC) $(CFLAGS) $(FLAGS) $(INCS) $< /Fo$*.obj
398 $(CC) $(CFLAGS) $(FLAGS) $(INCS) $< -D__WIN32__ -DNASM_ASSEMBLER -EP > $*.i
399 $(AS) $(ASFLAGS) $(INCS) $*.i -o $*.obj
403 $(RC) -Fo$@ $(INCS) $(FLAGS) -D__WIN32__ $<
405 # [dBorca] Hack alert:
406 # glapi_x86.S needs some adjustments
407 # in order to generate correct entrypoints
408 x86\glapi_x86.obj: x86\glapi_x86.S
409 $(CC) $(CFLAGS) $(FLAGS) $(INCS) x86\glapi_x86.S -DSTDCALL_API -DNASM_ASSEMBLER -EP > $*.i
410 $(AS) $(ASFLAGS) $(INCS) $*.i -o $*.obj
413 #################################
415 #################################
416 realclean: clean clobber
419 $(RM) array_cache\*.obj
424 $(RM) swrast_setup\*.obj
427 $(RM) drivers\common\*.obj
428 $(RM) drivers\glide\*.obj
429 $(RM) drivers\glide\*.res
430 $(RM) $(LIBDIR)\*.pdb
434 $(RM) $(LIBDIR)\*.lib
435 $(RM) $(LIBDIR)\*.exp
436 $(RM) $(LIBDIR)\*.dll