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