Makefile.am 8.82 KB
Newer Older
1
if BUILD_DOCS
2
SUBDIRS = doc
3 4
endif

5
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
6

7 8 9 10 11
AM_CPPFLAGS =					\
	-I$(top_builddir)/src			\
	-I$(top_srcdir)/src			\
	-I$(top_builddir)/protocol

12
AM_CFLAGS = $(GCC_CFLAGS)
13

14
aclocaldir = $(datadir)/aclocal
15
dist_aclocal_DATA = wayland-scanner.m4
16

17 18
dist_pkgdata_DATA =				\
	wayland-scanner.mk			\
19 20
	protocol/wayland.xml			\
	protocol/wayland.dtd
21

22 23 24
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA =

25
bin_PROGRAMS = wayland-scanner
26
wayland_scanner_SOURCES = src/scanner.c
27 28
wayland_scanner_CFLAGS = $(EXPAT_CFLAGS) $(LIBXML_CFLAGS) $(AM_CFLAGS)
wayland_scanner_LDADD = $(EXPAT_LIBS) $(LIBXML_LIBS) libwayland-util.la
29
pkgconfig_DATA += src/wayland-scanner.pc
30

31 32 33
if DTD_VALIDATION
wayland_scanner_SOURCES += src/dtddata.S
endif
34 35
src/dtddata.o: protocol/wayland.dtd

36
if USE_HOST_SCANNER
37
wayland_scanner = wayland-scanner
38 39 40
else
$(BUILT_SOURCES) : wayland-scanner
wayland_scanner = $(top_builddir)/wayland-scanner
41 42
endif

43
libwayland_util_la_CFLAGS = $(AM_CFLAGS)
44 45
libwayland_util_la_SOURCES =			\
	src/wayland-util.c			\
46
	src/wayland-util.h
47

48 49
noinst_LTLIBRARIES = libwayland-util.la

50
if ENABLE_LIBRARIES
51
noinst_LTLIBRARIES += libwayland-private.la
52 53
lib_LTLIBRARIES = libwayland-server.la libwayland-client.la

54 55
libwayland_private_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS)
libwayland_private_la_SOURCES =			\
56 57 58 59 60
	src/connection.c			\
	src/wayland-os.c			\
	src/wayland-os.h			\
	src/wayland-private.h

61 62 63
include_HEADERS =				\
	src/wayland-util.h			\
	src/wayland-server.h			\
64
	src/wayland-server-core.h		\
65
	src/wayland-client.h			\
66
	src/wayland-client-core.h		\
67 68
	src/wayland-version.h

69 70 71 72
nodist_include_HEADERS =			\
	protocol/wayland-server-protocol.h	\
	protocol/wayland-client-protocol.h

73
libwayland_server_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS) -pthread
74
libwayland_server_la_LIBADD = $(FFI_LIBS) libwayland-private.la libwayland-util.la -lrt -lm
75 76 77 78 79 80 81
libwayland_server_la_LDFLAGS = -version-info 1:0:1
libwayland_server_la_SOURCES =			\
	src/wayland-server.c			\
	src/wayland-shm.c			\
	src/event-loop.c

nodist_libwayland_server_la_SOURCES =		\
82
	protocol/wayland-server-protocol.h	\
83 84
	protocol/wayland-protocol.c

85
libwayland_client_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS) -pthread
86
libwayland_client_la_LIBADD = $(FFI_LIBS) libwayland-private.la libwayland-util.la -lrt -lm
87
libwayland_client_la_LDFLAGS = -version-info 3:0:3
88 89 90 91
libwayland_client_la_SOURCES =			\
	src/wayland-client.c

nodist_libwayland_client_la_SOURCES =		\
92
	protocol/wayland-client-protocol.h	\
93 94 95 96 97
	protocol/wayland-protocol.c

pkgconfig_DATA += src/wayland-client.pc src/wayland-server.pc

protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
98
if USE_HOST_SCANNER
99
	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code $< $@
100 101 102
else
	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) public-code $< $@
endif
103 104

protocol/%-server-protocol.h : $(top_srcdir)/protocol/%.xml
105
	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header $< $@
106

107
protocol/%-client-protocol.h : $(top_srcdir)/protocol/%.xml
108
	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header $< $@
109

110 111 112 113 114 115
protocol/%-server-protocol-core.h : $(top_srcdir)/protocol/%.xml
	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header -c < $< > $@

