X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=tools%2FMakefile;h=421414bc154b0a596cb5833148f2c19c614d5fa9;hb=8ea42101d2e97bb3c357baaf815ea575eb5464c1;hp=f72294a98a583fee5cfb43ec15cc61615b7e8e88;hpb=bff97dde8c8cf6fd5f04bb26fca83f61eadc1741;p=u-boot diff --git a/tools/Makefile b/tools/Makefile index f72294a98a..421414bc15 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -107,6 +107,20 @@ mkimage-objs := $(dumpimage-mkimage-objs) mkimage.o fit_info-objs := $(dumpimage-mkimage-objs) fit_info.o fit_check_sign-objs := $(dumpimage-mkimage-objs) fit_check_sign.o +# Build a libfdt Python module if swig is available +# Use 'sudo apt-get install swig libpython-dev' to enable this +hostprogs-$(CONFIG_SPL_OF_PLATDATA) += \ + $(if $(shell which swig),_libfdt.so) +_libfdt.so-sharedobjs += $(LIBFDT_OBJS) +libfdt: + +tools/_libfdt.so: $(patsubst %.o,%.c,$(LIBFDT_OBJS)) tools/libfdt_wrap.c + python $(srctree)/lib/libfdt/setup.py "$(_hostc_flags)" $^ + mv _libfdt.so $@ + +tools/libfdt_wrap.c: $(srctree)/lib/libfdt/libfdt.swig + swig -python -o $@ $< + # TODO(sjg@chromium.org): Is this correct on Mac OS? ifneq ($(CONFIG_MX23)$(CONFIG_MX28),)