Add key-sequence checking to rulescomp
[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 AM_CPPFLAGS = \
7         -DDFLT_XKB_CONFIG_ROOT='"$(XKBCONFIGROOT)"' \
8         -I$(top_srcdir)/src \
9         -I$(top_srcdir)/src/xkbcomp \
10         -I$(top_builddir)/src/xkbcomp \
11         -include $(top_builddir)/src/config.h
12
13 AM_CFLAGS = $(BASE_CFLAGS)
14
15 AM_LFLAGS = -o lex.yy.c
16 AM_YFLAGS = -d
17
18 xkbcommonincludedir = $(includedir)/xkbcommon
19 xkbcommoninclude_HEADERS = \
20         xkbcommon/xkbcommon.h \
21         xkbcommon/xkbcommon-compat.h \
22         xkbcommon/xkbcommon-keysyms.h \
23         xkbcommon/xkbcommon-names.h
24
25 lib_LTLIBRARIES = libxkbcommon.la
26 libxkbcommon_la_LDFLAGS = -no-undefined
27 libxkbcommon_la_SOURCES = \
28         src/xkbcomp/action.c \
29         src/xkbcomp/action.h \
30         src/xkbcomp/ast.h \
31         src/xkbcomp/ast-build.c \
32         src/xkbcomp/ast-build.h \
33         src/xkbcomp/compat.c \
34         src/xkbcomp/expr.c \
35         src/xkbcomp/expr.h \
36         src/xkbcomp/include.c \
37         src/xkbcomp/include.h \
38         src/xkbcomp/keycodes.c \
39         src/xkbcomp/keymap.c \
40         src/xkbcomp/keymap-dump.c \
41         src/xkbcomp/parser.y \
42         src/xkbcomp/parser-priv.h \
43         src/xkbcomp/rules.c \
44         src/xkbcomp/rules.h \
45         src/xkbcomp/scanner.l \
46         src/xkbcomp/symbols.c \
47         src/xkbcomp/types.c \
48         src/xkbcomp/vmod.c \
49         src/xkbcomp/vmod.h \
50         src/xkbcomp/xkbcomp.c \
51         src/xkbcomp/xkbcomp-priv.h \
52         src/atom.c \
53         src/atom.h \
54         src/context.c \
55         src/context.h \
56         src/compat.c \
57         src/darray.h \
58         src/keysym.c \
59         src/keysym.h \
60         src/keysym-utf.c \
61         src/ks_tables.h \
62         src/keymap.c \
63         src/keymap.h \
64         src/state.c \
65         src/text.c \
66         src/text.h \
67         src/utils.h
68
69 BUILT_SOURCES = \
70         src/xkbcomp/parser.c \
71         src/xkbcomp/parser.h \
72         src/xkbcomp/scanner.c
73 CLEANFILES = $(BUILT_SOURCES)
74
75 src/xkbcomp/parser.c: $(top_builddir)/src/$(am__dirstamp) $(top_builddir)/src/xkbcomp/$(am__dirstamp)
76 src/xkbcomp/parser.h: $(top_builddir)/src/$(am__dirstamp) $(top_builddir)/src/xkbcomp/$(am__dirstamp)
77 src/xkbcomp/scanner.c: $(top_builddir)/src/$(am__dirstamp) $(top_builddir)/src/xkbcomp/$(am__dirstamp)
78
79 # Documentation
80
81 if ENABLE_DOCS
82 if HAVE_DOXYGEN
83 doc: doc/stamp-doxygen
84 clean-doc: clean-doxygen
85 all-local:: doc
86 clean-local:: clean-doc
87
88 doc/stamp-doxygen: $(top_srcdir)/xkbcommon/*.h
89         $(AM_V_GEN)$(DOXYGEN) doc/Doxyfile
90         touch $@
91
92 clean-doxygen:
93         rm -rf doc/html doc/stamp-doxygen
94
95 install-data-local:: doc
96         $(MKDIR_P) $(DESTDIR)$(htmldir)
97         $(INSTALL_DATA) doc/html/* $(DESTDIR)$(htmldir)
98
99 uninstall-local::
100         rm -rf $(DESTDIR)$(htmldir)
101
102 endif HAVE_DOXYGEN
103 endif ENABLE_DOCS
104
105 # Tests
106
107 # Some tests need to use unexported symbols, so we link them against
108 # a private copy of libxkbcommon with all symbols exposed.
109 noinst_LTLIBRARIES = libtest.la
110 libtest_la_LDFLAGS = $(libxkbcommon_la_LDFLAGS)
111 libtest_la_SOURCES = \
112         $(libxkbcommon_la_SOURCES) \
113         test/common.c \
114         test/test.h
115
116 AM_TESTS_ENVIRONMENT = \
117         XKB_LOG_LEVEL=debug; export XKB_LOG_LEVEL; \
118         XKB_LOG_VERBOSITY=10; export XKB_LOG_VERBOSITY; \
119         $(XORG_MALLOC_DEBUG_ENV)
120
121 TESTS = \
122         test/keysym \
123         test/filecomp \
124         test/context \
125         test/rules-file \
126         test/stringcomp \
127         test/log
128 TESTS_LDADD = libtest.la
129
130 test_keysym_LDADD = $(TESTS_LDADD)
131 test_filecomp_LDADD = $(TESTS_LDADD)
132 test_rulescomp_LDADD = $(TESTS_LDADD) -lrt
133 test_context_LDADD = $(TESTS_LDADD)
134 test_rules_file_CFLAGS = $(AM_CFLAGS) -Wno-declaration-after-statement
135 test_rules_file_LDADD = $(TESTS_LDADD) -lrt
136 test_stringcomp_LDADD = $(TESTS_LDADD)
137 test_log_LDADD = $(TESTS_LDADD)
138 test_rmlvo_to_kccgst_LDADD = $(TESTS_LDADD)
139 test_print_compiled_keymap_LDADD = $(TESTS_LDADD)
140 test_bench_key_proc_LDADD = $(TESTS_LDADD) -lrt
141
142 check_PROGRAMS = \
143         $(TESTS) \
144         test/rmlvo-to-kccgst \
145         test/print-compiled-keymap \
146         test/bench-key-proc
147
148 if BUILD_LINUX_TESTS
149 TESTS += \
150         test/state \
151         test/keyseq \
152         test/rulescomp
153
154 test_keyseq_LDADD = $(TESTS_LDADD)
155 test_state_LDADD = $(TESTS_LDADD)
156 test_interactive_LDADD = $(TESTS_LDADD)
157
158 check_PROGRAMS += \
159         test/interactive
160
161 endif BUILD_LINUX_TESTS
162
163 EXTRA_DIST = \
164         test/data
165
166 # This sed script strips out lines that start with '#define _' which
167 # removes #define _OSF_Keysyms and such.  The XK_Ydiaeresis case is to
168 # handle a duplicate definition in HPkeysyms.h which kicks in if it's
169 # not already defined.
170
171 X11_INCLUDEDIR = /usr/include/X11
172 KEYSYMDEFS = \
173          $(X11_INCLUDEDIR)/keysymdef.h \
174          $(X11_INCLUDEDIR)/XF86keysym.h \
175          $(X11_INCLUDEDIR)/Sunkeysym.h \
176          $(X11_INCLUDEDIR)/DECkeysym.h \
177          $(X11_INCLUDEDIR)/HPkeysym.h
178 update-keysyms:
179         echo -en '#ifndef _XKBCOMMON_KEYSYMS_H\n#define _XKBCOMMON_KEYSYMS_H\n\n' > $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
180         echo -en '/* This file is autogenerated from Makefile.am; please do not commit directly. */\n\n' >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
181         echo -en '#define XKB_KEY_NoSymbol                    0x000000  /* Special KeySym */\n\n' >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
182         sed -e '/XK_Ydiaeresis\s*0x100000ee/d' \
183             -e '/#define _/d' \
184             -e 's/#define\s*\(\w*\)XK_/#define XKB_KEY_\1/' \
185             -e '/\(#ifdef\|#ifndef\|#endif\)/d' $(KEYSYMDEFS) >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
186         echo -en '\n\n#endif\n' >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
187         echo -en '/* This file is autogenerated from Makefile.am; please do not commit directly. */\n\n' > $(top_srcdir)/src/ks_tables.h
188         LC_CTYPE=C python $(top_srcdir)/makekeys.py $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h >> $(top_srcdir)/src/ks_tables.h
189
190 # Android stuff
191
192 Android_build.mk: Makefile $(BUILT_SOURCES)
193         androgenizer \
194         -:PROJECT libxkbcommon \
195         -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
196         \
197         -:STATIC libxkbcommon \
198         -:TAGS eng debug \
199         -:SOURCES $(filter-out %.l %.y,$(libxkbcommon_la_SOURCES)) $(BUILT_SOURCES) \
200         -:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(AM_CFLAGS) \
201         -:LDFLAGS $(libxkbcommon_la_LDFLAGS) \
202         \
203         -:PASSTHROUGH 'libxkbcommon-clean: clean-libxkbcommon' \
204         > $@