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