summaryrefslogtreecommitdiff
path: root/src/Makefile.am
blob: 1018784917f364e170d10ccf54bf1d07f36bc81c (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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# vim:set noet ts=4:
#
# ibus - The Input Bus
#
# Copyright (c) 2007-2015 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2007-2015 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
# USA

NULL =

if ENABLE_TESTS
TESTS_DIR = tests
endif

SUBDIRS = . $(TESTS_DIR)

# libibus = libibus-@IBUS_API_VERSION@.la
libibus = libibus-1.0.la

# gobject introspection
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_SCANNER_ARGS =
INTROSPECTION_COMPILER_ARGS = \
    --includedir=$(srcdir)    \
    --includedir=.            \
    $(NULL)
INTROSPECTION_GIRS =
CLEANFILES =

# C preprocessor flags
AM_CPPFLAGS =                                           \
    -DG_LOG_DOMAIN=\"IBUS\"                             \
    @GLIB2_CFLAGS@                                      \
    @GOBJECT2_CFLAGS@                                   \
    @GIO2_CFLAGS@                                       \
    -DIBUS_CACHE_DIR=\""$(localstatedir)/cache/ibus"\"  \
    -DIBUS_DATA_DIR=\"$(pkgdatadir)\"                   \
    -DIBUS_DISABLE_DEPRECATION_WARNINGS                 \
    -DIBUS_COMPILATION                                  \
    -DISOCODES_PREFIX=\"$(ISOCODES_PREFIX)\"            \
    $(NULL)

# ibus library
lib_LTLIBRARIES = $(libibus)

libibus_1_0_la_LIBADD =     \
    @GLIB2_LIBS@            \
    @GOBJECT2_LIBS@         \
    @GIO2_LIBS@             \
    $(NULL)
libibus_1_0_la_LDFLAGS =            \
    -no-undefined                   \
    -export-symbols-regex "ibus_.*" \
    -version-info @LT_VERSION_INFO@ \
    $(NULL)

ibus_sources =              \
    ibusshare.c             \
    ibusobject.c            \
    ibusserializable.c      \
    ibusproxy.c             \
    ibusservice.c           \
    ibusfactory.c           \
    ibusengine.c            \
    ibuserror.c             \
    ibustext.c              \
    ibuskeymap.c            \
    ibusattribute.c         \
    ibusattrlist.c          \
    ibusproperty.c          \
    ibusproplist.c          \
    ibuslookuptable.c       \
    ibusinputcontext.c      \
    ibusconfig.c            \
    ibusconfigservice.c     \
    ibuspanelservice.c      \
    ibusbus.c               \
    ibuskeynames.c          \
    ibuskeyuni.c            \
    ibushotkey.c            \
    ibusxml.c               \
    ibusenginedesc.c        \
    ibusobservedpath.c      \
    ibuscomponent.c         \
    ibusutil.c              \
    ibusenginesimple.c      \
    ibusregistry.c          \
    $(NULL)
libibus_1_0_la_SOURCES =    \
    ibusmarshalers.c        \
    ibuscomposetable.c      \
    ibusenumtypes.c         \
    $(ibus_sources)         \
    $(NULL)
ibus_marshalers_sources =   \
    ibusmarshalers.h        \
    ibusmarshalers.c        \
    $(NULL)
ibus_enumtypes_sources =    \
    ibusenumtypes.h         \
    ibusenumtypes.c         \
    $(NULL)
ibus_headers =              \
    ibus.h                  \
    ibusshare.h             \
    ibusdebug.h             \
    ibusobject.h            \
    ibusserializable.h      \
    ibusproxy.h             \
    ibusservice.h           \
    ibusfactory.h           \
    ibusengine.h            \
    ibuserror.h             \
    ibustext.h              \
    ibuskeymap.h            \
    ibusattribute.h         \
    ibusattrlist.h          \
    ibusproperty.h          \
    ibusproplist.h          \
    ibuslookuptable.h       \
    ibusinputcontext.h      \
    ibusconfig.h            \
    ibusconfigservice.h     \
    ibuspanelservice.h      \
    ibuskeysyms.h           \
    ibuskeysyms-compat.h    \
    ibuskeys.h              \
    ibustypes.h             \
    ibusbus.h               \
    ibushotkey.h            \
    ibusxml.h               \
    ibusenginedesc.h        \
    ibusobservedpath.h      \
    ibuscomponent.h         \
    ibusutil.h              \
    ibusenginesimple.h      \
    ibusregistry.h          \
    $(NULL)
ibusincludedir = $(includedir)/ibus-@IBUS_API_VERSION@
ibus_public_headers =       \
    $(ibus_headers)         \
    ibusenumtypes.h         \
    ibusversion.h           \
    $(NULL)
ibusinclude_HEADERS =       \
    $(ibus_public_headers)  \
    $(NULL)
ibus_private_headers =       \
    ibuscomposetable.h       \
    ibusinternal.h           \
    keyname-table.h          \
    gtkimcontextsimpleseqs.h \
    $(NULL)
noinst_HEADERS =            \
    $(ibus_private_headers) \
    $(NULL)

BUILT_SOURCES =                 \
    $(ibus_marshalers_sources)  \
    $(ibus_enumtypes_sources)   \
    $(NULL)

if HAVE_INTROSPECTION
introspection_sources =         \
    $(ibus_headers)             \
    $(ibus_sources)             \
    $(NULL)
built_introspection_sources =   \
    $(ibus_enumtypes_sources)   \
    ibusversion.h               \
    $(NULL)
IBus-1.0.gir: $(libibus) Makefile
IBus_1_0_gir_SCANNERFLAGS = --pkg-export=ibus-1.0 $(IBUS_GIR_SCANNERFLAGS)
IBus_1_0_gir_INCLUDES = GLib-2.0 GObject-2.0 Gio-2.0
IBus_1_0_gir_LIBS = $(libibus)
IBus_1_0_gir_FILES =                                            \
    $(addprefix $(srcdir)/,$(introspection_sources))            \
    $(addprefix $(builddir)/,$(built_introspection_sources))    \
    $(NULL)
IBus_1_0_gir_CFLAGS = -DIBUS_COMPILATION -I$(srcdir) -I$(builddir)
INTROSPECTION_GIRS += IBus-1.0.gir

girdir = $(datadir)/gir-1.0
dist_gir_DATA = $(INTROSPECTION_GIRS)

typelibsdir = $(libdir)/girepository-1.0
typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)

