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