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