CLEANFILES += $(dist_gir_DATA) $(typelibs_DATA)
endif

# gen enum types
ibusenumtypes.h: $(ibus_headers) ibusenumtypes.h.template
	$(AM_V_GEN) ( top_builddir=`cd $(top_builddir) && pwd`; \
	cd $(srcdir) && $(GLIB_MKENUMS) --template ibusenumtypes.h.template $(ibus_headers) | \
		sed 's/i_bus_/ibus_/g' | \
		sed 's/I_TYPE_BUS_/IBUS_TYPE_/g') > \
	ibusenumtypes.h.tmp && mv ibusenumtypes.h.tmp ibusenumtypes.h

ibusenumtypes.c: $(ibus_headers) ibusenumtypes.c.template
	$(AM_V_GEN) ( top_builddir=`cd $(top_builddir) && pwd`; \
	cd $(srcdir) && $(GLIB_MKENUMS) --template ibusenumtypes.c.template $(ibus_headers) | \
		sed 's/i_bus_/ibus_/g' | \
		sed 's/I_TYPE_BUS_/IBUS_TYPE_/g') > \
	ibusenumtypes.c.tmp && mv ibusenumtypes.c.tmp ibusenumtypes.c

# gen marshal
ibusmarshalers.h: ibusmarshalers.list
	$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_ibus_marshal $(srcdir)/ibusmarshalers.list --header --internal > $@.tmp && \
	mv $@.tmp $@

ibusmarshalers.c: ibusmarshalers.h ibusmarshalers.list
	$(AM_V_GEN) (echo "#include \"ibusmarshalers.h\""; \
	$(GLIB_GENMARSHAL) --prefix=_ibus_marshal $(srcdir)/ibusmarshalers.list --body --internal) > $@.tmp && \
	mv $@.tmp $@

EXTRA_DIST =                    \
    ibusversion.h.in            \
    ibusmarshalers.list         \
    ibusenumtypes.h.template    \
    ibusenumtypes.c.template    \
    $(NULL)

CLEANFILES +=                   \
    $(BUILT_SOURCES)            \
    stamp-ibusmarshalers.h      \
    stamp-ibusenumtypes.h       \
    $(NULL)

DISTCLEANFILES =                \
    ibusversion.h               \
    $(NULL)

-include $(top_srcdir)/git.mk