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