Commit | Line | Data |
---|---|---|
81447b5b PP |
1 | # native module name (without `.i` extension) |
2 | NATIVE_MODULE = native_bt | |
3 | ||
4 | # interface dependencies (without `native_bt` prefix and `.i` extension) | |
5 | NATIVE_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) | |
25 | EXTRA_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 | |
46 | EXTRA_MODULES_PY = $(addprefix $(srcdir)/,$(addsuffix .py,$(EXTRA_MODULES))) | |
47 | NATIVE_MODULE_I = $(srcdir)/$(NATIVE_MODULE).i | |
48 | NATIVE_MODULE_PY = $(NATIVE_MODULE).py | |
49 | NATIVE_MODULE_C = $(NATIVE_MODULE)_wrap.c | |
50 | NATIVE_MODULE_DEPS_I = $(addprefix $(srcdir)/native_bt,$(addsuffix .i,$(NATIVE_MODULE_DEPS))) | |
51 | ||
52 | # installed Python package | |
53 | nodist_bt2package_PYTHON = __init__.py $(EXTRA_MODULES_PY) $(NATIVE_MODULE_PY) | |
54 | ||
55 | # native libraries to build | |
56 | nativelibs_LTLIBRARIES = _native_bt.la | |
57 | ||
58 | # installation directory for the `bt2` package | |
59 | bt2packagedir = $(pythondir)/bt2 | |
60 | nativelibsdir = $(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 | |
05c03100 | 69 | _native_bt_la_CFLAGS = $(GLIB_CFLAGS) $(PYTHON_INCLUDE) -I$(srcdir) $(AM_CFLAGS) |
81447b5b PP |
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 | |
76 | all-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 | |
84 | clean-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 | |
92 | EXTRA_DIST = __init__.py.in $(EXTRA_MODULES_PY) $(NATIVE_MODULE_I) $(NATIVE_MODULE_DEPS_I) | |
93 | ||
94 | # clean: generated C and Python files (by SWIG) | |
95 | CLEANFILES = $(NATIVE_MODULE_PY) $(NATIVE_MODULE_C) |