1 # src/gallium/targets/egl-static/Makefile
3 # This is Makefile for egl_gallium.so. It is static in that all state trackers
4 # and pipe drivers are linked statically when possible.
6 # The following variables are examined
8 # EGL_PLATFORMS - platforms to support
9 # EGL_CLIENT_APIS - state trackers to support
10 # GALLIUM_WINSYS_DIRS - pipe drivers to support
11 # SHARED_GLAPI - st/mesa can be statically linked or not
15 include $(TOP
)/configs
/current
17 OUTPUTS
:= egl_gallium
21 -I
$(TOP
)/src
/gallium
/auxiliary \
22 -I
$(TOP
)/src
/gallium
/drivers \
23 -I
$(TOP
)/src
/gallium
/include \
24 -I
$(TOP
)/src
/gallium
/winsys
26 $(TOP
)/src
/gallium
/drivers
/identity
/libidentity.a \
27 $(TOP
)/src
/gallium
/drivers
/trace
/libtrace.a \
28 $(TOP
)/src
/gallium
/drivers
/rbug
/librbug.a \
29 $(GALLIUM_AUXILIARIES
)
37 egl_OBJECTS
:= $(egl_SOURCES
:%.c
=%.o
)
41 -I
$(TOP
)/src
/gallium
/state_trackers
/egl \
42 -I
$(TOP
)/src
/egl
/main \
44 egl_LIBS
+= $(TOP
)/src
/gallium
/state_trackers
/egl
/libegl.a
45 egl_SYS
+= $(LIBUDEV_LIBS
) $(DLOPEN_LIBS
) -lEGL
-lm
-lpthread
48 ifneq ($(findstring x11
, $(EGL_PLATFORMS
)),)
49 egl_CPPFLAGS
+= $(LIBDRM_CFLAGS
)
50 egl_LIBS
+= $(TOP
)/src
/gallium
/winsys
/sw
/xlib
/libws_xlib.a
51 egl_SYS
+= -lX11
-lXext
-lXfixes
$(LIBDRM_LIB
)
53 ifneq ($(findstring wayland
, $(EGL_PLATFORMS
)),)
54 egl_CPPFLAGS
+= $(LIBDRM_CFLAGS
)
55 egl_LIBS
+= $(TOP
)/src
/gallium
/winsys
/sw
/wayland
/libws_wayland.a
56 egl_LIBS
+= $(TOP
)/src
/egl
/wayland
/wayland-drm
/libwayland-drm.a
57 egl_SYS
+= $(LIBDRM_LIB
) $(WAYLAND_LIBS
)
59 ifneq ($(findstring drm
, $(EGL_PLATFORMS
)),)
60 egl_CPPFLAGS
+= $(LIBDRM_CFLAGS
)
61 egl_SYS
+= $(LIBDRM_LIB
) -lgbm
63 ifneq ($(findstring fbdev
, $(EGL_PLATFORMS
)),)
64 egl_LIBS
+= $(TOP
)/src
/gallium
/winsys
/sw
/fbdev
/libfbdev.a
68 ifneq ($(filter $(GL_LIB
), $(EGL_CLIENT_APIS
)),)
69 egl_CPPFLAGS
+= -I
$(TOP
)/src
/mesa
$(API_DEFINES
)
70 # make st/mesa built-in when there is a single glapi provider
71 ifeq ($(SHARED_GLAPI
),1)
72 egl_LIBS
+= $(TOP
)/src
/mesa
/libmesagallium.a
73 egl_SYS
+= -lm
-lpthread
$(DLOPEN_LIBS
) -l
$(GLAPI_LIB
)
75 egl_CPPFLAGS
+= -D_EGL_EXTERNAL_GL
=1
81 ifneq ($(filter $(VG_LIB
), $(EGL_CLIENT_APIS
)),)
82 egl_CPPFLAGS
+= -I
$(TOP
)/src
/gallium
/state_trackers
/vega
-DFEATURE_VG
=1
83 egl_LIBS
+= $(TOP
)/src
/gallium
/state_trackers
/vega
/libvega.a
84 egl_SYS
+= -lm
-l
$(VG_LIB
)
88 ifneq ($(findstring i915
/drm
,$(GALLIUM_WINSYS_DIRS
)),)
89 egl_CPPFLAGS
+= -D_EGL_PIPE_I915
=1
91 $(TOP
)/src
/gallium
/winsys
/i915
/drm
/libi915drm.a \
92 $(TOP
)/src
/gallium
/drivers
/i915
/libi915.a
93 egl_SYS
+= -ldrm_intel
97 ifneq ($(findstring i965
/drm
,$(GALLIUM_WINSYS_DIRS
)),)
98 egl_CPPFLAGS
+= -D_EGL_PIPE_I995
=1
100 $(TOP
)/src
/gallium
/winsys
/i965
/drm
/libi965drm.a \
101 $(TOP
)/src
/gallium
/drivers
/i965
/libi965.a \
102 $(TOP
)/src
/gallium
/winsys
/sw
/wrapper
/libwsw.a
103 egl_SYS
+= -ldrm_intel
107 ifneq ($(findstring nouveau
/drm
,$(GALLIUM_WINSYS_DIRS
)),)
108 egl_CPPFLAGS
+= -D_EGL_PIPE_NOUVEAU
=1
110 $(TOP
)/src
/gallium
/winsys
/nouveau
/drm
/libnouveaudrm.a \
111 $(TOP
)/src
/gallium
/drivers
/nvfx
/libnvfx.a \
112 $(TOP
)/src
/gallium
/drivers
/nv50
/libnv50.a \
113 $(TOP
)/src
/gallium
/drivers
/nvc0
/libnvc0.a \
114 $(TOP
)/src
/gallium
/drivers
/nouveau
/libnouveau.a
115 egl_SYS
+= -ldrm_nouveau
119 ifneq ($(findstring radeon
/drm
,$(GALLIUM_WINSYS_DIRS
)),)
120 egl_CPPFLAGS
+= -D_EGL_PIPE_R300
=1
122 $(TOP
)/src
/gallium
/winsys
/radeon
/drm
/libradeonwinsys.a \
123 $(TOP
)/src
/gallium
/drivers
/r300
/libr300.a
124 egl_SYS
+= -ldrm_radeon
128 ifneq ($(findstring r600
/drm
,$(GALLIUM_WINSYS_DIRS
)),)
129 egl_CPPFLAGS
+= -D_EGL_PIPE_R600
=1
131 $(TOP
)/src
/gallium
/winsys
/r600
/drm
/libr600winsys.a \
132 $(TOP
)/src
/gallium
/drivers
/r600
/libr600.a
133 egl_SYS
+= -ldrm_radeon
137 ifneq ($(findstring svga
/drm
,$(GALLIUM_WINSYS_DIRS
)),)
138 egl_CPPFLAGS
+= -D_EGL_PIPE_VMWGFX
=1
140 $(TOP
)/src
/gallium
/winsys
/svga
/drm
/libsvgadrm.a \
141 $(TOP
)/src
/gallium
/drivers
/svga
/libsvga.a
145 ifneq ($(findstring softpipe
,$(GALLIUM_DRIVERS_DIRS
)),)
146 egl_CPPFLAGS
+= -DGALLIUM_SOFTPIPE
-DGALLIUM_RBUG
-DGALLIUM_TRACE
147 egl_LIBS
+= $(TOP
)/src
/gallium
/drivers
/softpipe
/libsoftpipe.a
152 ifneq ($(findstring llvmpipe
,$(GALLIUM_DRIVERS_DIRS
)),)
153 egl_CPPFLAGS
+= -DGALLIUM_LLVMPIPE
154 egl_LIBS
+= $(TOP
)/src
/gallium
/drivers
/llvmpipe
/libllvmpipe.a
157 # sort to remove duplicates
158 egl_CPPFLAGS
:= $(sort $(egl_CPPFLAGS
))
159 egl_LIBS
:= $(sort $(egl_LIBS
))
160 egl_SYS
:= $(sort $(egl_SYS
))
162 # st_GL, built only when shared glapi is not enabled
163 st_GL_CPPFLAGS
:= -I
$(TOP
)/src
/mesa
-I
$(TOP
)/src
/gallium
/include
164 st_GL_LIBS
:= $(TOP
)/src
/mesa
/libmesagallium.a
$(GALLIUM_AUXILIARIES
)
165 st_GL_SYS
:= -lm
-lpthread
$(DLOPEN_LIBS
)
168 ifeq ($(MESA_LLVM
),1)
169 egl_SYS
+= $(LLVM_LIBS
)
170 LDFLAGS
+= $(LLVM_LDFLAGS
)
172 st_GL_SYS
+= $(LLVM_LIBS
)
175 OUTPUT_PATH
:= $(TOP
)/$(LIB_DIR
)/egl
176 OUTPUTS
:= $(addprefix $(OUTPUT_PATH
)/, $(addsuffix .so
, $(OUTPUTS
)))
180 $(OUTPUT_PATH
)/egl_gallium.so
: $(egl_OBJECTS
) $(egl_LIBS
)
181 $(MKLIB
) -o
$(notdir $@
) -noprefix
-linker
'$(CXX)' \
182 -ldflags '-L$(TOP)/$(LIB_DIR) -Wl,--no-undefined $(LDFLAGS)' \
183 -cplusplus
-install $(OUTPUT_PATH
) $(MKLIB_OPTIONS
) \
184 $(egl_OBJECTS
) -Wl
,--start-group
$(egl_LIBS
) -Wl
,--end-group \
187 $(OUTPUT_PATH
)/st_GL.so
: st_GL.o
$(st_GL_LIBS
)
188 $(MKLIB
) -o
$(notdir $@
) -noprefix
-linker
'$(CXX)' \
189 -ldflags '-L$(TOP)/$(LIB_DIR) $(LDFLAGS)' \
190 -cplusplus
-install $(OUTPUT_PATH
) $(MKLIB_OPTIONS
) \
191 $< -Wl
,--start-group
$(st_GL_LIBS
) -Wl
,--end-group \
194 $(egl_OBJECTS
): %.o
: %.c
195 $(CC
) -c
-o
$@
$< $(egl_CPPFLAGS
) $(DEFINES
) $(CFLAGS
)
198 $(CC
) -c
-o
$@
$< $(st_GL_CPPFLAGS
) $(DEFINES
) $(CFLAGS
)
201 $(INSTALL
) -d
$(DESTDIR
)$(EGL_DRIVER_INSTALL_DIR
)
202 for out in
$(OUTPUTS
); do \
203 $(MINSTALL
) -m
755 "$$out" $(DESTDIR
)$(EGL_DRIVER_INSTALL_DIR
); \