aboutsummaryrefslogtreecommitdiff
path: root/pylibfdt/Makefile.pylibfdt
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2018-08-10 12:39:18 +1000
committerDavid Gibson <david@gibson.dropbear.id.au>2018-09-25 10:29:35 +1000
commitdd695d6afb19359f9b1efb8aa649c0e508817f95 (patch)
treec7ffeee009425b3e7a11e1ec3fbda43eaf1089a9 /pylibfdt/Makefile.pylibfdt
parent59327523d0d827ba7d8ff311ec89f0f32a1b2ebe (diff)
downloaddtc-dd695d6afb19359f9b1efb8aa649c0e508817f95.zip
dtc-dd695d6afb19359f9b1efb8aa649c0e508817f95.tar.gz
dtc-dd695d6afb19359f9b1efb8aa649c0e508817f95.tar.bz2
pylibfdt: Correctly set build output directory
Our Makefile currently passes PYLIBFDT_objdir into setup.py in an attempt to set the correct place to put the Python extension module output. But that gets passed in the 'package_dir' map in distutils. But that's basically not what package_dir controls. What actually makes us find the module in the right place is the --inplace passed to setup.py (causing the module to go into the current directory), and the following 'mv' in the Makefile to move it into the right final location. We can simplify setup.py by dropping the useless objdir stuff, and get the module put in the right place straight way by instead using the --build-lib setup.py option. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'pylibfdt/Makefile.pylibfdt')
-rw-r--r--pylibfdt/Makefile.pylibfdt6
1 files changed, 2 insertions, 4 deletions
diff --git a/pylibfdt/Makefile.pylibfdt b/pylibfdt/Makefile.pylibfdt
index 9507d3d..0b5364e 100644
--- a/pylibfdt/Makefile.pylibfdt
+++ b/pylibfdt/Makefile.pylibfdt
@@ -6,15 +6,13 @@ PYLIBFDT_srcs = $(addprefix $(LIBFDT_srcdir)/,$(LIBFDT_SRCS)) \
PYMODULE = $(PYLIBFDT_objdir)/_libfdt.so
define run_setup
- SOURCES="$(1)" CPPFLAGS="$(CPPFLAGS)" OBJDIR="$(PYLIBFDT_objdir)"
- VERSION="$(dtc_version)"
+ SOURCES="$(1)" CPPFLAGS="$(CPPFLAGS)" VERSION="$(dtc_version)"
$(PYLIBFDT_objdir)/setup.py --quiet $(2)
endef
$(PYMODULE): $(PYLIBFDT_srcs)
@$(VECHO) PYMOD $@
- $(call run_setup, $^, build_ext --inplace)
- mv _libfdt.so $@
+ $(call run_setup, $^, build_ext --build-lib=$(PYLIBFDT_objdir))
install_pylibfdt: $(PYMODULE)
$(VECHO) INSTALL-PYLIB; \