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