Use $(shell :; ...) in Makefile to force shell
authorEmily <vcs@emily.moe>
Wed, 4 Sep 2019 23:30:29 +0000 (00:30 +0100)
committerEmily <vcs@emily.moe>
Wed, 4 Sep 2019 23:43:30 +0000 (00:43 +0100)
commita9af28694ce5fbcf4cdfd0c3cb440c08681f8f16
treec51305cf5b837d4898df6202520f051d4b189e85
parent8c1a98249457b790895aee76115ddd40ec891555
Use $(shell :; ...) in Makefile to force shell

Did you think that `$(shell command -v ...)` would actually get run by
the shell? Foolish mortal; GNU Make is obviously far more wise than
thee, as it optimizes it to a direct -- and hence broken (since
`command` is a shell builtin) -- exec. This horrifying contortion
ensures that an actual shell runs the command and fixes the behaviour.

@Shizmob found the source of this misbehaviour; turns out gmake has a
hard-coded, incomplete list of shell builtins:

    https://github.com/mirror/make/blob/715c787dc69bac37827a7d6ea6d40a86c55b5583/src/job.c#L2691

This contains `command`, but the whole function is full of horrible
heuristic garbage so who knows. I'm so sorry.
Makefile