xref: /openbmc/u-boot/scripts/show-gnu-make (revision b68a4062)
1*b68a4062SMasahiro Yamada#!/bin/sh
2*b68a4062SMasahiro Yamada#
3*b68a4062SMasahiro Yamada# Show the command name for GNU Make
4*b68a4062SMasahiro Yamada#
5*b68a4062SMasahiro Yamada# U-Boot is supposed to be built on various platforms.
6*b68a4062SMasahiro Yamada# One problem is that the command 'make' is not always GNU Make.
7*b68a4062SMasahiro Yamada# (For ex. the command name for GNU Make on FreeBSD is usually 'gmake'.)
8*b68a4062SMasahiro Yamada# It is not a good idea to hard-code the command name in scripts
9*b68a4062SMasahiro Yamada# where where GNU Make is expected.
10*b68a4062SMasahiro Yamada# Call this helper script to get the command name for GNU Make.
11*b68a4062SMasahiro Yamada#
12*b68a4062SMasahiro Yamada# SPDX-License-Identifier:	GPL-2.0+
13*b68a4062SMasahiro Yamada#
14*b68a4062SMasahiro Yamada
15*b68a4062SMasahiro Yamadagnu_make=
16*b68a4062SMasahiro Yamada
17*b68a4062SMasahiro Yamadafor m in make gmake
18*b68a4062SMasahiro Yamadado
19*b68a4062SMasahiro Yamada	if $m --version 2>/dev/null | grep -q GNU; then
20*b68a4062SMasahiro Yamada		echo $m
21*b68a4062SMasahiro Yamada		exit 0
22*b68a4062SMasahiro Yamada	fi
23*b68a4062SMasahiro Yamadadone
24*b68a4062SMasahiro Yamada
25*b68a4062SMasahiro Yamadaexit 1
26