1 # Mesa 3-D graphics library
4 # Copyright (C) 2001 Wind River Systems, Inc
7 # Permission is hereby granted, free of charge, to any person obtaining a
8 # copy of this software and associated documentation files (the "Software"),
9 # to deal in the Software without restriction, including without limitation
10 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 # and/or sell copies of the Software, and to permit persons to whom the
12 # Software is furnished to do so, subject to the following conditions:
14 # The above copyright notice and this permission notice shall be included
15 # in all copies or substantial portions of the Software.
17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 # DEALINGS IN THE SOFTWARE.
25 # Makefile for core library
27 # This makefile can moved all objects files in MESA_OBJ for use with
28 # ld in windShell or create a library from objects files in their
29 # associated .c folder.
31 # For an easy inclusion of lib$(CPU)$(TOOL)GL.a in vxworks image, this
32 # makefile collects together all .o in an only file
33 # (obj$(CPU)$(TOOL)GL.o). This operation is unnecessary for
34 # lib$(CPU)$(TOOL)OSMesa.a and lib$(CPU)$(TOOL)UglMesa.a because they
35 # already contain only one file.
41 VERSION=$(MESA_MAJOR).$(MESA_MINOR)
45 GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
49 include ..\rules.windml
109 math/m_debug_clip.c \
110 math/m_debug_norm.c \
111 math/m_debug_vertex.c \
112 math/m_debug_xform.c \
119 array_cache/ac_context.c \
120 array_cache/ac_import.c \
122 swrast/s_aatriangle.c \
125 swrast/s_alphabuf.c \
133 swrast/s_feedback.c \
139 swrast/s_pixeltex.c \
145 swrast/s_texstore.c \
146 swrast/s_triangle.c \
148 swrast_setup/ss_context.c \
149 swrast_setup/ss_triangle.c \
150 swrast_setup/ss_vb.c \
152 tnl/t_array_import.c \
173 GL_OBJECTS = $(GL_SOURCES:.c=.o)
174 GL_OBJNAME = $(MESA_LIBDIR)/objMesaGL.o
179 X86/common_x86_asm.S \
203 mmx_files = X86/mmx_blend.S
205 X86_OBJNAME = $(MESA_LIBDIR)/objMesaX86.o
215 windml/tornado/torMesaUGLInit.c
217 UGL_OBJECTS = $(UGL_SOURCES:.c=.o)
218 UGL_OBJNAME = $(MESA_LIBDIR)/objMesaUGL.o
222 OS_SOURCES = OSmesa/osmesa.c windml/tornado/torMesaOSInit.c
223 OS_OBJECTS = $(OS_SOURCES:.c=.o)
224 OS_OBJNAME = $(MESA_LIBDIR)/objMesaOS.o
226 ##### GLUTSHAPES #####
228 GLUTSHAPES_SOURCES = \
229 windml/ugl_glutshapes.c \
230 windml/tornado/torGLUTShapesInit.c
232 GLUTSHAPES_OBJECTS = $(GLUTSHAPES_SOURCES:.c=.o)
233 GLUTSHAPES_OBJNAME = $(MESA_LIBDIR)/objGLUTShapes.o
235 SOURCES = $(GL_SOURCES) $(UGL_SOURCES) $(OS_SOURCES) \
236 $(GLUTSHAPES_SOURCES)
240 all: depend.$(CPU)$(TOOL) cfgX86 $(X86_OBJNAME) $(GL_OBJNAME)\
241 $(UGL_OBJNAME) $(OS_OBJNAME) $(GLUTSHAPES_OBJNAME)
244 # $(CC) $(CFLAGS) -O1 $(OPTION_OBJECT_ONLY) $(OPTION_OBJECT_NAME)$@ $<
247 # $(CC) $(CFLAGS) -O1 $(OPTION_OBJECT_ONLY) $(OPTION_OBJECT_NAME)$@ $<
251 x3dnow_sources = $(x3dnow_files)
252 CFLAGS_3DNOW = -DUSE_3DNOW_ASM
256 sse_sources = $(sse_files)
257 CFLAGS_SSE = -DUSE_SSE_ASM
261 mmx_sources = $(mmx_files)
262 CFLAGS_MMX = -DUSE_MMX_ASM
266 x86_sources = $(x86_files)
267 CFLAGS_X86 = -DUSE_X86_ASM
269 X86_SOURCES = $(x86_sources) $(mmx_sources) \
270 $(x3dnow_sources) $(sse_sources)
271 X86_OBJECTS = $(X86_SOURCES:.S=.o)
272 CFLAGS_USE_X86 = $(CFLAGS_3DNOW) $(CFLAGS_SSE) $(CFLAGS_MMX) $(CFLAGS_X86)
274 #X86/matypes.h: mtypes.h tnl/t_context.h X86/gen_matypes.c
275 # $(CC) -I ./ X86/gen_matypes.c -o X86/gen_matypes
276 # ./X86/gen_matypes > X86/matypes.h
277 # $(RM) X86/gen_matypes
278 # $(RM) X86/gen_matypes.o
280 # Make the Mesax86 library
281 $(X86_OBJNAME): $(X86_OBJECTS)
283 # $(LD) -r $(X86_OBJECTS) -o $(MESA_OBJNAME)
284 $(LD) -r $(X86_OBJECTS) -o $(X86_OBJNAME)
285 # $(AR) rus $(MESA_LIBNAME) $(X86_OBJNAME)
286 # $(RM) $(X86_OBJNAME)
289 # Make the GL library
290 $(GL_OBJNAME): $(GL_OBJECTS)
291 # $(LD) -r $(GL_OBJECTS) -o $(MESA_OBJNAME)
292 $(LD) -r $(GL_OBJECTS) -o $(GL_OBJNAME)
293 # $(AR) rus $(MESA_LIBNAME) $(GL_OBJNAME)
294 # $(AR) rus $(VX_LIBNAME) $(GL_OBJNAME)
295 # $(RM) $(GL_OBJNAME)
297 # Make the UGLMesa library
298 $(UGL_OBJNAME): $(UGL_OBJECTS)
299 # $(LD) -r $(UGL_OBJECTS) -o $(MESA_OBJNAME)
300 $(LD) -r $(UGL_OBJECTS) -o $(UGL_OBJNAME)
301 # $(AR) rus $(MESA_LIBNAME) $(UGL_OBJNAME)
302 # $(AR) rus $(VX_LIBNAME) $(UGL_OBJNAME)
303 # $(RM) $(UGL_OBJNAME)
305 # Make the OSMesa library
306 $(OS_OBJNAME): $(OS_OBJECTS)
307 # $(LD) -r $(OS_OBJECTS) -o $(MESA_OBJNAME)
308 $(LD) -r $(OS_OBJECTS) -o $(OS_OBJNAME)
309 # $(AR) rus $(MESA_LIBNAME) $(OS_OBJNAME)
310 # $(AR) rus $(VX_LIBNAME) $(OS_OBJNAME)
311 # $(RM) $(OS_OBJNAME)
313 # Make the GLUT Shapes library
314 $(GLUTSHAPES_OBJNAME): $(GLUTSHAPES_OBJECTS)
315 # $(LD) -r $(GLUTSHAPES_OBJECTS) -o $(MESA_OBJNAME)
316 $(LD) -r $(GLUTSHAPES_OBJECTS) -o $(GLUTSHAPES_OBJNAME)
317 # $(AR) rus $(MESA_LIBNAME) $(GLUTSHAPES_OBJNAME)
318 # $(AR) rus $(VX_LIBNAME) $(GLUTSHAPES_OBJNAME)
319 # $(RM) $(GLUTSHAPES_OBJNAME)
321 depend.$(CPU)$(TOOL):
322 ifeq ($(WIND_HOST_TYPE),x86-win32)
324 @ $(ECHO) Creating depend.$(CPU)$(TOOL)
326 @ for %f in ($(SOURCES)) do \
327 $(CC) -MM $(CFLAGS) %f >>$@
332 @ $(ECHO) "Creating depend.$(CPU)$(TOOL)"
334 @ for FILE in $(filter-out $(NODEPENDOBJS), $(SOURCES)); \
336 $(CC) -MM $(CFLAGS) $$FILE \
337 | $(TCL) $(BIN_DIR)/depend.tcl $(TGT_DIR) >>$@; \
345 # $(AR) d $(MESA_LIBNAME) $(GL_OBJNAME)
346 # $(AR) d $(MESA_LIBNAME) $(UGL_OBJNAME)
347 # $(AR) d $(MESA_LIBNAME) $(OS_OBJNAME)
348 # $(AR) d $(MESA_LIBNAME) $(GLUTSHAPES_OBJNAME)
349 # $(AR) d $(VX_LIBNAME) $(GL_OBJNAME)
350 # $(AR) d $(VX_LIBNAME) $(UGL_OBJNAME)
351 # $(AR) d $(VX_LIBNAME) $(OS_OBJNAME)
352 # $(AR) d $(VX_LIBNAME) $(GLUTSHAPES_OBJNAME)
356 $(RM) $(GLUTSHAPES_OBJECTS)
360 $(RM) $(GLUTSHAPES_OBJNAME)
361 $(RM) depend.$(CPU)$(TOOL)
363 include depend.$(CPU)$(TOOL)