protocol/%-client-protocol-core.h : $(top_srcdir)/protocol/%.xml
	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header -c < $< > $@

116 117
BUILT_SOURCES =					\
	$(nodist_libwayland_server_la_SOURCES)	\
118
	$(nodist_libwayland_client_la_SOURCES)	\
119 120
	$(nodist_headers_test_SOURCES)		\
	$(nodist_display_test_SOURCES)
121

122
CLEANFILES = $(BUILT_SOURCES) doc/doxygen/doxygen_sqlite3.db
123
DISTCLEANFILES = src/wayland-version.h
Pekka Paalanen's avatar
Pekka Paalanen committed
124
EXTRA_DIST = CONTRIBUTING.md
125 126 127 128 129 130



lib_LTLIBRARIES += libwayland-cursor.la

include_HEADERS += cursor/wayland-cursor.h
131 132 133 134 135 136 137 138

libwayland_cursor_la_SOURCES =			\
	cursor/wayland-cursor.c			\
	cursor/os-compatibility.c		\
	cursor/os-compatibility.h		\
	cursor/cursor-data.h			\
	cursor/xcursor.c			\
	cursor/xcursor.h
139
libwayland_cursor_la_LIBADD = libwayland-client.la
140

141
pkgconfig_DATA += cursor/wayland-cursor.pc
142 143

libwayland_cursor_la_CFLAGS =			\
144
	$(AM_CFLAGS)				\
145 146 147
	-I$(top_builddir)/src			\
	-I$(top_srcdir)/src			\
	-DICONDIR=\"$(ICONDIR)\"
148

149 150
lib_LTLIBRARIES += libwayland-egl.la

151 152 153
include_HEADERS += egl/wayland-egl.h
include_HEADERS += egl/wayland-egl-core.h

154 155 156 157 158 159 160 161
libwayland_egl_la_SOURCES = egl/wayland-egl.c
libwayland_egl_la_LDFLAGS = -version-info 1

pkgconfig_DATA += egl/wayland-egl.pc

## XXX: backend interface
include_HEADERS += egl/wayland-egl-backend.h
pkgconfig_DATA += egl/wayland-egl-backend.pc
162

163
built_test_programs =				\
164 165 166 167 168 169
	array-test				\
	client-test				\
	display-test				\
	connection-test				\
	event-loop-test				\
	fixed-test				\
170
	interface-test				\
171 172 173 174 175 176 177
	list-test				\
	map-test				\
	os-wrappers-test			\
	sanity-test				\
	socket-test				\
	queue-test				\
	signal-test				\
178
	newsignal-test				\
179
	resources-test				\
180
	message-test				\
181
	headers-test				\
182
	compositor-introspection-test		\
183 184 185 186 187 188 189
	protocol-logger-test			\
	wayland-egl-abi-check

EXTRA_DIST += egl/wayland-egl-symbols-check

check_PROGRAMS = wayland-egl-abi-check
wayland_egl_abi_check_SOURCES = egl/wayland-egl-abi-check.c
190

191
if ENABLE_CPP_TEST
192
built_test_programs += cpp-compile-test
193 194
endif

195 196 197 198
AM_TESTS_ENVIRONMENT =							\
	export WAYLAND_SCANNER='$(top_builddir)/wayland-scanner'	\
	TEST_DATA_DIR='$(top_srcdir)/tests/data'			\
	TEST_OUTPUT_DIR='$(top_builddir)/tests/output'			\
199
	WAYLAND_EGL_LIB='$(top_builddir)/.libs/libwayland-egl.so'	\
200
	SED=$(SED)							\
201
	NM='$(NM)'							\
202 203 204
	;

TESTS = $(built_test_programs)			\
205
	egl/wayland-egl-symbols-check		\
206
	tests/scanner-test.sh
207

208
noinst_PROGRAMS =				\
209 210
	$(built_test_programs)			\
	exec-fd-leak-checker			\
211 212
	fixed-benchmark

213
noinst_LTLIBRARIES += libtest-runner.la
214 215 216 217

libtest_runner_la_SOURCES =			\
	tests/test-runner.c			\
	tests/test-runner.h			\
218 219 220
	tests/test-helpers.c			\
	tests/test-compositor.h			\
	tests/test-compositor.c
