Remove xkbcomp/misc.c
[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 = \
28         $(BASE_CFLAGS) \
29         $(XMALLOC_ZERO_CFLAGS)
30
31 AM_YFLAGS = -d
32
33 xkbcommonincludedir = $(includedir)/xkbcommon
34 xkbcommoninclude_HEADERS = \
35         xkbcommon/xkbcommon.h \
36         xkbcommon/xkbcommon-names.h \
37         xkbcommon/xkbcommon-keysyms.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/compat.c \
45         src/xkbcomp/expr.c \
46         src/xkbcomp/expr.h \
47         src/xkbcomp/keycodes.c \
48         src/xkbcomp/keytypes.c \
49         src/xkbcomp/parser.y \
50         src/xkbcomp/parseutils.c \
51         src/xkbcomp/parseutils.h \
52         src/xkbcomp/path.c \
53         src/xkbcomp/path.h \
54         src/xkbcomp/rules.c \
55         src/xkbcomp/rules.h \
56         src/xkbcomp/scanner.l \
57         src/xkbcomp/symbols.c \
58         src/xkbcomp/vmod.c \
59         src/xkbcomp/vmod.h \
60         src/xkbcomp/xkbcomp.c \
61         src/xkbcomp/xkbcomp.h \
62         src/xkbcomp/xkbcomp-priv.h \
63         src/atom.c \
64         src/atom.h \
65         src/context.c \
66         src/darray.h \
67         src/keymap-dump.c \
68         src/keysym.c \
69         src/keysym-utf.c \
70         src/list.h \
71         src/map.c \
72         src/state.c \
73         src/text.c \
74         src/text.h \
75         src/utils.h \
76         src/xkb-priv.h
77
78 BUILT_SOURCES = \
79         src/xkbcomp/parser.c \
80         src/xkbcomp/parser.h \
81         src/xkbcomp/scanner.c \
82         src/ks_tables.h
83 CLEANFILES = $(BUILT_SOURCES)
84
85 src/xkbcomp/parser.c: $(top_builddir)/src/$(am__dirstamp) $(top_builddir)/src/xkbcomp/$(am__dirstamp)
86 src/xkbcomp/parser.h: $(top_builddir)/src/$(am__dirstamp) $(top_builddir)/src/xkbcomp/$(am__dirstamp)
87 src/xkbcomp/scanner.c: $(top_builddir)/src/$(am__dirstamp) $(top_builddir)/src/xkbcomp/$(am__dirstamp)
88
89 src/ks_tables.h: $(top_builddir)/makekeys/makekeys$(EXEEXT)
90         $(AM_V_GEN)$(top_builddir)/makekeys/makekeys $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h > $@
91
92 $(top_builddir)/makekeys/makekeys$(EXEEXT): $(top_srcdir)/makekeys/makekeys.c
93         $(MAKE) -C makekeys
94
95 # Tests
96
97 # Some tests need to use unexported symbols, so we link them against
98 # a private copy of libxkbcommon with all symbols exposed.
99 noinst_LTLIBRARIES = libtest.la
100 libtest_la_LDFLAGS = $(libxkbcommon_la_LDFLAGS)
101 libtest_la_SOURCES = \
102         $(libxkbcommon_la_SOURCES) \
103         test/common.c
104
105 TESTS_ENVIRONMENT =
106
107 TESTS = \
108         test/keysym \
109         test/filecomp \
110         test/rulescomp \
111         test/state \
112         test/context \
113         test/rules-file \
114         test/stringcomp \
115         test/keyseq \
116         test/log
117 TESTS_LDADD = libtest.la
118
119 test_keysym_LDADD = $(TESTS_LDADD)
120 test_filecomp_LDADD = $(TESTS_LDADD)
121 test_rulescomp_LDADD = $(TESTS_LDADD) -lrt
122 test_state_LDADD = $(TESTS_LDADD)
123 test_context_LDADD = $(TESTS_LDADD)
124 test_rules_file_CFLAGS = $(AM_CFLAGS) -Wno-declaration-after-statement
125 test_rules_file_LDADD = $(TESTS_LDADD)
126 test_stringcomp_LDADD = $(TESTS_LDADD)
127 test_keyseq_LDADD = $(TESTS_LDADD)
128 test_log_LDADD = $(TESTS_LDADD)
129 test_interactive_LDADD = $(TESTS_LDADD)
130
131 check_PROGRAMS = \
132         $(TESTS) \
133         test/interactive
134
135 EXTRA_DIST = \
136         test/data \
137         test/test.h
138
139 # This sed script strips out lines that start with '#define _' which
140 # removes #define _OSF_Keysyms and such.  The XK_Ydiaeresis case is to
141 # handle a duplicate definition in HPkeysyms.h which kicks in if it's
142 # not already defined.
143
144 X11_INCLUDEDIR = /usr/include/X11
145 KEYSYMDEFS = \
146          $(X11_INCLUDEDIR)/keysymdef.h \
147          $(X11_INCLUDEDIR)/XF86keysym.h \
148          $(X11_INCLUDEDIR)/Sunkeysym.h \
149          $(X11_INCLUDEDIR)/DECkeysym.h \
150          $(X11_INCLUDEDIR)/HPkeysym.h
151 update-keysyms:
152         sed -e '/XK_Ydiaeresis\s*0x100000ee/d; /#define _/d; s/#define\s*\(\w*\)XK_/#define XKB_KEY_\1/; /\(#ifdef\|#ifndef\|#endif\)/d' $(KEYSYMDEFS) > xkbcommon/xkbcommon-keysyms.h
153
154 # Android stuff
155
156 Android_build.mk: Makefile $(BUILT_SOURCES)
157         androgenizer \
158         -:PROJECT libxkbcommon \
159         -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
160         \
161         -:STATIC libxkbcommon \
162         -:TAGS eng debug \
163         -:SOURCES $(filter-out %.l %.y,$(libxkbcommon_la_SOURCES)) $(BUILT_SOURCES) \
164         -:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(AM_CFLAGS) \
165         -:LDFLAGS $(libxkbcommon_la_LDFLAGS) \
166         \
167         -:PASSTHROUGH 'libxkbcommon-clean: clean-libxkbcommon' \
168         > $@