python: reimplement the babeltrace package as a bt2 wrapper
[babeltrace.git] / bindings / python / babeltrace / Makefile.am
CommitLineData
c72a561f
JG
1# Since the shared object used by the python bindings is not built with
2# libtool, we need to add the directory containing libbabeltrace to the
3# linker path.
4AM_LDFLAGS=-L$(top_builddir)/lib/.libs
45dc11d3 5
c72a561f 6INSTALLED_FILES=$(builddir)/installed_files.txt
45dc11d3 7
c72a561f
JG
8STATIC_BINDINGS_DEPS = \
9 babeltrace/common.py \
10 babeltrace/reader.py \
11 babeltrace/reader_event_declaration.py \
12 babeltrace/reader_event.py \
13 babeltrace/reader_field_declaration.py \
14 babeltrace/reader_field_definition.py \
15 babeltrace/reader_trace_collection.py \
16 babeltrace/reader_trace_handle.py \
17 babeltrace/writer.py
45dc11d3 18
c72a561f
JG
19GENERATED_BINDINGS_DEPS = \
20 babeltrace/__init__.py \
21 setup.py
45dc11d3 22
45dc11d3 23
c72a561f 24all-local: build-python-bindings.stamp
6027e07b 25
c72a561f 26copy-static-deps.stamp: $(STATIC_BINDINGS_DEPS)
6027e07b 27 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
c72a561f
JG
28 for file in $(STATIC_BINDINGS_DEPS); do \
29 cp -f $(srcdir)/$$file $(builddir)/$$file; \
6027e07b
JG
30 done; \
31 fi
c72a561f
JG
32 touch $@
33
34build-python-bindings.stamp: copy-static-deps.stamp $(GENERATED_BINDINGS_DEPS)
35 $(BUILD_FLAGS) $(PYTHON) $(builddir)/setup.py build_ext
36 $(BUILD_FLAGS) $(PYTHON) $(builddir)/setup.py build
37 touch $@
38
39install-exec-local: build-python-bindings.stamp
40 @opts="--prefix=$(prefix) --record $(INSTALLED_FILES) --verbose --no-compile $(DISTSETUPOPTS)"; \
41 if [ "$(DESTDIR)" != "" ]; then \
42 opts="$$opts --root=$(DESTDIR)"; \
43 fi; \
44 $(PYTHON) $(builddir)/setup.py install $$opts;
6027e07b
JG
45
46clean-local:
c72a561f 47 rm -rf $(builddir)/build
6027e07b 48 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
c72a561f
JG
49 for file in $(STATIC_BINDINGS_DEPS); do \
50 rm -f $(builddir)/$$file; \
6027e07b
JG
51 done; \
52 fi
c72a561f
JG
53
54# Distutils' setup.py does not include an uninstall target, we thus need to do
55# it manually. We save the path of the files that were installed during the install target
56# and delete them during the uninstallation.
57uninstall-local:
58 if [ "$(DESTDIR)" != "" ]; then \
59 $(SED) -i "s|^|$(DESTDIR)/|g" $(INSTALLED_FILES); \
60 fi
61 cat $(INSTALLED_FILES) | xargs rm -rf || true
62 $(GREP) "__init__.py" $(INSTALLED_FILES) | xargs dirname | xargs rm -rf || true
63 rm -f $(INSTALLED_FILES)
64
65# distribute: extra Python modules and SWIG interface files
66EXTRA_DIST = $(STATIC_BINDINGS_DEPS)
67
68# clean: generated Python files and stamps
69CLEANFILES = babeltrace/__init__.py copy-static-deps.stamp
This page took 0.048531 seconds and 4 git commands to generate.