[U-Boot] GNU Make shell application

Peter Tyser ptyser at xes-inc.com
Wed Nov 12 18:34:48 CET 2008


Hello,
I noticed on my Ubuntu 7.04 system that when I did a 'make clobber' the
tools directory was still littered with symlinks that should have been
removed.  It looks like commands such as the following in the Makefiles
fail:
	@rm -f $(obj)tools/{crc32.c,env_embedded.c,env/crc32.c,md5.c,sha1.c,inca-swap-bytes}
	@rm -f(obj)tools/{image.c,fdt.c,fdt_ro.c,fdt_rw.c,fdt_strerror.c,zlib.h}
	@rm -f $(obj)tools/{fdt_wip.c,libfdt_internal.h}

On Ubuntu 7.04 /bin/sh is a symlink to /bin/dash ordinarily.  By default
Make uses /bin/sh as its shell.  Dash doesn't support the {abc,xyz}
convention so all the symlinks in the above Make commands fail silently.

As a fix, would people prefer that bash be used by Make by default?
Adding something like this (stolen from Linux) to the top-level Makefile
should work:
# Set shell to bash if possible, otherwise fall back to sh
SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
	else if [ -x /bin/bash ]; then echo /bin/bash; \
	else echo sh; fi; fi)

Or would they prefer the Make commands are updated not to use the
{abc,xyz} convention?

Thanks,
Peter



More information about the U-Boot mailing list