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