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