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