1 # Makefile for core Mesa library
10 GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
12 GL_LIB_NAME = "GL" # may be overridden in Make-config
13 OSMESA_LIB_NAME = "OSMesa" # may be overridden in Make-config
20 ### Lists of source files
88 math/m_debug_xform.c \
95 ARRAY_CACHE_SOURCES = \
96 array_cache/ac_context.c \
97 array_cache/ac_import.c
101 swrast/s_aatriangle.c \
104 swrast/s_alphabuf.c \
112 swrast/s_feedback.c \
118 swrast/s_nvfragprog.c \
119 swrast/s_pixeltex.c \
125 swrast/s_texstore.c \
126 swrast/s_triangle.c \
129 SWRAST_SETUP_SOURCES = \
130 swrast_setup/ss_context.c \
131 swrast_setup/ss_triangle.c \
136 tnl/t_array_import.c \
166 x86/common_x86_asm.S \
186 sparc/glapi_sparc.S \
190 X11_DRIVER_SOURCES = \
191 drivers/x11/glxapi.c \
192 drivers/x11/fakeglx.c \
193 drivers/x11/xfonts.c \
194 drivers/x11/xm_api.c \
195 drivers/x11/xm_dd.c \
196 drivers/x11/xm_line.c \
197 drivers/x11/xm_span.c \
200 OSMESA_DRIVER_SOURCES = \
201 drivers/osmesa/osmesa.c
203 GLIDE_DRIVER_SOURCES = \
204 drivers/glide/fxapi.c \
205 drivers/glide/fxdd.c \
206 drivers/glide/fxddspan.c \
207 drivers/glide/fxddtex.c \
208 drivers/glide/fxsetup.c \
209 drivers/glide/fxtexman.c \
210 drivers/glide/fxtris.c \
211 drivers/glide/fxvb.c \
212 drivers/glide/fxglidew.c
214 SVGA_DRIVER_SOURCES = \
215 drivers/svga/svgamesa.c \
216 drivers/svga/svgamesa8.c \
217 drivers/svga/svgamesa15.c \
218 drivers/svga/svgamesa16.c \
219 drivers/svga/svgamesa24.c \
220 drivers/svga/svgamesa32.c
230 $(ARRAY_CACHE_SOURCES) \
232 $(SWRAST_SETUP_SOURCES) \
236 # This will probably get set to $(X86_SOURCES) in Make-config:
239 # This should get set in Make-config someday:
241 $(X11_DRIVER_SOURCES) \
242 $(GLIDE_DRIVER_SOURCES) \
243 $(SVGA_DRIVER_SOURCES)
248 CORE_OBJECTS = $(CORE_SOURCES:.c=.o)
250 DRIVER_OBJECTS = $(DRIVER_SOURCES:.c=.o)
252 ASM_OBJECTS = $(ASM_SOURCES:.S=.o)
254 OSMESA_OBJECTS = $(OSMESA_DRIVER_SOURCES:.c=.o)
262 ### Include directories
267 -I$(TOP)/src/mesa/main \
268 -I$(TOP)/src/mesa/glapi \
269 -I$(TOP)/src/mesa/math \
270 -I$(TOP)/src/mesa/transform \
271 -I$(TOP)/src/mesa/swrast \
272 -I$(TOP)/src/mesa/swrast_setup
279 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
282 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
285 x86/matypes.h: main/mtypes.h tnl/t_context.h x86/gen_matypes.c
286 $(CC) $(INCLUDE_DIRS) $(CFLAGS) x86/gen_matypes.c -o x86/gen_matypes
287 ./x86/gen_matypes > x86/matypes.h
288 rm -f x86/gen_matypes x86/*.o
290 x86/common_x86_asm.o: x86/matypes.h
297 @echo "Specify a target configuration"
300 targets: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(OSMESA_LIB) $(LIBMESA)
303 # Make the GL library
304 $(LIBDIR)/$(GL_LIB): $(OBJECTS)
305 $(TOP)/bin/mklib -o $(GL_LIB_NAME) -major $(GL_MAJOR) \
306 -minor $(GL_MINOR) -patch $(GL_TINY) -install $(LIBDIR) \
307 $(GL_LIB_DEPS) $(OBJECTS)
310 # Make the OSMesa library
311 $(LIBDIR)/$(OSMESA_LIB): $(OSMESA_OBJECTS)
312 if [ ${OSMESA_LIB} ] ; then $(TOP)/bin/mklib -o $(OSMESA_LIB_NAME) \
313 -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(GL_TINY) \
314 -L$(LIBDIR) -l$(GL_LIB_NAME) -install $(LIBDIR) \
315 $(OSMESA_OBJECTS) ; fi
318 # Make an optional library with _just_ core objects
319 libmesa: $(LIBDIR)/$(MESA_LIB)
320 if [ ${MESA_LIB} ] ; then $(MAKELIB) $(MESA_LIB) $(MESA_MAJOR) $(MESA_MINOR) $(GL_TINY) $(CORE_OBJECTS) ; fi
321 if [ ${MESA_LIB} ] ; then rm -f $(LIBDIR)/$(MESA_LIB)* ; fi
322 if [ ${MESA_LIB} ] ; then mv $(MESA_LIB)* $(LIBDIR) ; fi
324 $(LIBDIR)/$(MESA_LIB): $(CORE_OBJECTS)
326 mesa.a: $(CORE_OBJECTS)
327 rm -f $@ && ar rcv $@ $(CORE_OBJECTS) && ranlib $@
330 # Run 'make -f Makefile.X11 dep' to update the dependencies if you change
331 # what's included by any source file.
332 dep: $(CORE_SOURCES) $(DRIVER_SOURCES) $(OSMESA_DRIVER_SOURCES) $(ASM_SOURCES)
333 makedepend -fdepend -Y $(INCLUDE_DIRS) -DGGI -DSVGA -DFX \
334 $(CORE_SOURCES) $(DRIVER_SOURCES) $(OSMESA_DRIVER_SOURCES) \
340 etags `find . -name \*.[ch]` `find ../include`
343 # Remove .o and backup files
346 -rm -f */*.o */*~ */*.o */*~
350 include $(TOP)/Make-config