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