tools: Correct python building host tools
[platform/kernel/u-boot.git] / tools / Makefile
index 5b81dde..cefcedf 100644 (file)
@@ -111,13 +111,14 @@ 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) += \
+hostprogs-y += \
        $(if $(shell which swig 2> /dev/null),_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)" $^
+       LDFLAGS="$(HOSTLDFLAGS)" python $(srctree)/lib/libfdt/setup.py \
+               "$(_hostc_flags)" $^
        mv _libfdt.so $@
 
 tools/libfdt_wrap.c: $(srctree)/lib/libfdt/libfdt.swig