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