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
89 math/m_debug_xform.c \
96 ARRAY_CACHE_SOURCES = \
97 array_cache/ac_context.c \
98 array_cache/ac_import.c
102 swrast/s_aatriangle.c \
105 swrast/s_alphabuf.c \
113 swrast/s_feedback.c \
119 swrast/s_nvfragprog.c \
120 swrast/s_pixeltex.c \
126 swrast/s_texstore.c \
127 swrast/s_triangle.c \
130 SWRAST_SETUP_SOURCES = \
131 swrast_setup/ss_context.c \
132 swrast_setup/ss_triangle.c \
137 tnl/t_array_import.c \
141 tnl/t_save_loopback.c \
142 tnl/t_save_playback.c \
165 x86/common_x86_asm.S \
185 sparc/glapi_sparc.S \
189 X11_DRIVER_SOURCES = \
190 drivers/x11/glxapi.c \
191 drivers/x11/fakeglx.c \
192 drivers/x11/xfonts.c \
193 drivers/x11/xm_api.c \
194 drivers/x11/xm_dd.c \
195 drivers/x11/xm_line.c \
196 drivers/x11/xm_span.c \
199 OSMESA_DRIVER_SOURCES = \
200 drivers/osmesa/osmesa.c
202 GLIDE_DRIVER_SOURCES = \
203 drivers/glide/fxapi.c \
204 drivers/glide/fxdd.c \
205 drivers/glide/fxddspan.c \
206 drivers/glide/fxddtex.c \
207 drivers/glide/fxsetup.c \
208 drivers/glide/fxtexman.c \
209 drivers/glide/fxtris.c \
210 drivers/glide/fxvb.c \
211 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
222 FBDEV_DRIVER_SOURCES = \
223 drivers/fbdev/glfbdev.c
232 $(ARRAY_CACHE_SOURCES) \
235 $(SWRAST_SETUP_SOURCES) \
238 # This will probably get set to $(X86_SOURCES) in Make-config:
242 # This should get set in Make-config someday:
244 $(X11_DRIVER_SOURCES) \
245 $(GLIDE_DRIVER_SOURCES) \
246 $(SVGA_DRIVER_SOURCES) \
247 $(FBDEV_DRIVER_SOURCES)
253 CORE_OBJECTS = $(CORE_SOURCES:.c=.o)
255 DRIVER_OBJECTS = $(DRIVER_SOURCES:.c=.o)
257 ASM_OBJECTS = $(ASM_SOURCES:.S=.o)
259 OSMESA_OBJECTS = $(OSMESA_DRIVER_SOURCES:.c=.o)
267 ### Include directories
272 -I$(TOP)/src/mesa/main \
273 -I$(TOP)/src/mesa/glapi \
274 -I$(TOP)/src/mesa/math \
275 -I$(TOP)/src/mesa/transform \
276 -I$(TOP)/src/mesa/swrast \
277 -I$(TOP)/src/mesa/swrast_setup
284 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
287 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
290 x86/matypes.h: main/mtypes.h tnl/t_context.h x86/gen_matypes.c
291 $(CC) $(INCLUDE_DIRS) $(CFLAGS) x86/gen_matypes.c -o x86/gen_matypes
292 ./x86/gen_matypes > x86/matypes.h
293 rm -f x86/gen_matypes x86/*.o
295 x86/common_x86_asm.o: x86/matypes.h
302 @echo "Specify a target configuration"
305 targets: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(OSMESA_LIB) $(LIBMESA)
308 # Make the GL library
309 $(LIBDIR)/$(GL_LIB): $(OBJECTS)
310 $(TOP)/bin/mklib -o $(GL_LIB_NAME) -major $(GL_MAJOR) \
311 -minor $(GL_MINOR) -patch $(GL_TINY) -install $(LIBDIR) \
312 $(MKLIB_OPTIONS) $(GL_LIB_DEPS) $(OBJECTS)
315 # Make the OSMesa library
316 $(LIBDIR)/$(OSMESA_LIB): $(OSMESA_OBJECTS)
317 if [ ${OSMESA_LIB} ] ; then \
318 $(TOP)/bin/mklib -o $(OSMESA_LIB_NAME) -major $(MESA_MAJOR) \
319 -minor $(MESA_MINOR) -patch $(GL_TINY) -L$(LIBDIR) \
320 -l$(GL_LIB_NAME) -install $(LIBDIR) \
321 $(MKLIB_OPTIONS) $(OSMESA_OBJECTS) ; \
325 # Make an optional library with _just_ core objects
326 libmesa: $(LIBDIR)/$(MESA_LIB)
327 if [ ${MESA_LIB} ] ; then \
328 $(MAKELIB) $(MESA_LIB) $(MESA_MAJOR) \
329 $(MESA_MINOR) $(GL_TINY) $(CORE_OBJECTS) ; \
331 if [ ${MESA_LIB} ] ; then rm -f $(LIBDIR)/$(MESA_LIB)* ; fi
332 if [ ${MESA_LIB} ] ; then mv $(MESA_LIB)* $(LIBDIR) ; fi
334 $(LIBDIR)/$(MESA_LIB): $(CORE_OBJECTS)
336 mesa.a: $(CORE_OBJECTS)
337 rm -f $@ && ar rcv $@ $(CORE_OBJECTS) && ranlib $@
341 # Run 'make -f Makefile.X11 dep' to update the dependencies if you change
342 # what's included by any source file.
343 dep: $(CORE_SOURCES) $(DRIVER_SOURCES) $(OSMESA_DRIVER_SOURCES) $(ASM_SOURCES)
344 makedepend -fdepend -Y $(INCLUDE_DIRS) -DGGI -DSVGA -DFX \
345 $(CORE_SOURCES) $(DRIVER_SOURCES) $(OSMESA_DRIVER_SOURCES) \
351 etags `find . -name \*.[ch]` `find ../include`
354 # Remove .o and backup files
357 -rm -f */*.o */*~ */*.o */*~
358 -rm -f drivers/*/*.o drivers/*/*/*.o
361 include $(TOP)/Make-config