include sched.h to get sched_yield() prototype
[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 $(X11_DRIVER_SOURCES) \
28 $(GLIDE_DRIVER_SOURCES) \
29 $(SVGA_DRIVER_SOURCES) \
30 $(FBDEV_DRIVER_SOURCES)
31
32 # All the sources we care about:
33 SOURCES = \
34 $(CORE_SOURCES) \
35 $(ASM_SOURCES) \
36 $(DRIVER_SOURCES)
37
38
39 ASM_OBJECTS = $(ASM_SOURCES:.S=.o)
40
41 DRIVER_OBJECTS = $(DRIVER_SOURCES:.c=.o)
42
43 OSMESA_OBJECTS = $(OSMESA_DRIVER_SOURCES:.c=.o)
44
45 # All the objects we want to make:
46 OBJECTS = \
47 $(CORE_OBJECTS) \
48 $(ASM_OBJECTS) \
49 $(DRIVER_OBJECTS)
50
51
52
53 ##### RULES #####
54
55 .c.o:
56 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
57
58 .S.o:
59 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
60
61
62 # need some special rules here, unfortunately
63 x86/matypes.h: main/mtypes.h tnl/t_context.h x86/gen_matypes.c
64 $(CC) $(INCLUDE_DIRS) $(CFLAGS) x86/gen_matypes.c -o x86/gen_matypes
65 ./x86/gen_matypes > x86/matypes.h
66 #rm -f x86/gen_matypes x86/*.o
67
68 x86/common_x86_asm.o: x86/matypes.h
69 x86/3dnow_normal.o: x86/matypes.h
70 x86/3dnow_xform1.o: x86/matypes.h
71 x86/3dnow_xform2.o: x86/matypes.h
72 x86/3dnow_xform3.o: x86/matypes.h
73 x86/3dnow_xform4.o: x86/matypes.h
74 x86/mmx_blend.o: x86/matypes.h
75 x86/sse_normal.o: x86/matypes.h
76 x86/sse_xform1.o: x86/matypes.h
77 x86/sse_xform2.o: x86/matypes.h
78 x86/sse_xform3.o: x86/matypes.h
79 x86/sse_xform4.o: x86/matypes.h
80 x86/x86_cliptest.o: x86/matypes.h
81 x86/x86_xform2.o: x86/matypes.h
82 x86/x86_xform3.o: x86/matypes.h
83 x86/x86_xform4.o: x86/matypes.h
84
85
86
87 ##### TARGETS #####
88
89 default:
90 @echo "Specify a target configuration"
91
92
93 targets: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(OSMESA_LIB)
94
95
96 # Make the GL library
97 $(LIBDIR)/$(GL_LIB): $(OBJECTS)
98 $(TOP)/bin/mklib -o $(GL_LIB_NAME) -major $(GL_MAJOR) \
99 -minor $(GL_MINOR) -patch $(GL_TINY) -install $(LIBDIR) \
100 $(MKLIB_OPTIONS) $(GL_LIB_DEPS) $(OBJECTS)
101
102
103 # Make the OSMesa library
104 $(LIBDIR)/$(OSMESA_LIB): $(OSMESA_OBJECTS)
105 if [ ${OSMESA_LIB} ] ; then \
106 $(TOP)/bin/mklib -o $(OSMESA_LIB_NAME) -major $(MESA_MAJOR) \
107 -minor $(MESA_MINOR) -patch $(GL_TINY) -L$(LIBDIR) \
108 -l$(GL_LIB_NAME) $(OSMESA_LIB_DEPS) \
109 -install $(LIBDIR) \
110 $(MKLIB_OPTIONS) $(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