summaryrefslogtreecommitdiff
path: root/Makefile.am
blob: 98bc307f3ecc5cf2513a2439f42af008e9f983ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
ACLOCAL_AMFLAGS = -I m4

SUBDIRS = makekeys

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = xkbcommon.pc

MAINTAINERCLEANFILES = ChangeLog INSTALL

.PHONY: ChangeLog INSTALL

INSTALL:
	$(INSTALL_CMD)

ChangeLog:
	$(CHANGELOG_CMD)

dist-hook: ChangeLog INSTALL

AM_CPPFLAGS = \
	-DDFLT_XKB_CONFIG_ROOT='"$(XKBCONFIGROOT)"' \
	-I$(top_srcdir)/src \
	-I$(top_srcdir)/src/xkbcomp \
	-I$(top_builddir)/src/xkbcomp \
	-include $(top_builddir)/src/config.h

AM_CFLAGS = $(BASE_CFLAGS)

AM_LFLAGS = -o lex.yy.c
AM_YFLAGS = -d

xkbcommonincludedir = $(includedir)/xkbcommon
xkbcommoninclude_HEADERS = \
	xkbcommon/xkbcommon.h \
	xkbcommon/xkbcommon-compat.h \
	xkbcommon/xkbcommon-keysyms.h \
	xkbcommon/xkbcommon-names.h

lib_LTLIBRARIES = libxkbcommon.la
libxkbcommon_la_LDFLAGS = -no-undefined
libxkbcommon_la_SOURCES = \
	src/xkbcomp/action.c \
	src/xkbcomp/action.h \
	src/xkbcomp/ast.h \
	src/xkbcomp/ast-build.c \
	src/xkbcomp/ast-build.h \
	src/xkbcomp/compat.c \
	src/xkbcomp/expr.c \
	src/xkbcomp/expr.h \
	src/xkbcomp/include.c \
	src/xkbcomp/include.h \
	src/xkbcomp/keycodes.c \
	src/xkbcomp/keycodes.h \
	src/xkbcomp/keymap.c \
	src/xkbcomp/parser.y \
	src/xkbcomp/parser-priv.h \
	src/xkbcomp/rules.c \
	src/xkbcomp/rules.h \
	src/xkbcomp/scanner.l \
	src/xkbcomp/symbols.c \
	src/xkbcomp/types.c \
	src/xkbcomp/vmod.c \
	src/xkbcomp/vmod.h \
	src/xkbcomp/xkbcomp.c \
	src/xkbcomp/xkbcomp-priv.h \
	src/atom.c \
	src/atom.h \
	src/context.c \
	src/context.h \
	src/compat.c \
	src/darray.h \
	src/keymap-dump.c \
	src/keysym.c \
	src/keysym.h \
	src/keysym-utf.c \
	src/list.h \
	src/keymap.c \
	src/keymap.h \
	src/state.c \
	src/text.c \
	src/text.h \
	src/utils.h

BUILT_SOURCES = \
	src/xkbcomp/parser.c \
	src/xkbcomp/parser.h \
	src/xkbcomp/scanner.c \
	src/ks_tables.h
CLEANFILES = $(BUILT_SOURCES)

src/xkbcomp/parser.c: $(top_builddir)/src/$(am__dirstamp) $(top_builddir)/src/xkbcomp/$(am__dirstamp)
src/xkbcomp/parser.h: $(top_builddir)/src/$(am__dirstamp) $(top_builddir)/src/xkbcomp/$(am__dirstamp)
src/xkbcomp/scanner.c: $(top_builddir)/src/$(am__dirstamp) $(top_builddir)/src/xkbcomp/$(am__dirstamp)

src/ks_tables.h: $(top_builddir)/makekeys/makekeys$(EXEEXT)
	$(AM_V_GEN)$(top_builddir)/makekeys/makekeys $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h > $@

$(top_builddir)/makekeys/makekeys$(EXEEXT): $(top_srcdir)/makekeys/makekeys.c
	$(MAKE) -C makekeys

# Documentation

if ENABLE_DOCS
if HAVE_DOXYGEN
doc: doc/stamp-doxygen
clean-doc: clean-doxygen
all-local:: doc
clean-local:: clean-doc

