Merge branch 'nouveau-gallium-0.1' into darktama-gallium-0.1
[mesa.git] / src / mesa / Makefile
1 # src/mesa/Makefile
2
3 TOP = ../..
4 include $(TOP)/configs/current
5
6 include sources
7
8
9 GL_MAJOR = 1
10 GL_MINOR = 5
11 GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
12
13
14 SOFTPIPE_LIB = $(TOP)/src/mesa/pipe/softpipe/libsoftpipe.a
15
16 ifeq ($(CONFIG_NAME), linux-cell)
17 CELL_LIB = $(TOP)/src/mesa/pipe/cell/ppu/libcell.a
18 CELL_LIB_SPU = $(TOP)/src/mesa/pipe/cell/spu/g3d_spu.a
19 endif
20
21
22 .SUFFIXES : .cpp
23
24 .c.o:
25 $(CC) -c $(LLVM_CFLAGS) $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
26
27 .cpp.o:
28 $(CXX) -c $(LLVM_CXXFLAGS) $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@
29
30 .S.o:
31 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
32
33
34 # Figure out what to make here
35 default:
36 @if [ "${DRIVER_DIRS}" = "dri" ] ; then \
37 $(MAKE) linux-solo ; \
38 elif [ "${DRIVER_DIRS}" = "osmesa" ] ; then \
39 $(MAKE) osmesa-only ; \
40 elif [ "$(DRIVER_DIRS)" = "beos" ]; then \
41 $(MAKE) beos ; \
42 elif [ "$(DRIVER_DIRS)" = "directfb" ]; then \
43 $(MAKE) directfb ; \
44 elif [ "$(DRIVER_DIRS)" = "fbdev osmesa" ]; then \
45 $(MAKE) fbdev ; $(MAKE) osmesa-only ; \
46 else \
47 $(MAKE) stand-alone ; \
48 fi
49
50
51 ######################################################################
52 # BeOS driver target
53
54 beos: depend subdirs libmesa.a
55 cd drivers/beos; $(MAKE)
56
57
58 ######################################################################
59 # Linux DRI drivers
60
61 # Make archive of core object files
62 libmesa.a: $(SOLO_OBJECTS)
63 @ $(TOP)/bin/mklib -o mesa -static $(SOLO_OBJECTS);
64 @if [ "${CONFIG_NAME}" = "beos" ] ; then \
65 mimeset -f "$@" ; \
66 fi
67
68 linux-solo: depend subdirs libmesa.a
69 cd drivers/dri ; $(MAKE)
70
71
72 #####################################################################
73 # Stand-alone Mesa libGL, no built-in drivers (DirectFB)
74
75 libgl-core: $(CORE_OBJECTS)
76 @ $(TOP)/bin/mklib -o $(GL_LIB) \
77 -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
78 -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(CORE_OBJECTS) \
79 $(GL_LIB_DEPS)
80
81 directfb: depend subdirs libgl-core
82 cd drivers/directfb ; $(MAKE)
83
84
85 #####################################################################
86 # fbdev Mesa driver (libGL.so)
87
88 fbdev: $(CORE_OBJECTS) $(FBDEV_DRIVER_OBJECTS) $(COMMON_DRIVER_OBJECTS)
89 @ $(TOP)/bin/mklib -o $(GL_LIB) \
90 -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
91 -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
92 $(CORE_OBJECTS) $(FBDEV_DRIVER_OBJECTS) \
93 $(COMMON_DRIVER_OBJECTS) $(GL_LIB_DEPS)
94
95
96 ######################################################################
97 # Stand-alone Mesa libGL and libOSMesa
98 STAND_ALONE_DRIVER_SOURCES = \
99 $(COMMON_DRIVER_SOURCES) \
100 $(X11_DRIVER_SOURCES)
101
102 STAND_ALONE_DRIVER_OBJECTS = $(STAND_ALONE_DRIVER_SOURCES:.c=.o)
103
104 STAND_ALONE_OBJECTS = \
105 $(CORE_OBJECTS) \
106 $(STAND_ALONE_DRIVER_OBJECTS)
107
108 # For libOSMesa16 or libOSMesa32 we link _all_ the objects into the library,
109 # not just the osmesa.o object (i.e. we don't have a libGL).
110 OSMESA16_OBJECTS = \
111 $(CORE_OBJECTS) \
112 $(COMMON_DRIVER_OBJECTS) \
113 $(OSMESA_DRIVER_OBJECTS)
114
115
116 stand-alone: depend subdirs $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)
117
118 osmesa-only: depend subdirs $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)
119
120 # Make the GL library
121 $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(STAND_ALONE_OBJECTS) $(SOFTPIPE_LIB) $(CELL_LIB) $(CELL_LIB_SPU)
122 @ $(TOP)/bin/mklib -o $(GL_LIB) \
123 -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \
124 -install $(TOP)/$(LIB_DIR) \
125 $(MKLIB_OPTIONS) $(STAND_ALONE_OBJECTS) \
126 $(SOFTPIPE_LIB) $(CELL_LIB) $(CELL_LIB_SPU) $(GL_LIB_DEPS)
127
128 # Make the OSMesa library
129 $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OSMESA_DRIVER_OBJECTS) $(OSMESA16_OBJECTS)
130 @ if [ "${DRIVER_DIRS}" = "osmesa" ] ; then \
131 $(TOP)/bin/mklib -o $(OSMESA_LIB) \
132 -major $(MESA_MAJOR) \
133 -minor $(MESA_MINOR) -patch $(MESA_TINY) \
134 -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
135 $(OSMESA_LIB_DEPS) $(OSMESA16_OBJECTS) ; \
136 else \
137 $(TOP)/bin/mklib -o $(OSMESA_LIB) \
138 -major $(MESA_MAJOR) \
139 -minor $(MESA_MINOR) -patch $(GL_TINY) \
140 -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
141 $(OSMESA_LIB_DEPS) $(OSMESA_DRIVER_OBJECTS) ; \
142 fi
143
144
145 ######################################################################
146 # Generic stuff
147
148 depend: $(ALL_SOURCES)
149 @ echo "running $(MKDEP)"
150 @ rm -f depend # workaround oops on gutsy?!?
151 @ touch depend
152 @ $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(ALL_SOURCES) \
153 > /dev/null 2>/dev/null
154
155
156 subdirs:
157 @ (cd x86 ; $(MAKE))
158 @ (cd x86-64 ; $(MAKE))
159 (cd pipe ; $(MAKE))
160
161 install: default
162 $(INSTALL) -d $(INSTALL_DIR)/include/GL
163 $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR)
164 $(INSTALL) -m 644 $(TOP)/include/GL/*.h $(INSTALL_DIR)/include/GL
165 @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \
166 $(INSTALL) $(TOP)/$(LIB_DIR)/libGL* $(INSTALL_DIR)/$(LIB_DIR); \
167 fi
168 @if [ -e $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) ]; then \
169 $(INSTALL) $(TOP)/$(LIB_DIR)/libOSMesa* $(INSTALL_DIR)/$(LIB_DIR); \
170 fi
171 @if [ "${DRIVER_DIRS}" = "dri" ] ; then \
172 cd drivers/dri ; $(MAKE) install ; \
173 fi
174
175 ## NOT INSTALLED YET:
176 ## $(INSTALL) -d $(INSTALL_DIR)/include/GLES
177 ## $(INSTALL) -m 644 include/GLES/*.h $(INSTALL_DIR)/include/GLES
178
179
180 # Emacs tags
181 tags:
182 etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h
183
184 clean:
185 -rm -f */*.o
186 -rm -f */*/*.o
187 -rm -f depend depend.bak libmesa.a
188 -rm -f drivers/*/*.o
189 (cd drivers/dri && $(MAKE) clean)
190 (cd x86 && $(MAKE) clean)
191 (cd x86-64 && $(MAKE) clean)
192 (cd pipe ; $(MAKE) clean )
193
194
195 include depend