test: don't print control characters in interactive tests
[platform/upstream/libxkbcommon.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
2
3 pkgconfigdir = $(libdir)/pkgconfig
4 pkgconfig_DATA = xkbcommon.pc
5
6 EXTRA_DIST = \
7         makekeys.py \
8         src/xkbcomp/keywords.gperf
9
10 AM_CPPFLAGS = \
11         -DDFLT_XKB_CONFIG_ROOT='"$(XKBCONFIGROOT)"' \
12         -I$(top_srcdir)/src \
13         -I$(top_srcdir)/src/xkbcomp \
14         -I$(top_builddir)/src/xkbcomp \
15         -include $(top_builddir)/src/config.h
16
17 AM_CFLAGS = $(BASE_CFLAGS)
18
19 AM_LDFLAGS = -no-undefined
20 if HAVE_NO_UNDEFINED
21 AM_LDFLAGS += -Wl,--no-undefined
22 endif
23
24 AM_YFLAGS = -d -p _xkbcommon_
25
26 xkbcommonincludedir = $(includedir)/xkbcommon
27 xkbcommoninclude_HEADERS = \
28         xkbcommon/xkbcommon.h \
29         xkbcommon/xkbcommon-compat.h \
30         xkbcommon/xkbcommon-keysyms.h \
31         xkbcommon/xkbcommon-names.h
32
33 lib_LTLIBRARIES = libxkbcommon.la
34 libxkbcommon_la_SOURCES = \
35         src/xkbcomp/action.c \
36         src/xkbcomp/action.h \
37         src/xkbcomp/ast.h \
38         src/xkbcomp/ast-build.c \
39         src/xkbcomp/ast-build.h \
40         src/xkbcomp/compat.c \
41         src/xkbcomp/expr.c \
42         src/xkbcomp/expr.h \
43         src/xkbcomp/include.c \
44         src/xkbcomp/include.h \
45         src/xkbcomp/keycodes.c \
46         src/xkbcomp/keymap.c \
47         src/xkbcomp/keymap-dump.c \
48         src/xkbcomp/keywords.c \
49         src/xkbcomp/parser.y \
50         src/xkbcomp/parser-priv.h \
51         src/xkbcomp/rules.c \
52         src/xkbcomp/rules.h \
53         src/xkbcomp/scanner.c \
54         src/xkbcomp/scanner-utils.h \
55         src/xkbcomp/symbols.c \
56         src/xkbcomp/types.c \
57         src/xkbcomp/vmod.c \
58         src/xkbcomp/vmod.h \
59         src/xkbcomp/xkbcomp.c \
60         src/xkbcomp/xkbcomp-priv.h \
61         src/atom.c \
62         src/atom.h \
63         src/context.c \
64         src/context.h \
65         src/context-priv.c \
66         src/compat.c \
67         src/darray.h \
68         src/keysym.c \
69         src/keysym.h \
70         src/keysym-utf.c \
71         src/ks_tables.h \
72         src/keymap.c \
73         src/keymap.h \
74         src/keymap-priv.c \
75         src/state.c \
76         src/text.c \
77         src/text.h \
78         src/utils.c \
79         src/utils.h
80
81 if ENABLE_X11
82 pkgconfig_DATA += xkbcommon-x11.pc
83
84 xkbcommon_x11includedir = $(xkbcommonincludedir)
85 xkbcommon_x11include_HEADERS = \
86         xkbcommon/xkbcommon-x11.h
87
88 lib_LTLIBRARIES += libxkbcommon-x11.la
89
90 libxkbcommon_x11_la_CFLAGS = $(AM_CFLAGS) $(XCB_XKB_CFLAGS)
91 libxkbcommon_x11_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/x11
92 libxkbcommon_x11_la_LIBADD = libxkbcommon.la $(XCB_XKB_LIBS)
93
94 libxkbcommon_x11_la_SOURCES = \
95         src/x11/keymap.c \
96         src/x11/state.c \
97         src/x11/util.c \
98         src/x11/x11-priv.h \
99         src/context.h \
100         src/context-priv.c \
101         src/keymap.h \
102         src/keymap-priv.c \
103         src/atom.h \
104         src/atom.c
105
106 endif ENABLE_X11
107
108 BUILT_SOURCES = \
109         src/xkbcomp/parser.c \
110         src/xkbcomp/parser.h
111 CLEANFILES = $(BUILT_SOURCES)
112
113 src/xkbcomp/parser.c: $(top_builddir)/src/$(am__dirstamp) $(top_builddir)/src/xkbcomp/$(am__dirstamp)
114 src/xkbcomp/parser.h: $(top_builddir)/src/$(am__dirstamp) $(top_builddir)/src/xkbcomp/$(am__dirstamp)
115
116 # Documentation
117
118 if ENABLE_DOCS
119 if HAVE_DOXYGEN
120 doc: doc/stamp-doxygen
121 clean-doc: clean-doxygen
122 all-local:: doc
123 clean-local:: clean-doc
124
125 doc/stamp-doxygen: $(top_srcdir)/xkbcommon/*.h
126         $(AM_V_GEN)$(DOXYGEN) doc/Doxyfile
127         touch $@
128
129 clean-doxygen:
130         rm -rf doc/html doc/stamp-doxygen
131
132 install-data-local:: doc
133         $(MKDIR_P) $(DESTDIR)$(htmldir)
134         $(INSTALL_DATA) doc/html/* $(DESTDIR)$(htmldir)
135
136 uninstall-local::
137         rm -rf $(DESTDIR)$(htmldir)
138
139 endif HAVE_DOXYGEN
140 endif ENABLE_DOCS
141
142 # Tests
143
144 # Some tests need to use unexported symbols, so we link them against
145 # a private copy of libxkbcommon with all symbols exposed.
146 check_LTLIBRARIES = libtest.la
147 libtest_la_CFLAGS = $(AM_CLFLAGS) -fvisibility=default
148 libtest_la_SOURCES = \
149         $(libxkbcommon_la_SOURCES) \
150         test/common.c \
151         test/test.h
152
153 AM_TESTS_ENVIRONMENT = \
154         XKB_LOG_LEVEL=debug; export XKB_LOG_LEVEL; \
155         XKB_LOG_VERBOSITY=10; export XKB_LOG_VERBOSITY; \
156         $(XORG_MALLOC_DEBUG_ENV)
157
158 TESTS = \
159         test/keysym \
160         test/filecomp \
161         test/context \
162         test/rules-file \
163         test/stringcomp \
164         test/buffercomp \
165         test/log \
166         test/atom
167 TESTS_LDADD = libtest.la
168
169 test_keysym_LDADD = $(TESTS_LDADD)
170 test_filecomp_LDADD = $(TESTS_LDADD)
171 test_rulescomp_LDADD = $(TESTS_LDADD) -lrt
172 test_context_LDADD = $(TESTS_LDADD)
173 test_rules_file_CFLAGS = $(AM_CFLAGS) -Wno-declaration-after-statement
174 test_rules_file_LDADD = $(TESTS_LDADD) -lrt
175 test_stringcomp_LDADD = $(TESTS_LDADD)
176 test_buffercomp_LDADD = $(TESTS_LDADD)
177 test_log_LDADD = $(TESTS_LDADD)
178 test_atom_LDADD = $(TESTS_LDADD)
179 test_rmlvo_to_kccgst_LDADD = $(TESTS_LDADD)
180 test_print_compiled_keymap_LDADD = $(TESTS_LDADD)
181 test_bench_key_proc_LDADD = $(TESTS_LDADD) -lrt
182
183 check_PROGRAMS = \
184         $(TESTS) \
185         test/rmlvo-to-kccgst \
186         test/print-compiled-keymap \
187         test/bench-key-proc
188
189 if BUILD_LINUX_TESTS
190 TESTS += \
191         test/state \
192         test/keyseq \
193         test/rulescomp
194
195 test_keyseq_LDADD = $(TESTS_LDADD)
196 test_state_LDADD = $(TESTS_LDADD)
197 test_interactive_evdev_LDADD = $(TESTS_LDADD)
198
199 check_PROGRAMS += \
200         test/interactive-evdev
201
202 endif BUILD_LINUX_TESTS
203
204 if ENABLE_X11
205 TESTS += \
206         test/x11
207 TESTS_X11_LDADD = $(TESTS_LDADD) $(XCB_XKB_LIBS) libxkbcommon-x11.la
208 TESTS_X11_CFLAGS = $(XCB_XKB_CFLAGS)
209
210 test_x11_LDADD = $(TESTS_X11_LDADD)
211 test_x11_CFLAGS = $(TESTS_X11_CFLAGS)
212 test_interactive_x11_LDADD = $(TESTS_X11_LDADD)
213 test_interactive_x11_CFLAGS = $(TESTS_X11_CFLAGS)
214
215 check_PROGRAMS += \
216         test/interactive-x11
217 endif ENABLE_X11
218
219 EXTRA_DIST += \
220         test/data
221
222 # This sed script strips out lines that start with '#define _' which
223 # removes #define _OSF_Keysyms and such.  The XK_Ydiaeresis case is to
224 # handle a duplicate definition in HPkeysyms.h which kicks in if it's
225 # not already defined.
226 X11_INCLUDEDIR = /usr/include/X11
227 KEYSYMDEFS = \
228          $(X11_INCLUDEDIR)/keysymdef.h \
229          $(X11_INCLUDEDIR)/XF86keysym.h \
230          $(X11_INCLUDEDIR)/Sunkeysym.h \
231          $(X11_INCLUDEDIR)/DECkeysym.h \
232          $(X11_INCLUDEDIR)/HPkeysym.h
233 update-keysyms:
234         echo -en '#ifndef _XKBCOMMON_KEYSYMS_H\n#define _XKBCOMMON_KEYSYMS_H\n\n' > $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
235         echo -en '/* This file is autogenerated from Makefile.am; please do not commit directly. */\n\n' >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
236         echo -en '#define XKB_KEY_NoSymbol                    0x000000  /* Special KeySym */\n\n' >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
237         sed -e '/XK_Ydiaeresis\s*0x100000ee/d' \
238             -e '/#define _/d' \
239             -e 's/#define\s*\(\w*\)XK_/#define XKB_KEY_\1/' \
240             -e '/\(#ifdef\|#ifndef\|#endif\)/d' $(KEYSYMDEFS) >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
241         echo -en '\n\n#endif\n' >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
242         LC_CTYPE=C python $(top_srcdir)/makekeys.py $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h > $(top_srcdir)/src/ks_tables.h
243
244 # Run this if you add/remove a new keyword to the xkbcomp scanner,
245 # or just want to regenerate the gperf file.
246 update-keywords:
247         $(AM_V_GEN)gperf < $(top_srcdir)/src/xkbcomp/keywords.gperf > $(top_srcdir)/src/xkbcomp/keywords.c
248
249 # Android stuff
250
251 Android_build.mk: Makefile $(BUILT_SOURCES)
252         androgenizer \
253         -:PROJECT libxkbcommon \
254         -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
255         \
256         -:STATIC libxkbcommon \
257         -:TAGS eng debug \
258         -:SOURCES $(filter-out %.l %.y,$(libxkbcommon_la_SOURCES)) $(BUILT_SOURCES) \
259         -:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(AM_CFLAGS) \
260         -:LDFLAGS $(AM_LDFLAGS) \
261         \
262         -:PASSTHROUGH 'libxkbcommon-clean: clean-libxkbcommon' \
263         > $@