]> git.0d.be Git - empathy.git/blob - libempathy/Makefile.am
d7c9263cb4031c2435e677b5630e564310716e11
[empathy.git] / libempathy / Makefile.am
1 include $(top_srcdir)/tools/shave.mk
2
3 AM_CPPFLAGS =                                           \
4         -I.                                             \
5         -I$(top_srcdir)                                 \
6         -I$(top_builddir)                               \
7         -DDATADIR=\""$(datadir)"\"                      \
8         -DLOCALEDIR=\""$(datadir)/locale"\"             \
9         $(LIBEMPATHY_CFLAGS)                            \
10         $(WARN_CFLAGS)                                  \
11         $(DISABLE_DEPRECATED)
12
13 BUILT_SOURCES =                                         \
14         empathy-marshal.h                               \
15         empathy-marshal.c                               \
16         empathy-marshal.list                            \
17         empathy-enum-types.h                            \
18         empathy-enum-types.c
19
20 lib_LTLIBRARIES = libempathy.la
21
22 libempathy_la_SOURCES =                                 \
23         empathy-account-manager.c                       \
24         empathy-chatroom.c                              \
25         empathy-chatroom-manager.c                      \
26         empathy-call-factory.c                          \
27         empathy-call-handler.c                          \
28         empathy-contact.c                               \
29         empathy-contact-groups.c                        \
30         empathy-contact-list.c                          \
31         empathy-contact-manager.c                       \
32         empathy-contact-monitor.c                       \
33         empathy-debug.c                                 \
34         empathy-dispatcher.c                            \
35         empathy-dispatch-operation.c                    \
36         empathy-idle.c                                  \
37         empathy-irc-network.c                           \
38         empathy-irc-network-manager.c                   \
39         empathy-irc-server.c                            \
40         empathy-log-manager.c                           \
41         empathy-log-store.c                             \
42         empathy-log-store-empathy.c                     \
43         empathy-message.c                               \
44         empathy-status-presets.c                        \
45         empathy-time.c                                  \
46         empathy-tp-call.c                               \
47         empathy-tp-chat.c                               \
48         empathy-tp-contact-factory.c                    \
49         empathy-tp-contact-list.c                       \
50         empathy-tp-file.c                               \
51         empathy-tp-roomlist.c                           \
52         empathy-tp-tube.c                               \
53         empathy-tube-handler.c                          \
54         empathy-utils.c
55
56 # do not distribute generated files
57 nodist_libempathy_la_SOURCES =\
58         $(BUILT_SOURCES)
59
60 libempathy_la_LIBADD =          \
61         $(top_builddir)/extensions/libemp-extensions.la \
62         $(LIBEMPATHY_LIBS)
63
64 libempathy_la_LDFLAGS =         \
65        -version-info ${LIBEMPATHY_CURRENT}:${LIBEMPATHY_REVISION}:${LIBEMPATHY_AGE} \
66        -export-symbols-regex ^empathy_
67
68 libempathy_headers =                            \
69         empathy-account-manager.h               \
70         empathy-chatroom.h                      \
71         empathy-chatroom-manager.h              \
72         empathy-call-factory.h                  \
73         empathy-call-handler.h                  \
74         empathy-contact.h                       \
75         empathy-contact-groups.h                \
76         empathy-contact-list.h                  \
77         empathy-contact-manager.h               \
78         empathy-contact-monitor.h               \
79         empathy-debug.h                         \
80         empathy-dispatcher.h                    \
81         empathy-dispatch-operation.h            \
82         empathy-idle.h                          \
83         empathy-irc-network.h                   \
84         empathy-irc-network-manager.h           \
85         empathy-irc-server.h                    \
86         empathy-location.h                      \
87         empathy-log-manager.h                   \
88         empathy-log-store.h                     \
89         empathy-log-store-empathy.h             \
90         empathy-message.h                       \
91         empathy-status-presets.h                \
92         empathy-time.h                          \
93         empathy-tp-call.h                       \
94         empathy-tp-chat.h                       \
95         empathy-tp-contact-factory.h            \
96         empathy-tp-contact-list.h               \
97         empathy-tp-file.h                       \
98         empathy-tp-roomlist.h                   \
99         empathy-tp-tube.h                       \
100         empathy-tube-handler.h                  \
101         empathy-types.h                         \
102         empathy-utils.h
103
104 check_c_sources = \
105     $(libempathy_la_SOURCES) \
106     $(libempathy_headers)
107 include $(top_srcdir)/tools/check-coding-style.mk
108 check-local: check-coding-style
109
110 libempathy_includedir = $(includedir)/libempathy/
111 libempathy_include_HEADERS =                    \
112         $(libempathy_headers)                   \
113         empathy-enum-types.h
114
115 empathy-marshal.list: $(libempathy_la_SOURCES) Makefile.am
116         $(QUIET_GEN)( cd $(srcdir) && \
117         sed -n -e 's/.*empathy_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \
118         $(libempathy_la_SOURCES) ) \
119         | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp
120         if cmp -s $@.tmp $@; then \
121                 rm $@.tmp; \
122         else \
123                 mv $@.tmp $@; \
124         fi
125
126 %-marshal.h: %-marshal.list Makefile
127         $(QUIET_GEN)$(GLIB_GENMARSHAL) --header --prefix=_$(subst -,_,$*)_marshal $< > $*-marshal.h
128
129 %-marshal.c: %-marshal.list Makefile
130         $(QUIET_GEN)echo "#include \"empathy-marshal.h\"" > $@ && \
131         $(GLIB_GENMARSHAL) --body --prefix=_$(subst -,_,$*)_marshal $< >> $*-marshal.c
132
133 empathy-enum-types.h: stamp-empathy-enum-types.h
134         $(QUIET_GEN)true
135 stamp-empathy-enum-types.h: $(libempathy_headers) Makefile
136         $(QUIET_GEN)(cd $(srcdir) \
137         && glib-mkenums \
138                         --fhead "#ifndef __LIBEMPATHY_ENUM_TYPES_H__\n" \
139                         --fhead "#define __LIBEMPATHY_ENUM_TYPES_H__ 1\n\n" \
140                         --fhead "#include <glib-object.h>\n\n" \
141                         --fhead "G_BEGIN_DECLS\n\n" \
142                         --ftail "G_END_DECLS\n\n" \
143                         --ftail "#endif /* __LIBEMPATHY_ENUM_TYPES_H__ */\n" \
144                         --fprod "#include <libempathy/@filename@>\n" \
145                         --eprod "#define EMPATHY_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n" \
146                         --eprod "GType @enum_name@_get_type (void);\n" \
147                 $(libempathy_headers) ) > xgen-gth \
148         && (cmp -s xgen-gth empathy-enum-type.h || cp xgen-gth empathy-enum-types.h) \
149         && rm -f xgen-gth \
150         && echo timestamp > $(@F)
151
152 empathy-enum-types.c: $(libempathy_headers) Makefile
153         $(QUIET_GEN)(cd $(srcdir) \
154         && glib-mkenums \
155                         --fhead "#include <config.h>\n" \
156                         --fhead "#include <glib-object.h>\n" \
157                         --fhead "#include \"empathy-enum-types.h\"\n\n" \
158                         --fprod "\n/* enumerations from \"@filename@\" */" \
159                         --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
160                         --vprod "  { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
161                         --vtail "  { 0, NULL, NULL }\n};\n\n" \
162                         --vtail "GType\n@enum_name@_get_type (void)\n{\n" \
163                         --vtail "  static GType type = 0;\n\n" \
164                         --vtail "  if (!type)\n" \
165                         --vtail "    type = g_@type@_register_static (\"@EnumName@\", _@enum_name@_values);\n\n" \
166                         --vtail "  return type;\n}\n\n" \
167                 $(libempathy_headers) ) > xgen-gtc \
168         && cp xgen-gtc $(@F) \
169         && rm -f xgen-gtc
170
171 dtddir = $(datadir)/empathy
172 dtd_DATA =                                      \
173         empathy-status-presets.dtd              \
174         empathy-contact-groups.dtd              \
175         empathy-chatroom-manager.dtd            \
176         empathy-irc-networks.dtd
177
178 stylesheetdir = $(datadir)/empathy
179 stylesheet_DATA =               \
180         empathy-log-manager.xsl
181
182 ircnetworksdir = $(datadir)/empathy
183 ircnetworks_DATA =              \
184         irc-networks.xml
185
186 pkgconfigdir = $(libdir)/pkgconfig
187 pkgconfig_DATA = libempathy.pc
188
189 EXTRA_DIST =                    \
190         empathy-marshal.list    \
191         $(stylesheet_DATA)      \
192         $(dtd_DATA)             \
193         $(ircnetworks_DATA)
194
195 CLEANFILES =                            \
196         $(BUILT_SOURCES)                \
197         stamp-empathy-enum-types.h