Import tools from telepathy-glib 0.7.3 and build a static libemp-extensions.la.
[empathy.git] / libempathy / Makefile.am
1 AM_CPPFLAGS =                                           \
2         -I.                                             \
3         -I$(top_srcdir)                                 \
4         -I$(top_builddir)                               \
5         -DDATADIR=\""$(datadir)"\"                      \
6         $(LIBEMPATHY_CFLAGS)                            \
7         $(WARN_CFLAGS)
8
9 BUILT_SOURCES =                                         \
10         empathy-marshal.h                               \
11         empathy-marshal.c                               \
12         empathy-marshal.list                            \
13         empathy-enum-types.h                            \
14         empathy-enum-types.c                            \
15         empathy-filter-glue.h                           \
16         empathy-chandler-glue.h                         \
17         tp-stream-engine-gen.h
18
19 lib_LTLIBRARIES = libempathy.la
20
21 libempathy_la_SOURCES =                                 \
22         empathy-avatar.c                                \
23         empathy-time.c                                  \
24         empathy-status-presets.c                        \
25         empathy-debug.c                                 \
26         empathy-utils.c                                 \
27         empathy-message.c                               \
28         empathy-chatroom-manager.c                      \
29         empathy-chatroom.c                              \
30         empathy-contact.c                               \
31         empathy-contact-groups.c                        \
32         empathy-contact-list.c                          \
33         empathy-contact-manager.c                       \
34         empathy-contact-factory.c                       \
35         empathy-tp-contact-factory.c                    \
36         empathy-tp-group.c                              \
37         empathy-tp-contact-list.c                       \
38         empathy-tp-chat.c                               \
39         empathy-tp-chatroom.c                           \
40         empathy-tp-roomlist.c                           \
41         empathy-tp-call.c                               \
42         empathy-chandler.c                              \
43         empathy-filter.c                                \
44         empathy-idle.c                                  \
45         empathy-log-manager.c                           \
46         empathy-irc-network-manager.c                   \
47         empathy-irc-network.c                           \
48         empathy-irc-server.c
49
50 # do not distribute generated files
51 nodist_libempathy_la_SOURCES =\
52         $(BUILT_SOURCES)
53
54 libempathy_la_LIBADD =          \
55         $(top_builddir)/extensions/libemp-extensions.la \
56         $(LIBEMPATHY_LIBS)
57
58 libempathy_la_LDFLAGS =         \
59        -version-info ${LIBEMPATHY_CURRENT}:${LIBEMPATHY_REVISION}:${LIBEMPATHY_AGE} \
60        -export-symbols-regex ^empathy_
61
62 libempathy_headers =                            \
63         empathy-avatar.h                        \
64         empathy-time.h                          \
65         empathy-status-presets.h                \
66         empathy-debug.h                         \
67         empathy-utils.h                         \
68         empathy-message.h                       \
69         empathy-chatroom-manager.h              \
70         empathy-chatroom.h                      \
71         empathy-contact.h                       \
72         empathy-contact-groups.h                \
73         empathy-contact-list.h                  \
74         empathy-contact-manager.h               \
75         empathy-contact-factory.h               \
76         empathy-tp-contact-factory.h            \
77         empathy-tp-group.h                      \
78         empathy-tp-contact-list.h               \
79         empathy-tp-chat.h                       \
80         empathy-tp-chatroom.h                   \
81         empathy-tp-roomlist.h                   \
82         empathy-tp-call.h                       \
83         empathy-chandler.h                      \
84         empathy-filter.h                        \
85         empathy-idle.h                          \
86         empathy-log-manager.h                   \
87         empathy-irc-network-manager.h           \
88         empathy-irc-network.h                   \
89         empathy-irc-server.h
90
91 libempathy_includedir = $(includedir)/libempathy/
92 libempathy_include_HEADERS =                    \
93         $(libempathy_headers)                   \
94         empathy-enum-types.h
95
96 empathy-marshal.list: $(libempathy_la_SOURCES) Makefile.am
97         ( cd $(srcdir) && \
98         sed -n -e 's/.*empathy_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \
99         $(libempathy_la_SOURCES) ) \
100         | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp
101         if cmp -s $@.tmp $@; then \
102                 rm $@.tmp; \
103         else \
104                 mv $@.tmp $@; \
105         fi
106
107 %-marshal.h: %-marshal.list Makefile
108         $(GLIB_GENMARSHAL) --header --prefix=_$(subst -,_,$*)_marshal $< > $*-marshal.h
109
110 %-marshal.c: %-marshal.list Makefile
111         echo "#include \"empathy-marshal.h\"" > $@ && \
112         $(GLIB_GENMARSHAL) --body --prefix=_$(subst -,_,$*)_marshal $< >> $*-marshal.c
113
114 empathy-chandler-glue.h: empathy-chandler.xml Makefile
115         $(LIBTOOL) --mode=execute $(DBUS_BINDING_TOOL) --prefix=empathy_chandler --mode=glib-server --output=$@ $<
116 empathy-filter-glue.h: empathy-filter.xml Makefile
117         $(LIBTOOL) --mode=execute $(DBUS_BINDING_TOOL) --prefix=empathy_filter --mode=glib-server --output=$@ $<
118
119 tp-stream-engine-gen.h: tp-stream-engine.xml Makefile.am
120         $(LIBTOOL) --mode=execute $(DBUS_BINDING_TOOL) --prefix=tp_stream_engine --mode=glib-client --output=$@ $<
121
122
123 empathy-enum-types.h: stamp-empathy-enum-types.h
124         @true
125 stamp-empathy-enum-types.h: $(libempathy_headers) Makefile
126         (cd $(srcdir) \
127         && glib-mkenums \
128                         --fhead "#ifndef __LIBEMPATHY_ENUM_TYPES_H__\n" \
129                         --fhead "#define __LIBEMPATHY_ENUM_TYPES_H__ 1\n\n" \
130                         --fhead "#include <glib-object.h>\n\n" \
131                         --fhead "G_BEGIN_DECLS\n\n" \
132                         --ftail "G_END_DECLS\n\n" \
133                         --ftail "#endif /* __LIBEMPATHY_ENUM_TYPES_H__ */\n" \
134                         --fprod "#include <libempathy/@filename@>\n" \
135                         --eprod "#define EMPATHY_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n" \
136                         --eprod "GType @enum_name@_get_type (void);\n" \
137                 $(libempathy_headers) ) > xgen-gth \
138         && (cmp -s xgen-gth empathy-enum-type.h || cp xgen-gth empathy-enum-types.h) \
139         && rm -f xgen-gth \
140         && echo timestamp > $(@F)
141
142 empathy-enum-types.c: $(libempathy_headers) Makefile
143         (cd $(srcdir) \
144         && glib-mkenums \
145                         --fhead "#include <config.h>\n" \
146                         --fhead "#include <glib-object.h>\n" \
147                         --fhead "#include \"empathy-enum-types.h\"\n\n" \
148                         --fprod "\n/* enumerations from \"@filename@\" */" \
149                         --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
150                         --vprod "  { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
151                         --vtail "  { 0, NULL, NULL }\n};\n\n" \
152                         --vtail "GType\n@enum_name@_get_type (void)\n{\n" \
153                         --vtail "  static GType type = 0;\n\n" \
154                         --vtail "  if (!type)\n" \
155                         --vtail "    type = g_@type@_register_static (\"@EnumName@\", _@enum_name@_values);\n\n" \
156                         --vtail "  return type;\n}\n\n" \
157                 $(libempathy_headers) ) > xgen-gtc \
158         && cp xgen-gtc $(@F) \
159         && rm -f xgen-gtc
160
161 dtddir = $(datadir)/empathy
162 dtd_DATA =                                      \
163         empathy-status-presets.dtd              \
164         empathy-contact-groups.dtd              \
165         empathy-chatroom-manager.dtd            \
166         empathy-irc-networks.dtd
167
168 stylesheetdir = $(datadir)/empathy
169 stylesheet_DATA =               \
170         empathy-log-manager.xsl
171
172 ircnetworksdir = $(datadir)/empathy
173 ircnetworks_DATA =              \
174         irc-networks.xml
175
176 pkgconfigdir = $(libdir)/pkgconfig
177 pkgconfig_DATA = libempathy.pc
178
179 EXTRA_DIST =                    \
180         empathy-marshal.list    \
181         empathy-chandler.xml    \
182         empathy-filter.xml      \
183         tp-stream-engine.xml    \
184         $(stylesheet_DATA)      \
185         $(dtd_DATA)             \
186         $(ircnetworks_DATA)
187
188 CLEANFILES =                            \
189         $(BUILT_SOURCES)                \
190         stamp-empathy-enum-types.h