aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
blob: e4215307731987a0cb91bf7ebd7fd827f80bd3ce (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
include Makefile.decl

NULL =

# disable this for now. gtk-doc and non-recursive make don't play well together.
#DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc

XSLTPROC = xsltproc --xinclude --nonet
DROP_NAMESPACE = perl -pe '$$hash = chr(35); s{xmlns:tp="http://telepathy\.freedesktop\.org/wiki/DbusSpec$${hash}extensions-v0"}{}g'
RST2HTML = rst2html
XMLLINT = xmllint --noout --schema


AUTOMAKE_OPTIONS = subdir-objects
ACLOCAL_AMFLAGS = -I m4

SUBDIRS = \
	.\
	doc \
	$(NULL)

pkgconfigdir = ${libdir}/pkgconfig
pkgconfig_DATA = contextprovider-1.0.pc

AM_CPPFLAGS = \
	$(CONTEXTD_CFLAGS) \
	-include $(CONFIG_HEADER) \
	-I$(top_srcdir)/src \
	-I$(top_srcdir)/libcontextprovider \
	$(NULL)

BUILT_SOURCES = \
	src/contextd.vala.stamp \
	$(INTROSPECT) \
	$(ASYNC_INTROSPECT) \
	context.valid.stamp \
	$(NULL)

if CONTEXTKIT_BUILD_DOCS
BUILT_SOURCES += $(DOCS)
endif

bin_PROGRAMS = contextd

contextd_core_VALASOURCES = \
	src/main.vala \
	src/MCE.vala \
	$(NULL)

contextd_liblocation_VALASOURCES = \
	$(NULL)

contextd_VALASOURCES = \
	$(contextd_core_VALASOURCES) \
	$(contextd_liblocation_VALASOURCES) \
	$(NULL)

contextd_GENERATEDSOURCES = \
	$(contextd_VALASOURCES:.vala=.c) \
	$(contextd_VALASOURCES:.vala=.h) \
	$(NULL)

contextd_SOURCES = \
	$(contextd_core_VALASOURCES:.vala=.c) \
	$(contextd_core_VALASOURCES:.vala=.h) \
	$(NULL)

if HAVE_LOCATION
contextd_SOURCES += \
	$(contextd_liblocation_VALASOURCES:.vala=.c) \
	$(contextd_liblocation_VALASOURCES:.vala=.h) \
	$(NULL)
endif


SPEC_TOOLS = \
	tools/doc-generator.xsl \
	tools/spec-to-introspect.xsl \
	tools/context2html.pl \
	tools/context2asciidoc.pl \
	$(NULL)


INTERFACES = \
	spec/Manager.xml \
	spec/Subscriber.xml \
	$(NULL)


SPEC_FILES = \
	$(INTERFACES) \
	spec/generic-types.xml \
	$(NULL)

INTROSPECT = $(INTERFACES:spec/%.xml=introspect/%.xml)
ASYNC_INTROSPECT = $(INTERFACES:spec/%.xml=introspect/async/%.xml)
DOCS = doc/contextkit.html doc/context.html doc/context-providers.html

src/contextd.vala.stamp: contextprovider.vapi $(contextd_VALASOURCES) $(contextd_VAPISOURCES)
	$(VALAC) -C --basedir $(top_srcdir) --vapidir=$(top_srcdir)/vapi --pkg posix --pkg dbus-glib-1 --pkg gee-1.0 --disable-dbus-transformation $^
	touch $@

tools_dir = $(top_srcdir)/tools

$(INTROSPECT): introspect/%.xml: spec/%.xml $(tools_dir)/spec-to-introspect.xsl
	install -d introspect
	$(XSLTPROC) $(tools_dir)/spec-to-introspect.xsl $< | $(DROP_NAMESPACE) > $@

$(ASYNC_INTROSPECT): introspect/async/%.xml: $(SPEC_FILES) $(tools_dir)/spec-to-introspect.xsl
	install -d introspect/async
	$(XSLTPROC) $(tools_dir)/spec-to-introspect.xsl $< | $(DROP_NAMESPACE) > $@

doc/contextkit.html: $(SPEC_FILES) spec/all.xml $(tools_dir)/doc-generator.xsl
	install -d doc
	$(XSLTPROC) $(tools_dir)/doc-generator.xsl $(top_srcdir)/spec/all.xml > $@

context.valid.stamp: spec/context.xsd spec/context.xml
	$(XMLLINT) $^ 
	touch $@

doc/context.html: spec/context.xml tools/context2asciidoc.pl
	install -d doc
	$(top_srcdir)/tools/context2asciidoc.pl \
          < $(top_srcdir)/spec/context.xml | asciidoc -f myfilter.conf -o $@ -

doc/context-providers.html: doc/context-providers.txt
	asciidoc -f myfilter.conf $^

CLEANFILES = $(INTROSPECT) $(ASYNC_INTROSPECT) context.valid.stamp
clean-local:
	-rm -rf introspect

if HAVE_LOCATION
contextd_LDADD = \
	$(CONTEXTD_LIBS) \
	$(LOCATION_LIBS) \
	libcontextprovider.la \
	$(NULL)
else
contextd_LDADD = \
	$(CONTEXTD_LIBS) \
	libcontextprovider.la \
	$(NULL)
endif

EXTRA_DIST += \
	$(DOCS) \
	$(contextd_GENERATEDSOURCES) \
	$(contextd_VALASOURCES) \
	$(contextd_VAPISOURCES) \
	src/contextd.vala.stamp \
	doc/context-providers.txt \
	$(SPEC_FILES) \
	spec/all.xml \
	spec/context.xml \
	spec/context.xsd \
	$(SPEC_TOOLS) \
	$(NULL)

DISTCLEANFILES = \
	src/*.gcov \
	src/*.gcno \
	src/*.gcda \
	$(NULL)

MAINTAINERCLEANFILES = \
	$(contextd_GENERATEDSOURCES) \
	$(contextd_SOURCES)	\
	$(NULL)

clean-gcov:
	find -name "*.gcov" | xargs rm -f || true
	find -name "*.gcno" | xargs rm -f || true
	find -name "*.gcda" | xargs rm -f || true

version:
	@echo @VERSION@

.PHONEY: version

include tests/unit_tests/Makefile.fragment
include libcontextprovider/Makefile.fragment
include tests/python-test-library/Makefile.fragment