1 # Makefile for main Mesa library for Unix/X11-like systems
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
21 # This will probably get set to $(X86_SOURCES) in Make-config:
24 # This should get set in Make-config someday:
26 $(X11_DRIVER_SOURCES) \
27 $(GLIDE_DRIVER_SOURCES) \
28 $(SVGA_DRIVER_SOURCES) \
29 $(FBDEV_DRIVER_SOURCES)
31 # All the sources we care about:
38 ASM_OBJECTS = $(ASM_SOURCES:.S=.o)
40 DRIVER_OBJECTS = $(DRIVER_SOURCES:.c=.o)
42 OSMESA_OBJECTS = $(OSMESA_DRIVER_SOURCES:.c=.o)
44 # All the objects we want to make:
55 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
58 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
61 # need some special rules here, unfortunately
62 x86/matypes.h: main/mtypes.h tnl/t_context.h x86/gen_matypes.c
63 $(CC) $(INCLUDE_DIRS) $(CFLAGS) x86/gen_matypes.c -o x86/gen_matypes
64 ./x86/gen_matypes > x86/matypes.h
65 #rm -f x86/gen_matypes x86/*.o
67 x86/common_x86_asm.o: x86/matypes.h
68 x86/3dnow_normal.o: x86/matypes.h
69 x86/3dnow_xform1.o: x86/matypes.h
70 x86/3dnow_xform2.o: x86/matypes.h
71 x86/3dnow_xform3.o: x86/matypes.h
72 x86/3dnow_xform4.o: x86/matypes.h
73 x86/mmx_blend.o: x86/matypes.h
74 x86/sse_normal.o: x86/matypes.h
75 x86/sse_xform1.o: x86/matypes.h
76 x86/sse_xform2.o: x86/matypes.h
77 x86/sse_xform3.o: x86/matypes.h
78 x86/sse_xform4.o: x86/matypes.h
79 x86/x86_cliptest.o: x86/matypes.h
80 x86/x86_xform2.o: x86/matypes.h
81 x86/x86_xform3.o: x86/matypes.h
82 x86/x86_xform4.o: x86/matypes.h
89 @echo "Specify a target configuration"
92 targets: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(OSMESA_LIB)
96 $(LIBDIR)/$(GL_LIB): $(OBJECTS)
97 $(TOP)/bin/mklib -o $(GL_LIB_NAME) -major $(GL_MAJOR) \
98 -minor $(GL_MINOR) -patch $(GL_TINY) -install $(LIBDIR) \
99 $(MKLIB_OPTIONS) $(GL_LIB_DEPS) $(OBJECTS)
102 # Make the OSMesa library
103 $(LIBDIR)/$(OSMESA_LIB): $(OSMESA_OBJECTS)
104 if [ ${OSMESA_LIB} ] ; then \
105 $(TOP)/bin/mklib -o $(OSMESA_LIB_NAME) -major $(MESA_MAJOR) \
106 -minor $(MESA_MINOR) -patch $(GL_TINY) -L$(LIBDIR) \
107 -l$(GL_LIB_NAME) -install $(LIBDIR) \
108 $(MKLIB_OPTIONS) $(OSMESA_OBJECTS) ; \
112 # Make an optional library with _just_ core objects
113 # XXX this should probably be moved into a separate makefile
114 libmesa: $(LIBDIR)/$(MESA_LIB)
115 if [ ${MESA_LIB} ] ; then \
116 $(MAKELIB) $(MESA_LIB) $(MESA_MAJOR) \
117 $(MESA_MINOR) $(GL_TINY) $(CORE_OBJECTS) ; \
119 if [ ${MESA_LIB} ] ; then rm -f $(LIBDIR)/$(MESA_LIB)* ; fi
120 if [ ${MESA_LIB} ] ; then mv $(MESA_LIB)* $(LIBDIR) ; fi
121 $(LIBDIR)/$(MESA_LIB): $(CORE_OBJECTS)
125 # Run 'make -f Makefile.X11 dep' to update the dependencies if you change
126 # what's included by any source file.
128 makedepend -fdepend -Y $(INCLUDE_DIRS) -DGGI -DSVGA -DFX $(SOURCES)
133 etags `find . -name \*.[ch]` `find ../include`
136 # Remove .o and backup files
139 -rm -f */*.o */*~ */*.o */*~
140 -rm -f drivers/*/*.o drivers/*/*/*.o
143 include $(TOP)/Make-config