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