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