Masahiro Yamada | b68a406 | 2014-07-22 11:19:07 +0900 | [diff] [blame] | 1 | #!/bin/sh |
Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 2 | # SPDX-License-Identifier: GPL-2.0+ |
Masahiro Yamada | b68a406 | 2014-07-22 11:19:07 +0900 | [diff] [blame] | 3 | # |
| 4 | # Show the command name for GNU Make |
| 5 | # |
| 6 | # U-Boot is supposed to be built on various platforms. |
| 7 | # One problem is that the command 'make' is not always GNU Make. |
| 8 | # (For ex. the command name for GNU Make on FreeBSD is usually 'gmake'.) |
| 9 | # It is not a good idea to hard-code the command name in scripts |
| 10 | # where where GNU Make is expected. |
| 11 | # Call this helper script to get the command name for GNU Make. |
Masahiro Yamada | b68a406 | 2014-07-22 11:19:07 +0900 | [diff] [blame] | 12 | |
| 13 | gnu_make= |
| 14 | |
| 15 | for m in make gmake |
| 16 | do |
| 17 | if $m --version 2>/dev/null | grep -q GNU; then |
| 18 | echo $m |
| 19 | exit 0 |
| 20 | fi |
| 21 | done |
| 22 | |
| 23 | exit 1 |