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