1 # src/gallium/targets/egl/Makefile
3 # This is the Makefile for EGL Gallium driver package. The package consists of
5 # egl_gallium.so - EGL driver
6 # pipe_<HW>.so - pipe drivers
7 # st_<API>.so - client API state trackers
9 # The following variables are examined
11 # EGL_PLATFORMS - platforms to support
12 # GALLIUM_WINSYS_DIRS - pipe drivers to support
13 # EGL_CLIENT_APIS - state trackers to support
17 include $(TOP
)/configs
/current
24 -I
$(TOP
)/src
/gallium
/auxiliary \
25 -I
$(TOP
)/src
/gallium
/drivers \
26 -I
$(TOP
)/src
/gallium
/include \
27 -I
$(TOP
)/src
/gallium
/winsys
30 $(TOP
)/src
/gallium
/drivers
/identity
/libidentity.a \
31 $(TOP
)/src
/gallium
/drivers
/trace
/libtrace.a \
32 $(TOP
)/src
/gallium
/drivers
/rbug
/librbug.a \
33 $(GALLIUM_AUXILIARIES
)
37 -I
$(TOP
)/src
/gallium
/state_trackers
/egl \
38 -I
$(TOP
)/src
/egl
/main \
39 -DPIPE_PREFIX
=\"$(PIPE_PREFIX
)\" -DST_PREFIX
=\"$(ST_PREFIX
)\"
40 egl_SYS
:= -lm
$(DLOPEN_LIBS
) -L
$(TOP
)/$(LIB_DIR
) -lEGL
41 egl_LIBS
:= $(TOP
)/src
/gallium
/state_trackers
/egl
/libegl.a
43 ifneq ($(findstring x11
, $(EGL_PLATFORMS
)),)
44 egl_SYS
+= -lX11
-lXext
-lXfixes
45 egl_LIBS
+= $(TOP
)/src
/gallium
/winsys
/sw
/xlib
/libws_xlib.a
47 ifneq ($(findstring kms
, $(EGL_PLATFORMS
)),)
50 ifneq ($(findstring fbdev
, $(EGL_PLATFORMS
)),)
51 egl_LIBS
+= $(TOP
)/src
/gallium
/winsys
/sw
/fbdev
/libfbdev.a
54 # EGL_RENDERABLE_TYPE is a compile time attribute
55 egl_CPPFLAGS
+= $(API_DEFINES
)
56 ifneq ($(filter $(GL_LIB
), $(EGL_CLIENT_APIS
)),)
57 egl_CPPFLAGS
+= -DFEATURE_GL
=1
59 ifneq ($(filter $(GLESv1_CM_LIB
), $(EGL_CLIENT_APIS
)),)
60 egl_CPPFLAGS
+= -DFEATURE_ES1
=1
62 ifneq ($(filter $(GLESv2_LIB
), $(EGL_CLIENT_APIS
)),)
63 egl_CPPFLAGS
+= -DFEATURE_ES2
=1
65 ifneq ($(filter $(VG_LIB
), $(EGL_CLIENT_APIS
)),)
66 egl_CPPFLAGS
+= -DFEATURE_VG
=1
68 egl_CPPFLAGS
:= $(sort $(egl_CPPFLAGS
))
72 i915_SYS
:= -ldrm_intel
74 $(TOP
)/src
/gallium
/winsys
/i915
/drm
/libi915drm.a \
75 $(TOP
)/src
/gallium
/drivers
/i915
/libi915.a
79 i965_SYS
:= -ldrm_intel
81 $(TOP
)/src
/gallium
/winsys
/i965
/drm
/libi965drm.a \
82 $(TOP
)/src
/gallium
/drivers
/i965
/libi965.a
86 nouveau_SYS
:= -ldrm_nouveau
88 $(TOP
)/src
/gallium
/winsys
/nouveau
/drm
/libnouveaudrm.a \
89 $(TOP
)/src
/gallium
/drivers
/nvfx
/libnvfx.a \
90 $(TOP
)/src
/gallium
/drivers
/nv50
/libnv50.a \
91 $(TOP
)/src
/gallium
/drivers
/nouveau
/libnouveau.a
95 r300_SYS
:= -ldrm
-ldrm_radeon
97 $(TOP
)/src
/gallium
/winsys
/radeon
/drm
/libradeonwinsys.a \
98 $(TOP
)/src
/gallium
/drivers
/r300
/libr300.a
102 r600_SYS
:= -ldrm
-ldrm_radeon
104 $(TOP
)/src
/gallium
/winsys
/r600
/drm
/libr600winsys.a \
105 $(TOP
)/src
/gallium
/drivers
/r600
/libr600.a
111 $(TOP
)/src
/gallium
/winsys
/svga
/drm
/libsvgadrm.a \
112 $(TOP
)/src
/gallium
/drivers
/svga
/libsvga.a
114 # swrast (pseudo) pipe driver
115 swrast_CPPFLAGS
:= -DGALLIUM_SOFTPIPE
-DGALLIUM_RBUG
-DGALLIUM_TRACE
117 swrast_LIBS
:= $(TOP
)/src
/gallium
/drivers
/softpipe
/libsoftpipe.a
120 ifeq ($(MESA_LLVM
),1)
121 common_SYS
+= $(LLVM_LIBS
)
122 swrast_CPPFLAGS
+= -DGALLIUM_LLVMPIPE
123 swrast_LIBS
+= $(TOP
)/src
/gallium
/drivers
/llvmpipe
/libllvmpipe.a
124 LDFLAGS
+= $(LLVM_LDFLAGS
)
127 # OpenGL state tracker
128 GL_CPPFLAGS
:= -I
$(TOP
)/src
/mesa
$(API_DEFINES
)
129 GL_SYS
:= $(DRI_LIB_DEPS
) -L
$(TOP
)/$(LIB_DIR
) -l
$(GL_LIB
)
130 GL_LIBS
:= $(TOP
)/src
/mesa
/libmesagallium.a
132 # OpenGL ES 1.x state tracker
133 GLESv1_CM_CPPFLAGS
:= -I
$(TOP
)/src
/mesa
134 GLESv1_CM_SYS
:= $(DRI_LIB_DEPS
) -L
$(TOP
)/$(LIB_DIR
) -l
$(GLESv1_CM_LIB
)
135 GLESv1_CM_LIBS
:= $(TOP
)/src
/mesa
/libes1gallium.a
137 # OpenGL ES 2.x state tracker
138 GLESv2_CPPFLAGS
:= -I
$(TOP
)/src
/mesa
139 GLESv2_SYS
:= $(DRI_LIB_DEPS
) -L
$(TOP
)/$(LIB_DIR
) -l
$(GLESv2_LIB
)
140 GLESv2_LIBS
:= $(TOP
)/src
/mesa
/libes2gallium.a
142 # OpenVG state tracker
143 OpenVG_CPPFLAGS
:= -I
$(TOP
)/src
/gallium
/state_trackers
/vega
144 OpenVG_SYS
:= -lm
-L
$(TOP
)/$(LIB_DIR
) -l
$(VG_LIB
)
145 OpenVG_LIBS
:= $(TOP
)/src
/gallium
/state_trackers
/vega
/libvega.a
148 OUTPUT_PATH
:= $(TOP
)/$(LIB_DIR
)/egl
150 # determine the outputs
151 ifneq ($(findstring i915
/drm
,$(GALLIUM_WINSYS_DIRS
)),)
154 ifneq ($(findstring i965
/drm
,$(GALLIUM_WINSYS_DIRS
)),)
157 ifneq ($(findstring nouveau
/drm
,$(GALLIUM_WINSYS_DIRS
)),)
160 ifneq ($(findstring radeon
/drm
,$(GALLIUM_WINSYS_DIRS
)),)
163 ifneq ($(findstring r600
/drm
,$(GALLIUM_WINSYS_DIRS
)),)
166 ifneq ($(findstring svga
/drm
,$(GALLIUM_WINSYS_DIRS
)),)
170 OUTPUTS
:= $(addprefix $(PIPE_PREFIX
), $(OUTPUTS
))
172 # EGL driver and state trackers
173 OUTPUTS
+= egl_gallium
$(addprefix $(ST_PREFIX
), $(EGL_CLIENT_APIS
))
175 OUTPUTS
:= $(addsuffix .so
, $(OUTPUTS
))
176 OUTPUTS
:= $(addprefix $(OUTPUT_PATH
)/, $(OUTPUTS
))
181 $(MKLIB
) -o
$(notdir $@
) -noprefix
-linker
'$(CC)' -ldflags '$(LDFLAGS)' \
182 -install $(OUTPUT_PATH
) $(MKLIB_OPTIONS
) $< \
183 -Wl
,--start-group
$(common_LIBS
) $($(1)_LIBS
) -Wl
,--end-group \
184 $(common_SYS
) $($(1)_SYS
)
188 $(OUTPUT_PATH
)/egl_gallium.so
: egl.o
$(egl_LIBS
)
192 $(OUTPUT_PATH
)/$(PIPE_PREFIX
)i915.so
: pipe_i915.o
$(i915_LIBS
)
195 $(OUTPUT_PATH
)/$(PIPE_PREFIX
)i965.so
: pipe_i965.o
$(i965_LIBS
)
198 $(OUTPUT_PATH
)/$(PIPE_PREFIX
)nouveau.so
: pipe_nouveau.o
$(nouveau_LIBS
)
199 $(call mklib
,nouveau
)
201 $(OUTPUT_PATH
)/$(PIPE_PREFIX
)r300.so
: pipe_r300.o
$(r300_LIBS
)
204 $(OUTPUT_PATH
)/$(PIPE_PREFIX
)r600.so
: pipe_r600.o
$(r600_LIBS
)
207 $(OUTPUT_PATH
)/$(PIPE_PREFIX
)vmwgfx.so
: pipe_vmwgfx.o
$(vmwgfx_LIBS
)
210 $(OUTPUT_PATH
)/$(PIPE_PREFIX
)swrast.so
: pipe_swrast.o
$(swrast_LIBS
)
214 $(OUTPUT_PATH
)/$(ST_PREFIX
)$(GL_LIB
).so
: st_GL.o
$(GL_LIBS
)
217 $(OUTPUT_PATH
)/$(ST_PREFIX
)$(GLESv1_CM_LIB
).so
: st_GLESv1_CM.o
$(GLESv1_CM_LIBS
)
218 $(call mklib
,GLESv1_CM
)
220 $(OUTPUT_PATH
)/$(ST_PREFIX
)$(GLESv2_LIB
).so
: st_GLESv2.o
$(GLESv2_LIBS
)
223 $(OUTPUT_PATH
)/$(ST_PREFIX
)$(VG_LIB
).so
: st_OpenVG.o
$(OpenVG_LIBS
)
227 $(CC
) -c
-o
$@
$< $(common_CPPFLAGS
) $(egl_CPPFLAGS
) $(DEFINES
) $(CFLAGS
)
230 $(CC
) -c
-o
$@
$< $(common_CPPFLAGS
) $($*_CPPFLAGS
) $(DEFINES
) $(CFLAGS
)
233 $(CC
) -c
-o
$@
$< $(common_CPPFLAGS
) $($*_CPPFLAGS
) $(DEFINES
) $(CFLAGS
)
236 $(INSTALL
) -d
$(DESTDIR
)$(EGL_DRIVER_INSTALL_DIR
)
237 for out in
$(OUTPUTS
); do \
238 $(MINSTALL
) -m
755 "$$out" $(DESTDIR
)$(EGL_DRIVER_INSTALL_DIR
); \