X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=liblttng-ust-python-agent%2FMakefile.am;h=f80b8a3f04a026cb7eba5ee2d2747c930477ab8a;hb=8b4500252debf1ae09de9a24230b1db95b8a6698;hp=869add4878632c9c4a46c22964a19a20d83db33e;hpb=8871babdc4ba7c93a1a66db84b0609decdf331a0;p=lttng-ust.git diff --git a/liblttng-ust-python-agent/Makefile.am b/liblttng-ust-python-agent/Makefile.am index 869add48..f80b8a3f 100644 --- a/liblttng-ust-python-agent/Makefile.am +++ b/liblttng-ust-python-agent/Makefile.am @@ -1,24 +1,3 @@ -# inputs/outputs -LTTNGUST_PY_PACKAGE_DIR = $(srcdir)/lttngust -LTTNGUST_PY_PACKAGE_FILES = agent.py cmd.py debug.py loghandler.py -LTTNGUST_PY_PACKAGE_SRC = \ - $(addprefix $(LTTNGUST_PY_PACKAGE_DIR)/,$(LTTNGUST_PY_PACKAGE_FILES)) -INIT_PY_IN = $(srcdir)/__init__.py.in -INIT_PY = __init__.py - -# dist files -EXTRA_DIST = $(INIT_PY_IN) $(LTTNGUST_PY_PACKAGE_SRC) - -# __init__.py with proper version string -all-local: $(INIT_PY) - -$(INIT_PY): $(INIT_PY_IN) - $(SED) "s/@LTTNG_UST_VERSION@/$(PACKAGE_VERSION)/g" < $< > $@ - -# Python package -nodist_lttngust_PYTHON = $(LTTNGUST_PY_PACKAGE_SRC) $(INIT_PY) -lttngustdir = $(pythondir)/lttngust - # tracepoint provider AM_CPPFLAGS = $(PYTHON_INCLUDE) -I$(top_srcdir)/include/ \ -I$(top_builddir)/include/ @@ -28,4 +7,28 @@ liblttng_ust_python_agent_la_SOURCES = lttng_ust_python.c lttng_ust_python.h liblttng_ust_python_agent_la_LIBADD = -lc -llttng-ust \ -L$(top_builddir)/liblttng-ust/.libs -CLEANFILES = $(INIT_PY) +# Use setup.py for the installation instead of Autoconf. +# This ease the installation process and assure a *pythonic* +# installation. +agent_path=lttngust +all-local: + $(PYTHON) setup.py build --verbose + +install-exec-local: + if [ "$(DESTDIR)" = "" ]; then \ + $(PYTHON) setup.py install --prefix=$(prefix) --record install_files.txt --verbose --no-compile $(DISTSETUPOPTS); \ + else \ + $(PYTHON) setup.py install --root=$(DESTDIR) --verbose install_files.txt --prefix=$(prefix) --no-compile $(DISTSETUPOPTS); \ + fi +clean-local: + rm -rf build + +uninstall-local: + cat install_files.txt | xargs rm -rf + rm -rf $(DESTDIR)$(pkgpythondir) + +EXTRA_DIST=$(agent_path) + +# Remove automake generated file before dist +dist-hook: + rm -rf $(distdir)/$(agent_path)/__init__.py