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