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