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