Turns out that `make -pn` actually takes a while - about 300ms on
fish's makefile.
That's quite a bit of time just to throw away the output and use the
exit code.
So we just check for "GNU" in the version string.
It would be nice to just _do_ the completion and fall back on the
BSD-style if it doesn't work, but that is tricky to do with the pipe
to `awk` - the awk expression actually does not fail if `make` does
not print output.
And I don't know enough about awk to change that.
- Support completing dynamic make targets.
- Support completing make targets when using -C/--directory.
- Support `-Cdir/path`, `-C dir/path`
- Support `--directory=dir/path`, `--directory dir/path`
This detects if the make command have the `-p` switch otherwise it
assumes it is BSD make and will run a different command to try to figure
out the available targets.
I hate doing this but I am tired of touching a fish script as part of
some change and having `make style` radically change it. Which makes
editing fish scripts more painful than it needs to be. It is time to do
a wholesale reformatting of these scripts to conform to the documented
style as implemented by the `fish_indent` program.