keysyms: fix comment for XKB_KEY_OCARON
[platform/upstream/libxkbcommon.git] / Makefile.am
1 pkgconfigdir = $(libdir)/pkgconfig
2 pkgconfig_DATA = xkbcommon.pc
3
4 EXTRA_DIST = \
5         scripts/makeheader \
6         scripts/makekeys \
7         scripts/update-keysyms \
8         scripts/update-keywords \
9         scripts/doxygen-wrapper \
10         src/xkbcomp/keywords.gperf \
11         test/data \
12         README.md \
13         doc/quick-guide.md \
14         doc/compat.md \
15         doc/keymap-format-text-v1.md \
16         doc/rules-format.txt \
17         doc/doxygen-extra.css \
18         xkbcommon.map \
19         xkbcommon-x11.map \
20         PACKAGING \
21         LICENSE \
22         meson.build \
23         meson_options.txt \
24         test/symbols-leak-test.bash
25
26 # The constants are added here instead of using AC_DEFINE_UNQUOTED
27 # because it does not expand variables recursively.
28 AM_CPPFLAGS = \
29         -DDFLT_XKB_CONFIG_ROOT='"$(XKBCONFIGROOT)"' \
30         -DXLOCALEDIR='"$(XLOCALEDIR)"' \
31         -I$(top_srcdir)/src \
32         -I$(top_builddir)/src/xkbcomp \
33         -include $(top_builddir)/src/config.h
34
35 AM_CFLAGS = $(BASE_CFLAGS)
36
37 AM_LDFLAGS = -no-undefined
38 if HAVE_NO_UNDEFINED
39 AM_LDFLAGS += -Wl,--no-undefined
40 endif
41
42 AM_YFLAGS = -d -p _xkbcommon_
43
44 xkbcommonincludedir = $(includedir)/xkbcommon
45 xkbcommoninclude_HEADERS = \
46         xkbcommon/xkbcommon.h \
47         xkbcommon/xkbcommon-compat.h \
48         xkbcommon/xkbcommon-compose.h \
49         xkbcommon/xkbcommon-keysyms.h \
50         xkbcommon/xkbcommon-names.h
51
52 lib_LTLIBRARIES = libxkbcommon.la
53 libxkbcommon_la_SOURCES = \
54         src/compose/parser.c \
55         src/compose/parser.h \
56         src/compose/paths.c \
57         src/compose/paths.h \
58         src/compose/state.c \
59         src/compose/table.c \
60         src/compose/table.h \
61         src/xkbcomp/action.c \
62         src/xkbcomp/action.h \
63         src/xkbcomp/ast.h \
64         src/xkbcomp/ast-build.c \
65         src/xkbcomp/ast-build.h \
66         src/xkbcomp/compat.c \
67         src/xkbcomp/expr.c \
68         src/xkbcomp/expr.h \
69         src/xkbcomp/include.c \
70         src/xkbcomp/include.h \
71         src/xkbcomp/keycodes.c \
72         src/xkbcomp/keymap.c \
73         src/xkbcomp/keymap-dump.c \
74         src/xkbcomp/keywords.c \
75         src/xkbcomp/parser.y \
76         src/xkbcomp/parser-priv.h \
77         src/xkbcomp/rules.c \
78         src/xkbcomp/rules.h \
79         src/xkbcomp/scanner.c \
80         src/xkbcomp/symbols.c \
81         src/xkbcomp/types.c \
82         src/xkbcomp/vmod.c \
83         src/xkbcomp/vmod.h \
84         src/xkbcomp/xkbcomp.c \
85         src/xkbcomp/xkbcomp-priv.h \
86         src/atom.c \
87         src/atom.h \
88         src/context.c \
89         src/context.h \
90         src/context-priv.c \
91         src/darray.h \
92         src/keysym.c \
93         src/keysym.h \
94         src/keysym-utf.c \
95         src/ks_tables.h \
96         src/keymap.c \
97         src/keymap.h \
98         src/keymap-priv.c \
99         src/scanner-utils.h \
100         src/state.c \
101         src/text.c \
102         src/text.h \
103         src/utf8.c \
104         src/utf8.h \
105         src/utils.c \
106         src/utils.h
107 if HAVE_VERSION_SCRIPT
108 libxkbcommon_la_LDFLAGS = -Wl,--version-script=${top_srcdir}/xkbcommon.map
109 endif HAVE_VERSION_SCRIPT
110
111 if ENABLE_X11
112 pkgconfig_DATA += xkbcommon-x11.pc
113
114 xkbcommon_x11includedir = $(xkbcommonincludedir)
115 xkbcommon_x11include_HEADERS = \
116         xkbcommon/xkbcommon-x11.h
117
118 lib_LTLIBRARIES += libxkbcommon-x11.la
119
120 libxkbcommon_x11_la_CFLAGS = $(AM_CFLAGS) $(XCB_XKB_CFLAGS)
121 libxkbcommon_x11_la_CPPFLAGS = $(AM_CPPFLAGS)
122 libxkbcommon_x11_la_LIBADD = libxkbcommon.la $(XCB_XKB_LIBS)
123 if HAVE_VERSION_SCRIPT
124 libxkbcommon_x11_la_LDFLAGS = -Wl,--version-script=${top_srcdir}/xkbcommon-x11.map
125 endif HAVE_VERSION_SCRIPT
126
127 libxkbcommon_x11_la_SOURCES = \
128         src/x11/keymap.c \
129         src/x11/state.c \
130         src/x11/util.c \
131         src/x11/x11-priv.h \
132         src/context.h \
133         src/context-priv.c \
134         src/keymap.h \
135         src/keymap-priv.c \
136         src/atom.h \
137         src/atom.c
138 endif ENABLE_X11
139
140 BUILT_SOURCES = \
141         src/xkbcomp/parser.c \
142         src/xkbcomp/parser.h
143 CLEANFILES = $(BUILT_SOURCES)
144
145 src/xkbcomp/parser.c: $(top_builddir)/src/$(am__dirstamp) $(top_builddir)/src/xkbcomp/$(am__dirstamp)
146 src/xkbcomp/parser.h: $(top_builddir)/src/$(am__dirstamp) $(top_builddir)/src/xkbcomp/$(am__dirstamp)
147
148 ##
149 # Documentation
150 ##
151
152 if ENABLE_DOCS
153 if HAVE_DOXYGEN
154 doxygen_input = \
155         README.md \
156         doc/quick-guide.md \
157         doc/compat.md \
158         xkbcommon/xkbcommon.h \
159         xkbcommon/xkbcommon-names.h \
160         xkbcommon/xkbcommon-x11.h \
161         xkbcommon/xkbcommon-compose.h
162
163 doc/html: doc/Doxyfile $(doxygen_input)
164         $(AM_V_GEN)(\
165             cat $<; \
166             echo "INPUT = $(doxygen_input)"; \
167             echo "OUTPUT_DIRECTORY = $(abs_top_builddir)/doc"; \
168         ) | $(top_srcdir)/scripts/doxygen-wrapper "$(DOXYGEN)" - "$(abs_top_srcdir)"
169 clean-doxygen:
170         rm -rf doc/html
171
172 doc: doc/html
173 clean-doc: clean-doxygen
174 all-local:: doc
175 clean-local:: clean-doc
176
177 install-data-local:: doc
178         $(MKDIR_P) $(DESTDIR)$(htmldir)/html
179         $(INSTALL_DATA) doc/html/* $(DESTDIR)$(htmldir)/html
180
181 uninstall-local::
182         rm -rf $(DESTDIR)$(htmldir)
183 endif HAVE_DOXYGEN
184 endif ENABLE_DOCS
185
186 ##
187 # Tests
188 ##
189
190 # Some tests need to use unexported symbols, so we link them against
191 # a private copy of libxkbcommon with all symbols exposed.
192 check_LTLIBRARIES = libtest.la
193 libtest_la_SOURCES = \
194         $(libxkbcommon_la_SOURCES) \
195         test/common.c \
196         test/test.h \
197         test/evdev-scancodes.h
198
199 AM_TESTS_ENVIRONMENT = \
200         XKB_LOG_LEVEL=debug; export XKB_LOG_LEVEL; \
201         XKB_LOG_VERBOSITY=10; export XKB_LOG_VERBOSITY; \
202         $(XORG_MALLOC_DEBUG_ENV) \
203         top_srcdir=$(top_srcdir)
204
205 build_run_tests = \
206         test/keysym \
207         test/keymap \
208         test/filecomp \
209         test/context \
210         test/rules-file \
211         test/stringcomp \
212         test/buffercomp \
213         test/log \
214         test/atom \
215         test/utf8 \
216         test/state \
217         test/keyseq \
218         test/rulescomp \
219         test/compose
220 build_only_tests = \
221         test/rmlvo-to-kccgst \
222         test/rmlvo-to-keymap \
223         test/print-compiled-keymap
224 run_only_tests = \
225         test/symbols-leak-test.bash
226
227 TESTS_LDADD = libtest.la
228
229 test_keysym_LDADD = $(TESTS_LDADD)
230 test_keymap_LDADD = $(TESTS_LDADD)
231 test_filecomp_LDADD = $(TESTS_LDADD)
232 test_context_LDADD = $(TESTS_LDADD)
233 test_rules_file_CFLAGS = $(AM_CFLAGS) -Wno-declaration-after-statement
234 test_rules_file_LDADD = $(TESTS_LDADD)
235 test_stringcomp_LDADD = $(TESTS_LDADD)
236 test_buffercomp_LDADD = $(TESTS_LDADD)
237 test_log_LDADD = $(TESTS_LDADD)
238 test_atom_LDADD = $(TESTS_LDADD)
239 test_utf8_LDADD = $(TESTS_LDADD)
240 test_state_LDADD = $(TESTS_LDADD)
241 test_keyseq_LDADD = $(TESTS_LDADD)
242 test_rulescomp_LDADD = $(TESTS_LDADD)
243 test_rmlvo_to_kccgst_LDADD = $(TESTS_LDADD)
244 test_rmlvo_to_keymap_LDADD = $(TESTS_LDADD)
245 test_print_compiled_keymap_LDADD = $(TESTS_LDADD)
246 test_compose_LDADD = $(TESTS_LDADD) $(RT_LIBS)
247
248 if BUILD_LINUX_TESTS
249 build_only_tests += \
250         test/interactive-evdev
251
252 test_interactive_evdev_LDADD = $(TESTS_LDADD)
253 endif BUILD_LINUX_TESTS
254
255 if ENABLE_X11
256 build_run_tests += \
257         test/x11
258 # test/x11comp is meant to be run, but it is (temporarily?) disabled.
259 # See: https://github.com/xkbcommon/libxkbcommon/issues/30
260 build_only_tests += \
261         test/x11comp \
262         test/interactive-x11
263
264 TESTS_X11_LDADD = $(XCB_XKB_LIBS) $(TESTS_LDADD) libxkbcommon-x11.la
265 TESTS_X11_CFLAGS = $(XCB_XKB_CFLAGS)
266
267 test_x11_LDADD = $(TESTS_X11_LDADD)
268 test_x11_CFLAGS = $(TESTS_X11_CFLAGS)
269 test_x11comp_LDADD = $(TESTS_X11_LDADD)
270 test_x11comp_CFLAGS = $(TESTS_X11_CFLAGS)
271 test_interactive_x11_LDADD = $(TESTS_X11_LDADD)
272 test_interactive_x11_CFLAGS = $(TESTS_X11_CFLAGS)
273 endif ENABLE_X11
274
275 if ENABLE_WAYLAND
276 build_only_tests += \
277         test/interactive-wayland
278
279 TESTS_WAYLAND_LDADD = $(WAYLAND_LIBS) $(TESTS_LDADD)
280 TESTS_WAYLAND_CFLAGS = $(WAYLAND_CFLAGS)
281
282 .SECONDEXPANSION:
283
284 define protostability
285 $(if $(findstring unstable,$1),unstable,stable)
286 endef
287
288 define protoname
289 $(shell echo $1 | sed 's/\([a-z\-]\+\)-[a-z]\+-v[0-9]\+/\1/')
290 endef
291
292 %-protocol.c: $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
293         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
294 %-client-protocol.h: $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
295         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@
296
297 INTERACTIVE_WL_XDG_SHELL_SRCS = \
298         xdg-shell-unstable-v6-protocol.c \
299         xdg-shell-unstable-v6-client-protocol.h
300
301 test_interactive_wayland_SOURCES = \
302         test/interactive-wayland.c \
303         $(INTERACTIVE_WL_XDG_SHELL_SRCS)
304 test_interactive_wayland_LDADD = $(TESTS_WAYLAND_LDADD)
305 test_interactive_wayland_CFLAGS = $(TESTS_WAYLAND_CFLAGS)
306
307 BUILT_SOURCES += \
308         $(INTERACTIVE_WL_XDG_SHELL_SRCS)
309 endif
310
311 check_PROGRAMS = $(build_run_tests) $(build_only_tests)
312 TESTS = $(build_run_tests) $(run_only_tests)
313
314 ##
315 # Benchmarks
316 ##
317 check_LTLIBRARIES += libbench.la
318 libbench_la_SOURCES = \
319         bench/bench.c \
320         bench/bench.h
321 BENCH_LDADD  = libbench.la
322 BENCH_LDADD += $(TESTS_LDADD) $(RT_LIBS)
323
324 check_PROGRAMS += \
325         bench/key-proc \
326         bench/rules \
327         bench/rulescomp \
328         bench/compose
329 bench_key_proc_LDADD = $(BENCH_LDADD)
330 bench_rules_LDADD = $(BENCH_LDADD)
331 bench_rulescomp_LDADD = $(BENCH_LDADD)
332 bench_compose_LDADD = $(BENCH_LDADD)