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