platform_external_dtc/pylibfdt/Makefile.pylibfdt
David Gibson 7691f9d393 pylibfdt: Make SETUP make variable
This points to the Python setup script, since we reference it in a couple
of places.  While we're there correct two small problems:

1) setup.py is part of the checked in sources and so lives in
   $(PYLIBFDT_srcdir) not $(PYLIBFDT_objdir) [this only worked because
   those are the same by default]

2) The module itself should depend on the setup script so it is rebuilt
   if the script is changed

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Simon Glass <sjg@chromium.org>
2018-09-25 10:30:28 +10:00

22 lines
559 B
Makefile

# Makefile.pylibfdt
#
PYLIBFDT_srcs = $(PYLIBFDT_srcdir)/libfdt.i
PYMODULE = $(PYLIBFDT_objdir)/_libfdt.so
SETUP = $(PYLIBFDT_srcdir)/setup.py
define run_setup
VERSION="$(dtc_version)"
$(SETUP) --quiet $(1)
endef
$(PYMODULE): $(PYLIBFDT_srcs) $(LIBFDT_archive) $(SETUP)
@$(VECHO) PYMOD $@
$(call run_setup, build_ext --build-lib=$(PYLIBFDT_objdir))
install_pylibfdt: $(PYMODULE)
$(VECHO) INSTALL-PYLIB; \
$(call run_setup, install $(if $(SETUP_PREFIX),--prefix=$(SETUP_PREFIX)))
PYLIBFDT_cleanfiles = libfdt_wrap.c libfdt.py libfdt.pyc _libfdt.so