python: reimplement the babeltrace package as a bt2 wrapper
[babeltrace.git] / bindings / python / babeltrace / Makefile.am
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.
4 AM_LDFLAGS=-L$(top_builddir)/lib/.libs
5
6 INSTALLED_FILES=$(builddir)/installed_files.txt
7
8 STATIC_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
18
19 GENERATED_BINDINGS_DEPS = \
20 babeltrace/__init__.py \
21 setup.py
22
23
24 all-local: build-python-bindings.stamp
25
26 copy-static-deps.stamp: $(STATIC_BINDINGS_DEPS)
27 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
28 for file in $(STATIC_BINDINGS_DEPS); do \
29 cp -f $(srcdir)/$$file $(builddir)/$$file; \
30 done; \
31 fi
32 touch $@
33
34 build-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
39 install-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;
45
46 clean-local:
47 rm -rf $(builddir)/build
48 @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
49 for file in $(STATIC_BINDINGS_DEPS); do \
50 rm -f $(builddir)/$$file; \
51 done; \
52 fi
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.
57 uninstall-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
66 EXTRA_DIST = $(STATIC_BINDINGS_DEPS)
67
68 # clean: generated Python files and stamps
69 CLEANFILES = babeltrace/__init__.py copy-static-deps.stamp
This page took 0.029987 seconds and 4 git commands to generate.