aboutsummaryrefslogtreecommitdiff
path: root/libindicate/Makefile.am
blob: a35cf35b8670f551bea07ece599db13ba926654d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
MARSHAL_PREFIX = indicate_marshal
MARSHAL_FILE = indicate-marshal
ENUM_FILE = indicate-enum-types

INCLUDES= \
	-DG_LOG_DOMAIN=\"libindicate\"

EXTRA_DIST = \
	indicate-interface.xml \
	indicate-listener.xml \
	listener-marshal.list \
	server-marshal.list \
	indicate.pc.in

BUILT_SOURCES = \
	dbus-indicate-server.h \
	dbus-indicate-client.h \
	dbus-listener-server.h \
	dbus-listener-client.h \
	listener-marshal.c \
	listener-marshal.h \
	server-marshal.c \
	server-marshal.h \
	$(ENUM_FILE).h \
	$(ENUM_FILE).c

lib_LTLIBRARIES = \
	libindicate.la

libindicateincludedir=$(includedir)/libindicate-0.1/libindicate

indicate_headers = \
	indicator.h \
	indicator-message.h \
	listener.h \
	server.h \
	interests.h \
	$(ENUM_FILE).h

libindicateinclude_HEADERS = \
	$(indicate_headers)

libindicate_la_SOURCES = \
	$(indicate_headers) \
	dbus-indicate-server.h \
	dbus-indicate-client.h \
	dbus-listener-server.h \
	dbus-listener-client.h \
	indicate-enum-types.c \
	server.c \
	server-marshal.c \
	server-marshal.h \
	listener.c \
	listener-marshal.c \
	listener-marshal.h \
	indicator.c \
	indicator-message.c \
	interests-priv.h

libindicate_la_LDFLAGS = \
	-version-info $(LIBINDICATE_CURRENT):$(LIBINDICATE_REVISION):$(LIBINDICATE_AGE) \
	-no-undefined \
	-export-symbols-regex "^[^_d].*"

libindicate_la_CFLAGS = \
	$(LIBINDICATE_CFLAGS)

libindicate_la_LIBADD = \
	$(LIBINDICATE_LIBS)

dbus-indicate-server.h: indicate-interface.xml
	dbus-binding-tool \
		--prefix=_indicate_server \
		--mode=glib-server \
		--output=dbus-indicate-server.h \
		$(srcdir)/indicate-interface.xml

dbus-indicate-client.h: indicate-interface.xml
	dbus-binding-tool \
		--prefix=_indicate_client \
		--mode=glib-client \
		--output=dbus-indicate-client.h \
		$(srcdir)/indicate-interface.xml

dbus-listener-server.h: indicate-listener.xml
	dbus-binding-tool \
		--prefix=_indicate_listener \
		--mode=glib-server \
		--output=dbus-listener-server.h \
		$(srcdir)/indicate-listener.xml

dbus-listener-client.h: indicate-listener.xml
	dbus-binding-tool \
		--prefix=_indicate_listener \
		--mode=glib-client \
		--output=dbus-listener-client.h \
		$(srcdir)/indicate-listener.xml

listener-marshal.h: $(srcdir)/listener-marshal.list
	glib-genmarshal --header \
		--prefix=_indicate_listener_marshal $(srcdir)/listener-marshal.list \
		> listener-marshal.h

listener-marshal.c: $(srcdir)/listener-marshal.list
	glib-genmarshal --body \
		--prefix=_indicate_listener_marshal $(srcdir)/listener-marshal.list \
		> listener-marshal.c

server-marshal.h: $(srcdir)/server-marshal.list
	glib-genmarshal --header \
		--prefix=_indicate_server_marshal $(srcdir)/server-marshal.list \
		> server-marshal.h

server-marshal.c: $(srcdir)/server-marshal.list
	glib-genmarshal --body \
		--prefix=_indicate_server_marshal $(srcdir)/server-marshal.list \
		> server-marshal.c

pkgconfig_DATA = indicate.pc
pkgconfigdir = $(libdir)/pkgconfig

$(ENUM_FILE).h: s-enum-types-h
	@true
s-enum-types-h: $(indicate_headers) Makefile
	( cd $(srcdir) && glib-mkenums \
			--fhead "#ifndef _INDICATE_ENUM_TYPES_H_\n#define _INDICATE_ENUM_TYPES_H_\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
			--fprod "/* enumerations from \"@filename@\" */\n" \
			--vhead "GType @enum_name@_get_type(void);\n#define INDICATE_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"	\
			--ftail "G_END_DECLS\n\n#endif /* _INDICATE_ENUM_TYPES_H_ */" \
		interests.h ) > tmp-$(ENUM_FILE).h \
	&& (cmp -s tmp-$(ENUM_FILE).h $(ENUM_FILE).h || cp tmp-$(ENUM_FILE).h $(ENUM_FILE).h ) \
	&& rm -f tmp-$(ENUM_FILE).h	\
	&& echo timestamp > $(@F)

$(ENUM_FILE).c: s-enum-types-c
	@true
s-enum-types-c: $(indicate_headers) Makefile
	( cd $(srcdir) && glib-mkenums \
			--fhead "#include \"interests.h\"\n#include <glib-object.h>" \
			--fprod "\n/* enumerations from \"@filename@\" */" \
			--vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {" 	\
			--vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
			--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
		interests.h ) > tmp-$(ENUM_FILE).c \
	&& (cmp -s tmp-$(ENUM_FILE).c $(ENUM_FILE).c || cp tmp-$(ENUM_FILE).c $(ENUM_FILE).c ) \
	&& rm -f tmp-$(ENUM_FILE).c \
	&& echo timestamp > $(@F)

CLEANFILES = \
	$(ENUM_FILE).c \
	$(ENUM_FILE).h \
	s-enum-types-c \
	s-enum-types-h

if USE_GIR

gobjectintrospection_gir_DATA = \
	Indicate-0.1.gir
gobjectintrospection_girdir = $(datadir)/gir

gobjectintrospection_type_DATA = \
	Indicate-0.1.typelib
gobjectintrospection_typedir = $(libdir)/girepository

irscanner_headers = $(patsubst %,$(srcdir)/%,$(indicate_headers))
Indicate-0.1.gir: $(irscanner_headers)
	$(G_IR_SCANNER) \
		-v --namespace Indicate \
		--nsversion=0.1 \
		--add-include-path=$(srcdir) \
		--include=GObject-2.0 \
		--include=GLib-2.0 \
		--include=GdkPixbuf-2.0 \
		--library=indicate --pkg indicate \
		--output Indicate-0.1.gir $(irscanner_headers)

Indicate-0.1.typelib: Indicate-0.1.gir
	$(G_IR_COMPILER) \
		--includedir=$(srcdir) Indicate-0.1.gir \
		-o Indicate-0.1.typelib

DISTCLEANFILES = \
	Indicate-0.1.gir \
	Indicate-0.1.typelib

endif