clients: Port simple-shm and simple-egl to xdg-shell
[platform/upstream/weston.git] / Makefile.am
1 bin_PROGRAMS =
2 noinst_PROGRAMS =
3 libexec_PROGRAMS =
4 moduledir = $(libdir)/weston
5 module_LTLIBRARIES =
6 noinst_LTLIBRARIES =
7 BUILT_SOURCES =
8
9 DISTCHECK_CONFIGURE_FLAGS = --disable-setuid-install
10
11 EXTRA_DIST = weston.ini.in
12
13 weston.ini : $(srcdir)/weston.ini.in
14         $(AM_V_GEN)$(SED) \
15                 -e 's|@bindir[@]|$(bindir)|g' \
16                 -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
17                 -e 's|@libexecdir[@]|$(libexecdir)|g' \
18                 $< > $@
19
20 all-local : weston.ini
21
22 AM_CFLAGS = $(GCC_CFLAGS)
23
24 AM_CPPFLAGS =                                   \
25         -I$(top_srcdir)/src                     \
26         -I$(top_builddir)/src                   \
27         -I$(top_builddir)/clients               \
28         -I$(top_builddir)/tests                 \
29         -I$(top_srcdir)/shared                  \
30         -I$(top_builddir)/protocol              \
31         -DDATADIR='"$(datadir)"'                \
32         -DMODULEDIR='"$(moduledir)"'            \
33         -DLIBEXECDIR='"$(libexecdir)"'          \
34         -DBINDIR='"$(bindir)"'
35
36 CLEANFILES = weston.ini $(BUILT_SOURCES)
37
38 bin_PROGRAMS += weston
39
40 weston_LDFLAGS = -export-dynamic
41 weston_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON
42 weston_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBUNWIND_CFLAGS)
43 weston_LDADD = $(COMPOSITOR_LIBS) $(LIBUNWIND_LIBS) \
44         $(DLOPEN_LIBS) -lm libshared.la
45
46 weston_SOURCES =                                        \
47         src/git-version.h                               \
48         src/log.c                                       \
49         src/compositor.c                                \
50         src/compositor.h                                \
51         src/input.c                                     \
52         src/data-device.c                               \
53         src/filter.c                                    \
54         src/filter.h                                    \
55         src/screenshooter.c                             \
56         src/clipboard.c                                 \
57         src/zoom.c                                      \
58         src/text-backend.c                              \
59         src/bindings.c                                  \
60         src/animation.c                                 \
61         src/noop-renderer.c                             \
62         src/pixman-renderer.c                           \
63         src/pixman-renderer.h                           \
64         shared/matrix.c                                 \
65         shared/matrix.h                                 \
66         shared/zalloc.h                                 \
67         src/weston-egl-ext.h
68
69 nodist_weston_SOURCES =                                 \
70         protocol/screenshooter-protocol.c               \
71         protocol/screenshooter-server-protocol.h        \
72         protocol/text-cursor-position-protocol.c        \
73         protocol/text-cursor-position-server-protocol.h \
74         protocol/text-protocol.c                        \
75         protocol/text-server-protocol.h                 \
76         protocol/input-method-protocol.c                \
77         protocol/input-method-server-protocol.h         \
78         protocol/workspaces-protocol.c                  \
79         protocol/workspaces-server-protocol.h           \
80         protocol/scaler-protocol.c                      \
81         protocol/scaler-server-protocol.h
82
83 BUILT_SOURCES += $(nodist_weston_SOURCES)
84
85 # Track this dependency explicitly instead of using BUILT_SOURCES.  We
86 # add BUILT_SOURCES to CLEANFILES, but we want to keep git-version.h
87 # in case we're building from tarballs.
88
89 src/compositor.c : $(top_builddir)/src/git-version.h
90
91 noinst_LTLIBRARIES +=                           \
92         libsession-helper.la
93
94 libsession_helper_la_SOURCES =                  \
95         src/weston-launch.h                     \
96         src/launcher-util.c                     \
97         src/launcher-util.h
98 libsession_helper_la_CFLAGS = $(GCC_CFLAGS) $(LIBDRM_CFLAGS) $(PIXMAN_CFLAGS) $(COMPOSITOR_CFLAGS)
99 libsession_helper_la_LIBADD = $(LIBDRM_LIBS)
100
101 if ENABLE_DBUS
102 if HAVE_SYSTEMD_LOGIN
103 libsession_helper_la_SOURCES +=                 \
104         src/dbus.h                              \
105         src/dbus.c                              \
106         src/logind-util.h                       \
107         src/logind-util.c
108 libsession_helper_la_CFLAGS += $(SYSTEMD_LOGIN_CFLAGS) $(DBUS_CFLAGS)
109 libsession_helper_la_LIBADD += $(SYSTEMD_LOGIN_LIBS) $(DBUS_LIBS)
110 endif
111 endif
112
113 if HAVE_GIT_REPO
114 src/git-version.h : $(top_srcdir)/.git/logs/HEAD
115         $(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)')\"" > $@
116 else
117 src/git-version.h :
118         $(AM_V_GEN)echo "#define BUILD_ID \"unknown (not built from git or tarball)\"" > $@
119
120 endif
121
122 .FORCE :
123
124 if BUILD_WESTON_LAUNCH
125 bin_PROGRAMS += weston-launch
126 weston_launch_SOURCES = src/weston-launch.c src/weston-launch.h
127 weston_launch_CPPFLAGS = -DBINDIR='"$(bindir)"'
128 weston_launch_CFLAGS=                           \
129         $(GCC_CFLAGS)                           \
130         $(PAM_CFLAGS)                           \
131         $(SYSTEMD_LOGIN_CFLAGS)                 \
132         $(LIBDRM_CFLAGS)
133 weston_launch_LDADD = $(PAM_LIBS) $(SYSTEMD_LOGIN_LIBS) $(LIBDRM_LIBS)
134
135 if ENABLE_SETUID_INSTALL
136 install-exec-hook:
137         chown root $(DESTDIR)$(bindir)/weston-launch
138         chmod u+s $(DESTDIR)$(bindir)/weston-launch
139 endif
140
141 endif # BUILD_WESTON_LAUNCH
142
143 pkgconfigdir = $(libdir)/pkgconfig
144 pkgconfig_DATA = src/weston.pc
145
146 westonincludedir = $(includedir)/weston
147 westoninclude_HEADERS =                         \
148         src/version.h                           \
149         src/compositor.h                        \
150         shared/matrix.h                         \
151         shared/config-parser.h                  \
152         shared/zalloc.h
153
154 if ENABLE_EGL
155 module_LTLIBRARIES += gl-renderer.la
156 gl_renderer_la_LDFLAGS = -module -avoid-version
157 gl_renderer_la_LIBADD = $(COMPOSITOR_LIBS) $(EGL_LIBS)
158 gl_renderer_la_CFLAGS =                         \
159         $(COMPOSITOR_CFLAGS)                    \
160         $(EGL_CFLAGS)                           \
161         $(GCC_CFLAGS)
162 gl_renderer_la_SOURCES =                        \
163         src/gl-renderer.h                       \
164         src/gl-renderer.c                       \
165         src/vertex-clipping.c                   \
166         src/vertex-clipping.h
167 endif
168
169 if ENABLE_X11_COMPOSITOR
170 module_LTLIBRARIES += x11-backend.la
171 x11_backend_la_LDFLAGS = -module -avoid-version
172 x11_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(X11_COMPOSITOR_LIBS) \
173         libshared-cairo.la
174 x11_backend_la_CFLAGS =                         \
175         $(COMPOSITOR_CFLAGS)                    \
176         $(EGL_CFLAGS)                           \
177         $(PIXMAN_CFLAGS)                        \
178         $(CAIRO_CFLAGS)                         \
179         $(X11_COMPOSITOR_CFLAGS)                \
180         $(GCC_CFLAGS)
181 x11_backend_la_SOURCES = src/compositor-x11.c
182 endif
183
184 if ENABLE_DRM_COMPOSITOR
185 module_LTLIBRARIES += drm-backend.la
186 drm_backend_la_LDFLAGS = -module -avoid-version
187 drm_backend_la_LIBADD =                         \
188         $(COMPOSITOR_LIBS)                      \
189         $(DRM_COMPOSITOR_LIBS)                  \
190         libshared.la -lrt                       \
191         libsession-helper.la
192 drm_backend_la_CFLAGS =                         \
193         $(COMPOSITOR_CFLAGS)                    \
194         $(EGL_CFLAGS)                           \
195         $(DRM_COMPOSITOR_CFLAGS)                \
196         $(GCC_CFLAGS)
197 drm_backend_la_SOURCES =                        \
198         src/compositor-drm.c                    \
199         src/udev-seat.c                         \
200         src/udev-seat.h                         \
201         src/evdev.c                             \
202         src/evdev.h                             \
203         src/evdev-touchpad.c                    \
204         src/libbacklight.c                      \
205         src/libbacklight.h
206
207 if ENABLE_VAAPI_RECORDER
208 drm_backend_la_SOURCES += src/vaapi-recorder.c src/vaapi-recorder.h
209 drm_backend_la_LIBADD += $(LIBVA_LIBS)
210 drm_backend_la_CFLAGS += $(LIBVA_CFLAGS)
211 endif
212 endif
213
214 if ENABLE_WAYLAND_COMPOSITOR
215 module_LTLIBRARIES += wayland-backend.la
216 wayland_backend_la_LDFLAGS = -module -avoid-version
217 wayland_backend_la_LIBADD =                     \
218         $(COMPOSITOR_LIBS)                      \
219         $(WAYLAND_COMPOSITOR_LIBS)              \
220         libshared-cairo.la
221 wayland_backend_la_CFLAGS =                     \
222         $(COMPOSITOR_CFLAGS)                    \
223         $(EGL_CFLAGS)                           \
224         $(PIXMAN_CFLAGS)                        \
225         $(CAIRO_CFLAGS)                         \
226         $(WAYLAND_COMPOSITOR_CFLAGS)            \
227         $(GCC_CFLAGS)
228 wayland_backend_la_SOURCES = src/compositor-wayland.c
229 endif
230
231 if ENABLE_RPI_COMPOSITOR
232 if INSTALL_RPI_COMPOSITOR
233 module_LTLIBRARIES += rpi-backend.la
234 else
235 noinst_LTLIBRARIES += rpi-backend.la
236 endif
237
238 rpi_backend_la_LDFLAGS = -module -avoid-version
239 rpi_backend_la_LIBADD = $(COMPOSITOR_LIBS)      \
240         $(RPI_COMPOSITOR_LIBS)                  \
241         $(RPI_BCM_HOST_LIBS)                    \
242         libsession-helper.la                    \
243         libshared.la
244 rpi_backend_la_CFLAGS =                         \
245         $(GCC_CFLAGS)                           \
246         $(COMPOSITOR_CFLAGS)                    \
247         $(RPI_COMPOSITOR_CFLAGS)                \
248         $(RPI_BCM_HOST_CFLAGS)
249 rpi_backend_la_SOURCES =                        \
250         src/compositor-rpi.c                    \
251         src/rpi-renderer.c                      \
252         src/rpi-renderer.h                      \
253         src/rpi-bcm-stubs.h                     \
254         src/udev-seat.c                         \
255         src/udev-seat.h                         \
256         src/evdev.c                             \
257         src/evdev.h                             \
258         src/evdev-touchpad.c
259
260 if ENABLE_EGL
261 rpi_backend_la_LIBADD += $(EGL_LIBS)
262 rpi_backend_la_CFLAGS += $(EGL_CFLAGS)
263 endif
264
265 endif
266
267 if ENABLE_HEADLESS_COMPOSITOR
268 module_LTLIBRARIES += headless-backend.la
269 headless_backend_la_LDFLAGS = -module -avoid-version
270 headless_backend_la_LIBADD = $(COMPOSITOR_LIBS) \
271         libshared.la
272 headless_backend_la_CFLAGS =                    \
273         $(COMPOSITOR_CFLAGS)                    \
274         $(GCC_CFLAGS)
275 headless_backend_la_SOURCES = src/compositor-headless.c
276 endif
277
278 if ENABLE_FBDEV_COMPOSITOR
279 module_LTLIBRARIES += fbdev-backend.la
280 fbdev_backend_la_LDFLAGS = -module -avoid-version
281 fbdev_backend_la_LIBADD =                       \
282         $(COMPOSITOR_LIBS)                      \
283         $(FBDEV_COMPOSITOR_LIBS)                \
284         libsession-helper.la                    \
285         libshared.la
286 fbdev_backend_la_CFLAGS =                       \
287         $(COMPOSITOR_CFLAGS)                    \
288         $(EGL_CFLAGS)                           \
289         $(FBDEV_COMPOSITOR_CFLAGS)              \
290         $(PIXMAN_CFLAGS)                        \
291         $(GCC_CFLAGS)
292 fbdev_backend_la_SOURCES =                      \
293         src/compositor-fbdev.c                  \
294         src/udev-seat.c                         \
295         src/udev-seat.h                         \
296         src/evdev.c                             \
297         src/evdev.h                             \
298         src/evdev-touchpad.c
299 endif
300
301 if ENABLE_RDP_COMPOSITOR
302 module_LTLIBRARIES += rdp-backend.la
303 rdp_backend_la_LDFLAGS = -module -avoid-version
304 rdp_backend_la_LIBADD = $(COMPOSITOR_LIBS) \
305         $(RDP_COMPOSITOR_LIBS) \
306         libshared.la
307 rdp_backend_la_CFLAGS =                         \
308         $(COMPOSITOR_CFLAGS)                    \
309         $(RDP_COMPOSITOR_CFLAGS)                \
310         $(GCC_CFLAGS)
311 rdp_backend_la_SOURCES = src/compositor-rdp.c
312 endif
313
314 if HAVE_LCMS
315 module_LTLIBRARIES += cms-static.la
316 cms_static_la_LDFLAGS = -module -avoid-version
317 cms_static_la_LIBADD = $(COMPOSITOR_LIBS) $(LCMS_LIBS) libshared.la
318 cms_static_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS) $(LCMS_CFLAGS)
319 cms_static_la_SOURCES =                         \
320         src/cms-static.c                                \
321         src/cms-helper.c                                \
322         src/cms-helper.h
323 if ENABLE_COLORD
324 module_LTLIBRARIES += cms-colord.la
325 cms_colord_la_LDFLAGS = -module -avoid-version
326 cms_colord_la_LIBADD = $(COMPOSITOR_LIBS) $(COLORD_LIBS)
327 cms_colord_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS) $(COLORD_CFLAGS)
328 cms_colord_la_SOURCES =                         \
329         src/cms-colord.c                        \
330         src/cms-helper.c                        \
331         src/cms-helper.h
332 endif
333 endif
334
335 noinst_PROGRAMS += spring-tool
336 spring_tool_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
337 spring_tool_LDADD = $(COMPOSITOR_LIBS) -lm
338 spring_tool_SOURCES =                           \
339         src/spring-tool.c                       \
340         src/animation.c                         \
341         shared/matrix.c                         \
342         shared/matrix.h                         \
343         src/compositor.h
344
345 if BUILD_CLIENTS
346
347 bin_PROGRAMS += weston-terminal weston-info
348
349 libexec_PROGRAMS +=                             \
350         weston-desktop-shell                    \
351         weston-screenshooter                    \
352         weston-keyboard                         \
353         weston-simple-im
354
355 demo_clients =                                  \
356         weston-flower                           \
357         weston-image                            \
358         weston-cliptest                         \
359         weston-dnd                              \
360         weston-smoke                            \
361         weston-resizor                          \
362         weston-eventdemo                        \
363         weston-clickdot                         \
364         weston-transformed                      \
365         weston-fullscreen                       \
366         weston-stacking                         \
367         weston-calibrator                       \
368         weston-scaler
369
370 if INSTALL_DEMO_CLIENTS
371 bin_PROGRAMS += $(demo_clients)
372 else
373 noinst_PROGRAMS += $(demo_clients)
374 endif
375
376
377 if BUILD_SIMPLE_CLIENTS
378 demo_clients +=                                 \
379         weston-simple-shm                       \
380         weston-simple-touch                     \
381         weston-multi-resource
382
383 weston_simple_shm_SOURCES =                     \
384         clients/simple-shm.c                    \
385         protocol/xdg-shell-protocol.c           \
386         protocol/xdg-shell-client-protocol.h    \
387         shared/os-compatibility.c               \
388         shared/os-compatibility.h
389 weston_simple_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
390 weston_simple_shm_LDADD = $(SIMPLE_CLIENT_LIBS)
391
392 weston_simple_touch_SOURCES =                   \
393         clients/simple-touch.c                  \
394         shared/os-compatibility.c               \
395         shared/os-compatibility.h
396 weston_simple_touch_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
397 weston_simple_touch_LDADD = $(SIMPLE_CLIENT_LIBS)
398
399 weston_multi_resource_SOURCES =                 \
400         clients/multi-resource.c                \
401         shared/os-compatibility.c               \
402         shared/os-compatibility.h
403 weston_multi_resource_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
404 weston_multi_resource_LDADD = $(SIMPLE_CLIENT_LIBS) -lm
405 endif
406
407 if BUILD_SIMPLE_EGL_CLIENTS
408 demo_clients += weston-simple-egl
409 weston_simple_egl_SOURCES =                     \
410         clients/simple-egl.c                    \
411         protocol/xdg-shell-protocol.c           \
412         protocol/xdg-shell-client-protocol.h
413 weston_simple_egl_CFLAGS = $(AM_CFLAGS) $(SIMPLE_EGL_CLIENT_CFLAGS)
414 weston_simple_egl_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm
415 endif
416
417 noinst_LTLIBRARIES += libtoytoolkit.la
418
419 libtoytoolkit_la_SOURCES =                              \
420         clients/window.c                                \
421         clients/window.h
422
423 nodist_libtoytoolkit_la_SOURCES =                       \
424         protocol/text-cursor-position-protocol.c        \
425         protocol/text-cursor-position-client-protocol.h \
426         protocol/scaler-protocol.c                      \
427         protocol/scaler-client-protocol.h               \
428         protocol/workspaces-protocol.c                  \
429         protocol/workspaces-client-protocol.h           \
430         protocol/xdg-shell-protocol.c                   \
431         protocol/xdg-shell-client-protocol.h
432
433 BUILT_SOURCES += $(nodist_libtoytoolkit_la_SOURCES)
434
435
436 libtoytoolkit_la_LIBADD =                       \
437         $(CLIENT_LIBS)                          \
438         $(CAIRO_EGL_LIBS)                       \
439         libshared-cairo.la -lrt -lm
440 libtoytoolkit_la_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) $(CAIRO_EGL_CFLAGS)
441
442 weston_flower_SOURCES = clients/flower.c
443 weston_flower_LDADD = libtoytoolkit.la
444 weston_flower_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
445
446 weston_screenshooter_SOURCES =                          \
447         clients/screenshot.c                            \
448         shared/os-compatibility.c                       \
449         shared/os-compatibility.h
450 nodist_weston_screenshooter_SOURCES =                   \
451         protocol/screenshooter-protocol.c               \
452         protocol/screenshooter-client-protocol.h
453 weston_screenshooter_LDADD = $(CLIENT_LIBS)
454 weston_screenshooter_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
455
456 weston_terminal_SOURCES = clients/terminal.c
457 weston_terminal_LDADD = libtoytoolkit.la -lutil
458 weston_terminal_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
459
460 weston_image_SOURCES = clients/image.c
461 weston_image_LDADD = libtoytoolkit.la
462 weston_image_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
463
464 weston_cliptest_SOURCES = clients/cliptest.c
465 weston_cliptest_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
466 weston_cliptest_LDADD = libtoytoolkit.la
467
468 weston_dnd_SOURCES = clients/dnd.c
469 weston_dnd_LDADD = libtoytoolkit.la
470 weston_dnd_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
471
472 weston_smoke_SOURCES = clients/smoke.c
473 weston_smoke_LDADD = libtoytoolkit.la
474 weston_smoke_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
475
476 weston_resizor_SOURCES = clients/resizor.c
477 weston_resizor_LDADD = libtoytoolkit.la
478 weston_resizor_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
479
480 weston_scaler_SOURCES = clients/scaler.c
481 weston_scaler_LDADD = libtoytoolkit.la
482 weston_scaler_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
483
484 if HAVE_CAIRO_GLESV2
485 demo_clients += weston-nested weston-nested-client
486
487 weston_nested_SOURCES = clients/nested.c
488 weston_nested_LDADD = libtoytoolkit.la $(SERVER_LIBS)
489 weston_nested_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
490
491 weston_nested_client_SOURCES = clients/nested-client.c
492 weston_nested_client_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm
493 weston_nested_client_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
494 endif
495
496 weston_eventdemo_SOURCES = clients/eventdemo.c
497 weston_eventdemo_LDADD = libtoytoolkit.la
498 weston_eventdemo_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
499
500 weston_clickdot_SOURCES = clients/clickdot.c
501 weston_clickdot_LDADD = libtoytoolkit.la
502 weston_clickdot_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
503
504 weston_transformed_SOURCES = clients/transformed.c
505 weston_transformed_LDADD = libtoytoolkit.la
506 weston_transformed_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
507
508 weston_fullscreen_SOURCES = clients/fullscreen.c
509 weston_fullscreen_LDADD = libtoytoolkit.la
510 weston_fullscreen_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
511
512 weston_stacking_SOURCES = clients/stacking.c
513 weston_stacking_LDADD = libtoytoolkit.la
514 weston_stacking_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
515
516 weston_calibrator_SOURCES = clients/calibrator.c        \
517         shared/matrix.c                                 \
518         shared/matrix.h
519 weston_calibrator_LDADD = libtoytoolkit.la
520 weston_calibrator_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
521
522 if BUILD_SUBSURFACES_CLIENT
523 demo_clients += weston-subsurfaces
524 weston_subsurfaces_SOURCES = clients/subsurfaces.c
525 weston_subsurfaces_CFLAGS =                     \
526         $(AM_CFLAGS)                            \
527         $(SIMPLE_EGL_CLIENT_CFLAGS)             \
528         $(CLIENT_CFLAGS)
529 weston_subsurfaces_LDADD = libtoytoolkit.la $(SIMPLE_EGL_CLIENT_LIBS) -lm
530 endif
531
532 if HAVE_PANGO
533 demo_clients += weston-editor
534 weston_editor_SOURCES = clients/editor.c
535 nodist_weston_editor_SOURCES =                  \
536         protocol/text-protocol.c                \
537         protocol/text-client-protocol.h
538 weston_editor_LDADD = libtoytoolkit.la $(PANGO_LIBS)
539 weston_editor_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) $(PANGO_CFLAGS)
540 endif
541
542 weston_keyboard_SOURCES = clients/keyboard.c
543 nodist_weston_keyboard_SOURCES =                        \
544         protocol/desktop-shell-client-protocol.h        \
545         protocol/desktop-shell-protocol.c               \
546         protocol/input-method-protocol.c                \
547         protocol/input-method-client-protocol.h
548 weston_keyboard_LDADD = libtoytoolkit.la
549 weston_keyboard_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
550
551 weston_simple_im_SOURCES = clients/weston-simple-im.c
552 nodist_weston_simple_im_SOURCES =               \
553         protocol/input-method-protocol.c        \
554         protocol/input-method-client-protocol.h
555 weston_simple_im_LDADD = $(CLIENT_LIBS)
556 weston_simple_im_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
557
558 weston_info_SOURCES =                           \
559         clients/weston-info.c                   \
560         shared/os-compatibility.c               \
561         shared/os-compatibility.h
562 weston_info_LDADD = $(WESTON_INFO_LIBS)
563 weston_info_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
564
565 weston_desktop_shell_SOURCES = clients/desktop-shell.c
566 nodist_weston_desktop_shell_SOURCES =                   \
567         protocol/desktop-shell-client-protocol.h        \
568         protocol/desktop-shell-protocol.c
569 weston_desktop_shell_LDADD = libtoytoolkit.la
570 weston_desktop_shell_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
571
572 if BUILD_FULL_GL_CLIENTS
573 demo_clients += weston-gears
574 weston_gears_SOURCES = clients/gears.c
575 weston_gears_LDADD = libtoytoolkit.la
576 weston_gears_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
577
578 if HAVE_GLU
579 libexec_PROGRAMS += weston-screensaver
580 weston_screensaver_SOURCES =                            \
581         clients/wscreensaver.c                          \
582         clients/wscreensaver.h                          \
583         clients/wscreensaver-glue.c                     \
584         clients/wscreensaver-glue.h                     \
585         clients/glmatrix.c                              \
586         clients/matrix3.xpm
587 nodist_weston_screensaver_SOURCES =                     \
588         protocol/desktop-shell-client-protocol.h        \
589         protocol/desktop-shell-protocol.c
590
591 weston_screensaver_LDADD = libtoytoolkit.la $(GLU_LIBS)
592 weston_screensaver_CFLAGS = $(AM_CFLAGS) $(GLU_CFLAGS) $(CLIENT_CFLAGS)
593
594 endif
595
596 endif
597
598 endif
599
600 BUILT_SOURCES +=                                        \
601         protocol/screenshooter-protocol.c               \
602         protocol/screenshooter-client-protocol.h        \
603         protocol/text-cursor-position-client-protocol.h \
604         protocol/text-cursor-position-protocol.c        \
605         protocol/text-protocol.c                        \
606         protocol/text-client-protocol.h                 \
607         protocol/input-method-protocol.c                \
608         protocol/input-method-client-protocol.h         \
609         protocol/desktop-shell-client-protocol.h        \
610         protocol/desktop-shell-protocol.c               \
611         protocol/scaler-client-protocol.h               \
612         protocol/scaler-protocol.c                      \
613         protocol/workspaces-client-protocol.h           \
614         protocol/workspaces-protocol.c                  \
615         protocol/xdg-shell-protocol.c                   \
616         protocol/xdg-shell-client-protocol.h
617
618
619 westondatadir = $(datadir)/weston
620 dist_westondata_DATA =                          \
621         data/wayland.svg                        \
622         data/wayland.png                        \
623         data/pattern.png                        \
624         data/terminal.png                       \
625         data/border.png                         \
626         data/icon_window.png                    \
627         data/sign_close.png                     \
628         data/sign_maximize.png                  \
629         data/sign_minimize.png
630
631
632 if BUILD_WCAP_TOOLS
633 bin_PROGRAMS += wcap-decode
634
635 wcap_decode_SOURCES =                           \
636         wcap/main.c                             \
637         wcap/wcap-decode.c                      \
638         wcap/wcap-decode.h
639
640 wcap_decode_CFLAGS = $(GCC_CFLAGS) $(WCAP_CFLAGS)
641 wcap_decode_LDADD = $(WCAP_LIBS)
642 endif
643
644
645 if ENABLE_DESKTOP_SHELL
646
647 module_LTLIBRARIES += desktop-shell.la
648
649 desktop_shell_la_CPPFLAGS =                     \
650         -I$(top_builddir)/protocol              \
651         -I$(top_srcdir)/shared                  \
652         -I$(top_srcdir)/src                     \
653         -I$(top_builddir)/src                   \
654         -I$(top_builddir)/desktop-shell         \
655         -DDATADIR='"$(datadir)"'                \
656         -DMODULEDIR='"$(moduledir)"'            \
657         -DLIBEXECDIR='"$(libexecdir)"'          \
658         -DIN_WESTON
659
660 desktop_shell_la_LDFLAGS = -module -avoid-version
661 desktop_shell_la_LIBADD = $(COMPOSITOR_LIBS)    \
662         libshared.la
663 desktop_shell_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
664 desktop_shell_la_SOURCES =                              \
665         desktop-shell/shell.h                           \
666         desktop-shell/shell.c                           \
667         desktop-shell/exposay.c                         \
668         desktop-shell/input-panel.c
669 nodist_desktop_shell_la_SOURCES =                       \
670         protocol/desktop-shell-protocol.c               \
671         protocol/desktop-shell-server-protocol.h        \
672         protocol/xdg-shell-protocol.c                   \
673         protocol/xdg-shell-server-protocol.h
674
675 BUILT_SOURCES += $(nodist_desktop_shell_la_SOURCES)
676 endif
677
678
679 if ENABLE_XWAYLAND
680
681 module_LTLIBRARIES += xwayland.la
682
683 xwayland_la_CPPFLAGS =                          \
684         -I$(top_builddir)/protocol              \
685         -I$(top_srcdir)/shared                  \
686         -I$(top_srcdir)/src                     \
687         -I$(top_builddir)/src                   \
688         -I$(top_builddir)/xwayland              \
689         -DDATADIR='"$(datadir)"'                \
690         -DMODULEDIR='"$(moduledir)"'            \
691         -DLIBEXECDIR='"$(libexecdir)"'          \
692         -DXSERVER_PATH='"@XSERVER_PATH@"'
693
694 xwayland_la_LDFLAGS = -module -avoid-version
695 xwayland_la_LIBADD =                    \
696         $(XWAYLAND_LIBS)                \
697         $(top_builddir)/libshared-cairo.la
698 xwayland_la_CFLAGS =                            \
699         $(GCC_CFLAGS)                           \
700         $(COMPOSITOR_CFLAGS)                    \
701         $(PIXMAN_CFLAGS)                        \
702         $(CAIRO_CFLAGS)
703 xwayland_la_SOURCES =                           \
704         xwayland/xwayland.h                     \
705         xwayland/window-manager.c               \
706         xwayland/selection.c                    \
707         xwayland/dnd.c                          \
708         xwayland/launcher.c                     \
709         xwayland/hash.c                         \
710         xwayland/hash.h
711 nodist_xwayland_la_SOURCES =                    \
712         protocol/xserver-protocol.c             \
713         protocol/xserver-server-protocol.h
714
715 BUILT_SOURCES += $(nodist_xwayland_la_SOURCES)
716 endif
717
718
719 #
720 # Shared utilities
721 #
722
723 noinst_LTLIBRARIES += libshared.la libshared-cairo.la
724
725 libshared_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
726
727 libshared_la_SOURCES =                          \
728         shared/config-parser.c                  \
729         shared/option-parser.c                  \
730         shared/config-parser.h                  \
731         shared/os-compatibility.c               \
732         shared/os-compatibility.h
733
734 libshared_cairo_la_CFLAGS =                     \
735         -DDATADIR='"$(datadir)"'                \
736         $(GCC_CFLAGS)                           \
737         $(COMPOSITOR_CFLAGS)                    \
738         $(PIXMAN_CFLAGS)                        \
739         $(CAIRO_CFLAGS)                         \
740         $(PNG_CFLAGS)                           \
741         $(WEBP_CFLAGS)
742
743 libshared_cairo_la_LIBADD =                     \
744         $(PIXMAN_LIBS)                          \
745         $(CAIRO_LIBS)                           \
746         $(PNG_LIBS)                             \
747         $(WEBP_LIBS)                            \
748         $(JPEG_LIBS)
749
750 libshared_cairo_la_SOURCES =                    \
751         $(libshared_la_SOURCES)                 \
752         shared/image-loader.c                   \
753         shared/image-loader.h                   \
754         shared/cairo-util.c                     \
755         shared/frame.c                          \
756         shared/cairo-util.h
757
758
759 #
760 # tests subdirectory
761 #
762
763 TESTS = $(shared_tests) $(module_tests) $(weston_tests)
764
765 shared_tests =                                  \
766         config-parser.test                      \
767         vertex-clip.test
768
769 module_tests =                                  \
770         surface-test.la                         \
771         surface-global-test.la
772
773 weston_tests =                                  \
774         bad_buffer.weston                       \
775         keyboard.weston                         \
776         event.weston                            \
777         button.weston                           \
778         text.weston                             \
779         subsurface.weston
780
781
782 AM_TESTS_ENVIRONMENT = \
783         abs_builddir='$(abs_builddir)'; export abs_builddir;
784
785 TEST_EXTENSIONS = .la .weston
786 LA_LOG_COMPILER = $(srcdir)/tests/weston-tests-env
787 WESTON_LOG_COMPILER = $(srcdir)/tests/weston-tests-env
788
789 clean-local:
790         -rm -rf tests/logs
791
792 # To remove when automake 1.11 support is dropped
793 export abs_builddir
794
795 noinst_LTLIBRARIES +=                   \
796         weston-test.la                  \
797         $(module_tests)                 \
798         libtest-runner.la               \
799         libtest-client.la
800
801 noinst_PROGRAMS +=                      \
802         $(setbacklight)                 \
803         $(shared_tests)                 \
804         $(weston_tests)                 \
805         matrix-test
806
807 test_module_ldflags = \
808         -module -avoid-version -rpath $(libdir) $(COMPOSITOR_LIBS)
809
810 surface_global_test_la_SOURCES = tests/surface-global-test.c
811 surface_global_test_la_LDFLAGS = $(test_module_ldflags)
812 surface_global_test_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
813
814 surface_test_la_SOURCES = tests/surface-test.c
815 surface_test_la_LDFLAGS = $(test_module_ldflags)
816 surface_test_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
817
818 weston_test_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la
819 weston_test_la_LDFLAGS = $(test_module_ldflags)
820 weston_test_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
821 weston_test_la_SOURCES = tests/weston-test.c
822 nodist_weston_test_la_SOURCES =                 \
823         protocol/wayland-test-protocol.c        \
824         protocol/wayland-test-server-protocol.h
825
826 if ENABLE_EGL
827 weston_test_la_CFLAGS += $(EGL_TESTS_CFLAGS)
828 weston_test_la_LDFLAGS += $(EGL_TESTS_LIBS)
829 endif
830
831 libtest_runner_la_SOURCES =                     \
832         tests/weston-test-runner.c              \
833         tests/weston-test-runner.h
834 libtest_runner_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
835
836 config_parser_test_SOURCES = tests/config-parser-test.c
837 config_parser_test_LDADD = libshared.la libtest-runner.la $(COMPOSITOR_LIBS)
838
839 vertex_clip_test_SOURCES =                      \
840         tests/vertex-clip-test.c                \
841         src/vertex-clipping.c                   \
842         src/vertex-clipping.h
843 vertex_clip_test_LDADD = libtest-runner.la -lm -lrt
844
845 libtest_client_la_SOURCES =                     \
846         tests/weston-test-client-helper.c       \
847         tests/weston-test-client-helper.h
848 nodist_libtest_client_la_SOURCES =              \
849         protocol/wayland-test-protocol.c        \
850         protocol/wayland-test-client-protocol.h
851 libtest_client_la_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
852 libtest_client_la_LIBADD = $(TEST_CLIENT_LIBS) libshared.la libtest-runner.la
853
854 bad_buffer_weston_SOURCES = tests/bad-buffer-test.c
855 bad_buffer_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
856 bad_buffer_weston_LDADD = libtest-client.la
857
858 keyboard_weston_SOURCES = tests/keyboard-test.c
859 keyboard_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
860 keyboard_weston_LDADD = libtest-client.la
861
862 event_weston_SOURCES = tests/event-test.c
863 event_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
864 event_weston_LDADD = libtest-client.la
865
866 button_weston_SOURCES = tests/button-test.c
867 button_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
868 button_weston_LDADD = libtest-client.la
869
870 text_weston_SOURCES = tests/text-test.c
871 nodist_text_weston_SOURCES =                    \
872         protocol/text-protocol.c                \
873         protocol/text-client-protocol.h
874 text_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
875 text_weston_LDADD = libtest-client.la
876
877 subsurface_weston_SOURCES = tests/subsurface-test.c
878 subsurface_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
879 subsurface_weston_LDADD = libtest-client.la
880
881 if ENABLE_EGL
882 weston_tests += buffer-count.weston
883 buffer_count_weston_SOURCES = tests/buffer-count-test.c
884 buffer_count_weston_CFLAGS = $(GCC_CFLAGS) $(EGL_TESTS_CFLAGS)
885 buffer_count_weston_LDADD = libtest-client.la $(EGL_TESTS_LIBS)
886 endif
887
888 if ENABLE_XWAYLAND_TEST
889 weston_tests += xwayland.weston
890 xwayland_weston_SOURCES = tests/xwayland-test.c
891 xwayland_weston_CFLAGS = $(GCC_CFLAGS) $(XWAYLAND_TEST_CFLAGS)
892 xwayland_weston_LDADD = libtest-client.la $(XWAYLAND_TEST_LIBS)
893 endif
894
895 matrix_test_SOURCES =                           \
896         tests/matrix-test.c                     \
897         shared/matrix.c                         \
898         shared/matrix.h
899 matrix_test_CPPFLAGS = -DUNIT_TEST
900 matrix_test_LDADD = -lm -lrt
901
902 if BUILD_SETBACKLIGHT
903 noinst_PROGRAMS += setbacklight
904 setbacklight_SOURCES =                          \
905         tests/setbacklight.c                    \
906         src/libbacklight.c                      \
907         src/libbacklight.h
908 setbacklight_CFLAGS = $(AM_CFLAGS) $(SETBACKLIGHT_CFLAGS)
909 setbacklight_LDADD = $(SETBACKLIGHT_LIBS)
910 endif
911
912 EXTRA_DIST += tests/weston-tests-env
913
914 BUILT_SOURCES +=                                \
915         protocol/wayland-test-protocol.c        \
916         protocol/wayland-test-server-protocol.h \
917         protocol/wayland-test-client-protocol.h \
918         protocol/text-protocol.c                \
919         protocol/text-client-protocol.h
920
921 EXTRA_DIST +=                                   \
922         protocol/desktop-shell.xml              \
923         protocol/screenshooter.xml              \
924         protocol/xserver.xml                    \
925         protocol/text.xml                       \
926         protocol/input-method.xml               \
927         protocol/workspaces.xml                 \
928         protocol/text-cursor-position.xml       \
929         protocol/wayland-test.xml               \
930         protocol/xdg-shell.xml                  \
931         protocol/scaler.xml
932
933 man_MANS = weston.1 weston.ini.5
934
935 if ENABLE_DRM_COMPOSITOR
936 man_MANS += weston-drm.7
937 endif
938
939 MAN_SUBSTS =                                                            \
940         -e 's|__weston_native_backend__|$(WESTON_NATIVE_BACKEND)|g'     \
941         -e 's|__weston_modules_dir__|$(pkglibdir)|g'                    \
942         -e 's|__weston_shell_client__|$(WESTON_SHELL_CLIENT)|g'         \
943         -e 's|__version__|$(PACKAGE_VERSION)|g'
944
945 SUFFIXES = .1 .5 .7 .man
946
947 %.1 %.5 %.7 : man/%.man
948         $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
949
950 EXTRA_DIST +=                                   \
951         man/weston.man                          \
952         man/weston-drm.man                      \
953         man/weston.ini.man
954
955 CLEANFILES += $(man_MANS)
956
957
958 protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
959         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
960
961 protocol/%-server-protocol.h : $(top_srcdir)/protocol/%.xml
962         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < $< > $@
963
964 protocol/%-client-protocol.h : $(top_srcdir)/protocol/%.xml
965         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@