summaryrefslogtreecommitdiff
path: root/libmcclient/Makefile.am
blob: d12831b853ffd8243ddc650e6507ac0f2e9786f5 (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
INCLUDES = \
	$(DBUS_CFLAGS) \
	$(TELEPATHY_CFLAGS) \
	-I$(top_srcdir) \
	-I$(top_builddir) \
	-DLIBDIR="@libdir@" -DLIBVERSION="0"

BUILT_SOURCES = \
	_gen/all.xml \
	mc-signals-marshal.c \
	mc-signals-marshal.h \
	$(nodist_libmcclient_la_SOURCES) \
	$(nodist_geninclude_HEADERS)

CLEANFILES = $(BUILT_SOURCES)

lib_LTLIBRARIES = libmcclient.la

libmcclient_la_CFLAGS = $(GLIB_CFLAGS) $(GCONF_CFLAGS)
libmcclient_la_SOURCES = \
	dbus-api.c \
	mc-account.c \
	mc-account-avatar.c \
	mc-account-compat.c \
	mc-account-manager.c \
	mc-errors.c \
	mc-profile.c \
	mc-signals-marshal.c

libmcclient_includedir = $(includedir)/libmcclient
libmcclient_include_HEADERS = \
	dbus-api.h \
	mc-account.h \
	mc-errors.h \
	mc-profile.h \
	mc-account-manager.h \
	mc-signals-marshal.h

noinst_HEADERS = \
	mc-account-priv.h

genincludedir = $(libmcclient_includedir)/_gen
nodist_geninclude_HEADERS = \
	_gen/cli-account.h \
	_gen/cli-account-manager.h \
	_gen/enums.h \
	_gen/interfaces.h \
	_gen/gtypes.h

nodist_libmcclient_la_SOURCES = \
	_gen/cli-account-body.h \
	_gen/cli-account-manager-body.h \
	_gen/gtypes-body.h \
	_gen/interfaces-body.h \
	_gen/register-dbus-glib-marshallers-body.h \
	_gen/signals-marshal.c \
	_gen/signals-marshal.h \
	_gen/signals-marshal.list

libmcclient_la_LIBADD = $(GCONF_LIBS) $(GLIB_LIBS) $(DBUS_LIBS) $(TELEPATHY_LIBS)

libmcclient_la_LDFLAGS = $(common_ldflags) \
				      -export-symbols-regex "^(mc_)|(mission_control_)" \
				      -version-info 5:0:0

%-marshal.h: %-marshal.list Makefile.am
	glib-genmarshal --header --prefix=$(subst -,_,$*)_marshal $< > $*-marshal.h

%-marshal.c: %-marshal.list Makefile.am
	glib-genmarshal --body --prefix=$(subst -,_,$*)_marshal $< > $*-marshal.c


EXTRA_DIST = \
	$(libmcclient_include_DATA) \
	account.xml \
	account-manager.xml \
	mc-signals-marshal.list

# ---- telepathy-glib-style code generation ----

tools_dir = $(top_srcdir)/tools

_gen/%.xml: $(top_srcdir)/xml/%.xml $(wildcard $(top_srcdir)/xml/*.xml)
	$(mkdir_p) _gen
	$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \
		$< > $@

# Generated files which can be done for all "classes" at once

_gen/gtypes.h _gen/gtypes-body.h: _gen/all.xml \
	$(top_srcdir)/tools/glib-gtypes-generator.py
	$(PYTHON) $(top_srcdir)/tools/glib-gtypes-generator.py \
		$< _gen/gtypes mc

_gen/signals-marshal.list: _gen/all.xml \
	$(tools_dir)/glib-signals-marshal-gen.py
	$(PYTHON) $(tools_dir)/glib-signals-marshal-gen.py $< > $@

_gen/signals-marshal.h: _gen/signals-marshal.list
	$(GLIB_GENMARSHAL) --header --prefix=_mc_ext_marshal $< > $@

_gen/signals-marshal.c: _gen/signals-marshal.list
	$(GLIB_GENMARSHAL) --body --prefix=_mc_ext_marshal $< > $@

_gen/register-dbus-glib-marshallers-body.h: _gen/all.xml \
	$(tools_dir)/glib-client-marshaller-gen.py
	$(PYTHON) $(tools_dir)/glib-client-marshaller-gen.py $< \
		_mc_ext > $@

_gen/enums.h: _gen/all.xml $(tools_dir)/c-constants-generator.xsl
	$(XSLTPROC) $(XSLTPROCFLAGS) \
		--stringparam mixed-case-prefix mc \
		$(tools_dir)/c-constants-generator.xsl \
		$< > $@

_gen/interfaces.h: _gen/all.xml \
	$(tools_dir)/glib-interfaces-generator.xsl \
	$(tools_dir)/c-interfaces-generator.xsl
	$(XSLTPROC) $(XSLTPROCFLAGS) \
		--stringparam mixed-case-prefix mc \
		$(tools_dir)/glib-interfaces-generator.xsl \
		$< > $@

_gen/interfaces-body.h: _gen/all.xml \
	$(tools_dir)/glib-interfaces-body-generator.xsl \
	$(tools_dir)/c-interfaces-generator.xsl
	$(XSLTPROC) $(XSLTPROCFLAGS) \
		--stringparam mixed-case-prefix mc \
		$(tools_dir)/glib-interfaces-body-generator.xsl \
		$< > $@


# Generated files which must be generated per "class".
# (Currently the only "class" is nmc4, but the new API will need "classes"
# like account, account-manager, ...)

_gen/%.xml: %.xml
	$(mkdir_p) _gen
	$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \
		$< > $@

_gen/cli-%-body.h _gen/cli-%.h: _gen/%.xml \
	$(tools_dir)/glib-client-gen.py Makefile.am
	$(PYTHON) $(tools_dir)/glib-client-gen.py \
		--group=`echo $* | tr x- x_` \
		--iface-quark-prefix=MC_IFACE_QUARK \
		$< Mc_Cli _gen/cli-$*