Comments

This commit moves some variable definitions from config.mk
to the top Makefile:
- HOSTCC, HOSTCFLAGS, HOSTLDFLAGS
- AS, LD, CC, CPP, etc.
- SHELL (renamed to CONFIG_SHELL)
I'd like to slim down config.mk file
because it is included from all recursive make.
It is redundant to re-define the variables
every time descending into sub directories.
We should rather define them at the top Makefile
and export them.
U-Boot makefiles has been used "SHELL" variable to store shell
chosen for the user, whereas Linux Kernel uses "CONFIG_SHELL".
We should never use "SHELL" variable because it is
a special variable for GNU Make.
Changing SHELL may cause unpredictable side effects
whose root cause is usually difficult to find.
We should use a generic variable name "CONFIG_SHELL".
We should not use the syntax as follows either:
rm -f $(obj)tools/env/{fw_printenv,fw_setenv}
This depends on "bash" although GNU Make generally
invokes "sh" to run the each rule.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---
O'REILLY GNU Make says like follows about SHELL variable:
By default, /bin/sh is used for the shell.
This shell is controlled by the make variable SHELL
but it is not inherited from the environment.
When make starts, it imports all the variables
from the user’s environment as make variables, except SHELL.
This is because the user’s choice of shell should not cause a
makefile (possibly included in some downloaded software package) to fail.
If a user really wants to change the default shell used by make,
he can set the SHELL variable explicitly in the makefile.
Please refer to the first page of the following PDF file:
http://oreilly.com/catalog/make3/book/ch05.pdf
Changes in v4: None
Changes in v3: None
Changes in v2:
- Do not use bash-dependent clean rules:
For example,
rm -f $(obj)tools/env/{fw_printenv,fw_setenv}
should be converted to
rm -f $(addprefix $(obj)tools/env/, fw_printenv fw_setenv)
- Add more comments in commit log
- Rebase on v2014.01-rc2 tag
Makefile | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---------
config.mk | 78 ++--------------------------------------------------
2 files changed, 84 insertions(+), 88 deletions(-)