summaryrefslogtreecommitdiff
path: root/src/Makefile.am
blob: ad7dcf9d89b5031422ae950e1fbfc220717c08e1 (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
SUBDIRS = client server

telepathydir = $(pythondir)/telepathy
telepathy_PYTHON = \
	constants.py \
	errors.py \
	__init__.py \
	interfaces.py \
	utils.py

spec_dir = $(top_srcdir)/spec
spec_files := $(patsubst $(spec_dir)%.xml,_generated%.py,$(wildcard $(spec_dir)/*.xml))

BUILT_SOURCES = \
	_generated/interfaces.py \
	_generated/constants.py \
	_generated/errors.py \
	_generated/__init__.py \
	$(spec_files)

CLEANFILES = \
	_version.py \
	$(BUILT_SOURCES)

EXTRA_DIST = _version.py.in

versiondir = $(telepathydir)
nodist_version_PYTHON = _version.py

generateddir = $(telepathydir)/_generated
nodist_generated_PYTHON = $(BUILT_SOURCES)

distclean-local:
	rm -rf *.pyc *.pyo _generated

XSLTPROC_OPTS = --nonet --novalid --xinclude
tools_dir = $(top_srcdir)/tools

_generated/interfaces.py:
	$(XSLTPROC) $(XSLTPROC_OPTS) -o $@ \
	    $(tools_dir)/python-interfaces-generator.xsl \
	    $(spec_dir)/all.xml

_generated/constants.py:
	$(XSLTPROC) $(XSLTPROC_OPTS) -o $@ \
	    $(tools_dir)/python-constants-generator.xsl \
	    $(spec_dir)/all.xml

_generated/errors.py:
	$(XSLTPROC) $(XSLTPROC_OPTS) -o $@ \
	    $(tools_dir)/python-errors-generator.xsl \
	    $(spec_dir)/all.xml

_generated/__init__.py:
	echo "# Placeholder for package" > $@

_generated/%.py:
	$(XSLTPROC) $(XSLTPROC_OPTS) -o $@ \
	    $(tools_dir)/spec-to-python.xsl \
	    $(spec_dir)/$*.xml