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