disable under _SOLO build
[mesa.git] / src / mesa / Makefile.X11
1 # Makefile for main Mesa library for Unix/X11-like systems
2
3
4 ##### MACROS #####
5
6 TOP = ../..
7
8 GL_MAJOR = 1
9 GL_MINOR = 5
10 GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
11
12 # These may be overridden in Make-config
13 GL_LIB_NAME = GL
14 OSMESA_LIB_NAME = OSMesa
15
16 LIBDIR = $(TOP)/lib
17
18
19 include sources
20
21
22 # This will probably get set to $(X86_SOURCES) in Make-config:
23 ASM_SOURCES =
24
25 # This should get set in Make-config someday:
26 DRIVER_SOURCES = \
27 $(COMMON_DRIVER_SOURCES) \
28 $(X11_DRIVER_SOURCES) \
29 $(GLIDE_DRIVER_SOURCES) \
30 $(SVGA_DRIVER_SOURCES) \
31 $(FBDEV_DRIVER_SOURCES)
32
33 # All the sources we care about:
34 SOURCES = \
35 $(CORE_SOURCES) \
36 $(ASM_SOURCES) \
37 $(DRIVER_SOURCES)
38
39
40 ASM_OBJECTS = $(ASM_SOURCES:.S=.o)
41
42 DRIVER_OBJECTS = $(DRIVER_SOURCES:.c=.o)
43
44 OSMESA_OBJECTS = $(OSMESA_DRIVER_SOURCES:.c=.o)
45
46 # All the objects we want to make:
47 OBJECTS = \
48 $(CORE_OBJECTS) \
49 $(ASM_OBJECTS) \
50 $(DRIVER_OBJECTS)
51
52
53
54 ##### RULES #####
55
56 .c.o:
57 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
58
59 .S.o:
60 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
61
62
63 # need some special rules here, unfortunately
64 x86/matypes.h: main/mtypes.h tnl/t_context.h x86/gen_matypes.c
65 $(CC) $(INCLUDE_DIRS) $(CFLAGS) x86/gen_matypes.c -o x86/gen_matypes
66 ./x86/gen_matypes > x86/matypes.h
67 #rm -f x86/gen_matypes x86/*.o
68
69 x86/common_x86_asm.o: x86/matypes.h
70 x86/3dnow_normal.o: x86/matypes.h
71 x86/3dnow_xform1.o: x86/matypes.h
72 x86/3dnow_xform2.o: x86/matypes.h
73 x86/3dnow_xform3.o: x86/matypes.h
74 x86/3dnow_xform4.o: x86/matypes.h
75 x86/mmx_blend.o: x86/matypes.h
76 x86/sse_normal.o: x86/matypes.h
77 x86/sse_xform1.o: x86/matypes.h
78 x86/sse_xform2.o: x86/matypes.h
79 x86/sse_xform3.o: x86/matypes.h
80 x86/sse_xform4.o: x86/matypes.h
81 x86/x86_cliptest.o: x86/matypes.h
82 x86/x86_xform2.o: x86/matypes.h
83 x86/x86_xform3.o: x86/matypes.h
84 x86/x86_xform4.o: x86/matypes.h
85
86
87
88 ##### TARGETS #####
89
90 default:
91 @echo "Specify a target configuration"
92
93
94 targets: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(OSMESA_LIB)
95
96
97 # Make the GL library
98 $(LIBDIR)/$(GL_LIB): $(OBJECTS)
99 $(TOP)/bin/mklib -o $(GL_LIB_NAME) -major $(GL_MAJOR) \
100 -minor $(GL_MINOR) -patch $(GL_TINY) -install $(LIBDIR) \
101 $(MKLIB_OPTIONS) $(GL_LIB_DEPS) $(OBJECTS)
102
103
104 # Make the OSMesa library
105 $(LIBDIR)/$(OSMESA_LIB): $(OSMESA_OBJECTS)
106 if [ ${OSMESA_LIB} ] ; then \
107 $(TOP)/bin/mklib -o $(OSMESA_LIB_NAME) -major $(MESA_MAJOR) \
108 -minor $(MESA_MINOR) -patch $(GL_TINY) \
109 $(MKLIB_OPTIONS) -install $(LIBDIR) \
110 $(OSMESA_LIB_DEPS) $(OSMESA_OBJECTS) ; \
111 fi
112
113
114 # Make an optional library with _just_ core objects
115 # XXX this should probably be moved into a separate makefile
116 libmesa: $(LIBDIR)/$(MESA_LIB)
117 if [ ${MESA_LIB} ] ; then \
118 $(MAKELIB) $(MESA_LIB) $(MESA_MAJOR) \
119 $(MESA_MINOR) $(GL_TINY) $(CORE_OBJECTS) ; \
120 fi
121 if [ ${MESA_LIB} ] ; then rm -f $(LIBDIR)/$(MESA_LIB)* ; fi
122 if [ ${MESA_LIB} ] ; then mv $(MESA_LIB)* $(LIBDIR) ; fi
123 $(LIBDIR)/$(MESA_LIB): $(CORE_OBJECTS)
124
125
126
127 # Run 'make -f Makefile.X11 dep' to update the dependencies if you change
128 # what's included by any source file.
129 dep: $(SOURCES)
130 makedepend -fdepend -Y $(INCLUDE_DIRS) -DGGI -DSVGA -DFX $(SOURCES)
131
132
133 # Emacs tags
134 tags:
135 etags `find . -name \*.[ch]` `find ../include`
136
137
138 # Remove .o and backup files
139 clean:
140 -rm -f *.a
141 -rm -f */*.o */*~ */*.o */*~
142 -rm -f drivers/*/*.o drivers/*/*/*.o
143
144
145 include $(TOP)/Make-config
146
147 include depend