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