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