doc/stamp-doxygen: $(top_srcdir)/xkbcommon/*.h
	$(AM_V_GEN)$(DOXYGEN) doc/Doxyfile
	touch $@

clean-doxygen:
	rm -rf doc/html doc/stamp-doxygen

install-data-local:: doc
	$(MKDIR_P) $(DESTDIR)$(htmldir)
	$(INSTALL_DATA) doc/html/* $(DESTDIR)$(htmldir)

uninstall-local::
	rm -rf $(DESTDIR)$(htmldir)

endif HAVE_DOXYGEN
endif ENABLE_DOCS

# Tests

# Some tests need to use unexported symbols, so we link them against
# a private copy of libxkbcommon with all symbols exposed.
noinst_LTLIBRARIES = libtest.la
libtest_la_LDFLAGS = $(libxkbcommon_la_LDFLAGS)
libtest_la_SOURCES = \
	$(libxkbcommon_la_SOURCES) \
	test/common.c

AM_TESTS_ENVIRONMENT = \
	XKB_LOG_LEVEL=debug; export XKB_LOG_LEVEL; \
	XKB_LOG_VERBOSITY=10; export XKB_LOG_VERBOSITY; \
	$(XORG_MALLOC_DEBUG_ENV)

TESTS = \
	test/keysym \
	test/filecomp \
	test/rulescomp \
	test/state \
	test/context \
	test/rules-file \
	test/stringcomp \
	test/keyseq \
	test/log
TESTS_LDADD = libtest.la

test_keysym_LDADD = $(TESTS_LDADD)
test_filecomp_LDADD = $(TESTS_LDADD)
test_rulescomp_LDADD = $(TESTS_LDADD) -lrt
test_state_LDADD = $(TESTS_LDADD)
test_context_LDADD = $(TESTS_LDADD)
test_rules_file_CFLAGS = $(AM_CFLAGS) -Wno-declaration-after-statement
test_rules_file_LDADD = $(TESTS_LDADD) -lrt
test_stringcomp_LDADD = $(TESTS_LDADD)
test_keyseq_LDADD = $(TESTS_LDADD)
test_log_LDADD = $(TESTS_LDADD)
test_interactive_LDADD = $(TESTS_LDADD)
test_rmlvo_to_kccgst_LDADD = $(TESTS_LDADD)
test_print_compiled_keymap_LDADD = $(TESTS_LDADD)

check_PROGRAMS = \
	$(TESTS) \
	test/interactive \
	test/rmlvo-to-kccgst \
	test/print-compiled-keymap

EXTRA_DIST = \
	test/data \
	test/test.h

# This sed script strips out lines that start with '#define _' which
# removes #define _OSF_Keysyms and such.  The XK_Ydiaeresis case is to
# handle a duplicate definition in HPkeysyms.h which kicks in if it's
# not already defined.

X11_INCLUDEDIR = /usr/include/X11
KEYSYMDEFS = \
	 $(X11_INCLUDEDIR)/keysymdef.h \
	 $(X11_INCLUDEDIR)/XF86keysym.h \
	 $(X11_INCLUDEDIR)/Sunkeysym.h \
	 $(X11_INCLUDEDIR)/DECkeysym.h \
	 $(X11_INCLUDEDIR)/HPkeysym.h
update-keysyms:
	echo -en '#ifndef _XKBCOMMON_KEYSYMS_H\n#define _XKBCOMMON_KEYSYMS_H\n\n' > $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
	echo -en '/* This file is autogenerated from Makefile.am; please do not commit directly. */\n\n' >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
	echo -en '#define XKB_KEY_NoSymbol                    0x000000  /* Special KeySym */\n\n' >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
	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
	echo -en '\n\n#endif\n' >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h

# Android stuff

Android_build.mk: Makefile $(BUILT_SOURCES)
	androgenizer \
	-:PROJECT libxkbcommon \
	-:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
	\
	-:STATIC libxkbcommon \
	-:TAGS eng debug \
	-:SOURCES $(filter-out %.l %.y,$(libxkbcommon_la_SOURCES)) $(BUILT_SOURCES) \
	-:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(AM_CFLAGS) \
	-:LDFLAGS $(libxkbcommon_la_LDFLAGS) \
	\
	-:PASSTHROUGH 'libxkbcommon-clean: clean-libxkbcommon' \
	> $@