OSDN Git Service

mesa: Remove GLES overlay.
[android-x86/external-mesa.git] / src / gallium / targets / egl / Makefile
1 # src/gallium/targets/egl/Makefile
2 #
3 # This is the Makefile for EGL Gallium driver package.  The package consists of
4 #
5 #   egl_gallium.so - EGL driver
6 #   pipe_<HW>.so   - pipe drivers
7 #   st_<API>.so    - client API state trackers
8 #
9 # The following variables are examined
10 #
11 #   EGL_PLATFORMS       - platforms to support
12 #   GALLIUM_WINSYS_DIRS - pipe drivers to support
13 #   EGL_CLIENT_APIS     - state trackers to support
14 #
15
16 TOP = ../../../..
17 include $(TOP)/configs/current
18
19 ST_PREFIX := st_
20 PIPE_PREFIX := pipe_
21
22 common_CPPFLAGS := \
23         -I$(TOP)/include \
24         -I$(TOP)/src/gallium/auxiliary \
25         -I$(TOP)/src/gallium/drivers \
26         -I$(TOP)/src/gallium/include \
27         -I$(TOP)/src/gallium/winsys \
28         $(LIBDRM_CFLAGS)
29
30 common_SYS :=
31 common_LIBS := \
32         $(TOP)/src/gallium/drivers/identity/libidentity.a \
33         $(TOP)/src/gallium/drivers/trace/libtrace.a \
34         $(TOP)/src/gallium/drivers/rbug/librbug.a \
35         $(GALLIUM_AUXILIARIES)
36
37 # EGL driver
38 egl_CPPFLAGS := \
39         -I$(TOP)/src/gallium/state_trackers/egl \
40         -I$(TOP)/src/egl/main \
41         -DPIPE_PREFIX=\"$(PIPE_PREFIX)\" -DST_PREFIX=\"$(ST_PREFIX)\"
42 egl_SYS := -lm $(DLOPEN_LIBS) -lEGL
43 egl_LIBS := $(TOP)/src/gallium/state_trackers/egl/libegl.a
44
45 ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
46 egl_SYS += -lX11 -lXext -lXfixes $(LIBDRM_LIB)
47 egl_LIBS += $(TOP)/src/gallium/winsys/sw/xlib/libws_xlib.a
48 endif
49 ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
50 egl_SYS += $(LIBDRM_LIB)
51 endif
52 ifneq ($(findstring fbdev, $(EGL_PLATFORMS)),)
53 egl_LIBS += $(TOP)/src/gallium/winsys/sw/fbdev/libfbdev.a
54 endif
55
56 # EGL_RENDERABLE_TYPE is a compile time attribute
57 ifneq ($(filter $(GL_LIB), $(EGL_CLIENT_APIS)),)
58 egl_CPPFLAGS += $(API_DEFINES)
59 endif
60 ifneq ($(filter $(VG_LIB), $(EGL_CLIENT_APIS)),)
61 egl_CPPFLAGS += -DFEATURE_VG=1
62 endif
63 egl_CPPFLAGS := $(sort $(egl_CPPFLAGS))
64
65 # i915 pipe driver
66 i915_CPPFLAGS :=
67 i915_SYS := -ldrm_intel
68 i915_LIBS := \
69         $(TOP)/src/gallium/winsys/i915/drm/libi915drm.a \
70         $(TOP)/src/gallium/drivers/i915/libi915.a
71
72 # i965 pipe driver
73 i965_CPPFLAGS :=
74 i965_SYS := -ldrm_intel
75 i965_LIBS := \
76         $(TOP)/src/gallium/winsys/i965/drm/libi965drm.a \
77         $(TOP)/src/gallium/drivers/i965/libi965.a
78
79 # nouveau pipe driver
80 nouveau_CPPFLAGS :=
81 nouveau_SYS := -ldrm_nouveau
82 nouveau_LIBS := \
83         $(TOP)/src/gallium/winsys/nouveau/drm/libnouveaudrm.a \
84         $(TOP)/src/gallium/drivers/nvfx/libnvfx.a \
85         $(TOP)/src/gallium/drivers/nv50/libnv50.a \
86         $(TOP)/src/gallium/drivers/nvc0/libnvc0.a \
87         $(TOP)/src/gallium/drivers/nouveau/libnouveau.a
88
89 # r300 pipe driver
90 r300_CPPFLAGS :=
91 r300_SYS := -ldrm -ldrm_radeon
92 r300_LIBS := \
93         $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
94         $(TOP)/src/gallium/drivers/r300/libr300.a
95
96 # r600 pipe driver
97 r600_CPPFLAGS :=
98 r600_SYS := -ldrm -ldrm_radeon
99 r600_LIBS := \
100         $(TOP)/src/gallium/winsys/r600/drm/libr600winsys.a \
101         $(TOP)/src/gallium/drivers/r600/libr600.a
102
103 # vmwgfx pipe driver
104 vmwgfx_CPPFLAGS :=
105 vmwgfx_SYS :=
106 vmwgfx_LIBS := \
107         $(TOP)/src/gallium/winsys/svga/drm/libsvgadrm.a \
108         $(TOP)/src/gallium/drivers/svga/libsvga.a
109
110 # swrast (pseudo) pipe driver
111 swrast_CPPFLAGS := -DGALLIUM_SOFTPIPE -DGALLIUM_RBUG -DGALLIUM_TRACE
112 swrast_SYS := -lm
113 swrast_LIBS := $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a
114
115 # LLVM
116 ifeq ($(MESA_LLVM),1)
117 common_SYS += $(LLVM_LIBS)
118 swrast_CPPFLAGS += -DGALLIUM_LLVMPIPE
119 swrast_LIBS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
120 LDFLAGS += $(LLVM_LDFLAGS)
121 endif
122
123 # OpenGL state tracker
124 GL_CPPFLAGS := -I$(TOP)/src/mesa $(API_DEFINES)
125 # cannot not link to $(GL_LIB) as the app might want GLES
126 GL_SYS := $(DRI_LIB_DEPS)
127 GL_LIBS := $(TOP)/src/mesa/libmesagallium.a
128
129 # OpenVG state tracker
130 OpenVG_CPPFLAGS := -I$(TOP)/src/gallium/state_trackers/vega
131 OpenVG_SYS := -lm -l$(VG_LIB)
132 OpenVG_LIBS := $(TOP)/src/gallium/state_trackers/vega/libvega.a
133
134
135 OUTPUT_PATH := $(TOP)/$(LIB_DIR)/egl
136
137 # determine the outputs
138 ifneq ($(findstring i915/drm,$(GALLIUM_WINSYS_DIRS)),)
139 OUTPUTS += i915
140 endif
141 ifneq ($(findstring i965/drm,$(GALLIUM_WINSYS_DIRS)),)
142 OUTPUTS += i965
143 endif
144 ifneq ($(findstring nouveau/drm,$(GALLIUM_WINSYS_DIRS)),)
145 OUTPUTS += nouveau
146 endif
147 ifneq ($(findstring radeon/drm,$(GALLIUM_WINSYS_DIRS)),)
148 OUTPUTS += r300
149 endif
150 ifneq ($(findstring r600/drm,$(GALLIUM_WINSYS_DIRS)),)
151 OUTPUTS += r600
152 endif
153 ifneq ($(findstring svga/drm,$(GALLIUM_WINSYS_DIRS)),)
154 OUTPUTS += vmwgfx
155 endif
156 OUTPUTS += swrast
157 OUTPUTS := $(addprefix $(PIPE_PREFIX), $(OUTPUTS))
158
159 # EGL driver and state trackers
160 OUTPUTS += egl_gallium $(addprefix $(ST_PREFIX), $(EGL_CLIENT_APIS))
161
162 OUTPUTS := $(addsuffix .so, $(OUTPUTS))
163 OUTPUTS := $(addprefix $(OUTPUT_PATH)/, $(OUTPUTS))
164
165 default: $(OUTPUTS)
166
167 define mklib
168 $(MKLIB) -o $(notdir $@) -noprefix -linker '$(CC)' \
169         -L$(TOP)/$(LIB_DIR) -ldflags '$(LDFLAGS)' \
170         -install $(OUTPUT_PATH) $(MKLIB_OPTIONS) $< \
171         -Wl,--start-group $(common_LIBS) $($(1)_LIBS) -Wl,--end-group \
172         $(common_SYS) $($(1)_SYS)
173 endef
174
175 define mklib-cxx
176 $(MKLIB) -o $(notdir $@) -noprefix -linker '$(CXX)' \
177         -L$(TOP)/$(LIB_DIR) -ldflags '$(LDFLAGS)' \
178         -cplusplus -install $(OUTPUT_PATH) $(MKLIB_OPTIONS) $< \
179         -Wl,--start-group $(common_LIBS) $($(1)_LIBS) -Wl,--end-group \
180         $(common_SYS) $($(1)_SYS)
181 endef
182
183 # EGL driver
184 $(OUTPUT_PATH)/egl_gallium.so: egl.o $(egl_LIBS)
185         $(call mklib,egl)
186
187 # pipe drivers
188 $(OUTPUT_PATH)/$(PIPE_PREFIX)i915.so: pipe_i915.o $(i915_LIBS)
189         $(call mklib,i915)
190
191 $(OUTPUT_PATH)/$(PIPE_PREFIX)i965.so: pipe_i965.o $(i965_LIBS)
192         $(call mklib,i965)
193
194 $(OUTPUT_PATH)/$(PIPE_PREFIX)nouveau.so: pipe_nouveau.o $(nouveau_LIBS)
195         $(call mklib,nouveau)
196
197 $(OUTPUT_PATH)/$(PIPE_PREFIX)r300.so: pipe_r300.o $(r300_LIBS)
198         $(call mklib,r300)
199
200 $(OUTPUT_PATH)/$(PIPE_PREFIX)r600.so: pipe_r600.o $(r600_LIBS)
201         $(call mklib,r600)
202
203 $(OUTPUT_PATH)/$(PIPE_PREFIX)vmwgfx.so: pipe_vmwgfx.o $(vmwgfx_LIBS)
204         $(call mklib,vmwgfx)
205
206 $(OUTPUT_PATH)/$(PIPE_PREFIX)swrast.so: pipe_swrast.o $(swrast_LIBS)
207         $(call mklib,swrast)
208
209 # state trackers
210 $(OUTPUT_PATH)/$(ST_PREFIX)$(GL_LIB).so: st_GL.o $(GL_LIBS)
211         $(call mklib-cxx,GL)
212
213 $(OUTPUT_PATH)/$(ST_PREFIX)$(VG_LIB).so: st_OpenVG.o $(OpenVG_LIBS)
214         $(call mklib,OpenVG)
215
216 egl.o: egl.c
217         $(CC) -c -o $@ $< $(common_CPPFLAGS) $(egl_CPPFLAGS) $(DEFINES) $(CFLAGS)
218
219 pipe_%.o: pipe_%.c
220         $(CC) -c -o $@ $< $(common_CPPFLAGS) $($*_CPPFLAGS) $(DEFINES) $(CFLAGS)
221
222 st_%.o: st_%.c
223         $(CC) -c -o $@ $< $(common_CPPFLAGS) $($*_CPPFLAGS) $(DEFINES) $(CFLAGS)
224
225 install: $(OUTPUTS)
226         $(INSTALL) -d $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR)
227         for out in $(OUTPUTS); do \
228                 $(MINSTALL) -m 755 "$$out" $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR); \
229         done
230
231 clean:
232         rm -f *.o