summaryrefslogtreecommitdiffstats
path: root/Makefile.python.am
diff options
context:
space:
mode:
authorPetr Spacek <pspacek@redhat.com>2016-11-23 14:59:57 +0100
committerMartin Basti <mbasti@redhat.com>2016-11-29 15:28:24 +0100
commit6aa360775a781bee5a2fdd884cbfa33b545fcbb4 (patch)
tree07bc848aaccd6aacdbb806950d16b0674d4ef888 /Makefile.python.am
parent6fcfe689f47a02df023de69f62c889d9b4dc26fe (diff)
downloadfreeipa-6aa360775a781bee5a2fdd884cbfa33b545fcbb4.tar.gz
freeipa-6aa360775a781bee5a2fdd884cbfa33b545fcbb4.tar.xz
freeipa-6aa360775a781bee5a2fdd884cbfa33b545fcbb4.zip
Build: properly integrate ipasetup.py into build system
AC_CONFIG_FILES in configure.ac works well only with Makefiles. Other files have to be handled by Makefile.am so depedencies are tracked properly. There is a problem that Python sub-directories depend on ipasetup.py which is one level above the sub-directory. This means that depedencies are the other way around that expected. This is being worked around using hack from http://lists.gnu.org/archive/html/automake/2009-03/msg00011.html https://fedorahosted.org/freeipa/ticket/6498 Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'Makefile.python.am')
-rw-r--r--Makefile.python.am15
1 files changed, 10 insertions, 5 deletions
diff --git a/Makefile.python.am b/Makefile.python.am
index 2d6285348..665893f43 100644
--- a/Makefile.python.am
+++ b/Makefile.python.am
@@ -7,13 +7,18 @@ else
VERBOSITY="--quiet"
endif !VERBOSE_MAKE
-all-local:
+# hack to handle back-in-the-hierarchy depedency on ipasetup.py
+.PHONY: $(top_builddir)/ipasetup.py
+$(top_builddir)/ipasetup.py:
+ (cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) ipasetup.py)
+
+all-local: $(top_builddir)/ipasetup.py
cd $(srcdir); $(PYTHON) setup.py \
$(VERBOSITY) \
build \
--build-base "$(abs_builddir)/build"
-install-exec-local:
+install-exec-local: $(top_builddir)/ipasetup.py
$(PYTHON) $(srcdir)/setup.py \
$(VERBOSITY) \
install \
@@ -26,7 +31,7 @@ uninstall-local:
cat "$(DESTDIR)$(pkgpythondir)/install_files.txt" | xargs rm -rf
rm -rf "$(DESTDIR)$(pkgpythondir)"
-clean-local:
+clean-local: $(top_builddir)/ipasetup.py
$(PYTHON) "$(srcdir)/setup.py" clean --all
rm -rf "$(srcdir)/build" "$(srcdir)/dist" "$(srcdir)/MANIFEST"
find "$(srcdir)" \
@@ -36,7 +41,7 @@ clean-local:
# take list of all Python source files and copy them into distdir
# SOURCES.txt does not contain directories so we need to create those
-dist-hook:
+dist-hook: $(top_builddir)/ipasetup.py
$(PYTHON) "$(srcdir)/setup.py" egg_info
PYTHON_SOURCES=$$(cat "$(srcdir)/$(pkgname).egg-info/SOURCES.txt") || exit $$?; \
for FILEN in $${PYTHON_SOURCES}; \
@@ -47,6 +52,6 @@ dist-hook:
WHEELDISTDIR = $(top_builddir)/dist/wheels
.PHONY: bdist_wheel
-bdist_wheel:
+bdist_wheel: $(top_builddir)/ipasetup.py
rm -rf $(WHEELDISTDIR)/$(pkgname)*.whl
$(PYTHON) "$(srcdir)/setup.py" bdist_wheel --dist-dir=$(WHEELDISTDIR)