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