221
libtest_runner_la_LIBADD =			\
222
	libwayland-private.la			\
223 224 225 226 227 228 229 230 231 232 233 234
	libwayland-util.la			\
	libwayland-client.la			\
	libwayland-server.la			\
	-lrt -ldl $(FFI_LIBS)


array_test_SOURCES = tests/array-test.c
array_test_LDADD = libtest-runner.la
client_test_SOURCES = tests/client-test.c
client_test_LDADD = libtest-runner.la
display_test_SOURCES = tests/display-test.c
display_test_LDADD = libtest-runner.la
235 236 237 238
nodist_display_test_SOURCES =				\
	protocol/tests-server-protocol.h		\
	protocol/tests-client-protocol.h 		\
	protocol/tests-protocol.c
239 240 241 242 243 244
connection_test_SOURCES = tests/connection-test.c
connection_test_LDADD = libtest-runner.la
event_loop_test_SOURCES = tests/event-loop-test.c
event_loop_test_LDADD = libtest-runner.la
fixed_test_SOURCES = tests/fixed-test.c
fixed_test_LDADD = libtest-runner.la
245 246
interface_test_SOURCES = tests/interface-test.c
interface_test_LDADD = libtest-runner.la
247 248 249 250 251 252 253 254 255 256 257 258
list_test_SOURCES = tests/list-test.c
list_test_LDADD = libtest-runner.la
map_test_SOURCES = tests/map-test.c
map_test_LDADD = libtest-runner.la
sanity_test_SOURCES = tests/sanity-test.c
sanity_test_LDADD = libtest-runner.la
socket_test_SOURCES = tests/socket-test.c
socket_test_LDADD = libtest-runner.la
queue_test_SOURCES = tests/queue-test.c
queue_test_LDADD = libtest-runner.la
signal_test_SOURCES = tests/signal-test.c
signal_test_LDADD = libtest-runner.la
259 260 261
# wayland-server.c is needed here to access wl_priv_* functions
newsignal_test_SOURCES = tests/newsignal-test.c src/wayland-server.c
newsignal_test_LDADD = libtest-runner.la
262 263
resources_test_SOURCES = tests/resources-test.c
resources_test_LDADD = libtest-runner.la
264 265
message_test_SOURCES = tests/message-test.c
message_test_LDADD = libtest-runner.la
266 267
compositor_introspection_test_SOURCES = tests/compositor-introspection-test.c
compositor_introspection_test_LDADD = libtest-runner.la
268 269
protocol_logger_test_SOURCES = tests/protocol-logger-test.c
protocol_logger_test_LDADD = libtest-runner.la
270 271 272 273 274 275 276
headers_test_SOURCES = tests/headers-test.c \
		       tests/headers-protocol-test.c \
		       tests/headers-protocol-core-test.c
headers_test_LDADD = libtest-runner.la
nodist_headers_test_SOURCES =			\
	protocol/wayland-server-protocol-core.h	\
	protocol/wayland-client-protocol-core.h
277

278 279 280 281
if ENABLE_CPP_TEST
cpp_compile_test_SOURCES = tests/cpp-compile-test.cpp
endif

282
fixed_benchmark_SOURCES = tests/fixed-benchmark.c
283
fixed_benchmark_LDADD = libtest-runner.la
284 285 286 287 288 289

os_wrappers_test_SOURCES = tests/os-wrappers-test.c
os_wrappers_test_LDADD = libtest-runner.la

exec_fd_leak_checker_SOURCES = tests/exec-fd-leak-checker.c
exec_fd_leak_checker_LDADD = libtest-runner.la
290

291
EXTRA_DIST += tests/scanner-test.sh			\
292
	protocol/tests.xml				\
293 294 295 296 297 298 299 300 301 302
	tests/data/example.xml				\
	tests/data/example-client.h			\
	tests/data/example-server.h			\
	tests/data/example-code.c			\
	tests/data/small.xml				\
	tests/data/small-code.c				\
	tests/data/small-client.h			\
	tests/data/small-server.h			\
	tests/data/small-code-core.c			\
	tests/data/small-client-core.h			\
303 304
	tests/data/small-server-core.h			\
	tests/data/small-private-code.c
305 306 307 308 309 310

tests/scanner-test.sh: $(top_builddir)/wayland-scanner

clean-local:
	-rm -rf tests/output

311
endif #ENABLE_LIBRARIES