diff mbox

[U-Boot,v2,2/3] MAKEALL: make sure to invoke GNU Make

Message ID 1405995549-30489-3-git-send-email-yamada.m@jp.panasonic.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Masahiro Yamada July 22, 2014, 2:19 a.m. UTC
Since the command name 'make' may not be GNU Make on some platforms
such as FreeBSD, MAKEALL should call scripts/show-gnu-make to get
the command name for GNU MAKE (and error out if it is not found).

The GNU Make should be searched after parsing options because we want
to allow "MAKEALL -h" even if GNU Make is missing on the system.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

Changes in v2:
  - Check GNU Make only once at startup.
    It seems more reasonable because MAKEALL generally invokes
    make over and over again.

 MAKEALL | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Comments

Simon Glass July 25, 2014, 3:31 p.m. UTC | #1
On 22 July 2014 03:19, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> Since the command name 'make' may not be GNU Make on some platforms
> such as FreeBSD, MAKEALL should call scripts/show-gnu-make to get
> the command name for GNU MAKE (and error out if it is not found).
>
> The GNU Make should be searched after parsing options because we want
> to allow "MAKEALL -h" even if GNU Make is missing on the system.
>
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> ---
>
> Changes in v2:
>   - Check GNU Make only once at startup.
>     It seems more reasonable because MAKEALL generally invokes
>     make over and over again.

Acked-by: Simon Glass <sjg@chromium.org>
Tom Rini July 29, 2014, 3:57 p.m. UTC | #2
On Tue, Jul 22, 2014 at 11:19:08AM +0900, Masahiro Yamada wrote:

> Since the command name 'make' may not be GNU Make on some platforms
> such as FreeBSD, MAKEALL should call scripts/show-gnu-make to get
> the command name for GNU MAKE (and error out if it is not found).
> 
> The GNU Make should be searched after parsing options because we want
> to allow "MAKEALL -h" even if GNU Make is missing on the system.
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/MAKEALL b/MAKEALL
index 37ef71e..9510982 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -162,6 +162,12 @@  while true ; do
 		echo "Internal error!" >&2 ; exit 1 ;;
 	esac
 done
+
+GNU_MAKE=$(scripts/show-gnu-make) || {
+	echo "GNU Make not found" >&2
+	exit 1
+}
+
 # echo "Remaining arguments:"
 # for arg do echo '--> '"\`$arg'" ; done
 
@@ -633,11 +639,11 @@  build_target() {
 	target_arch=$(get_target_arch ${target})
 	eval cross_toolchain=\$CROSS_COMPILE_`echo $target_arch | tr '[:lower:]' '[:upper:]'`
 	if [ "${cross_toolchain}" ] ; then
-	    MAKE="make CROSS_COMPILE=${cross_toolchain}"
+	    MAKE="$GNU_MAKE CROSS_COMPILE=${cross_toolchain}"
 	elif [ "${CROSS_COMPILE}" ] ; then
-	    MAKE="make CROSS_COMPILE=${CROSS_COMPILE}"
+	    MAKE="$GNU_MAKE CROSS_COMPILE=${CROSS_COMPILE}"
 	else
-	    MAKE=make
+	    MAKE=$GNU_MAKE
 	fi
 
 	if [  "${output_dir}" != "." ] ; then