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