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