|
|
|
# Makefile.pylibfdt
|
|
|
|
#
|
|
|
|
|
|
|
|
PYLIBFDT_srcs = $(addprefix $(LIBFDT_srcdir)/,$(LIBFDT_SRCS))
|
|
|
|
WRAP = $(PYLIBFDT_objdir)/libfdt_wrap.c
|
|
|
|
PYMODULE = $(PYLIBFDT_objdir)/_libfdt.so
|
|
|
|
|
|
|
|
run_setup = SOURCES="$(1)" CPPFLAGS="$(CPPFLAGS)" OBJDIR="$(PYLIBFDT_objdir)" \
|
|
|
|
VERSION="$(dtc_version)" \
|
|
|
|
python $(PYLIBFDT_objdir)/setup.py --quiet $(2)
|
|
|
|
|
|
|
|
$(PYMODULE): $(PYLIBFDT_srcs) $(WRAP)
|
|
|
|
@$(VECHO) PYMOD $@
|
|
|
|
$(call run_setup, $^, build_ext --inplace)
|
|
|
|
|
|
|
|
$(WRAP): $(PYLIBFDT_srcdir)/libfdt.i
|
|
|
|
@$(VECHO) SWIG $@
|
|
|
|
$(SWIG) -python -o $@ $<
|
|
|
|
|
|
|
|
install_pylibfdt: $(WRAP) $(PYMODULE)
|
|
|
|
$(VECHO) INSTALL-PYLIB; \
|
|
|
|
$(call run_setup, $(PYLIBFDT_srcs) $(WRAP), \
|
|
|
|
install $(if $(SETUP_PREFIX),--prefix=$(SETUP_PREFIX)))
|
|
|
|
|
|
|
|
maybe_install_pylibfdt:
|
|
|
|
if [ -e $(PYMODULE) ]; then \
|
|
|
|
if [ -z "$(NO_PYTHON)" ]; then \
|
|
|
|
$(MAKE) install_pylibfdt; \
|
|
|
|
fi; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
PYLIBFDT_cleanfiles = libfdt_wrap.c libfdt.py libfdt.pyc _libfdt.so
|