3 moduledir = $(libdir)/weston
12 DISTCHECK_CONFIGURE_FLAGS = --disable-setuid-install
14 EXTRA_DIST = weston.ini.in wayland-scanner.mk
16 weston.ini : $(srcdir)/weston.ini.in
18 -e 's|@bindir[@]|$(bindir)|g' \
19 -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
20 -e 's|@libexecdir[@]|$(libexecdir)|g' \
23 all-local : weston.ini validate-protocol-xml
25 AM_CFLAGS = $(GCC_CFLAGS)
29 -I$(top_builddir)/src \
30 -I$(top_builddir)/tests \
31 -I$(top_srcdir)/shared \
32 -DDATADIR='"$(datadir)"' \
33 -DMODULEDIR='"$(moduledir)"' \
34 -DLIBEXECDIR='"$(libexecdir)"'
36 CLEANFILES = weston.ini $(BUILT_SOURCES)
38 bin_PROGRAMS += weston
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 shared/libshared.la
56 src/screenshooter-protocol.c \
57 src/screenshooter-server-protocol.h \
59 src/text-cursor-position-protocol.c \
60 src/text-cursor-position-server-protocol.h \
64 src/text-server-protocol.h \
65 src/input-method-protocol.c \
66 src/input-method-server-protocol.h \
67 src/workspaces-protocol.c \
68 src/workspaces-server-protocol.h \
69 src/scaler-protocol.c \
70 src/scaler-server-protocol.h \
74 src/pixman-renderer.c \
75 src/pixman-renderer.h \
81 noinst_LTLIBRARIES += \
84 libsession_helper_la_SOURCES = \
88 libsession_helper_la_CFLAGS = $(GCC_CFLAGS) $(LIBDRM_CFLAGS) $(PIXMAN_CFLAGS) $(COMPOSITOR_CFLAGS)
89 libsession_helper_la_LIBADD = $(LIBDRM_LIBS)
93 libsession_helper_la_SOURCES += \
98 libsession_helper_la_CFLAGS += $(SYSTEMD_LOGIN_CFLAGS) $(DBUS_CFLAGS)
99 libsession_helper_la_LIBADD += $(SYSTEMD_LOGIN_LIBS) $(DBUS_LIBS)
103 src/git-version.h : .FORCE
104 $(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)')\"" > $@-new; \
105 cmp -s $@ $@-new || cp $@-new $@; \
110 if BUILD_WESTON_LAUNCH
111 bin_PROGRAMS += weston-launch
112 weston_launch_SOURCES = src/weston-launch.c src/weston-launch.h
113 weston_launch_CPPFLAGS = -DBINDIR='"$(bindir)"'
114 weston_launch_CFLAGS= \
117 $(SYSTEMD_LOGIN_CFLAGS) \
119 weston_launch_LDADD = $(PAM_LIBS) $(SYSTEMD_LOGIN_LIBS) $(LIBDRM_LIBS)
121 if ENABLE_SETUID_INSTALL
123 chown root $(DESTDIR)$(bindir)/weston-launch
124 chmod u+s $(DESTDIR)$(bindir)/weston-launch
127 endif # BUILD_WESTON_LAUNCH
129 pkgconfigdir = $(libdir)/pkgconfig
130 pkgconfig_DATA = src/weston.pc
132 westonincludedir = $(includedir)/weston
133 westoninclude_HEADERS = \
137 shared/config-parser.h \
141 module_LTLIBRARIES += gl-renderer.la
142 gl_renderer_la_LDFLAGS = -module -avoid-version
143 gl_renderer_la_LIBADD = $(COMPOSITOR_LIBS) $(EGL_LIBS)
144 gl_renderer_la_CFLAGS = \
145 $(COMPOSITOR_CFLAGS) \
148 gl_renderer_la_SOURCES = \
151 src/vertex-clipping.c \
152 src/vertex-clipping.h
155 if ENABLE_X11_COMPOSITOR
156 module_LTLIBRARIES += x11-backend.la
157 x11_backend_la_LDFLAGS = -module -avoid-version
158 x11_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(X11_COMPOSITOR_LIBS) \
159 shared/libshared-cairo.la
160 x11_backend_la_CFLAGS = \
161 $(COMPOSITOR_CFLAGS) \
165 $(X11_COMPOSITOR_CFLAGS) \
167 x11_backend_la_SOURCES = src/compositor-x11.c
170 if ENABLE_DRM_COMPOSITOR
171 module_LTLIBRARIES += drm-backend.la
172 drm_backend_la_LDFLAGS = -module -avoid-version
173 drm_backend_la_LIBADD = \
175 $(DRM_COMPOSITOR_LIBS) \
176 shared/libshared.la -lrt \
178 drm_backend_la_CFLAGS = \
179 $(COMPOSITOR_CFLAGS) \
181 $(DRM_COMPOSITOR_CFLAGS) \
183 drm_backend_la_SOURCES = \
184 src/compositor-drm.c \
189 src/evdev-touchpad.c \
193 if ENABLE_VAAPI_RECORDER
194 drm_backend_la_SOURCES += src/vaapi-recorder.c src/vaapi-recorder.h
195 drm_backend_la_LIBADD += $(LIBVA_LIBS)
196 drm_backend_la_CFLAGS += $(LIBVA_CFLAGS)
200 if ENABLE_WAYLAND_COMPOSITOR
201 module_LTLIBRARIES += wayland-backend.la
202 wayland_backend_la_LDFLAGS = -module -avoid-version
203 wayland_backend_la_LIBADD = \
205 $(WAYLAND_COMPOSITOR_LIBS) \
206 shared/libshared-cairo.la
207 wayland_backend_la_CFLAGS = \
208 $(COMPOSITOR_CFLAGS) \
212 $(WAYLAND_COMPOSITOR_CFLAGS) \
214 wayland_backend_la_SOURCES = src/compositor-wayland.c
217 if ENABLE_RPI_COMPOSITOR
218 if INSTALL_RPI_COMPOSITOR
219 module_LTLIBRARIES += rpi-backend.la
221 noinst_LTLIBRARIES += rpi-backend.la
224 rpi_backend_la_LDFLAGS = -module -avoid-version
225 rpi_backend_la_LIBADD = $(COMPOSITOR_LIBS) \
226 $(RPI_COMPOSITOR_LIBS) \
227 $(RPI_BCM_HOST_LIBS) \
228 libsession-helper.la \
230 rpi_backend_la_CFLAGS = \
232 $(COMPOSITOR_CFLAGS) \
233 $(RPI_COMPOSITOR_CFLAGS) \
234 $(RPI_BCM_HOST_CFLAGS)
235 rpi_backend_la_SOURCES = \
236 src/compositor-rpi.c \
239 src/rpi-bcm-stubs.h \
247 rpi_backend_la_LIBADD += $(EGL_LIBS)
248 rpi_backend_la_CFLAGS += $(EGL_CFLAGS)
253 if ENABLE_HEADLESS_COMPOSITOR
254 module_LTLIBRARIES += headless-backend.la
255 headless_backend_la_LDFLAGS = -module -avoid-version
256 headless_backend_la_LIBADD = $(COMPOSITOR_LIBS) \
258 headless_backend_la_CFLAGS = \
259 $(COMPOSITOR_CFLAGS) \
261 headless_backend_la_SOURCES = src/compositor-headless.c
264 if ENABLE_FBDEV_COMPOSITOR
265 module_LTLIBRARIES += fbdev-backend.la
266 fbdev_backend_la_LDFLAGS = -module -avoid-version
267 fbdev_backend_la_LIBADD = \
269 $(FBDEV_COMPOSITOR_LIBS) \
270 libsession-helper.la \
272 fbdev_backend_la_CFLAGS = \
273 $(COMPOSITOR_CFLAGS) \
275 $(FBDEV_COMPOSITOR_CFLAGS) \
278 fbdev_backend_la_SOURCES = \
279 src/compositor-fbdev.c \
287 if ENABLE_RDP_COMPOSITOR
288 module_LTLIBRARIES += rdp-backend.la
289 rdp_backend_la_LDFLAGS = -module -avoid-version
290 rdp_backend_la_LIBADD = $(COMPOSITOR_LIBS) \
291 $(RDP_COMPOSITOR_LIBS) \
293 rdp_backend_la_CFLAGS = \
294 $(COMPOSITOR_CFLAGS) \
295 $(RDP_COMPOSITOR_CFLAGS) \
297 rdp_backend_la_SOURCES = src/compositor-rdp.c
301 module_LTLIBRARIES += cms-static.la
302 cms_static_la_LDFLAGS = -module -avoid-version
303 cms_static_la_LIBADD = $(COMPOSITOR_LIBS) $(LCMS_LIBS) shared/libshared.la
304 cms_static_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS) $(LCMS_CFLAGS)
305 cms_static_la_SOURCES = \
310 module_LTLIBRARIES += cms-colord.la
311 cms_colord_la_LDFLAGS = -module -avoid-version
312 cms_colord_la_LIBADD = $(COMPOSITOR_LIBS) $(COLORD_LIBS)
313 cms_colord_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS) $(COLORD_CFLAGS)
314 cms_colord_la_SOURCES = \
321 noinst_PROGRAMS += spring-tool
322 spring_tool_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
323 spring_tool_LDADD = $(COMPOSITOR_LIBS) -lm
324 spring_tool_SOURCES = \
332 src/screenshooter-server-protocol.h \
333 src/screenshooter-protocol.c \
334 src/text-cursor-position-server-protocol.h \
335 src/text-cursor-position-protocol.c \
336 src/text-protocol.c \
337 src/text-server-protocol.h \
338 src/input-method-protocol.c \
339 src/input-method-server-protocol.h \
340 src/workspaces-server-protocol.h \
341 src/workspaces-protocol.c \
342 src/scaler-server-protocol.h \
343 src/scaler-protocol.c \
346 westondatadir = $(datadir)/weston
347 dist_westondata_DATA = \
353 data/icon_window.png \
354 data/sign_close.png \
355 data/sign_maximize.png \
356 data/sign_minimize.png
360 bin_PROGRAMS += wcap-decode
362 wcap_decode_SOURCES = \
367 wcap_decode_CFLAGS = $(GCC_CFLAGS) $(WCAP_CFLAGS)
368 wcap_decode_LDADD = $(WCAP_LIBS)
372 if ENABLE_DESKTOP_SHELL
374 module_LTLIBRARIES += desktop-shell.la
376 desktop_shell_la_CPPFLAGS = \
377 -I$(top_srcdir)/shared \
378 -I$(top_srcdir)/src \
379 -I$(top_builddir)/src \
380 -I$(top_builddir)/desktop-shell \
381 -DDATADIR='"$(datadir)"' \
382 -DMODULEDIR='"$(moduledir)"' \
383 -DLIBEXECDIR='"$(libexecdir)"' \
386 desktop_shell_la_LDFLAGS = -module -avoid-version
387 desktop_shell_la_LIBADD = $(COMPOSITOR_LIBS) \
389 desktop_shell_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
390 desktop_shell_la_SOURCES = \
391 desktop-shell/shell.h \
392 desktop-shell/shell.c \
393 desktop-shell/exposay.c \
394 desktop-shell/input-panel.c \
395 desktop-shell/desktop-shell-protocol.c \
396 desktop-shell/desktop-shell-server-protocol.h \
397 desktop-shell/xdg-shell-protocol.c \
398 desktop-shell/xdg-shell-server-protocol.h
401 desktop-shell/desktop-shell-protocol.c \
402 desktop-shell/desktop-shell-server-protocol.h \
403 desktop-shell/xdg-shell-protocol.c \
404 desktop-shell/xdg-shell-server-protocol.h
410 module_LTLIBRARIES += xwayland.la
412 xwayland_la_CPPFLAGS = \
413 -I$(top_srcdir)/shared \
414 -I$(top_srcdir)/src \
415 -I$(top_builddir)/src \
416 -I$(top_builddir)/xwayland \
417 -DDATADIR='"$(datadir)"' \
418 -DMODULEDIR='"$(moduledir)"' \
419 -DLIBEXECDIR='"$(libexecdir)"' \
420 -DXSERVER_PATH='"@XSERVER_PATH@"'
422 xwayland_la_LDFLAGS = -module -avoid-version
423 xwayland_la_LIBADD = \
425 $(top_builddir)/shared/libshared-cairo.la
426 xwayland_la_CFLAGS = \
428 $(COMPOSITOR_CFLAGS) \
431 xwayland_la_SOURCES = \
432 xwayland/xwayland.h \
433 xwayland/window-manager.c \
434 xwayland/selection.c \
436 xwayland/launcher.c \
437 xwayland/xserver-protocol.c \
438 xwayland/xserver-server-protocol.h \
443 xwayland/xserver-protocol.c \
444 xwayland/xserver-server-protocol.h
452 TESTS = $(shared_tests) $(module_tests) $(weston_tests)
460 surface-global-test.la
471 AM_TESTS_ENVIRONMENT = \
472 abs_builddir='$(abs_builddir)'; export abs_builddir;
474 TEST_EXTENSIONS = .la .weston
475 LA_LOG_COMPILER = $(srcdir)/tests/weston-tests-env
476 WESTON_LOG_COMPILER = $(srcdir)/tests/weston-tests-env
481 # To remove when automake 1.11 support is dropped
484 noinst_LTLIBRARIES += \
496 test_module_ldflags = \
497 -module -avoid-version -rpath $(libdir) $(COMPOSITOR_LIBS)
499 surface_global_test_la_SOURCES = tests/surface-global-test.c
500 surface_global_test_la_LDFLAGS = $(test_module_ldflags)
501 surface_global_test_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
503 surface_test_la_SOURCES = tests/surface-test.c
504 surface_test_la_LDFLAGS = $(test_module_ldflags)
505 surface_test_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
507 weston_test_la_LIBADD = $(COMPOSITOR_LIBS) shared/libshared.la
508 weston_test_la_LDFLAGS = $(test_module_ldflags)
509 weston_test_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
510 weston_test_la_SOURCES = \
511 tests/weston-test.c \
512 tests/wayland-test-protocol.c \
513 tests/wayland-test-server-protocol.h
516 weston_test_la_CFLAGS += $(EGL_TESTS_CFLAGS)
517 weston_test_la_LDFLAGS += $(EGL_TESTS_LIBS)
520 libtest_runner_la_SOURCES = \
521 tests/weston-test-runner.c \
522 tests/weston-test-runner.h
523 libtest_runner_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
525 config_parser_test_SOURCES = tests/config-parser-test.c
526 config_parser_test_LDADD = shared/libshared.la libtest-runner.la $(COMPOSITOR_LIBS)
528 vertex_clip_test_SOURCES = \
529 tests/vertex-clip-test.c \
530 src/vertex-clipping.c \
531 src/vertex-clipping.h
532 vertex_clip_test_LDADD = libtest-runner.la -lm -lrt
534 libtest_client_la_SOURCES = \
535 tests/weston-test-client-helper.c \
536 tests/weston-test-client-helper.h \
537 tests/wayland-test-protocol.c \
538 tests/wayland-test-client-protocol.h
539 libtest_client_la_LIBADD = $(TEST_CLIENT_LIBS) shared/libshared.la libtest-runner.la
541 bad_buffer_weston_SOURCES = tests/bad-buffer-test.c
542 bad_buffer_weston_LDADD = libtest-client.la
544 keyboard_weston_SOURCES = tests/keyboard-test.c
545 keyboard_weston_LDADD = libtest-client.la
547 event_weston_SOURCES = tests/event-test.c
548 event_weston_LDADD = libtest-client.la
550 button_weston_SOURCES = tests/button-test.c
551 button_weston_LDADD = libtest-client.la
553 text_weston_SOURCES = tests/text-test.c tests/text-protocol.c
554 text_weston_LDADD = libtest-client.la
556 subsurface_weston_SOURCES = tests/subsurface-test.c
557 subsurface_weston_LDADD = libtest-client.la
560 weston_tests += buffer-count.weston
561 buffer_count_weston_SOURCES = tests/buffer-count-test.c
562 buffer_count_weston_CFLAGS = $(GCC_CFLAGS) $(EGL_TESTS_CFLAGS)
563 buffer_count_weston_LDADD = libtest-client.la $(EGL_TESTS_LIBS)
566 if ENABLE_XWAYLAND_TEST
567 weston_tests += xwayland.weston
568 xwayland_weston_SOURCES = tests/xwayland-test.c
569 xwayland_weston_CFLAGS = $(GCC_CFLAGS) $(XWAYLAND_TEST_CFLAGS)
570 xwayland_weston_LDADD = libtest-client.la $(XWAYLAND_TEST_LIBS)
573 matrix_test_SOURCES = \
574 tests/matrix-test.c \
577 matrix_test_CPPFLAGS = -DUNIT_TEST
578 matrix_test_LDADD = -lm -lrt
580 if BUILD_SETBACKLIGHT
581 noinst_PROGRAMS += setbacklight
582 setbacklight_SOURCES = \
583 tests/setbacklight.c \
586 setbacklight_CFLAGS = $(AM_CFLAGS) $(SETBACKLIGHT_CFLAGS)
587 setbacklight_LDADD = $(SETBACKLIGHT_LIBS)
590 EXTRA_DIST += tests/weston-tests-env
593 tests/wayland-test-protocol.c \
594 tests/wayland-test-server-protocol.h \
595 tests/wayland-test-client-protocol.h \
596 tests/text-protocol.c \
597 tests/text-client-protocol.h
600 protocol/desktop-shell.xml \
601 protocol/screenshooter.xml \
602 protocol/xserver.xml \
604 protocol/input-method.xml \
605 protocol/workspaces.xml \
606 protocol/text-cursor-position.xml \
607 protocol/wayland-test.xml \
608 protocol/xdg-shell.xml \
612 .PHONY : validate-protocol-xml
614 .%.xml.valid : $(top_srcdir)/protocol/%.xml
615 $(AM_V_GEN)$(XMLLINT) --noout --dtdvalid $(dtddir)/wayland.dtd $^ > $@
617 validate-protocol-xml : $(protocol_sources:protocol/%.xml=.%.xml.valid)
619 CLEANFILES += $(protocol_sources:protocol/%.xml=.%.xml.valid)
620 EXTRA_DIST += $(protocol_sources)
625 man_MANS = weston.1 weston.ini.5
627 if ENABLE_DRM_COMPOSITOR
628 man_MANS += weston-drm.7
632 -e 's|__weston_native_backend__|$(WESTON_NATIVE_BACKEND)|g' \
633 -e 's|__weston_modules_dir__|$(pkglibdir)|g' \
634 -e 's|__weston_shell_client__|$(WESTON_SHELL_CLIENT)|g' \
635 -e 's|__version__|$(PACKAGE_VERSION)|g'
637 SUFFIXES = .1 .5 .7 .man
639 %.1 %.5 %.7 : man/%.man
640 $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
647 CLEANFILES += $(man_MANS)
650 wayland_protocoldir = $(top_srcdir)/protocol
651 include $(top_srcdir)/wayland-scanner.mk