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