I've seen things like echo
, mv
, if
, for
, in makefile rules. Some kind of shell commands seem to be recognized. Is this bash? How can I figure out which shell is being used and full list of keywords available to me?
Make – Which Shell is Used in GNU Make Files?
make
Best Answer
It's
sh
:system()
usessh
. You can definitely use the keywords of the POSIX Shell Command Language, and any non-keyword commands that you expect to be available on your host platform.sh
on your system may actually be another name for a different shell (likebash
), in which case you'd have more options available. That sort of makefile won't be portable, though.As you ask about GNU make specifically, I'll also note that it permits you to specify a different shell to use in the makefile, but that makefile again won't be portable to other implementations of
make
. GNU make usessh
by default, as POSIX specifies.