build: fix weston-info CFLAGS
[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 weston_info_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
551
552 weston_desktop_shell_SOURCES = clients/desktop-shell.c
553 nodist_weston_desktop_shell_SOURCES =                   \
554         protocol/desktop-shell-client-protocol.h        \
555         protocol/desktop-shell-protocol.c
556 weston_desktop_shell_LDADD = libtoytoolkit.la
557 weston_desktop_shell_CFLAGS = $(CLIENT_CFLAGS)
558
559 if BUILD_FULL_GL_CLIENTS
560 demo_clients += weston-gears
561 weston_gears_SOURCES = clients/gears.c
562 weston_gears_LDADD = libtoytoolkit.la
563 weston_gears_CFLAGS = $(CLIENT_CFLAGS)
564
565 if HAVE_GLU
566 libexec_PROGRAMS += weston-screensaver
567 weston_screensaver_SOURCES =                            \
568         clients/wscreensaver.c                          \
569         clients/wscreensaver.h                          \
570         clients/wscreensaver-glue.c                     \
571         clients/wscreensaver-glue.h                     \
572         clients/glmatrix.c                              \
573         clients/matrix3.xpm
574 nodist_weston_screensaver_SOURCES =                     \
575         protocol/desktop-shell-client-protocol.h        \
576         protocol/desktop-shell-protocol.c
577
578 weston_screensaver_LDADD = libtoytoolkit.la $(GLU_LIBS)
579 weston_screensaver_CFLAGS = $(GLU_CFLAGS) $(CLIENT_CFLAGS)
580
581 endif
582
583 endif
584
585 endif
586
587 BUILT_SOURCES +=                                        \
588         protocol/screenshooter-protocol.c               \
589         protocol/screenshooter-client-protocol.h        \
590         protocol/text-cursor-position-client-protocol.h \
591         protocol/text-cursor-position-protocol.c        \
592         protocol/text-protocol.c                        \
593         protocol/text-client-protocol.h                 \
594         protocol/input-method-protocol.c                \
595         protocol/input-method-client-protocol.h         \
596         protocol/desktop-shell-client-protocol.h        \
597         protocol/desktop-shell-protocol.c               \
598         protocol/scaler-client-protocol.h               \
599         protocol/scaler-protocol.c                      \
600         protocol/workspaces-client-protocol.h           \
601         protocol/workspaces-protocol.c                  \
602         protocol/xdg-shell-protocol.c                   \
603         protocol/xdg-shell-client-protocol.h
604
605
606 westondatadir = $(datadir)/weston
607 dist_westondata_DATA =                          \
608         data/wayland.svg                        \
609         data/wayland.png                        \
610         data/pattern.png                        \
611         data/terminal.png                       \
612         data/border.png                         \
613         data/icon_window.png                    \
614         data/sign_close.png                     \
615         data/sign_maximize.png                  \
616         data/sign_minimize.png
617
618
619 if BUILD_WCAP_TOOLS
620 bin_PROGRAMS += wcap-decode
621
622 wcap_decode_SOURCES =                           \
623         wcap/main.c                             \
624         wcap/wcap-decode.c                      \
625         wcap/wcap-decode.h
626
627 wcap_decode_CFLAGS = $(GCC_CFLAGS) $(WCAP_CFLAGS)
628 wcap_decode_LDADD = $(WCAP_LIBS)
629 endif
630
631
632 if ENABLE_DESKTOP_SHELL
633
634 module_LTLIBRARIES += desktop-shell.la
635
636 desktop_shell_la_CPPFLAGS =                     \
637         -I$(top_builddir)/protocol              \
638         -I$(top_srcdir)/shared                  \
639         -I$(top_srcdir)/src                     \
640         -I$(top_builddir)/src                   \
641         -I$(top_builddir)/desktop-shell         \
642         -DDATADIR='"$(datadir)"'                \
643         -DMODULEDIR='"$(moduledir)"'            \
644         -DLIBEXECDIR='"$(libexecdir)"'          \
645         -DIN_WESTON
646
647 desktop_shell_la_LDFLAGS = -module -avoid-version
648 desktop_shell_la_LIBADD = $(COMPOSITOR_LIBS)    \
649         libshared.la
650 desktop_shell_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
651 desktop_shell_la_SOURCES =                              \
652         desktop-shell/shell.h                           \
653         desktop-shell/shell.c                           \
654         desktop-shell/exposay.c                         \
655         desktop-shell/input-panel.c
656 nodist_desktop_shell_la_SOURCES =                       \
657         protocol/desktop-shell-protocol.c               \
658         protocol/desktop-shell-server-protocol.h        \
659         protocol/xdg-shell-protocol.c                   \
660         protocol/xdg-shell-server-protocol.h
661
662 BUILT_SOURCES += $(nodist_desktop_shell_la_SOURCES)
663 endif
664
665
666 if ENABLE_XWAYLAND
667
668 module_LTLIBRARIES += xwayland.la
669
670 xwayland_la_CPPFLAGS =                          \
671         -I$(top_builddir)/protocol              \
672         -I$(top_srcdir)/shared                  \
673         -I$(top_srcdir)/src                     \
674         -I$(top_builddir)/src                   \
675         -I$(top_builddir)/xwayland              \
676         -DDATADIR='"$(datadir)"'                \
677         -DMODULEDIR='"$(moduledir)"'            \
678         -DLIBEXECDIR='"$(libexecdir)"'          \
679         -DXSERVER_PATH='"@XSERVER_PATH@"'
680
681 xwayland_la_LDFLAGS = -module -avoid-version
682 xwayland_la_LIBADD =                    \
683         $(XWAYLAND_LIBS)                \
684         $(top_builddir)/libshared-cairo.la
685 xwayland_la_CFLAGS =                            \
686         $(GCC_CFLAGS)                           \
687         $(COMPOSITOR_CFLAGS)                    \
688         $(PIXMAN_CFLAGS)                        \
689         $(CAIRO_CFLAGS)
690 xwayland_la_SOURCES =                           \
691         xwayland/xwayland.h                     \
692         xwayland/window-manager.c               \
693         xwayland/selection.c                    \
694         xwayland/dnd.c                          \
695         xwayland/launcher.c                     \
696         xwayland/hash.c                         \
697         xwayland/hash.h
698 nodist_xwayland_la_SOURCES =                    \
699         protocol/xserver-protocol.c             \
700         protocol/xserver-server-protocol.h
701
702 BUILT_SOURCES += $(nodist_xwayland_la_SOURCES)
703 endif
704
705
706 #
707 # Shared utilities
708 #
709
710 noinst_LTLIBRARIES += libshared.la libshared-cairo.la
711
712 libshared_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
713
714 libshared_la_SOURCES =                          \
715         shared/config-parser.c                  \
716         shared/option-parser.c                  \
717         shared/config-parser.h                  \
718         shared/os-compatibility.c               \
719         shared/os-compatibility.h
720
721 libshared_cairo_la_CFLAGS =                     \
722         -DDATADIR='"$(datadir)"'                \
723         $(GCC_CFLAGS)                           \
724         $(COMPOSITOR_CFLAGS)                    \
725         $(PIXMAN_CFLAGS)                        \
726         $(CAIRO_CFLAGS)                         \
727         $(PNG_CFLAGS)                           \
728         $(WEBP_CFLAGS)
729
730 libshared_cairo_la_LIBADD =                     \
731         $(PIXMAN_LIBS)                          \
732         $(CAIRO_LIBS)                           \
733         $(PNG_LIBS)                             \
734         $(WEBP_LIBS)                            \
735         $(JPEG_LIBS)
736
737 libshared_cairo_la_SOURCES =                    \
738         $(libshared_la_SOURCES)                 \
739         shared/image-loader.c                   \
740         shared/image-loader.h                   \
741         shared/cairo-util.c                     \
742         shared/frame.c                          \
743         shared/cairo-util.h
744
745
746 #
747 # tests subdirectory
748 #
749
750 TESTS = $(shared_tests) $(module_tests) $(weston_tests)
751
752 shared_tests =                                  \
753         config-parser.test                      \
754         vertex-clip.test
755
756 module_tests =                                  \
757         surface-test.la                         \
758         surface-global-test.la
759
760 weston_tests =                                  \
761         bad_buffer.weston                       \
762         keyboard.weston                         \
763         event.weston                            \
764         button.weston                           \
765         text.weston                             \
766         subsurface.weston
767
768
769 AM_TESTS_ENVIRONMENT = \
770         abs_builddir='$(abs_builddir)'; export abs_builddir;
771
772 TEST_EXTENSIONS = .la .weston
773 LA_LOG_COMPILER = $(srcdir)/tests/weston-tests-env
774 WESTON_LOG_COMPILER = $(srcdir)/tests/weston-tests-env
775
776 clean-local:
777         -rm -rf tests/logs
778
779 # To remove when automake 1.11 support is dropped
780 export abs_builddir
781
782 noinst_LTLIBRARIES +=                   \
783         weston-test.la                  \
784         $(module_tests)                 \
785         libtest-runner.la               \
786         libtest-client.la
787
788 noinst_PROGRAMS +=                      \
789         $(setbacklight)                 \
790         $(shared_tests)                 \
791         $(weston_tests)                 \
792         matrix-test
793
794 test_module_ldflags = \
795         -module -avoid-version -rpath $(libdir) $(COMPOSITOR_LIBS)
796
797 surface_global_test_la_SOURCES = tests/surface-global-test.c
798 surface_global_test_la_LDFLAGS = $(test_module_ldflags)
799 surface_global_test_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
800
801 surface_test_la_SOURCES = tests/surface-test.c
802 surface_test_la_LDFLAGS = $(test_module_ldflags)
803 surface_test_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
804
805 weston_test_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la
806 weston_test_la_LDFLAGS = $(test_module_ldflags)
807 weston_test_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
808 weston_test_la_SOURCES = tests/weston-test.c
809 nodist_weston_test_la_SOURCES =                 \
810         protocol/wayland-test-protocol.c        \
811         protocol/wayland-test-server-protocol.h
812
813 if ENABLE_EGL
814 weston_test_la_CFLAGS += $(EGL_TESTS_CFLAGS)
815 weston_test_la_LDFLAGS += $(EGL_TESTS_LIBS)
816 endif
817
818 libtest_runner_la_SOURCES =                     \
819         tests/weston-test-runner.c              \
820         tests/weston-test-runner.h
821 libtest_runner_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
822
823 config_parser_test_SOURCES = tests/config-parser-test.c
824 config_parser_test_LDADD = libshared.la libtest-runner.la $(COMPOSITOR_LIBS)
825
826 vertex_clip_test_SOURCES =                      \
827         tests/vertex-clip-test.c                \
828         src/vertex-clipping.c                   \
829         src/vertex-clipping.h
830 vertex_clip_test_LDADD = libtest-runner.la -lm -lrt
831
832 libtest_client_la_SOURCES =                     \
833         tests/weston-test-client-helper.c       \
834         tests/weston-test-client-helper.h
835 nodist_libtest_client_la_SOURCES =              \
836         protocol/wayland-test-protocol.c        \
837         protocol/wayland-test-client-protocol.h
838 libtest_client_la_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CLIENT_CFLAGS)
839 libtest_client_la_LIBADD = $(TEST_CLIENT_LIBS) libshared.la libtest-runner.la
840
841 bad_buffer_weston_SOURCES = tests/bad-buffer-test.c
842 bad_buffer_weston_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CLIENT_CFLAGS)
843 bad_buffer_weston_LDADD = libtest-client.la
844
845 keyboard_weston_SOURCES = tests/keyboard-test.c
846 keyboard_weston_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CLIENT_CFLAGS)
847 keyboard_weston_LDADD = libtest-client.la
848
849 event_weston_SOURCES = tests/event-test.c
850 event_weston_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CLIENT_CFLAGS)
851 event_weston_LDADD = libtest-client.la
852
853 button_weston_SOURCES = tests/button-test.c
854 button_weston_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CLIENT_CFLAGS)
855 button_weston_LDADD = libtest-client.la
856
857 text_weston_SOURCES = tests/text-test.c
858 nodist_text_weston_SOURCES =                    \
859         protocol/text-protocol.c                \
860         protocol/text-client-protocol.h
861 text_weston_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CLIENT_CFLAGS)
862 text_weston_LDADD = libtest-client.la
863
864 subsurface_weston_SOURCES = tests/subsurface-test.c
865 subsurface_weston_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CLIENT_CFLAGS)
866 subsurface_weston_LDADD = libtest-client.la
867
868 if ENABLE_EGL
869 weston_tests += buffer-count.weston
870 buffer_count_weston_SOURCES = tests/buffer-count-test.c
871 buffer_count_weston_CFLAGS = $(GCC_CFLAGS) $(EGL_TESTS_CFLAGS)
872 buffer_count_weston_LDADD = libtest-client.la $(EGL_TESTS_LIBS)
873 endif
874
875 if ENABLE_XWAYLAND_TEST
876 weston_tests += xwayland.weston
877 xwayland_weston_SOURCES = tests/xwayland-test.c
878 xwayland_weston_CFLAGS = $(GCC_CFLAGS) $(XWAYLAND_TEST_CFLAGS)
879 xwayland_weston_LDADD = libtest-client.la $(XWAYLAND_TEST_LIBS)
880 endif
881
882 matrix_test_SOURCES =                           \
883         tests/matrix-test.c                     \
884         shared/matrix.c                         \
885         shared/matrix.h
886 matrix_test_CPPFLAGS = -DUNIT_TEST
887 matrix_test_LDADD = -lm -lrt
888
889 if BUILD_SETBACKLIGHT
890 noinst_PROGRAMS += setbacklight
891 setbacklight_SOURCES =                          \
892         tests/setbacklight.c                    \
893         src/libbacklight.c                      \
894         src/libbacklight.h
895 setbacklight_CFLAGS = $(AM_CFLAGS) $(SETBACKLIGHT_CFLAGS)
896 setbacklight_LDADD = $(SETBACKLIGHT_LIBS)
897 endif
898
899 EXTRA_DIST += tests/weston-tests-env
900
901 BUILT_SOURCES +=                                \
902         protocol/wayland-test-protocol.c        \
903         protocol/wayland-test-server-protocol.h \
904         protocol/wayland-test-client-protocol.h \
905         protocol/text-protocol.c                \
906         protocol/text-client-protocol.h
907
908 EXTRA_DIST +=                                   \
909         protocol/desktop-shell.xml              \
910         protocol/screenshooter.xml              \
911         protocol/xserver.xml                    \
912         protocol/text.xml                       \
913         protocol/input-method.xml               \
914         protocol/workspaces.xml                 \
915         protocol/text-cursor-position.xml       \
916         protocol/wayland-test.xml               \
917         protocol/xdg-shell.xml                  \
918         protocol/scaler.xml
919
920 man_MANS = weston.1 weston.ini.5
921
922 if ENABLE_DRM_COMPOSITOR
923 man_MANS += weston-drm.7
924 endif
925
926 MAN_SUBSTS =                                                            \
927         -e 's|__weston_native_backend__|$(WESTON_NATIVE_BACKEND)|g'     \
928         -e 's|__weston_modules_dir__|$(pkglibdir)|g'                    \
929         -e 's|__weston_shell_client__|$(WESTON_SHELL_CLIENT)|g'         \
930         -e 's|__version__|$(PACKAGE_VERSION)|g'
931
932 SUFFIXES = .1 .5 .7 .man
933
934 %.1 %.5 %.7 : man/%.man
935         $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
936
937 EXTRA_DIST +=                                   \
938         man/weston.man                          \
939         man/weston-drm.man                      \
940         man/weston.ini.man
941
942 CLEANFILES += $(man_MANS)
943
944
945 protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
946         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
947
948 protocol/%-server-protocol.h : $(top_srcdir)/protocol/%.xml
949         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < $< > $@
950
951 protocol/%-client-protocol.h : $(top_srcdir)/protocol/%.xml
952         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@