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