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