This repository has been archived by the owner on Jan 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Makefile.am
270 lines (230 loc) · 7.83 KB
/
Makefile.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
#
# If not stated otherwise in this file or this component's Licenses.txt file the
# following copyright and licenses apply:
#
# Copyright 2016 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
AUTOMAKE_OPTIONS = subdir-objects
SUBDIRS =
BUILT_SOURCES =
AM_CXXFLAGS= \
-I$(top_srcdir)/include \
-I${PKG_CONFIG_SYSROOT_DIR}/$(includedir)/wayland \
$(WAYLAND_CLIENT_CFLAGS) $(WAYLAND_SERVER_CFLAGS) \
$(XKBCOMMON_CFLAGS)
AM_LDFLAGS=$(WAYLANDLIB)
## --- Configurtion -------
if ENABLE_PLATFORM_EMBEDDED
AM_CXXFLAGS += -DWESTEROS_PLATFORM_EMBEDDED
endif
if ENABLE_ESSOS
SUBDIRS += essos
endif
# add required modules sub directory here
if ENABLE_MODULES
SUBDIRS += drm/modules
endif
if HAVE_EGL
AM_CXXFLAGS += ${EGL_CFLAGS}
endif
if HAVE_WAYLAND_EGL
AM_CXXFLAGS += -DWESTEROS_HAVE_WAYLAND_EGL
WSTEGL_LIBS= -lwayland-egl -lGLESv2
else
WSTEGL_LIBS= -lwesteros_egl
endif
if ENABLE_WESTEROS_SBPROTOCOL
AM_CXXFLAGS += -DENABLE_SBPROTOCOL
endif
if ENABLE_WESTEROS_LDBPROTOCOL
AM_CXXFLAGS += -DENABLE_LDBPROTOCOL
AM_CXXFLAGS += -I${PKG_CONFIG_SYSROOT_DIR}/$(includedir)/libdrm
endif
if ENABLE_XDG_V4
AM_CXXFLAGS += -DUSE_XDG_VERSION4 -I$(srcdir)/protocol/version4
endif
if ENABLE_XDG_V5
AM_CXXFLAGS += -DUSE_XDG_VERSION5 -I$(srcdir)/protocol/version5
endif
if ENABLE_XDG_STABLE
AM_CXXFLAGS += -DUSE_XDG_STABLE -I$(srcdir)/protocol/stable
endif
AM_CFLAGS = $(AM_CXXFLAGS) -Wno-deprecated-declarations
if ENABLE_WESTEROS_LDBPROTOCOL
BUILT_SOURCES += libwesteros_linux_dmabuf_server.la
endif
BUILT_SOURCES += libwesteros_compositor.la \
libwesteros_render_embedded.la
if ENABLE_WESTEROS_RENDERERGL
BUILT_SOURCES += libwesteros_render_gl.la
endif
bin_PROGRAMS =
if ENABLE_WESTEROS_APP
bin_PROGRAMS += westeros
endif
if ENABLE_WESTEROS_TEST
bin_PROGRAMS += westeros_test
endif
if ENABLE_WESTEROS_PLAYER
bin_PROGRAMS += westeros_player
endif
## --- Sample compositor app -------
westeros_SOURCES = westeros-main.cpp
westeros_LDFLAGS= \
$(AM_LDFLAGS) \
$(WAYLAND_SERVER_LIBS) \
-lwesteros_compositor
if !ENABLE_PLATFORM_EMBEDDED
westeros_LDFLAGS += -lglut -lGL -lGLEW -lX11 -lEGL
endif
if ENABLE_PLATFORM_EMBEDDED
westeros_LDFLAGS += -lEGL -lwesteros_gl
if HAVE_WAYLAND_EGL
westeros_LDFLAGS += -lGLESv2
endif
endif
## --- Sample client -------
westeros_test_SOURCES = westeros-test.cpp
westeros_test_LDFLAGS= \
$(AM_LDFLAGS) \
$(WAYLAND_CLIENT_LIBS) \
$(XKBCOMMON_LIBS) \
-lxkbcommon \
-lwesteros_simpleshell_client \
$(WSTEGL_LIBS) \
-lEGL
if !ENABLE_PLATFORM_EMBEDDED
westeros_test_LDFLAGS += -lGL -lGLEW
endif
## --- Sample player -------
westeros_player_SOURCES = westeros-player.cpp
westeros_player_CXXFLAGS = $(AM_CXXFLAGS) $(GST_CFLAGS)
westeros_player_LDFLAGS= \
$(AM_LDFLAGS) \
$(GST_LIBS) \
$(WAYLAND_CLIENT_LIBS) \
$(WSTEGL_LIBS) \
-lEGL
## --- Compositor -------
lib_LTLIBRARIES = libwesteros_compositor.la \
libwesteros_render_embedded.la
if ENABLE_WESTEROS_RENDERERGL
lib_LTLIBRARIES += libwesteros_render_gl.la
endif
if ENABLE_WESTEROS_LDBPROTOCOL
lib_LTLIBRARIES += libwesteros_linux_dmabuf_server.la
endif
libwesteros_compositor_la_SOURCES = \
westeros-compositor.cpp \
westeros-nested.cpp \
westeros-render.cpp \
protocol/vpc-protocol.c
libwesteros_compositor_la_include_HEADERS = \
westeros-compositor.h \
westeros-version.h \
westeros-render.h \
protocol/vpc-client-protocol.h
libwesteros_compositor_la_DEPENDENCIES =
libwesteros_compositor_la_includedir = $(includedir)
libwesteros_compositor_la_CXXFLAGS = $(AM_CXXFLAGS) -I$(srcdir)/protocol
libwesteros_compositor_la_LDFLAGS= \
$(AM_LDFLAGS) \
$(WAYLAND_SERVER_LIBS) \
$(WAYLAND_CLIENT_LIBS) \
$(WAYLAND_EGL_LIBS) \
$(XKBCOMMON_LIBS) \
$(WESTEROS_COMPOSITOR_EXTRA_LIBS) \
-lxkbcommon \
-lwesteros_simpleshell_server \
-lpthread \
-ldl
if ENABLE_XDG_V4
libwesteros_compositor_la_SOURCES += protocol/version4/xdg-shell-protocol.c
endif
if ENABLE_XDG_V5
libwesteros_compositor_la_SOURCES += protocol/version5/xdg-shell-protocol.c
endif
if ENABLE_XDG_STABLE
libwesteros_compositor_la_SOURCES += protocol/stable/xdg-shell-protocol.c
endif
if ENABLE_WESTEROS_SBPROTOCOL
libwesteros_compositor_la_LDFLAGS += -lwesteros_simplebuffer_server
endif
if ENABLE_WESTEROS_LDBPROTOCOL
libwesteros_compositor_la_DEPENDENCIES += libwesteros_linux_dmabuf_server.la
libwesteros_compositor_la_LDFLAGS += -lwesteros_linux_dmabuf_server
endif
## --- Renderer: OpenGL -------
libwesteros_render_gl_la_SOURCES = westeros-render-gl.cpp
libwesteros_render_gl_la_includedir = $(includedir)
libwesteros_render_gl_la_DEPENDENCIES =
if !ENABLE_PLATFORM_EMBEDDED
libwesteros_render_gl_la_LDFLAGS= $(WSTEGL_LIBS) -lEGL -lGL -lGLEW $(WAYLAND_SERVER_LIBS)
else
libwesteros_render_gl_la_LDFLAGS= $(WSTEGL_LIBS) -lEGL -lwesteros_gl $(WESTEROS_PLATFORM_LIBS) $(WAYLAND_SERVER_LIBS)
endif
if ENABLE_WESTEROS_SBPROTOCOL
libwesteros_render_gl_la_LDFLAGS += -lwesteros_simplebuffer_server
endif
if ENABLE_WESTEROS_LDBPROTOCOL
libwesteros_render_gl_la_DEPENDENCIES += libwesteros_linux_dmabuf_server.la
libwesteros_render_gl_la_LDFLAGS += -lwesteros_linux_dmabuf_server
endif
## --- Renderer: Embedded -------
libwesteros_render_embedded_la_SOURCES = westeros-render-embedded.cpp
libwesteros_render_embedded_la_DEPENDENCIES =
libwesteros_render_embedded_la_includedir = $(includedir)
if !ENABLE_PLATFORM_EMBEDDED
libwesteros_render_embedded_la_LDFLAGS= -lEGL -lglut -lGL -lGLEW $(WAYLAND_SERVER_LIBS)
else
libwesteros_render_embedded_la_LDFLAGS= $(WSTEGL_LIBS) -lEGL -lwesteros_gl $(WESTEROS_PLATFORM_LIBS) $(WAYLAND_SERVER_LIBS)
endif
if ENABLE_WESTEROS_SBPROTOCOL
libwesteros_render_embedded_la_LDFLAGS += -lwesteros_simplebuffer_server
endif
if ENABLE_WESTEROS_LDBPROTOCOL
libwesteros_render_embedded_la_DEPENDENCIES += libwesteros_linux_dmabuf_server.la
libwesteros_render_embedded_la_LDFLAGS += -lwesteros_linux_dmabuf_server
endif
if ENABLE_WESTEROS_LDBPROTOCOL
## --- Linux dmabuf -------
libwesteros_linux_dmabuf_server_la_SOURCES = linux-dmabuf/westeros-linux-dmabuf.cpp linux-dmabuf/protocol/linux-dmabuf-unstable-v1-protocol.c
libwesteros_linux_dmabuf_server_la_include_HEADERS = linux-dmabuf/westeros-linux-dmabuf.h linux-dmabuf/protocol/linux-dmabuf-unstable-v1-server-protocol.h
libwesteros_linux_dmabuf_server_la_includedir = $(includedir)
libwesteros_linux_dmabuf_server_la_CXXFLAGS = $(AM_CXXFLAGS) \
-I${srcdir}/linux-dmabuf/protocol
libwesteros_linux_dmabuf_server_la_LDFLAGS= \
$(AM_LDFLAGS) \
$(WAYLAND_SERVER_LIBS)
endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = westeros-compositor.pc
distcleancheck_listfiles = *-libtool
## IPK Generation Support
IPK_GEN_PATH = $(abs_top_builddir)/ipk
IPK_GEN_STAGING_DIR=$(abs_top_builddir)/staging_dir
IPK_GEN_INPUT = debian-binary control.tar.gz data.tar.gz
IPK_GEN_OUTPUT = westeros.ipk
package_ipk:
@echo "Generating IPK Package"
$(MAKE) prefix=${abs_top_builddir}/staging_dir install
$(mkdir_p) $(IPK_GEN_STAGING_DIR)/usr/bin/
cp -af $(IPK_GEN_STAGING_DIR)/bin/* $(IPK_GEN_STAGING_DIR)/usr/bin/
tar -czvf $(IPK_GEN_PATH)/data.tar.gz -C $(IPK_GEN_STAGING_DIR) usr
tar -czvf $(IPK_GEN_PATH)/control.tar.gz -C $(IPK_GEN_PATH) control postinst prerm
cd $(IPK_GEN_PATH) && ar cr $(IPK_GEN_OUTPUT) $(IPK_GEN_INPUT) && cd -
rm -rf ${abs_top_builddir}/staging_dir
rm -rf $(abs_top_builddir)/ipk/control.tar.gz
rm -rf $(abs_top_builddir)/ipk/data.tar.gz