Commit d0fc6dc5 authored by Andre Przywara's avatar Andre Przywara Committed by Tom Rini

tools/Makefile: suppress "which swig" error output

The Makefile in tools/ tries to find the "swig" utility by calling "which".
If nothing is found in the path, some versions of which will print an error
$ make clean
which: no swig in (/usr/local/bin:/usr/bin:/bin)

This does not apply to all version of "which", though:
$ echo $0
$ type which
which is aliased to `type -path'
$ which foo				<== this version is OK
$ /usr/bin/which foo			<== this one is chatty
/usr/bin/which: no foo in (/usr/local/bin:/usr/bin:/bin)
$ sh					<== make uses /bin/sh
sh-4.3$ which foo			<== no alias here
which: no foo in (/usr/local/bin:/usr/bin:/bin)

This error message is rather pointless in our case, since we just have
this very check to care for this. So add stderr redirection to suppress
the message.
Signed-off-by: default avatarAndre Przywara <>
Reviewed-by: default avatarSimon Glass <>
parent 979a1f8b
......@@ -112,7 +112,7 @@ 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),
$(if $(shell which swig 2> /dev/null), += $(LIBFDT_OBJS)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment