Add support for plugins written in Python
[babeltrace.git] / bindings / python / bt2 / Makefile.am
CommitLineData
81447b5b
PP
1# native module name (without `.i` extension)
2NATIVE_MODULE = native_bt
3
4# interface dependencies (without `native_bt` prefix and `.i` extension)
5NATIVE_MODULE_DEPS = \
6 clockclass \
7 eventclass \
8 event \
9 fields \
10 ft \
11 packet \
12 ref \
13 streamclass \
14 stream \
15 trace \
16 values \
17 ctfwriter \
18 componentclass \
19 component \
20 notification \
21 notifiter \
22 plugin
23
24# Python modules (without `.py` extension)
25EXTRA_MODULES = \
26 clock_class \
27 event_class \
28 event \
29 fields \
30 field_types \
31 object \
32 packet \
33 stream_class \
34 stream \
35 trace \
36 utils \
37 values \
38 ctf_writer \
39 component \
40 notification \
41 notification_iterator \
55bb57e0
PP
42 plugin \
43 py_plugin
81447b5b
PP
44
45# automatically generated file lists
46EXTRA_MODULES_PY = $(addprefix $(srcdir)/,$(addsuffix .py,$(EXTRA_MODULES)))
47NATIVE_MODULE_I = $(srcdir)/$(NATIVE_MODULE).i
48NATIVE_MODULE_PY = $(NATIVE_MODULE).py
49NATIVE_MODULE_C = $(NATIVE_MODULE)_wrap.c
50NATIVE_MODULE_DEPS_I = $(addprefix $(srcdir)/native_bt,$(addsuffix .i,$(NATIVE_MODULE_DEPS)))
51
52# installed Python package
53nodist_bt2package_PYTHON = __init__.py $(EXTRA_MODULES_PY) $(NATIVE_MODULE_PY)
54
55# native libraries to build
56nativelibs_LTLIBRARIES = _native_bt.la
57
58# installation directory for the `bt2` package
59bt2packagedir = $(pythondir)/bt2
60nativelibsdir = $(bt2packagedir)
61
62# SWIG to C wrapper (and Python file)
63$(NATIVE_MODULE_C): $(NATIVE_MODULE_I) $(NATIVE_MODULE_DEPS_I)
64 $(SWIG) -python -Wall -I$(srcdir) -I$(top_srcdir)/include -module $(NATIVE_MODULE) -outcurrentdir $(NATIVE_MODULE_I)
65
66# native_bt module
67_native_bt_la_SOURCES = native_bt_wrap.c
68_native_bt_la_LDFLAGS = -module
69_native_bt_la_CFLAGS = $(GLIB_CFLAGS) $(PYTHON_INCLUDE) -I$(top_srcdir)/include/ -I$(srcdir)
70_native_bt_la_LIBS = $(GLIB_LIBS)
71_native_bt_la_LIBADD = \
72 $(top_builddir)/lib/libbabeltrace.la \
73 $(top_builddir)/formats/ctf/libbabeltrace-ctf.la
74
75# extra module sources -> build directory
76all-local:
77 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
78 for file in $(EXTRA_MODULES_PY); do \
79 cp -f $(srcdir)/$$file $(builddir); \
80 done; \
81 fi
82
83# clean extra module sources in build directory
84clean-local:
85 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
86 for file in $(EXTRA_MODULES_PY); do \
87 rm -f $(srcdir)/$$file $(builddir); \
88 done; \
89 fi
90
91# distribute: extra Python modules and SWIG interface files
92EXTRA_DIST = __init__.py.in $(EXTRA_MODULES_PY) $(NATIVE_MODULE_I) $(NATIVE_MODULE_DEPS_I)
93
94# clean: generated C and Python files (by SWIG)
95CLEANFILES = $(NATIVE_MODULE_PY) $(NATIVE_MODULE_C)
This page took 0.026687 seconds and 4 git commands to generate.