fix weston launch error
[platform/upstream/weston.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4
2
3 bin_PROGRAMS =
4 noinst_PROGRAMS =
5 libexec_PROGRAMS =
6 moduledir = $(libdir)/weston
7 module_LTLIBRARIES =
8 libweston_moduledir = $(libdir)/libweston-$(LIBWESTON_MAJOR)
9 libweston_module_LTLIBRARIES =
10 noinst_LTLIBRARIES =
11 BUILT_SOURCES =
12
13 AM_DISTCHECK_CONFIGURE_FLAGS = --disable-setuid-install
14
15 EXTRA_DIST = weston.ini.in ivi-shell/weston.ini.in
16
17 weston.ini : $(srcdir)/weston.ini.in
18         $(AM_V_GEN)$(SED) \
19                 -e 's|@bindir[@]|$(bindir)|g' \
20                 -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
21                 -e 's|@libexecdir[@]|$(libexecdir)|g' \
22                 $< > $@
23
24 ivi-shell/weston.ini : $(srcdir)/ivi-shell/weston.ini.in
25         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
26                 -e 's|@bindir[@]|$(bindir)|g' \
27                 -e 's|@libexecdir[@]|$(libexecdir)|g' \
28                 -e 's|@westondatadir[@]|$(westondatadir)|g' \
29                 $< > $@
30
31 all-local : weston.ini ivi-shell/weston.ini
32
33 AM_CFLAGS = $(GCC_CFLAGS)
34
35 AM_CPPFLAGS =                                   \
36         -I$(top_builddir)/libweston             \
37         -I$(top_srcdir)/libweston               \
38         -I$(top_builddir)/clients               \
39         -I$(top_builddir)/tests                 \
40         -I$(top_srcdir)/shared                  \
41         -I$(top_builddir)/protocol              \
42         -DLIBWESTON_MODULEDIR='"$(libweston_moduledir)"' \
43         -DLIBEXECDIR='"$(libexecdir)"'          \
44         -DBINDIR='"$(bindir)"'
45
46 CLEANFILES = weston.ini                         \
47         ivi-shell/weston.ini                    \
48         internal-screenshot-00.png              \
49         $(BUILT_SOURCES)
50
51 # Libtool race fix
52 # libweston-desktop depends on libweston, and desktop-shell depends on both.
53 # This leads to a libtool race at installation, because libtool re-links
54 # everything.
55 # If you add more fixes, you may need a workaround to keep automake generated
56 # targets. See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7328
57 install-libweston_moduleLTLIBRARIES install-moduleLTLIBRARIES: install-libLTLIBRARIES
58
59 lib_LTLIBRARIES = libweston-@LIBWESTON_MAJOR@.la
60 libweston_@LIBWESTON_MAJOR@_la_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON
61 libweston_@LIBWESTON_MAJOR@_la_CFLAGS = $(AM_CFLAGS) \
62         $(COMPOSITOR_CFLAGS) $(EGL_CFLAGS) $(LIBDRM_CFLAGS)
63 libweston_@LIBWESTON_MAJOR@_la_LIBADD = $(COMPOSITOR_LIBS) \
64         $(DL_LIBS) -lm $(CLOCK_GETTIME_LIBS) \
65         $(LIBINPUT_BACKEND_LIBS) libshared.la
66 libweston_@LIBWESTON_MAJOR@_la_LDFLAGS = -version-info $(LT_VERSION_INFO)
67
68 libweston_@LIBWESTON_MAJOR@_la_SOURCES =                        \
69         libweston/git-version.h                         \
70         libweston/log.c                                 \
71         libweston/compositor.c                          \
72         libweston/compositor.h                          \
73         libweston/compositor-drm.h                      \
74         libweston/compositor-fbdev.h                    \
75         libweston/compositor-headless.h                 \
76         libweston/compositor-rdp.h                      \
77         libweston/compositor-wayland.h                  \
78         libweston/compositor-x11.h                      \
79         libweston/input.c                               \
80         libweston/data-device.c                         \
81         libweston/screenshooter.c                       \
82         libweston/touch-calibration.c                   \
83         libweston/clipboard.c                           \
84         libweston/zoom.c                                \
85         libweston/bindings.c                            \
86         libweston/animation.c                           \
87         libweston/noop-renderer.c                       \
88         libweston/pixman-renderer.c                     \
89         libweston/pixman-renderer.h                     \
90         libweston/plugin-registry.c                             \
91         libweston/plugin-registry.h                             \
92         libweston/timeline.c                            \
93         libweston/timeline.h                            \
94         libweston/timeline-object.h                     \
95         libweston/linux-dmabuf.c                        \
96         libweston/linux-dmabuf.h                        \
97         libweston/pixel-formats.c                       \
98         libweston/pixel-formats.h                       \
99         shared/helpers.h                                \
100         shared/matrix.c                                 \
101         shared/matrix.h                                 \
102         shared/timespec-util.h                          \
103         shared/zalloc.h                                 \
104         shared/platform.h                               \
105         shared/weston-egl-ext.h
106
107 lib_LTLIBRARIES += libweston-desktop-@LIBWESTON_MAJOR@.la
108 libweston_desktop_@LIBWESTON_MAJOR@_la_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON
109 libweston_desktop_@LIBWESTON_MAJOR@_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
110 libweston_desktop_@LIBWESTON_MAJOR@_la_LIBADD =         \
111         libweston-@LIBWESTON_MAJOR@.la                  \
112         $(COMPOSITOR_LIBS)
113 libweston_desktop_@LIBWESTON_MAJOR@_la_LDFLAGS = -version-info $(LT_VERSION_INFO)
114
115 libweston_desktop_@LIBWESTON_MAJOR@_la_SOURCES =        \
116         libweston-desktop/client.c                      \
117         libweston-desktop/internal.h                    \
118         libweston-desktop/libweston-desktop.c           \
119         libweston-desktop/libweston-desktop.h           \
120         libweston-desktop/seat.c                        \
121         libweston-desktop/surface.c                     \
122         libweston-desktop/wl-shell.c                    \
123         libweston-desktop/xdg-shell-v6.c                \
124         libweston-desktop/xwayland.c
125
126 nodist_libweston_desktop_@LIBWESTON_MAJOR@_la_SOURCES =         \
127         protocol/xdg-shell-unstable-v6-protocol.c               \
128         protocol/xdg-shell-unstable-v6-server-protocol.h
129
130 BUILT_SOURCES += $(nodist_libweston_desktop_@LIBWESTON_MAJOR@_la_SOURCES)
131
132 libweston-desktop-@LIBWESTON_MAJOR@.la libweston-desktop/libweston_desktop_@LIBWESTON_MAJOR@_la-xdg-shell-v6.lo: protocol/xdg-shell-unstable-v6-server-protocol.h
133
134 if SYSTEMD_NOTIFY_SUPPORT
135 module_LTLIBRARIES += systemd-notify.la
136 systemd_notify_la_LDFLAGS = -module -avoid-version
137 systemd_notify_la_LIBADD = libweston-@LIBWESTON_MAJOR@.la $(SYSTEMD_DAEMON_LIBS)
138 systemd_notify_la_CFLAGS =                      \
139         $(COMPOSITOR_CFLAGS)                    \
140         $(SYSTEMD_DAEMON_CFLAGS)                \
141         $(PIXMAN_CFLAGS)                        \
142         $(AM_CFLAGS)
143 systemd_notify_la_SOURCES =                     \
144         compositor/systemd-notify.c             \
145         shared/helpers.h                        \
146         shared/zalloc.h                         \
147         libweston/compositor.h
148 endif
149
150 nodist_libweston_@LIBWESTON_MAJOR@_la_SOURCES =                         \
151         protocol/weston-screenshooter-protocol.c                        \
152         protocol/weston-screenshooter-server-protocol.h                 \
153         protocol/text-cursor-position-protocol.c        \
154         protocol/text-cursor-position-server-protocol.h \
155         protocol/text-input-unstable-v1-protocol.c                      \
156         protocol/text-input-unstable-v1-server-protocol.h               \
157         protocol/input-method-unstable-v1-protocol.c                    \
158         protocol/input-method-unstable-v1-server-protocol.h             \
159         protocol/presentation-time-protocol.c           \
160         protocol/presentation-time-server-protocol.h    \
161         protocol/viewporter-protocol.c                  \
162         protocol/viewporter-server-protocol.h           \
163         protocol/linux-dmabuf-unstable-v1-protocol.c    \
164         protocol/linux-dmabuf-unstable-v1-server-protocol.h             \
165         protocol/relative-pointer-unstable-v1-protocol.c                \
166         protocol/relative-pointer-unstable-v1-server-protocol.h         \
167         protocol/pointer-constraints-unstable-v1-protocol.c             \
168         protocol/pointer-constraints-unstable-v1-server-protocol.h      \
169         protocol/input-timestamps-unstable-v1-protocol.c                \
170         protocol/input-timestamps-unstable-v1-server-protocol.h         \
171         protocol/weston-touch-calibration-protocol.c                    \
172         protocol/weston-touch-calibration-server-protocol.h
173
174 BUILT_SOURCES += $(nodist_libweston_@LIBWESTON_MAJOR@_la_SOURCES)
175
176 bin_PROGRAMS += weston
177
178 weston_LDFLAGS = -export-dynamic
179 weston_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON            \
180                                  -DMODULEDIR='"$(moduledir)"' \
181                                  -DXSERVER_PATH='"@XSERVER_PATH@"'
182 weston_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBINPUT_BACKEND_CFLAGS)
183 weston_LDADD = libshared.la libweston-@LIBWESTON_MAJOR@.la \
184         $(COMPOSITOR_LIBS) \
185         $(DL_LIBS) $(LIBINPUT_BACKEND_LIBS) \
186         $(CLOCK_GETRES_LIBS) \
187         -lm
188
189 weston_SOURCES =                                        \
190         compositor/main.c                               \
191         compositor/weston-screenshooter.c               \
192         compositor/text-backend.c                       \
193         compositor/xwayland.c
194
195 # Track this dependency explicitly instead of using BUILT_SOURCES.  We
196 # add BUILT_SOURCES to CLEANFILES, but we want to keep git-version.h
197 # in case we're building from tarballs.
198
199 compositor/main.c : $(top_builddir)/libweston/git-version.h
200 libweston/compositor.c : $(top_builddir)/libweston/git-version.h
201
202 noinst_LTLIBRARIES +=                           \
203         libsession-helper.la
204
205 libsession_helper_la_SOURCES =                  \
206         libweston/launcher-util.c               \
207         libweston/launcher-util.h               \
208         libweston/launcher-impl.h               \
209         libweston/weston-launch.h               \
210         libweston/launcher-weston-launch.c      \
211         libweston/launcher-direct.c
212 libsession_helper_la_CFLAGS = $(AM_CFLAGS) $(LIBDRM_CFLAGS) $(PIXMAN_CFLAGS) $(COMPOSITOR_CFLAGS)
213 libsession_helper_la_LIBADD = libweston-@LIBWESTON_MAJOR@.la
214
215 if ENABLE_DRM_COMPOSITOR
216 libsession_helper_la_LIBADD += $(LIBDRM_LIBS)
217 endif
218
219 if ENABLE_DBUS
220 if HAVE_SYSTEMD_LOGIN
221 libsession_helper_la_SOURCES +=                 \
222         libweston/dbus.h                        \
223         libweston/dbus.c                        \
224         libweston/launcher-logind.c
225 libsession_helper_la_CFLAGS += $(SYSTEMD_LOGIN_CFLAGS) $(DBUS_CFLAGS)
226 libsession_helper_la_LIBADD += $(SYSTEMD_LOGIN_LIBS) $(DBUS_LIBS)
227 endif
228 endif
229
230 if HAVE_GIT_REPO
231 libweston/git-version.h : $(top_srcdir)/.git/logs/HEAD
232         $(AM_V_GEN)echo "#define BUILD_ID \"$(shell git --git-dir=$(top_srcdir)/.git describe --always --dirty) $(shell git --git-dir=$(top_srcdir)/.git log -1 --format='%s (%ci)')\"" > $@
233 else
234 libweston/git-version.h :
235         $(AM_V_GEN)echo "#define BUILD_ID \"unknown (not built from git or tarball)\"" > $@
236
237 endif
238
239 .FORCE :
240
241 if BUILD_WESTON_LAUNCH
242 bin_PROGRAMS += weston-launch
243 weston_launch_SOURCES = libweston/weston-launch.c libweston/weston-launch.h
244 weston_launch_CPPFLAGS = -DBINDIR='"$(bindir)"'
245 weston_launch_CFLAGS=                           \
246         $(AM_CFLAGS)                            \
247         $(PAM_CFLAGS)                           \
248         $(SYSTEMD_LOGIN_CFLAGS)                 \
249         $(LIBDRM_CFLAGS)
250 weston_launch_LDADD = $(PAM_LIBS) $(SYSTEMD_LOGIN_LIBS)
251
252 if ENABLE_DRM_COMPOSITOR
253 weston_launch_LDADD += $(LIBDRM_LIBS)
254 endif
255
256 if ENABLE_SETUID_INSTALL
257 install-exec-hook:
258         can_suid_files=no; \
259         chown root $(DESTDIR)$(bindir)/weston-launch \
260                 && chmod u+s $(DESTDIR)$(bindir)/weston-launch \
261                 && can_suid_files=yes;\
262         if test $$can_suid_files = no; then \
263                 echo 'Error: unable to unable to change ownership/setuid on weston-launch.'; \
264                 echo 'To skip this step, re-run ./configure using --disable-setuid-install'; \
265                 false; \
266         fi
267 endif
268
269 endif # BUILD_WESTON_LAUNCH
270
271 pkgconfigdir = $(libdir)/pkgconfig
272 pkgconfig_DATA = \
273         libweston/libweston-${LIBWESTON_MAJOR}.pc \
274         libweston-desktop/libweston-desktop-${LIBWESTON_MAJOR}.pc \
275         compositor/weston.pc
276
277 wayland_sessiondir = $(datadir)/wayland-sessions
278 dist_wayland_session_DATA = compositor/weston.desktop
279
280 libwestonincludedir = $(includedir)/libweston-${LIBWESTON_MAJOR}
281 libwestoninclude_HEADERS =                      \
282         libweston/version.h                     \
283         libweston/compositor.h                  \
284         libweston/compositor-drm.h              \
285         libweston/compositor-fbdev.h            \
286         libweston/compositor-headless.h         \
287         libweston/compositor-rdp.h              \
288         libweston/compositor-wayland.h          \
289         libweston/compositor-x11.h              \
290         libweston/windowed-output-api.h         \
291         libweston/plugin-registry.h             \
292         libweston/timeline-object.h             \
293         shared/matrix.h                         \
294         shared/config-parser.h                  \
295         shared/zalloc.h
296
297 libwestoninclude_HEADERS +=                     \
298         libweston-desktop/libweston-desktop.h
299
300 westonincludedir = $(includedir)/weston
301 westoninclude_HEADERS = compositor/weston.h
302
303 if ENABLE_IVI_SHELL
304 westoninclude_HEADERS +=                                \
305         ivi-shell/ivi-layout-export.h
306 endif
307
308 if ENABLE_EGL
309 libweston_module_LTLIBRARIES += gl-renderer.la
310 gl_renderer_la_LDFLAGS = -module -avoid-version
311 gl_renderer_la_LIBADD =                         \
312         libweston-@LIBWESTON_MAJOR@.la          \
313         $(EGL_LIBS)                             \
314         $(COMPOSITOR_LIBS)
315 gl_renderer_la_CFLAGS =                         \
316         $(COMPOSITOR_CFLAGS)                    \
317         $(EGL_CFLAGS)                           \
318         $(LIBDRM_CFLAGS)                        \
319         $(AM_CFLAGS)
320 gl_renderer_la_SOURCES =                        \
321         libweston/gl-renderer.h                 \
322         libweston/gl-renderer.c                 \
323         libweston/vertex-clipping.c             \
324         libweston/vertex-clipping.h             \
325         libweston/weston-sync-file.h            \
326         shared/helpers.h
327 endif
328
329 if ENABLE_X11_COMPOSITOR
330 libweston_module_LTLIBRARIES += x11-backend.la
331 x11_backend_la_LDFLAGS = -module -avoid-version
332 x11_backend_la_LIBADD =                         \
333         libshared-cairo.la                      \
334         libweston-@LIBWESTON_MAJOR@.la          \
335         $(X11_COMPOSITOR_LIBS)                  \
336         $(COMPOSITOR_LIBS)
337 x11_backend_la_CFLAGS =                         \
338         $(AM_CFLAGS)                            \
339         $(COMPOSITOR_CFLAGS)                    \
340         $(EGL_CFLAGS)                           \
341         $(PIXMAN_CFLAGS)                        \
342         $(CAIRO_CFLAGS)                         \
343         $(X11_COMPOSITOR_CFLAGS)
344 x11_backend_la_SOURCES =                        \
345         libweston/compositor-x11.c              \
346         libweston/compositor-x11.h              \
347         shared/helpers.h
348 endif
349
350 INPUT_BACKEND_CFLAGS = $(LIBINPUT_BACKEND_CFLAGS)
351 INPUT_BACKEND_LIBS = $(LIBINPUT_BACKEND_LIBS)
352 INPUT_BACKEND_SOURCES =                         \
353         libweston/libinput-seat.c               \
354         libweston/libinput-seat.h               \
355         libweston/libinput-device.c             \
356         libweston/libinput-device.h             \
357         shared/helpers.h
358
359 if ENABLE_DRM_COMPOSITOR
360 libweston_module_LTLIBRARIES += drm-backend.la
361 drm_backend_la_LDFLAGS = -module -avoid-version
362 drm_backend_la_LIBADD =                         \
363         libsession-helper.la                    \
364         libweston-@LIBWESTON_MAJOR@.la          \
365         $(COMPOSITOR_LIBS)                      \
366         $(DRM_COMPOSITOR_LIBS)                  \
367         $(INPUT_BACKEND_LIBS)                   \
368         libshared.la                            \
369         $(CLOCK_GETTIME_LIBS)
370 drm_backend_la_CFLAGS =                         \
371         $(COMPOSITOR_CFLAGS)                    \
372         $(EGL_CFLAGS)                           \
373         $(DRM_COMPOSITOR_CFLAGS)                \
374         $(INPUT_BACKEND_CFLAGS)                 \
375         $(AM_CFLAGS)
376 drm_backend_la_SOURCES =                        \
377         libweston/compositor-drm.c              \
378         libweston/compositor-drm.h              \
379         $(INPUT_BACKEND_SOURCES)                \
380         shared/helpers.h                        \
381         shared/timespec-util.h                  \
382         libweston/libbacklight.c                \
383         libweston/libbacklight.h
384
385 if ENABLE_VAAPI_RECORDER
386 drm_backend_la_SOURCES += libweston/vaapi-recorder.c libweston/vaapi-recorder.h
387 drm_backend_la_LIBADD += $(LIBVA_LIBS)
388 drm_backend_la_LDFLAGS += -pthread
389 drm_backend_la_CFLAGS += $(LIBVA_CFLAGS)
390 endif
391 endif
392
393 if ENABLE_WAYLAND_COMPOSITOR
394 libweston_module_LTLIBRARIES += wayland-backend.la
395 wayland_backend_la_LDFLAGS = -module -avoid-version
396 wayland_backend_la_LIBADD =                     \
397         libshared-cairo.la                      \
398         libweston-@LIBWESTON_MAJOR@.la          \
399         $(COMPOSITOR_LIBS)                      \
400         $(WAYLAND_COMPOSITOR_EGL_LIBS)          \
401         $(WAYLAND_COMPOSITOR_LIBS)
402 wayland_backend_la_CFLAGS =                     \
403         $(COMPOSITOR_CFLAGS)                    \
404         $(EGL_CFLAGS)                           \
405         $(PIXMAN_CFLAGS)                        \
406         $(CAIRO_CFLAGS)                         \
407         $(WAYLAND_COMPOSITOR_CFLAGS)            \
408         $(AM_CFLAGS)
409 wayland_backend_la_SOURCES =                                    \
410         libweston/compositor-wayland.c                          \
411         libweston/compositor-wayland.h                          \
412         shared/helpers.h
413 nodist_wayland_backend_la_SOURCES =                             \
414         protocol/fullscreen-shell-unstable-v1-protocol.c        \
415         protocol/fullscreen-shell-unstable-v1-client-protocol.h \
416         protocol/xdg-shell-unstable-v6-protocol.c               \
417         protocol/xdg-shell-unstable-v6-client-protocol.h
418 endif
419
420 if ENABLE_HEADLESS_COMPOSITOR
421 libweston_module_LTLIBRARIES += headless-backend.la
422 headless_backend_la_LDFLAGS = -module -avoid-version
423 headless_backend_la_LIBADD =                    \
424         libshared.la                            \
425         libweston-@LIBWESTON_MAJOR@.la          \
426         $(COMPOSITOR_LIBS)
427 headless_backend_la_CFLAGS = $(COMPOSITOR_CFLAGS) $(AM_CFLAGS)
428 headless_backend_la_SOURCES =                   \
429         libweston/compositor-headless.c         \
430         libweston/compositor-headless.h         \
431         shared/helpers.h
432 endif
433
434 if ENABLE_FBDEV_COMPOSITOR
435 libweston_module_LTLIBRARIES += fbdev-backend.la
436 fbdev_backend_la_LDFLAGS = -module -avoid-version
437 fbdev_backend_la_LIBADD =                       \
438         libshared.la                            \
439         libsession-helper.la                    \
440         libweston-@LIBWESTON_MAJOR@.la          \
441         $(COMPOSITOR_LIBS)                      \
442         $(FBDEV_COMPOSITOR_LIBS)                \
443         $(INPUT_BACKEND_LIBS)
444 fbdev_backend_la_CFLAGS =                       \
445         $(COMPOSITOR_CFLAGS)                    \
446         $(EGL_CFLAGS)                           \
447         $(FBDEV_COMPOSITOR_CFLAGS)              \
448         $(PIXMAN_CFLAGS)                        \
449         $(INPUT_BACKEND_CFLAGS)                 \
450         $(AM_CFLAGS)
451 fbdev_backend_la_SOURCES =                      \
452         libweston/compositor-fbdev.c            \
453         libweston/compositor-fbdev.h            \
454         shared/helpers.h                        \
455         $(INPUT_BACKEND_SOURCES)
456 endif
457
458 if ENABLE_RDP_COMPOSITOR
459 libweston_module_LTLIBRARIES += rdp-backend.la
460 rdp_backend_la_LDFLAGS = -module -avoid-version
461 rdp_backend_la_LIBADD =                         \
462         libshared.la                            \
463         libweston-@LIBWESTON_MAJOR@.la          \
464         $(COMPOSITOR_LIBS)              \
465         $(RDP_COMPOSITOR_LIBS)
466 rdp_backend_la_CFLAGS =                         \
467         $(COMPOSITOR_CFLAGS)                    \
468         $(RDP_COMPOSITOR_CFLAGS)                \
469         $(AM_CFLAGS)
470 rdp_backend_la_SOURCES =                        \
471         libweston/compositor-rdp.c              \
472         libweston/compositor-rdp.h              \
473         shared/helpers.h
474 endif
475
476 if HAVE_LCMS
477 module_LTLIBRARIES += cms-static.la
478 cms_static_la_LDFLAGS = -module -avoid-version
479 cms_static_la_LIBADD =                          \
480         libshared.la                            \
481         libweston-@LIBWESTON_MAJOR@.la          \
482         $(LCMS_LIBS)                            \
483         $(COMPOSITOR_LIBS)
484 cms_static_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LCMS_CFLAGS)
485 cms_static_la_SOURCES =                         \
486         compositor/cms-static.c                 \
487         compositor/cms-helper.c                 \
488         compositor/cms-helper.h                 \
489         shared/helpers.h
490 if ENABLE_COLORD
491 module_LTLIBRARIES += cms-colord.la
492 cms_colord_la_LDFLAGS = -module -avoid-version
493 cms_colord_la_LIBADD =                          \
494         libshared.la                            \
495         libweston-@LIBWESTON_MAJOR@.la          \
496         $(COLORD_LIBS)                          \
497         $(LCMS_LIBS)                            \
498         $(COMPOSITOR_LIBS)
499 cms_colord_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(COLORD_CFLAGS)
500 cms_colord_la_SOURCES =                         \
501         compositor/cms-colord.c                 \
502         compositor/cms-helper.c                 \
503         compositor/cms-helper.h                 \
504         shared/helpers.h
505 endif
506 endif
507
508 noinst_PROGRAMS += spring-tool
509 spring_tool_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
510 spring_tool_LDADD = $(COMPOSITOR_LIBS) -lm
511 spring_tool_SOURCES =                           \
512         libweston/spring-tool.c                 \
513         libweston/animation.c                   \
514         shared/matrix.c                         \
515         shared/matrix.h                         \
516         libweston/compositor.h
517
518 if BUILD_CLIENTS
519
520 bin_PROGRAMS += weston-terminal weston-info
521
522 libexec_PROGRAMS +=                             \
523         weston-desktop-shell                    \
524         weston-screenshooter                    \
525         weston-keyboard                         \
526         weston-simple-im
527
528 if ENABLE_IVI_SHELL
529 libexec_PROGRAMS +=                             \
530         weston-ivi-shell-user-interface
531 endif
532
533 demo_clients =                                  \
534         weston-flower                           \
535         weston-image                            \
536         weston-cliptest                         \
537         weston-dnd                              \
538         weston-smoke                            \
539         weston-resizor                          \
540         weston-eventdemo                        \
541         weston-clickdot                         \
542         weston-confine                          \
543         weston-transformed                      \
544         weston-fullscreen                       \
545         weston-stacking                         \
546         weston-calibrator                       \
547         weston-touch-calibrator                 \
548         weston-scaler
549
550 if INSTALL_DEMO_CLIENTS
551 bin_PROGRAMS += $(demo_clients)
552 else
553 noinst_PROGRAMS += $(demo_clients)
554 endif
555
556
557 if BUILD_SIMPLE_CLIENTS
558 demo_clients +=                                 \
559         weston-simple-shm                       \
560         weston-simple-damage                    \
561         weston-simple-touch                     \
562         weston-presentation-shm                 \
563         weston-multi-resource
564
565 weston_simple_shm_SOURCES = clients/simple-shm.c
566 nodist_weston_simple_shm_SOURCES =              \
567         protocol/xdg-shell-unstable-v6-protocol.c               \
568         protocol/xdg-shell-unstable-v6-client-protocol.h        \
569         protocol/fullscreen-shell-unstable-v1-protocol.c        \
570         protocol/fullscreen-shell-unstable-v1-client-protocol.h \
571         protocol/ivi-application-protocol.c             \
572         protocol/ivi-application-client-protocol.h
573 weston_simple_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
574 weston_simple_shm_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la
575
576 weston_simple_damage_SOURCES = clients/simple-damage.c
577 nodist_weston_simple_damage_SOURCES =           \
578         protocol/viewporter-protocol.c          \
579         protocol/viewporter-client-protocol.h   \
580         protocol/xdg-shell-unstable-v6-protocol.c               \
581         protocol/xdg-shell-unstable-v6-client-protocol.h        \
582         protocol/fullscreen-shell-unstable-v1-protocol.c        \
583         protocol/fullscreen-shell-unstable-v1-client-protocol.h
584 weston_simple_damage_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
585 weston_simple_damage_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la
586
587 weston_simple_touch_SOURCES =                   \
588         clients/simple-touch.c                  \
589         shared/helpers.h
590 weston_simple_touch_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
591 weston_simple_touch_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la
592
593 weston_presentation_shm_SOURCES =                       \
594         clients/presentation-shm.c                      \
595         shared/helpers.h
596 nodist_weston_presentation_shm_SOURCES =                \
597         protocol/presentation-time-protocol.c           \
598         protocol/presentation-time-client-protocol.h
599 weston_presentation_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
600 weston_presentation_shm_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la -lm $(CLOCK_GETTIME_LIBS)
601
602 weston_multi_resource_SOURCES = clients/multi-resource.c
603 weston_multi_resource_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
604 weston_multi_resource_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la $(CLOCK_GETTIME_LIBS) -lm
605 endif
606
607 if BUILD_SIMPLE_EGL_CLIENTS
608 demo_clients += weston-simple-egl
609 weston_simple_egl_SOURCES = clients/simple-egl.c
610 nodist_weston_simple_egl_SOURCES =              \
611         protocol/xdg-shell-unstable-v6-protocol.c               \
612         protocol/xdg-shell-unstable-v6-client-protocol.h        \
613         protocol/ivi-application-protocol.c             \
614         protocol/ivi-application-client-protocol.h
615 weston_simple_egl_CFLAGS = $(AM_CFLAGS) $(SIMPLE_EGL_CLIENT_CFLAGS)
616 weston_simple_egl_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm
617 endif
618
619 if BUILD_SIMPLE_DMABUF_DRM_CLIENT
620 demo_clients += weston-simple-dmabuf-drm
621 weston_simple_dmabuf_drm_SOURCES =                      \
622         clients/simple-dmabuf-drm.c                     \
623         clients/simple-dmabuf-drm-data.h
624 nodist_weston_simple_dmabuf_drm_SOURCES =               \
625         protocol/xdg-shell-unstable-v6-protocol.c               \
626         protocol/xdg-shell-unstable-v6-client-protocol.h        \
627         protocol/fullscreen-shell-unstable-v1-protocol.c        \
628         protocol/fullscreen-shell-unstable-v1-client-protocol.h \
629         protocol/linux-dmabuf-unstable-v1-protocol.c \
630         protocol/linux-dmabuf-unstable-v1-client-protocol.h
631 weston_simple_dmabuf_drm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_DMABUF_DRM_CLIENT_CFLAGS)
632 weston_simple_dmabuf_drm_LDADD = $(SIMPLE_DMABUF_DRM_CLIENT_LIBS) \
633         $(LIBDRM_PLATFORM_FREEDRENO_LIBS) \
634         $(LIBDRM_PLATFORM_ETNAVIV_LIBS)   \
635         $(LIBDRM_PLATFORM_INTEL_LIBS)     \
636         libshared.la
637 endif
638
639 if BUILD_SIMPLE_DMABUF_V4L_CLIENT
640 demo_clients += weston-simple-dmabuf-v4l
641 weston_simple_dmabuf_v4l_SOURCES = clients/simple-dmabuf-v4l.c
642 nodist_weston_simple_dmabuf_v4l_SOURCES =               \
643         protocol/xdg-shell-unstable-v6-protocol.c               \
644         protocol/xdg-shell-unstable-v6-client-protocol.h        \
645         protocol/fullscreen-shell-unstable-v1-protocol.c        \
646         protocol/fullscreen-shell-unstable-v1-client-protocol.h \
647         protocol/linux-dmabuf-unstable-v1-protocol.c \
648         protocol/linux-dmabuf-unstable-v1-client-protocol.h
649 weston_simple_dmabuf_v4l_CFLAGS = $(AM_CFLAGS) $(SIMPLE_DMABUF_V4L_CLIENT_CFLAGS)
650 weston_simple_dmabuf_v4l_LDADD = $(SIMPLE_DMABUF_V4L_CLIENT_LIBS) libshared.la
651 endif
652
653 noinst_LTLIBRARIES += libtoytoolkit.la
654
655 libtoytoolkit_la_SOURCES =                              \
656         clients/window.c                                \
657         clients/window.h                                \
658         shared/helpers.h
659
660 nodist_libtoytoolkit_la_SOURCES =                       \
661         protocol/text-cursor-position-protocol.c        \
662         protocol/text-cursor-position-client-protocol.h \
663         protocol/viewporter-protocol.c                  \
664         protocol/viewporter-client-protocol.h           \
665         protocol/xdg-shell-unstable-v6-protocol.c                       \
666         protocol/xdg-shell-unstable-v6-client-protocol.h                \
667         protocol/ivi-application-protocol.c             \
668         protocol/ivi-application-client-protocol.h      \
669         protocol/pointer-constraints-unstable-v1-protocol.c             \
670         protocol/pointer-constraints-unstable-v1-client-protocol.h      \
671         protocol/relative-pointer-unstable-v1-protocol.c                \
672         protocol/relative-pointer-unstable-v1-client-protocol.h
673
674 BUILT_SOURCES += $(nodist_libtoytoolkit_la_SOURCES)
675
676
677 libtoytoolkit_la_LIBADD =                       \
678         $(CLIENT_LIBS)                          \
679         $(CAIRO_EGL_LIBS)                       \
680         libshared-cairo.la $(CLOCK_GETTIME_LIBS) -lm
681 libtoytoolkit_la_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) $(CAIRO_EGL_CFLAGS)
682
683 weston_flower_SOURCES = clients/flower.c
684 weston_flower_LDADD = libtoytoolkit.la
685 weston_flower_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
686
687 weston_screenshooter_SOURCES =                          \
688         clients/screenshot.c
689 nodist_weston_screenshooter_SOURCES =                   \
690         protocol/weston-screenshooter-protocol.c        \
691         protocol/weston-screenshooter-client-protocol.h
692 weston_screenshooter_LDADD = $(CLIENT_LIBS) libshared.la
693 weston_screenshooter_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
694
695 weston_terminal_SOURCES =                               \
696         clients/terminal.c                              \
697         shared/helpers.h
698 weston_terminal_LDADD = libtoytoolkit.la -lutil
699 weston_terminal_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
700
701 weston_image_SOURCES = clients/image.c
702 weston_image_LDADD = libtoytoolkit.la
703 weston_image_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
704
705 weston_cliptest_SOURCES =                               \
706         clients/cliptest.c                              \
707         libweston/vertex-clipping.c                     \
708         libweston/vertex-clipping.h
709 weston_cliptest_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
710 weston_cliptest_LDADD = libtoytoolkit.la
711
712 weston_dnd_SOURCES =                                    \
713         clients/dnd.c                                   \
714         shared/helpers.h
715 weston_dnd_LDADD = libtoytoolkit.la
716 weston_dnd_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
717
718 weston_smoke_SOURCES = clients/smoke.c
719 weston_smoke_LDADD = libtoytoolkit.la
720 weston_smoke_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
721
722 weston_resizor_SOURCES = clients/resizor.c
723 weston_resizor_LDADD = libtoytoolkit.la
724 weston_resizor_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
725
726 weston_scaler_SOURCES = clients/scaler.c
727 weston_scaler_LDADD = libtoytoolkit.la
728 weston_scaler_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
729
730 if HAVE_CAIRO_GLESV2
731 demo_clients += weston-nested weston-nested-client
732
733 weston_nested_SOURCES =                                 \
734         clients/nested.c                                \
735         shared/helpers.h
736 weston_nested_LDADD = libtoytoolkit.la $(SERVER_LIBS)
737 weston_nested_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
738
739 weston_nested_client_SOURCES = clients/nested-client.c
740 weston_nested_client_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm
741 weston_nested_client_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
742 endif
743
744 weston_eventdemo_SOURCES =                              \
745         clients/eventdemo.c                             \
746         shared/helpers.h
747 weston_eventdemo_LDADD = libtoytoolkit.la
748 weston_eventdemo_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
749
750 weston_clickdot_SOURCES =                               \
751         clients/clickdot.c                              \
752         shared/helpers.h
753 weston_clickdot_LDADD = libtoytoolkit.la
754 weston_clickdot_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
755
756 weston_confine_SOURCES =                                \
757         clients/confine.c                               \
758         shared/helpers.h
759 weston_confine_LDADD = libtoytoolkit.la
760 weston_confine_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
761
762 weston_transformed_SOURCES = clients/transformed.c
763 weston_transformed_LDADD = libtoytoolkit.la
764 weston_transformed_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
765
766 weston_fullscreen_SOURCES = clients/fullscreen.c
767 nodist_weston_fullscreen_SOURCES =                      \
768         protocol/fullscreen-shell-unstable-v1-protocol.c                \
769         protocol/fullscreen-shell-unstable-v1-client-protocol.h
770 weston_fullscreen_LDADD = libtoytoolkit.la
771 weston_fullscreen_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
772
773 weston_stacking_SOURCES =                               \
774         clients/stacking.c                              \
775         shared/helpers.h
776 weston_stacking_LDADD = libtoytoolkit.la
777 weston_stacking_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
778
779 weston_calibrator_SOURCES =                             \
780         clients/calibrator.c                            \
781         shared/helpers.h                                \
782         shared/matrix.c                                 \
783         shared/matrix.h
784 weston_calibrator_LDADD = libtoytoolkit.la
785 weston_calibrator_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
786
787 weston_touch_calibrator_SOURCES =                       \
788         clients/touch-calibrator.c                      \
789         shared/helpers.h                                \
790         shared/matrix.c                                 \
791         shared/matrix.h
792 nodist_weston_touch_calibrator_SOURCES =                \
793         protocol/weston-touch-calibration-protocol.c    \
794         protocol/weston-touch-calibration-client-protocol.h
795 weston_touch_calibrator_LDADD = libtoytoolkit.la
796 weston_touch_calibrator_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
797
798 if BUILD_SUBSURFACES_CLIENT
799 demo_clients += weston-subsurfaces
800 weston_subsurfaces_SOURCES =                    \
801         clients/subsurfaces.c                   \
802         shared/helpers.h
803 weston_subsurfaces_CFLAGS =                     \
804         $(AM_CFLAGS)                            \
805         $(SIMPLE_EGL_CLIENT_CFLAGS)             \
806         $(CLIENT_CFLAGS)
807 weston_subsurfaces_LDADD = libtoytoolkit.la $(SIMPLE_EGL_CLIENT_LIBS) -lm
808 endif
809
810 if HAVE_PANGO
811 demo_clients += weston-editor
812 weston_editor_SOURCES =                         \
813         clients/editor.c                        \
814         shared/helpers.h
815 nodist_weston_editor_SOURCES =                  \
816         protocol/text-input-unstable-v1-protocol.c              \
817         protocol/text-input-unstable-v1-client-protocol.h
818 weston_editor_LDADD = libtoytoolkit.la $(PANGO_LIBS)
819 weston_editor_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) $(PANGO_CFLAGS)
820 endif
821
822 weston_keyboard_SOURCES = clients/keyboard.c
823 nodist_weston_keyboard_SOURCES =                                \
824         protocol/weston-desktop-shell-client-protocol.h         \
825         protocol/weston-desktop-shell-protocol.c                \
826         protocol/input-method-unstable-v1-protocol.c            \
827         protocol/input-method-unstable-v1-client-protocol.h
828 weston_keyboard_LDADD = libtoytoolkit.la
829 weston_keyboard_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
830
831 weston_simple_im_SOURCES = clients/simple-im.c
832 nodist_weston_simple_im_SOURCES =               \
833         protocol/input-method-unstable-v1-protocol.c            \
834         protocol/input-method-unstable-v1-client-protocol.h
835 weston_simple_im_LDADD = $(CLIENT_LIBS)
836 weston_simple_im_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
837
838 weston_info_SOURCES =                                   \
839         clients/weston-info.c                           \
840         shared/helpers.h
841 nodist_weston_info_SOURCES =                                    \
842         protocol/presentation-time-protocol.c                   \
843         protocol/presentation-time-client-protocol.h            \
844         protocol/linux-dmabuf-unstable-v1-protocol.c            \
845         protocol/linux-dmabuf-unstable-v1-client-protocol.h     \
846         protocol/tablet-unstable-v2-protocol.c                  \
847         protocol/tablet-unstable-v2-client-protocol.h
848 weston_info_LDADD = $(WESTON_INFO_LIBS) libshared.la
849 weston_info_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
850
851 weston_desktop_shell_SOURCES =                          \
852         clients/desktop-shell.c                         \
853         shared/helpers.h
854 nodist_weston_desktop_shell_SOURCES =                   \
855         protocol/weston-desktop-shell-client-protocol.h \
856         protocol/weston-desktop-shell-protocol.c
857 weston_desktop_shell_LDADD = libtoytoolkit.la
858 weston_desktop_shell_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
859
860 if ENABLE_IVI_SHELL
861 weston_ivi_shell_user_interface_SOURCES =                               \
862         clients/ivi-shell-user-interface.c                              \
863         shared/helpers.h
864 nodist_weston_ivi_shell_user_interface_SOURCES =                        \
865         protocol/ivi-hmi-controller-client-protocol.h                   \
866         protocol/ivi-hmi-controller-protocol.c                          \
867         protocol/ivi-application-client-protocol.h                      \
868         protocol/ivi-application-protocol.c
869 weston_ivi_shell_user_interface_LDADD = libtoytoolkit.la
870 weston_ivi_shell_user_interface_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
871 endif
872
873 if BUILD_FULL_GL_CLIENTS
874 demo_clients += weston-gears
875 weston_gears_SOURCES = clients/gears.c
876 weston_gears_LDADD = libtoytoolkit.la
877 weston_gears_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
878 endif
879
880 endif
881
882 BUILT_SOURCES +=                                        \
883         protocol/weston-screenshooter-protocol.c                        \
884         protocol/weston-screenshooter-client-protocol.h                 \
885         protocol/weston-touch-calibration-protocol.c                    \
886         protocol/weston-touch-calibration-client-protocol.h             \
887         protocol/text-cursor-position-client-protocol.h \
888         protocol/text-cursor-position-protocol.c        \
889         protocol/text-input-unstable-v1-protocol.c                      \
890         protocol/text-input-unstable-v1-client-protocol.h               \
891         protocol/input-method-unstable-v1-protocol.c                    \
892         protocol/input-method-unstable-v1-client-protocol.h             \
893         protocol/weston-desktop-shell-client-protocol.h                 \
894         protocol/weston-desktop-shell-protocol.c                        \
895         protocol/viewporter-client-protocol.h           \
896         protocol/viewporter-protocol.c                  \
897         protocol/presentation-time-protocol.c                           \
898         protocol/presentation-time-client-protocol.h                    \
899         protocol/fullscreen-shell-unstable-v1-protocol.c                \
900         protocol/fullscreen-shell-unstable-v1-client-protocol.h \
901         protocol/xdg-shell-unstable-v6-protocol.c                       \
902         protocol/xdg-shell-unstable-v6-client-protocol.h                \
903         protocol/ivi-hmi-controller-protocol.c          \
904         protocol/ivi-hmi-controller-client-protocol.h   \
905         protocol/ivi-application-protocol.c             \
906         protocol/ivi-application-client-protocol.h      \
907         protocol/linux-dmabuf-unstable-v1-protocol.c    \
908         protocol/linux-dmabuf-unstable-v1-client-protocol.h             \
909         protocol/tablet-unstable-v2-protocol.c          \
910         protocol/tablet-unstable-v2-client-protocol.h                   \
911         protocol/input-timestamps-unstable-v1-protocol.c                \
912         protocol/input-timestamps-unstable-v1-client-protocol.h
913
914 westondatadir = $(datadir)/weston
915 dist_westondata_DATA =                          \
916         data/wayland.svg                        \
917         data/wayland.png                        \
918         data/pattern.png                        \
919         data/terminal.png                       \
920         data/border.png                         \
921         data/icon_editor.png                    \
922         data/icon_flower.png                    \
923         data/icon_terminal.png                  \
924         data/icon_window.png                    \
925         data/sign_close.png                     \
926         data/sign_maximize.png                  \
927         data/sign_minimize.png                  \
928         data/background.png                     \
929         data/panel.png                          \
930         data/tiling.png                         \
931         data/sidebyside.png                     \
932         data/fullscreen.png                     \
933         data/random.png                         \
934         data/home.png                           \
935         data/icon_ivi_simple-egl.png            \
936         data/icon_ivi_simple-shm.png            \
937         data/icon_ivi_smoke.png                 \
938         data/icon_ivi_flower.png               \
939         data/icon_ivi_clickdot.png
940
941 if ENABLE_IVI_SHELL
942 dist_westondata_DATA +=                         \
943         data/background.png                     \
944         data/tiling.png                         \
945         data/fullscreen.png                     \
946         data/panel.png                          \
947         data/random.png                         \
948         data/sidebyside.png                     \
949         data/home.png                           \
950         data/icon_ivi_clickdot.png              \
951         data/icon_ivi_flower.png                \
952         data/icon_ivi_simple-egl.png            \
953         data/icon_ivi_simple-shm.png            \
954         data/icon_ivi_smoke.png
955 endif
956
957
958 if BUILD_WCAP_TOOLS
959 bin_PROGRAMS += wcap-decode
960
961 wcap_decode_SOURCES =                           \
962         wcap/main.c                             \
963         wcap/wcap-decode.c                      \
964         wcap/wcap-decode.h
965
966 wcap_decode_CFLAGS = $(AM_CFLAGS) $(WCAP_CFLAGS)
967 wcap_decode_LDADD = $(WCAP_LIBS)
968 endif
969
970
971 if ENABLE_DESKTOP_SHELL
972
973 module_LTLIBRARIES += desktop-shell.la
974
975 desktop_shell_la_CPPFLAGS =                     \
976         -I$(top_builddir)/protocol              \
977         -I$(top_srcdir)/shared                  \
978         -I$(top_builddir)/libweston             \
979         -I$(top_srcdir)/libweston               \
980         -I$(top_builddir)/desktop-shell         \
981         -DMODULEDIR='"$(moduledir)"'            \
982         -DLIBEXECDIR='"$(libexecdir)"'          \
983         -DIN_WESTON
984
985 desktop_shell_la_LDFLAGS = -module -avoid-version
986 desktop_shell_la_LIBADD = libshared.la libweston-desktop-@LIBWESTON_MAJOR@.la $(COMPOSITOR_LIBS)
987 desktop_shell_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
988 desktop_shell_la_SOURCES =                              \
989         desktop-shell/shell.h                           \
990         desktop-shell/shell.c                           \
991         desktop-shell/exposay.c                         \
992         desktop-shell/input-panel.c                     \
993         shared/helpers.h
994 nodist_desktop_shell_la_SOURCES =                       \
995         protocol/weston-desktop-shell-protocol.c        \
996         protocol/weston-desktop-shell-server-protocol.h
997
998 BUILT_SOURCES += $(nodist_desktop_shell_la_SOURCES)
999 endif
1000
1001 if ENABLE_FULLSCREEN_SHELL
1002
1003 module_LTLIBRARIES += fullscreen-shell.la
1004
1005 fullscreen_shell_la_CPPFLAGS =                  \
1006         -I$(top_builddir)/protocol              \
1007         -I$(top_srcdir)/shared                  \
1008         -I$(top_builddir)/libweston             \
1009         -I$(top_srcdir)/libweston               \
1010         -DIN_WESTON
1011
1012 fullscreen_shell_la_LDFLAGS = -module -avoid-version
1013 fullscreen_shell_la_LIBADD =                    \
1014         libweston-@LIBWESTON_MAJOR@.la          \
1015         $(COMPOSITOR_LIBS)
1016 fullscreen_shell_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
1017 fullscreen_shell_la_SOURCES =                   \
1018         fullscreen-shell/fullscreen-shell.c     \
1019         shared/helpers.h
1020 nodist_fullscreen_shell_la_SOURCES =                    \
1021         protocol/fullscreen-shell-unstable-v1-protocol.c                \
1022         protocol/fullscreen-shell-unstable-v1-server-protocol.h
1023
1024 BUILT_SOURCES += $(nodist_fullscreen_shell_la_SOURCES)
1025 endif
1026
1027 if ENABLE_IVI_SHELL
1028
1029 module_LTLIBRARIES +=                           \
1030         $(ivi_shell)                            \
1031         $(hmi_controller)
1032
1033 ivi_shell = ivi-shell.la
1034 ivi_shell_la_LDFLAGS = -module -avoid-version
1035 ivi_shell_la_LIBADD =                           \
1036         libshared.la                            \
1037         libweston-@LIBWESTON_MAJOR@.la          \
1038         $(COMPOSITOR_LIBS)
1039 ivi_shell_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
1040 ivi_shell_la_SOURCES =                          \
1041         ivi-shell/ivi-layout-export.h           \
1042         ivi-shell/ivi-layout-private.h          \
1043         ivi-shell/ivi-layout-shell.h            \
1044         ivi-shell/ivi-layout.c                  \
1045         ivi-shell/ivi-layout-transition.c       \
1046         ivi-shell/ivi-shell.h                   \
1047         ivi-shell/ivi-shell.c                   \
1048         ivi-shell/input-panel-ivi.c             \
1049         shared/helpers.h
1050 nodist_ivi_shell_la_SOURCES =                   \
1051         protocol/ivi-application-protocol.c             \
1052         protocol/ivi-application-server-protocol.h
1053
1054 BUILT_SOURCES += $(nodist_ivi_shell_la_SOURCES)
1055
1056 hmi_controller = hmi-controller.la
1057 hmi_controller_la_LDFLAGS = -module -avoid-version
1058 hmi_controller_la_LIBADD =                      \
1059         libshared.la                            \
1060         libweston-@LIBWESTON_MAJOR@.la          \
1061         $(COMPOSITOR_LIBS)
1062 hmi_controller_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
1063 hmi_controller_la_SOURCES =                             \
1064         ivi-shell/ivi-layout-export.h                   \
1065         ivi-shell/hmi-controller.c                      \
1066         shared/helpers.h
1067 nodist_hmi_controller_la_SOURCES =                      \
1068         protocol/ivi-hmi-controller-protocol.c          \
1069         protocol/ivi-hmi-controller-server-protocol.h
1070
1071 BUILT_SOURCES += $(nodist_hmi_controller_la_SOURCES)
1072
1073 endif
1074
1075
1076 if ENABLE_SCREEN_SHARING
1077
1078 module_LTLIBRARIES += screen-share.la
1079
1080 screen_share_la_CPPFLAGS = $(AM_CPPFLAGS) -DBINDIR='"$(bindir)"'
1081 screen_share_la_LDFLAGS = -module -avoid-version
1082 screen_share_la_LIBADD =                        \
1083         libshared-cairo.la                      \
1084         libweston-@LIBWESTON_MAJOR@.la          \
1085         $(COMPOSITOR_LIBS)                      \
1086         $(SCREEN_SHARE_LIBS)
1087 screen_share_la_CFLAGS =                        \
1088         $(COMPOSITOR_CFLAGS)                    \
1089         $(SCREEN_SHARE_CFLAGS)                  \
1090         $(AM_CFLAGS)
1091 screen_share_la_SOURCES =                       \
1092         compositor/screen-share.c               \
1093         shared/helpers.h
1094 nodist_screen_share_la_SOURCES =                        \
1095         protocol/fullscreen-shell-unstable-v1-protocol.c                \
1096         protocol/fullscreen-shell-unstable-v1-client-protocol.h
1097
1098 endif
1099
1100 if ENABLE_XWAYLAND
1101
1102 libweston_module_LTLIBRARIES += xwayland.la
1103
1104 xwayland_la_CPPFLAGS =                          \
1105         -I$(top_builddir)/protocol              \
1106         -I$(top_srcdir)/shared                  \
1107         -I$(top_builddir)/libweston             \
1108         -I$(top_srcdir)/libweston               \
1109         -I$(top_builddir)/xwayland              \
1110         -DMODULEDIR='"$(moduledir)"'            \
1111         -DLIBEXECDIR='"$(libexecdir)"'
1112
1113 xwayland_la_LDFLAGS = -module -avoid-version
1114 xwayland_la_LIBADD =                            \
1115         libshared-cairo.la                      \
1116         libweston-@LIBWESTON_MAJOR@.la          \
1117         $(XWAYLAND_LIBS)
1118 xwayland_la_CFLAGS =                            \
1119         $(AM_CFLAGS)                            \
1120         $(COMPOSITOR_CFLAGS)                    \
1121         $(PIXMAN_CFLAGS)                        \
1122         $(CAIRO_CFLAGS)
1123 xwayland_la_SOURCES =                           \
1124         xwayland/xwayland.h                     \
1125         xwayland/xwayland-internal-interface.h  \
1126         xwayland/window-manager.c               \
1127         xwayland/selection.c                    \
1128         xwayland/dnd.c                          \
1129         xwayland/launcher.c                     \
1130         xwayland/hash.c                         \
1131         xwayland/hash.h                         \
1132         shared/helpers.h
1133
1134 libwestoninclude_HEADERS += xwayland/xwayland-api.h
1135
1136 endif
1137
1138
1139 #
1140 # Shared utilities
1141 #
1142
1143 noinst_LTLIBRARIES += libshared.la libshared-cairo.la \
1144         libzunitc.la libzunitcmain.la
1145
1146 libshared_la_CPPFLAGS = \
1147         -DDATADIR='"$(datadir)"' \
1148         $(AM_CPPFLAGS)
1149
1150 libshared_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
1151
1152 libshared_la_SOURCES =                          \
1153         shared/config-parser.c                  \
1154         shared/option-parser.c                  \
1155         shared/config-parser.h                  \
1156         shared/file-util.c                      \
1157         shared/file-util.h                      \
1158         shared/helpers.h                        \
1159         shared/os-compatibility.c               \
1160         shared/os-compatibility.h               \
1161         shared/xalloc.c                 \
1162         shared/xalloc.h
1163
1164 libshared_cairo_la_CPPFLAGS = $(libshared_la_CPPFLAGS)
1165
1166 libshared_cairo_la_CFLAGS =                     \
1167         $(AM_CFLAGS)                            \
1168         $(COMPOSITOR_CFLAGS)                    \
1169         $(PIXMAN_CFLAGS)                        \
1170         $(CAIRO_CFLAGS)                         \
1171         $(PANGO_CFLAGS)                         \
1172         $(PNG_CFLAGS)                           \
1173         $(WEBP_CFLAGS)
1174
1175 libshared_cairo_la_LIBADD =                     \
1176         $(PIXMAN_LIBS)                          \
1177         $(CAIRO_LIBS)                           \
1178         $(PANGO_LIBS)                           \
1179         $(PNG_LIBS)                             \
1180         $(WEBP_LIBS)                            \
1181         $(JPEG_LIBS)
1182
1183 libshared_cairo_la_SOURCES =                    \
1184         $(libshared_la_SOURCES)                 \
1185         shared/helpers.h                        \
1186         shared/image-loader.c                   \
1187         shared/image-loader.h                   \
1188         shared/cairo-util.c                     \
1189         shared/frame.c                          \
1190         shared/cairo-util.h
1191
1192 libzunitc_la_SOURCES = \
1193         tools/zunitc/inc/zunitc/zunitc.h        \
1194         tools/zunitc/inc/zunitc/zunitc_impl.h   \
1195         tools/zunitc/src/zuc_base_logger.c      \
1196         tools/zunitc/src/zuc_base_logger.h      \
1197         tools/zunitc/src/zuc_collector.c        \
1198         tools/zunitc/src/zuc_collector.h        \
1199         tools/zunitc/src/zuc_context.h          \
1200         tools/zunitc/src/zuc_event.h            \
1201         tools/zunitc/src/zuc_event_listener.h   \
1202         tools/zunitc/src/zuc_junit_reporter.c   \
1203         tools/zunitc/src/zuc_junit_reporter.h   \
1204         tools/zunitc/src/zuc_types.h            \
1205         tools/zunitc/src/zunitc_impl.c          \
1206         shared/helpers.h
1207
1208 libzunitc_la_CFLAGS = \
1209         $(AM_CFLAGS)                            \
1210         -I$(top_srcdir)/tools/zunitc/inc
1211
1212 libzunitc_la_LIBADD = \
1213         libshared.la \
1214         $(CLOCK_GETTIME_LIBS)
1215
1216 if ENABLE_JUNIT_XML
1217 libzunitc_la_CFLAGS += \
1218         $(LIBXML2_CFLAGS)
1219 libzunitc_la_LIBADD += \
1220         $(LIBXML2_LIBS)
1221 endif
1222
1223 libzunitcmain_la_SOURCES = \
1224         tools/zunitc/src/main.c
1225
1226 libzunitcmain_la_CFLAGS = \
1227         $(AM_CFLAGS)                            \
1228         -I$(top_srcdir)/tools/zunitc/inc
1229
1230 libzunitcmain_la_LIBADD =       \
1231         libzunitc.la            \
1232         libshared.la
1233
1234 #
1235 # tests subdirectory
1236 #
1237
1238 TESTS = $(internal_tests) $(shared_tests) $(module_tests) $(weston_tests) $(ivi_tests)
1239
1240 internal_tests =                                \
1241         internal-screenshot.weston
1242
1243 shared_tests =                                  \
1244         config-parser.test                      \
1245         timespec.test                           \
1246         string.test                                     \
1247         vertex-clip.test                        \
1248         zuctest
1249
1250 module_tests =                                  \
1251         plugin-registry-test.la                 \
1252         surface-test.la                         \
1253         surface-global-test.la
1254
1255 weston_tests =                                  \
1256         bad_buffer.weston                       \
1257         keyboard.weston                         \
1258         event.weston                            \
1259         pointer.weston                          \
1260         text.weston                             \
1261         presentation.weston                     \
1262         viewporter.weston                       \
1263         roles.weston                            \
1264         subsurface.weston                       \
1265         subsurface-shot.weston                  \
1266         devices.weston                          \
1267         touch.weston
1268
1269 AM_TESTS_ENVIRONMENT = \
1270         abs_builddir='$(abs_builddir)'; export abs_builddir; \
1271         abs_top_srcdir='$(abs_top_srcdir)'; export abs_top_srcdir;
1272
1273 TEST_EXTENSIONS = .la .weston
1274 LA_LOG_COMPILER = $(srcdir)/tests/weston-tests-env
1275 WESTON_LOG_COMPILER = $(srcdir)/tests/weston-tests-env
1276
1277 clean-local:
1278         -rm -rf logs
1279         -rm -rf $(DOCDIRS)
1280
1281 # To remove when automake 1.11 support is dropped
1282 export abs_builddir
1283
1284 noinst_LTLIBRARIES +=                   \
1285         weston-test.la                  \
1286         weston-test-desktop-shell.la    \
1287         $(module_tests)                 \
1288         libtest-runner.la               \
1289         libtest-client.la
1290
1291 noinst_PROGRAMS +=                      \
1292         $(setbacklight)                 \
1293         $(internal_tests)               \
1294         $(shared_tests)                 \
1295         $(weston_tests)                 \
1296         $(ivi_tests)                    \
1297         matrix-test
1298
1299 test_module_ldflags = -module -avoid-version -rpath $(libdir)
1300 test_module_libadd =                    \
1301         libweston-@LIBWESTON_MAJOR@.la  \
1302         $(COMPOSITOR_LIBS)
1303
1304 plugin_registry_test_la_SOURCES = tests/plugin-registry-test.c
1305 plugin_registry_test_la_LIBADD = $(test_module_libadd)
1306 plugin_registry_test_la_LDFLAGS = $(test_module_ldflags)
1307 plugin_registry_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
1308
1309 surface_global_test_la_SOURCES = tests/surface-global-test.c
1310 surface_global_test_la_LIBADD = $(test_module_libadd)
1311 surface_global_test_la_LDFLAGS = $(test_module_ldflags)
1312 surface_global_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
1313
1314 surface_test_la_SOURCES = tests/surface-test.c
1315 surface_test_la_LIBADD = $(test_module_libadd)
1316 surface_test_la_LDFLAGS = $(test_module_ldflags)
1317 surface_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
1318
1319 weston_test_la_LIBADD = libshared.la $(test_module_libadd)
1320 weston_test_la_LDFLAGS = $(test_module_ldflags)
1321 weston_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
1322 weston_test_la_SOURCES =                        \
1323         tests/weston-test.c                     \
1324         shared/helpers.h
1325 nodist_weston_test_la_SOURCES =                 \
1326         protocol/weston-test-protocol.c \
1327         protocol/weston-test-server-protocol.h
1328
1329 weston_test_desktop_shell_la_LIBADD = libshared.la libweston-desktop-@LIBWESTON_MAJOR@.la $(COMPOSITOR_LIBS)
1330 weston_test_desktop_shell_la_LDFLAGS = $(test_module_ldflags)
1331 weston_test_desktop_shell_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
1332 weston_test_desktop_shell_la_SOURCES =                  \
1333         tests/weston-test-desktop-shell.c               \
1334         shared/helpers.h
1335
1336 if ENABLE_EGL
1337 weston_test_la_CFLAGS += $(EGL_TESTS_CFLAGS)
1338 weston_test_la_LDFLAGS += $(EGL_TESTS_LIBS)
1339 endif
1340
1341 libtest_runner_la_SOURCES =                     \
1342         tests/weston-test-runner.c              \
1343         tests/weston-test-runner.h
1344 libtest_runner_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
1345
1346 config_parser_test_SOURCES = tests/config-parser-test.c
1347 config_parser_test_LDADD =      \
1348         libshared.la            \
1349         $(COMPOSITOR_LIBS)      \
1350         libzunitc.la            \
1351         libzunitcmain.la
1352 config_parser_test_CFLAGS =                     \
1353         $(AM_CFLAGS)                            \
1354         -I$(top_srcdir)/tools/zunitc/inc
1355
1356 timespec_test_SOURCES = tests/timespec-test.c
1357 timespec_test_LDADD =   \
1358         libshared.la            \
1359         libzunitc.la            \
1360         libzunitcmain.la
1361 timespec_test_CFLAGS =                  \
1362         $(AM_CFLAGS)                            \
1363         -I$(top_srcdir)/tools/zunitc/inc
1364
1365 string_test_SOURCES = \
1366         tests/string-test.c \
1367         shared/string-helpers.h
1368 string_test_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
1369 string_test_LDADD =     libtest-client.la
1370
1371 vertex_clip_test_SOURCES =                      \
1372         tests/vertex-clip-test.c                \
1373         shared/helpers.h                        \
1374         libweston/vertex-clipping.c             \
1375         libweston/vertex-clipping.h
1376 vertex_clip_test_LDADD = libtest-runner.la -lm $(CLOCK_GETTIME_LIBS)
1377
1378 libtest_client_la_SOURCES =                     \
1379         tests/weston-test-client-helper.c       \
1380         tests/weston-test-client-helper.h       \
1381         tests/input-timestamps-helper.c         \
1382         tests/input-timestamps-helper.h
1383 nodist_libtest_client_la_SOURCES =                              \
1384         protocol/weston-test-protocol.c                         \
1385         protocol/weston-test-client-protocol.h                  \
1386         protocol/input-timestamps-unstable-v1-protocol.c        \
1387         protocol/input-timestamps-unstable-v1-client-protocol.h
1388 libtest_client_la_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) $(CAIRO_CFLAGS)
1389 libtest_client_la_LIBADD = libshared.la libtest-runner.la $(TEST_CLIENT_LIBS) $(CAIRO_LIBS)
1390
1391
1392 #
1393 # Internal tests - tests functionality of the testsuite itself
1394 #
1395
1396 internal_screenshot_weston_SOURCES = tests/internal-screenshot-test.c
1397 internal_screenshot_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
1398 internal_screenshot_weston_LDADD = libtest-client.la
1399
1400
1401 #
1402 # Weston Tests
1403 #
1404
1405 bad_buffer_weston_SOURCES = tests/bad-buffer-test.c
1406 bad_buffer_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
1407 bad_buffer_weston_LDADD = libtest-client.la
1408
1409 keyboard_weston_SOURCES = tests/keyboard-test.c
1410 keyboard_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
1411 keyboard_weston_LDADD = libtest-client.la
1412
1413 event_weston_SOURCES = tests/event-test.c
1414 event_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
1415 event_weston_LDADD = libtest-client.la
1416
1417 pointer_weston_SOURCES = tests/pointer-test.c
1418 pointer_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
1419 pointer_weston_LDADD = libtest-client.la
1420
1421 devices_weston_SOURCES = tests/devices-test.c
1422 devices_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
1423 devices_weston_LDADD = libtest-client.la
1424
1425 text_weston_SOURCES = tests/text-test.c
1426 nodist_text_weston_SOURCES =                    \
1427         protocol/text-input-unstable-v1-protocol.c              \
1428         protocol/text-input-unstable-v1-client-protocol.h
1429 text_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
1430 text_weston_LDADD = libtest-client.la
1431
1432 subsurface_weston_SOURCES = tests/subsurface-test.c
1433 subsurface_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
1434 subsurface_weston_LDADD = libtest-client.la
1435
1436 subsurface_shot_weston_SOURCES = tests/subsurface-shot-test.c
1437 subsurface_shot_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
1438 subsurface_shot_weston_LDADD = libtest-client.la
1439
1440 presentation_weston_SOURCES =                   \
1441         tests/presentation-test.c               \
1442         shared/helpers.h
1443 nodist_presentation_weston_SOURCES =            \
1444         protocol/presentation-time-protocol.c   \
1445         protocol/presentation-time-client-protocol.h
1446 presentation_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
1447 presentation_weston_LDADD = libtest-client.la
1448
1449 roles_weston_SOURCES = tests/roles-test.c
1450 roles_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
1451 roles_weston_LDADD = libtest-client.la
1452
1453 viewporter_weston_SOURCES =                     \
1454         tests/viewporter-test.c         \
1455         shared/helpers.h
1456 nodist_viewporter_weston_SOURCES =              \
1457         protocol/viewporter-protocol.c  \
1458         protocol/viewporter-client-protocol.h
1459 viewporter_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
1460 viewporter_weston_LDADD = libtest-client.la
1461
1462 touch_weston_SOURCES = tests/touch-test.c
1463 touch_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
1464 touch_weston_LDADD = libtest-client.la
1465
1466 if ENABLE_XWAYLAND_TEST
1467 weston_tests += xwayland-test.weston
1468 xwayland_test_weston_SOURCES = tests/xwayland-test.c
1469 xwayland_test_weston_CFLAGS = \
1470         $(AM_CFLAGS) $(XWAYLAND_TEST_CFLAGS) -DXSERVER_PATH='"@XSERVER_PATH@"'
1471 xwayland_test_weston_LDADD = libtest-client.la $(XWAYLAND_TEST_LIBS)
1472 endif
1473
1474 matrix_test_SOURCES =                           \
1475         tests/matrix-test.c                     \
1476         shared/matrix.c                         \
1477         shared/matrix.h
1478 matrix_test_CPPFLAGS = -DUNIT_TEST
1479 matrix_test_LDADD = -lm $(CLOCK_GETTIME_LIBS)
1480
1481 if ENABLE_IVI_SHELL
1482 module_tests +=                                 \
1483         ivi-layout-internal-test.la             \
1484         ivi-layout-test.la
1485
1486 ivi_layout_internal_test_la_LIBADD = $(test_module_libadd)
1487 ivi_layout_internal_test_la_LDFLAGS = $(test_module_ldflags)
1488 ivi_layout_internal_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
1489 ivi_layout_internal_test_la_SOURCES =                   \
1490         tests/ivi-layout-internal-test.c
1491
1492 ivi_layout_test_la_LIBADD = $(test_module_libadd)
1493 ivi_layout_test_la_LDFLAGS = $(test_module_ldflags)
1494 ivi_layout_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
1495 ivi_layout_test_la_SOURCES =                    \
1496         tests/ivi-layout-test-plugin.c          \
1497         tests/ivi-test.h                        \
1498         shared/helpers.h
1499 nodist_ivi_layout_test_la_SOURCES =             \
1500         protocol/weston-test-protocol.c         \
1501         protocol/weston-test-server-protocol.h
1502
1503 ivi_tests =                                     \
1504         ivi-shell-app.weston
1505
1506 ivi_shell_app_weston_SOURCES = tests/ivi-shell-app-test.c
1507 nodist_ivi_shell_app_weston_SOURCES =           \
1508         protocol/ivi-application-protocol.c     \
1509         protocol/ivi-application-client-protocol.h
1510 ivi_shell_app_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
1511 ivi_shell_app_weston_LDADD = libtest-client.la
1512
1513 noinst_PROGRAMS += ivi-layout-test-client.ivi
1514
1515 ivi_layout_test_client_ivi_SOURCES =                    \
1516         tests/ivi-layout-test-client.c          \
1517         tests/ivi-test.h                        \
1518         shared/helpers.h
1519 nodist_ivi_layout_test_client_ivi_SOURCES =             \
1520         protocol/ivi-application-protocol.c     \
1521         protocol/ivi-application-client-protocol.h
1522 ivi_layout_test_client_ivi_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
1523 ivi_layout_test_client_ivi_LDADD = libtest-client.la
1524 endif
1525
1526 if BUILD_SETBACKLIGHT
1527 noinst_PROGRAMS += setbacklight
1528 setbacklight_SOURCES =                          \
1529         tests/setbacklight.c                    \
1530         libweston/libbacklight.c                \
1531         libweston/libbacklight.h
1532 setbacklight_CFLAGS = $(AM_CFLAGS) $(SETBACKLIGHT_CFLAGS)
1533 setbacklight_LDADD = $(SETBACKLIGHT_LIBS)
1534 endif
1535
1536 all-local: zuctest$(EXEEXT)
1537
1538 noinst_PROGRAMS += zuctest$(EXEEXT)
1539
1540 zuctest_LDADD =                 \
1541         libzunitc.la            \
1542         libzunitcmain.la
1543
1544 zuctest_CFLAGS =                                \
1545         $(AM_CFLAGS)                            \
1546         -I$(top_srcdir)/tools/zunitc/inc
1547
1548 zuctest_SOURCES =                               \
1549         tools/zunitc/test/fixtures_test.c       \
1550         tools/zunitc/test/zunitc_test.c
1551
1552 EXTRA_DIST +=                                                   \
1553         tests/internal-screenshot.ini                           \
1554         tests/reference/internal-screenshot-bad-00.png          \
1555         tests/reference/internal-screenshot-good-00.png         \
1556         tests/reference/subsurface_z_order-00.png               \
1557         tests/reference/subsurface_z_order-01.png               \
1558         tests/reference/subsurface_z_order-02.png               \
1559         tests/reference/subsurface_z_order-03.png               \
1560         tests/reference/subsurface_z_order-04.png               \
1561         tests/weston-tests-env
1562
1563 BUILT_SOURCES +=                                \
1564         protocol/weston-test-protocol.c \
1565         protocol/weston-test-server-protocol.h  \
1566         protocol/weston-test-client-protocol.h  \
1567         protocol/text-input-unstable-v1-protocol.c              \
1568         protocol/text-input-unstable-v1-client-protocol.h
1569
1570 EXTRA_DIST +=                                   \
1571         protocol/weston-desktop-shell.xml       \
1572         protocol/weston-screenshooter.xml       \
1573         protocol/text-cursor-position.xml       \
1574         protocol/weston-test.xml                \
1575         protocol/weston-touch-calibration.xml   \
1576         protocol/ivi-application.xml            \
1577         protocol/ivi-hmi-controller.xml
1578
1579 #
1580 # manual test modules in tests subdirectory
1581 #
1582
1583 noinst_LTLIBRARIES +=                           \
1584         surface-screenshot.la
1585
1586 surface_screenshot_la_LIBADD = libshared.la $(test_module_libadd)
1587 surface_screenshot_la_LDFLAGS = $(test_module_ldflags)
1588 surface_screenshot_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
1589 surface_screenshot_la_SOURCES = tests/surface-screenshot.c
1590
1591
1592 #
1593 # Documentation
1594 #
1595
1596 man_MANS = weston.1 weston.ini.5
1597
1598 if ENABLE_DRM_COMPOSITOR
1599 man_MANS += weston-drm.7
1600 endif
1601
1602 if ENABLE_RDP_COMPOSITOR
1603 man_MANS += weston-rdp.7
1604 endif
1605
1606 MAN_SUBSTS =                                                            \
1607         -e 's|__weston_native_backend__|$(WESTON_NATIVE_BACKEND)|g'     \
1608         -e 's|__weston_modules_dir__|$(moduledir)|g'                    \
1609         -e 's|__libweston_modules_dir__|$(libweston_moduledir)|g'       \
1610         -e 's|__weston_shell_client__|$(WESTON_SHELL_CLIENT)|g'         \
1611         -e 's|__weston_libexecdir__|$(libexecdir)|g'                    \
1612         -e 's|__weston_bindir__|$(bindir)|g'                            \
1613         -e 's|__xserver_path__|$(XSERVER_PATH)|g'                       \
1614         -e 's|__version__|$(PACKAGE_VERSION)|g'
1615
1616 SUFFIXES = .1 .5 .7 .man
1617
1618 %.1 %.5 %.7 : man/%.man
1619         $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
1620
1621 EXTRA_DIST +=                                   \
1622         CONTRIBUTING.md                         \
1623         README.md                               \
1624         doc/wayland-screenshot.jpg              \
1625         doc/calibration-helper.bash             \
1626         man/weston.man                          \
1627         man/weston-drm.man                      \
1628         man/weston-rdp.man                      \
1629         man/weston.ini.man
1630
1631 CLEANFILES += $(man_MANS)
1632
1633 if ENABLE_DEVDOCS
1634 DOXYGEN_INDICES = docs/developer/html/index.html docs/tools/html/index.html
1635
1636 docs/developer/html/index.html: doc/doxygen/tooldev.doxygen | docs/developer
1637         cd doc/doxygen && $(DOXYGEN) tooldev.doxygen
1638
1639 docs/tools/html/index.html: doc/doxygen/tools.doxygen | docs/tools
1640         cd doc/doxygen && $(DOXYGEN) tools.doxygen
1641 endif
1642
1643 DOCDIRS =               \
1644         docs/developer  \
1645         docs/tools
1646
1647 $(DOCDIRS):
1648         $(MKDIR_P) $@
1649
1650 .PHONY: doc $(DOXYGEN_INDICES)
1651
1652 doc: $(DOXYGEN_INDICES)
1653
1654 .SECONDEXPANSION:
1655
1656 define protostability
1657 $(if $(findstring unstable,$1),unstable,stable)
1658 endef
1659
1660 define protoname
1661 $(shell echo $1 | $(SED) 's/\([a-z\-]\+\)-[a-z]\+-v[0-9]\+/\1/')
1662 endef
1663
1664 protocol/%-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
1665         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
1666
1667 protocol/%-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
1668         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < $< > $@
1669
1670 protocol/%-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
1671         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@
1672
1673 protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
1674         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
1675
1676 protocol/%-server-protocol.h : $(top_srcdir)/protocol/%.xml
1677         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < $< > $@
1678
1679 protocol/%-client-protocol.h : $(top_srcdir)/protocol/%.xml
1680         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@