]> git.0d.be Git - empathy.git/blob - libempathy/Makefile.am
e7dbd7f866d91d113891541e4506b376990545da
[empathy.git] / libempathy / Makefile.am
1 include $(top_srcdir)/tools/flymake.mk
2
3 AM_CPPFLAGS =                                           \
4         $(ERROR_CFLAGS)                                 \
5         -I$(top_srcdir)/extensions                      \
6         -I$(top_builddir)                               \
7         -DDATADIR=\""$(datadir)"\"                      \
8         -DLOCALEDIR=\""$(datadir)/locale"\"             \
9         -DG_LOG_DOMAIN=\"empathy\"                      \
10         -DGCR_API_SUBJECT_TO_CHANGE                     \
11         $(EMPATHY_CFLAGS)                               \
12         $(GEOCLUE_CFLAGS)                               \
13         $(GEOCODE_CFLAGS)                               \
14         $(NETWORK_MANAGER_CFLAGS)                       \
15         $(CONNMAN_CFLAGS)                               \
16         $(GOA_CFLAGS)                                   \
17         $(UOA_CFLAGS)                                   \
18         $(WARN_CFLAGS)                                  \
19         $(DISABLE_DEPRECATED)
20
21 BUILT_SOURCES =                                         \
22         empathy-dtd-resources.c                         \
23         empathy-dtd-resources.h                         \
24         empathy-enum-types.h                            \
25         empathy-enum-types.c
26
27 libempathy_headers =                            \
28         action-chain-internal.h                 \
29         empathy-auth-factory.h                  \
30         empathy-chatroom-manager.h              \
31         empathy-chatroom.h                      \
32         empathy-client-factory.h \
33         empathy-connection-aggregator.h         \
34         empathy-contact-groups.h                \
35         empathy-contact.h                       \
36         empathy-debug.h                         \
37         empathy-ft-factory.h                    \
38         empathy-ft-handler.h                    \
39         empathy-gsettings.h                     \
40         empathy-presence-manager.h                              \
41         empathy-individual-manager.h            \
42         empathy-location.h                      \
43         empathy-message.h                       \
44         empathy-pkg-kit.h               \
45         empathy-request-util.h                  \
46         empathy-sasl-mechanisms.h               \
47         empathy-server-sasl-handler.h           \
48         empathy-server-tls-handler.h            \
49         empathy-status-presets.h                \
50         empathy-tls-verifier.h                  \
51         empathy-tp-chat.h                       \
52         empathy-types.h                         \
53         empathy-utils.h
54
55 libempathy_handwritten_source =                         \
56         $(libempathy_headers)                           \
57         action-chain.c                                  \
58         empathy-auth-factory.c                          \
59         empathy-chatroom-manager.c                      \
60         empathy-chatroom.c                              \
61         empathy-client-factory.c \
62         empathy-connection-aggregator.c         \
63         empathy-contact-groups.c                        \
64         empathy-contact.c                               \
65         empathy-debug.c                                 \
66         empathy-ft-factory.c                            \
67         empathy-ft-handler.c                            \
68         empathy-presence-manager.c                                      \
69         empathy-individual-manager.c                    \
70         empathy-message.c                               \
71         empathy-pkg-kit.c               \
72         empathy-request-util.c                          \
73         empathy-sasl-mechanisms.c                       \
74         empathy-server-sasl-handler.c                   \
75         empathy-server-tls-handler.c                    \
76         empathy-status-presets.c                        \
77         empathy-tls-verifier.c                          \
78         empathy-tp-chat.c                               \
79         empathy-utils.c
80
81 # these are sources that depend on GOA
82 goa_sources = \
83         empathy-goa-auth-handler.c \
84         empathy-goa-auth-handler.h \
85         $(NULL)
86
87 # these are sources that depend on Ubuntu Online Accounts
88 uoa_sources = \
89         empathy-uoa-auth-handler.c \
90         empathy-uoa-auth-handler.h \
91         $(NULL)
92
93 pkglib_LTLIBRARIES = libempathy.la
94
95 # libempathy's API is not stable and will never be, so use -release to make the
96 # SONAME of the plugin library change with every Empathy release.
97 libempathy_la_LDFLAGS = \
98    -no-undefined \
99    -release $(VERSION) \
100    $(NULL)
101
102 libempathy_la_SOURCES = \
103         $(libempathy_handwritten_source) \
104         $(NULL)
105
106 libempathy_la_LIBADD =          \
107         $(top_builddir)/extensions/libemp-extensions.la \
108         $(GCR_LIBS) \
109         $(EMPATHY_LIBS) \
110         $(GEOCLUE_LIBS) \
111         $(GEOCODE_LIBS) \
112         $(NETWORK_MANAGER_LIBS) \
113         $(CONNMAN_LIBS) \
114         $(UDEV_LIBS) \
115         $(GOA_LIBS) \
116         $(UOA_LIBS) \
117         $(LIBM)
118
119 dtd_resources_files =                           \
120         empathy-status-presets.dtd              \
121         empathy-contact-groups.dtd              \
122         empathy-chatroom-manager.dtd            \
123         $(NULL)
124
125 dtd_resource_files: $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/empathy-dtd.gresource.xml)
126
127 empathy-dtd-resources.c: empathy-dtd.gresource.xml $(dtd_resource_files)
128         $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $<
129
130 empathy-dtd-resources.h: empathy-dtd.gresource.xml $(dtd_resource_files)
131         $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-header $<
132
133 EXTRA_DIST =                            \
134         empathy-dtd.gresource.xml       \
135         $(dtd_resources_files)          \
136         $(NULL)
137
138 CLEANFILES =                            \
139         $(BUILT_SOURCES)                \
140         stamp-empathy-enum-types.h
141
142 if HAVE_GOA
143 libempathy_la_SOURCES += $(goa_sources)
144 else
145 EXTRA_DIST += $(goa_sources)
146 endif
147
148 if HAVE_UOA
149 libempathy_la_SOURCES += $(uoa_sources)
150 else
151 EXTRA_DIST += $(uoa_sources)
152 endif
153
154 # do not distribute generated files
155 nodist_libempathy_la_SOURCES =\
156         $(BUILT_SOURCES)
157
158 check_c_sources = \
159     $(libempathy_handwritten_source) \
160     $(goa_sources) \
161     $(uoa_sources) \
162     $(NULL)
163
164 include $(top_srcdir)/tools/check-coding-style.mk
165 check-local: check-coding-style
166
167 empathy-enum-types.h: stamp-empathy-enum-types.h
168         $(AM_V_GEN)true
169 stamp-empathy-enum-types.h: $(libempathy_headers) Makefile
170         $(AM_V_GEN)(cd $(srcdir) \
171         && glib-mkenums \
172                         --fhead "#ifndef __LIBEMPATHY_ENUM_TYPES_H__\n" \
173                         --fhead "#define __LIBEMPATHY_ENUM_TYPES_H__ 1\n\n" \
174                         --fhead "#include <glib-object.h>\n\n" \
175                         --fhead "G_BEGIN_DECLS\n\n" \
176                         --ftail "G_END_DECLS\n\n" \
177                         --ftail "#endif /* __LIBEMPATHY_ENUM_TYPES_H__ */\n" \
178                         --fprod '#include "@filename@"\n' \
179                         --eprod "#define EMPATHY_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n" \
180                         --eprod "GType @enum_name@_get_type (void);\n" \
181                 $(libempathy_headers) ) > xgen-gth \
182         && (cmp -s xgen-gth empathy-enum-type.h || cp xgen-gth empathy-enum-types.h) \
183         && rm -f xgen-gth \
184         && echo timestamp > $(@F)
185
186 empathy-enum-types.c: $(libempathy_headers) Makefile
187         $(AM_V_GEN)(cd $(srcdir) \
188         && glib-mkenums \
189                         --fhead "#include <config.h>\n" \
190                         --fhead "#include <glib-object.h>\n" \
191                         --fhead "#include \"empathy-enum-types.h\"\n\n" \
192                         --fprod "\n/* enumerations from \"@filename@\" */" \
193                         --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
194                         --vprod "  { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
195                         --vtail "  { 0, NULL, NULL }\n};\n\n" \
196                         --vtail "GType\n@enum_name@_get_type (void)\n{\n" \
197                         --vtail "  static GType type = 0;\n\n" \
198                         --vtail "  if (!type)\n" \
199                         --vtail "    type = g_@type@_register_static (\"@EnumName@\", _@enum_name@_values);\n\n" \
200                         --vtail "  return type;\n}\n\n" \
201                 $(libempathy_headers) ) > xgen-gtc \
202         && cp xgen-gtc $(@F) \
203         && rm -f xgen-gtc