blob: b9438b7e9b8b3cf86b289194e064dc68a8c00298 [file] [log] [blame]
Lloyd Pique818c5d82015-10-27 14:32:21 -07001if BUILD_DOCS
2SUBDIRS = doc
3endif
4
5ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
6
7AM_CPPFLAGS = \
8 -I$(top_builddir)/src \
9 -I$(top_srcdir)/src \
10 -I$(top_builddir)/protocol
11
12AM_CFLAGS = $(GCC_CFLAGS)
13
14aclocaldir = $(datadir)/aclocal
15dist_aclocal_DATA = wayland-scanner.m4
16
17dist_pkgdata_DATA = \
18 wayland-scanner.mk \
19 protocol/wayland.xml \
20 protocol/wayland.dtd
21
22pkgconfigdir = $(libdir)/pkgconfig
23pkgconfig_DATA =
24
25bin_PROGRAMS = wayland-scanner
David Reveman8b54fb22016-06-25 06:25:19 -040026wayland_scanner_SOURCES = src/scanner.c
Lloyd Piqueb53eb392021-02-09 11:16:44 -080027wayland_scanner_CPPFLAGS = $(AM_CPPFLAGS) -include config.h
Dennis Kempineed3fcd2016-02-10 13:25:12 -080028wayland_scanner_CFLAGS = $(EXPAT_CFLAGS) $(LIBXML_CFLAGS) $(AM_CFLAGS)
29wayland_scanner_LDADD = $(EXPAT_LIBS) $(LIBXML_LIBS) libwayland-util.la
Lloyd Pique818c5d82015-10-27 14:32:21 -070030pkgconfig_DATA += src/wayland-scanner.pc
31
David Reveman8b54fb22016-06-25 06:25:19 -040032if DTD_VALIDATION
33wayland_scanner_SOURCES += src/dtddata.S
34endif
Dennis Kempineed3fcd2016-02-10 13:25:12 -080035src/dtddata.o: protocol/wayland.dtd
36
Lloyd Pique818c5d82015-10-27 14:32:21 -070037if USE_HOST_SCANNER
38wayland_scanner = wayland-scanner
39else
40$(BUILT_SOURCES) : wayland-scanner
41wayland_scanner = $(top_builddir)/wayland-scanner
42endif
43
44libwayland_util_la_CFLAGS = $(AM_CFLAGS)
45libwayland_util_la_SOURCES = \
46 src/wayland-util.c \
47 src/wayland-util.h
48
49noinst_LTLIBRARIES = libwayland-util.la
50
51if ENABLE_LIBRARIES
52noinst_LTLIBRARIES += libwayland-private.la
53lib_LTLIBRARIES = libwayland-server.la libwayland-client.la
54
55libwayland_private_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS)
56libwayland_private_la_SOURCES = \
57 src/connection.c \
58 src/wayland-os.c \
59 src/wayland-os.h \
Lloyd Piqueb53eb392021-02-09 11:16:44 -080060 src/wayland-private.h \
61 src/wayland-server-private.h
Lloyd Pique818c5d82015-10-27 14:32:21 -070062
63include_HEADERS = \
64 src/wayland-util.h \
65 src/wayland-server.h \
66 src/wayland-server-core.h \
67 src/wayland-client.h \
68 src/wayland-client-core.h \
Lloyd Pique818c5d82015-10-27 14:32:21 -070069 src/wayland-version.h
70
71nodist_include_HEADERS = \
72 protocol/wayland-server-protocol.h \
73 protocol/wayland-client-protocol.h
74
75libwayland_server_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS) -pthread
Lloyd Piqueb53eb392021-02-09 11:16:44 -080076libwayland_server_la_LIBADD = $(FFI_LIBS) libwayland-private.la libwayland-util.la $(RT_LIBS) -lm
Lloyd Pique818c5d82015-10-27 14:32:21 -070077libwayland_server_la_LDFLAGS = -version-info 1:0:1
78libwayland_server_la_SOURCES = \
79 src/wayland-server.c \
80 src/wayland-shm.c \
81 src/event-loop.c
82
83nodist_libwayland_server_la_SOURCES = \
84 protocol/wayland-server-protocol.h \
85 protocol/wayland-protocol.c
86
87libwayland_client_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS) -pthread
Lloyd Piqueb53eb392021-02-09 11:16:44 -080088libwayland_client_la_LIBADD = $(FFI_LIBS) libwayland-private.la libwayland-util.la $(RT_LIBS) -lm
Lloyd Pique818c5d82015-10-27 14:32:21 -070089libwayland_client_la_LDFLAGS = -version-info 3:0:3
90libwayland_client_la_SOURCES = \
91 src/wayland-client.c
92
93nodist_libwayland_client_la_SOURCES = \
94 protocol/wayland-client-protocol.h \
95 protocol/wayland-protocol.c
96
97pkgconfig_DATA += src/wayland-client.pc src/wayland-server.pc
98
99protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
Garfield Tanfa337ef2019-09-26 17:12:49 -0700100if USE_HOST_SCANNER
Lloyd Piqueb53eb392021-02-09 11:16:44 -0800101 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s code $< $@
Garfield Tanfa337ef2019-09-26 17:12:49 -0700102else
Lloyd Piqueb53eb392021-02-09 11:16:44 -0800103 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s public-code $< $@
Garfield Tanfa337ef2019-09-26 17:12:49 -0700104endif
Lloyd Pique818c5d82015-10-27 14:32:21 -0700105
106protocol/%-server-protocol.h : $(top_srcdir)/protocol/%.xml
Lloyd Piqueb53eb392021-02-09 11:16:44 -0800107 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s server-header $< $@
Lloyd Pique818c5d82015-10-27 14:32:21 -0700108
109protocol/%-client-protocol.h : $(top_srcdir)/protocol/%.xml
Lloyd Piqueb53eb392021-02-09 11:16:44 -0800110 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s client-header $< $@
Lloyd Pique818c5d82015-10-27 14:32:21 -0700111
112protocol/%-server-protocol-core.h : $(top_srcdir)/protocol/%.xml
Lloyd Piqueb53eb392021-02-09 11:16:44 -0800113 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s server-header -c < $< > $@
Lloyd Pique818c5d82015-10-27 14:32:21 -0700114
115protocol/%-client-protocol-core.h : $(top_srcdir)/protocol/%.xml
Lloyd Piqueb53eb392021-02-09 11:16:44 -0800116 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s client-header -c < $< > $@
Lloyd Pique818c5d82015-10-27 14:32:21 -0700117
118BUILT_SOURCES = \
119 $(nodist_libwayland_server_la_SOURCES) \
120 $(nodist_libwayland_client_la_SOURCES) \
Garfield Tanfa337ef2019-09-26 17:12:49 -0700121 $(nodist_headers_test_SOURCES) \
122 $(nodist_display_test_SOURCES)
Lloyd Pique818c5d82015-10-27 14:32:21 -0700123
124CLEANFILES = $(BUILT_SOURCES) doc/doxygen/doxygen_sqlite3.db
125DISTCLEANFILES = src/wayland-version.h
Garfield Tanfa337ef2019-09-26 17:12:49 -0700126EXTRA_DIST = CONTRIBUTING.md
Lloyd Pique818c5d82015-10-27 14:32:21 -0700127
128
129
130lib_LTLIBRARIES += libwayland-cursor.la
131
132include_HEADERS += cursor/wayland-cursor.h
133
134libwayland_cursor_la_SOURCES = \
135 cursor/wayland-cursor.c \
136 cursor/os-compatibility.c \
137 cursor/os-compatibility.h \
138 cursor/cursor-data.h \
139 cursor/xcursor.c \
140 cursor/xcursor.h
141libwayland_cursor_la_LIBADD = libwayland-client.la
142
143pkgconfig_DATA += cursor/wayland-cursor.pc
144
145libwayland_cursor_la_CFLAGS = \
146 $(AM_CFLAGS) \
147 -I$(top_builddir)/src \
148 -I$(top_srcdir)/src \
149 -DICONDIR=\"$(ICONDIR)\"
150
Garfield Tanfa337ef2019-09-26 17:12:49 -0700151lib_LTLIBRARIES += libwayland-egl.la
152
153include_HEADERS += egl/wayland-egl.h
154include_HEADERS += egl/wayland-egl-core.h
155
156libwayland_egl_la_SOURCES = egl/wayland-egl.c
157libwayland_egl_la_LDFLAGS = -version-info 1
158
159pkgconfig_DATA += egl/wayland-egl.pc
160
161## XXX: backend interface
162include_HEADERS += egl/wayland-egl-backend.h
163pkgconfig_DATA += egl/wayland-egl-backend.pc
Lloyd Pique818c5d82015-10-27 14:32:21 -0700164
Dennis Kempin293a0fb2016-12-08 13:42:04 -0800165built_test_programs = \
Lloyd Pique818c5d82015-10-27 14:32:21 -0700166 array-test \
167 client-test \
168 display-test \
169 connection-test \
170 event-loop-test \
171 fixed-test \
Garfield Tanfa337ef2019-09-26 17:12:49 -0700172 interface-test \
Lloyd Pique818c5d82015-10-27 14:32:21 -0700173 list-test \
174 map-test \
175 os-wrappers-test \
176 sanity-test \
177 socket-test \
178 queue-test \
Lloyd Piqueb53eb392021-02-09 11:16:44 -0800179 proxy-test \
Lloyd Pique818c5d82015-10-27 14:32:21 -0700180 signal-test \
Garfield Tanfa337ef2019-09-26 17:12:49 -0700181 newsignal-test \
Lloyd Pique818c5d82015-10-27 14:32:21 -0700182 resources-test \
183 message-test \
Dennis Kempin293a0fb2016-12-08 13:42:04 -0800184 headers-test \
185 compositor-introspection-test \
Garfield Tanfa337ef2019-09-26 17:12:49 -0700186 protocol-logger-test \
187 wayland-egl-abi-check
188
189EXTRA_DIST += egl/wayland-egl-symbols-check
190
191check_PROGRAMS = wayland-egl-abi-check
192wayland_egl_abi_check_SOURCES = egl/wayland-egl-abi-check.c
Lloyd Pique818c5d82015-10-27 14:32:21 -0700193
194if ENABLE_CPP_TEST
Dennis Kempin293a0fb2016-12-08 13:42:04 -0800195built_test_programs += cpp-compile-test
Lloyd Pique818c5d82015-10-27 14:32:21 -0700196endif
197
Garfield Tanfa337ef2019-09-26 17:12:49 -0700198AM_TESTS_ENVIRONMENT = \
199 export WAYLAND_SCANNER='$(top_builddir)/wayland-scanner' \
200 TEST_DATA_DIR='$(top_srcdir)/tests/data' \
201 TEST_OUTPUT_DIR='$(top_builddir)/tests/output' \
202 WAYLAND_EGL_LIB='$(top_builddir)/.libs/libwayland-egl.so' \
203 SED=$(SED) \
204 NM='$(NM)' \
205 ;
Dennis Kempin293a0fb2016-12-08 13:42:04 -0800206
Garfield Tanfa337ef2019-09-26 17:12:49 -0700207TESTS = $(built_test_programs) \
208 egl/wayland-egl-symbols-check \
209 tests/scanner-test.sh
Lloyd Pique818c5d82015-10-27 14:32:21 -0700210
211noinst_PROGRAMS = \
Garfield Tanfa337ef2019-09-26 17:12:49 -0700212 $(built_test_programs) \
213 exec-fd-leak-checker \
Lloyd Pique818c5d82015-10-27 14:32:21 -0700214 fixed-benchmark
215
Garfield Tanfa337ef2019-09-26 17:12:49 -0700216noinst_LTLIBRARIES += \
217 libtest-runner.la \
218 libtest-helpers.la
219
220libtest_helpers_la_SOURCES = tests/test-helpers.c
Lloyd Pique818c5d82015-10-27 14:32:21 -0700221
222libtest_runner_la_SOURCES = \
223 tests/test-runner.c \
224 tests/test-runner.h \
Lloyd Pique818c5d82015-10-27 14:32:21 -0700225 tests/test-compositor.h \
226 tests/test-compositor.c
227libtest_runner_la_LIBADD = \
228 libwayland-private.la \
229 libwayland-util.la \
230 libwayland-client.la \
231 libwayland-server.la \
Garfield Tanfa337ef2019-09-26 17:12:49 -0700232 libtest-helpers.la \
Lloyd Piqueb53eb392021-02-09 11:16:44 -0800233 $(RT_LIBS) $(DL_LIBS) $(FFI_LIBS)
Lloyd Pique818c5d82015-10-27 14:32:21 -0700234
Lloyd Pique818c5d82015-10-27 14:32:21 -0700235array_test_SOURCES = tests/array-test.c
236array_test_LDADD = libtest-runner.la
237client_test_SOURCES = tests/client-test.c
238client_test_LDADD = libtest-runner.la
Lloyd Piqueb53eb392021-02-09 11:16:44 -0800239display_test_CFLAGS = -pthread
Lloyd Pique818c5d82015-10-27 14:32:21 -0700240display_test_SOURCES = tests/display-test.c
241display_test_LDADD = libtest-runner.la
Garfield Tanfa337ef2019-09-26 17:12:49 -0700242nodist_display_test_SOURCES = \
243 protocol/tests-server-protocol.h \
244 protocol/tests-client-protocol.h \
245 protocol/tests-protocol.c
Lloyd Pique818c5d82015-10-27 14:32:21 -0700246connection_test_SOURCES = tests/connection-test.c
247connection_test_LDADD = libtest-runner.la
248event_loop_test_SOURCES = tests/event-loop-test.c
249event_loop_test_LDADD = libtest-runner.la
250fixed_test_SOURCES = tests/fixed-test.c
251fixed_test_LDADD = libtest-runner.la
Garfield Tanfa337ef2019-09-26 17:12:49 -0700252interface_test_SOURCES = tests/interface-test.c
253interface_test_LDADD = libtest-runner.la
Lloyd Pique818c5d82015-10-27 14:32:21 -0700254list_test_SOURCES = tests/list-test.c
255list_test_LDADD = libtest-runner.la
256map_test_SOURCES = tests/map-test.c
257map_test_LDADD = libtest-runner.la
258sanity_test_SOURCES = tests/sanity-test.c
259sanity_test_LDADD = libtest-runner.la
260socket_test_SOURCES = tests/socket-test.c
261socket_test_LDADD = libtest-runner.la
262queue_test_SOURCES = tests/queue-test.c
263queue_test_LDADD = libtest-runner.la
Lloyd Piqueb53eb392021-02-09 11:16:44 -0800264proxy_test_SOURCES = tests/proxy-test.c
265proxy_test_LDADD = libtest-runner.la
Lloyd Pique818c5d82015-10-27 14:32:21 -0700266signal_test_SOURCES = tests/signal-test.c
267signal_test_LDADD = libtest-runner.la
Garfield Tanfa337ef2019-09-26 17:12:49 -0700268# wayland-server.c is needed here to access wl_priv_* functions
269newsignal_test_SOURCES = tests/newsignal-test.c src/wayland-server.c
270newsignal_test_LDADD = libtest-runner.la
Lloyd Pique818c5d82015-10-27 14:32:21 -0700271resources_test_SOURCES = tests/resources-test.c
272resources_test_LDADD = libtest-runner.la
273message_test_SOURCES = tests/message-test.c
274message_test_LDADD = libtest-runner.la
Dennis Kempin293a0fb2016-12-08 13:42:04 -0800275compositor_introspection_test_SOURCES = tests/compositor-introspection-test.c
276compositor_introspection_test_LDADD = libtest-runner.la
277protocol_logger_test_SOURCES = tests/protocol-logger-test.c
278protocol_logger_test_LDADD = libtest-runner.la
Lloyd Pique818c5d82015-10-27 14:32:21 -0700279headers_test_SOURCES = tests/headers-test.c \
280 tests/headers-protocol-test.c \
281 tests/headers-protocol-core-test.c
Lloyd Pique818c5d82015-10-27 14:32:21 -0700282nodist_headers_test_SOURCES = \
283 protocol/wayland-server-protocol-core.h \
284 protocol/wayland-client-protocol-core.h
285
286if ENABLE_CPP_TEST
287cpp_compile_test_SOURCES = tests/cpp-compile-test.cpp
288endif
289
290fixed_benchmark_SOURCES = tests/fixed-benchmark.c
Lloyd Piqueb53eb392021-02-09 11:16:44 -0800291fixed_benchmark_LDADD = $(RT_LIBS)
Lloyd Pique818c5d82015-10-27 14:32:21 -0700292
293os_wrappers_test_SOURCES = tests/os-wrappers-test.c
294os_wrappers_test_LDADD = libtest-runner.la
295
296exec_fd_leak_checker_SOURCES = tests/exec-fd-leak-checker.c
Garfield Tanfa337ef2019-09-26 17:12:49 -0700297exec_fd_leak_checker_LDADD = libtest-helpers.la
298
299EXTRA_DIST += tests/scanner-test.sh \
300 protocol/tests.xml \
Lloyd Piqueb53eb392021-02-09 11:16:44 -0800301 tests/data/bad-identifier-arg.xml \
302 tests/data/bad-identifier-entry.xml \
303 tests/data/bad-identifier-enum.xml \
304 tests/data/bad-identifier-event.xml \
305 tests/data/bad-identifier-interface.xml \
306 tests/data/bad-identifier-protocol.xml \
307 tests/data/bad-identifier-request.xml \
Garfield Tanfa337ef2019-09-26 17:12:49 -0700308 tests/data/example.xml \
309 tests/data/example-client.h \
310 tests/data/example-server.h \
311 tests/data/example-code.c \
312 tests/data/small.xml \
313 tests/data/small-code.c \
314 tests/data/small-client.h \
315 tests/data/small-server.h \
316 tests/data/small-code-core.c \
317 tests/data/small-client-core.h \
318 tests/data/small-server-core.h \
Lloyd Piqueb53eb392021-02-09 11:16:44 -0800319 tests/data/small-private-code.c \
320 meson.build \
321 meson_options.txt \
322 cursor/meson.build \
323 doc/meson.build \
324 doc/doxygen/mainpage.dox \
325 doc/doxygen/meson.build \
326 doc/doxygen/gen-doxygen.py \
327 doc/doxygen/xml/meson.build \
328 doc/doxygen/xml/Client/meson.build \
329 doc/doxygen/xml/Server/meson.build \
330 doc/publican/meson.build \
331 doc/publican/sources/meson.build \
332 egl/meson.build \
333 src/meson.build \
334 tests/meson.build
Garfield Tanfa337ef2019-09-26 17:12:49 -0700335
336tests/scanner-test.sh: $(top_builddir)/wayland-scanner
337
338clean-local:
339 -rm -rf tests/output
340
Lloyd Pique818c5d82015-10-27 14:32:21 -0700341endif #ENABLE_LIBRARIES