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