diff options
author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2016-10-16 16:34:26 +0000 |
---|---|---|
committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2016-10-18 01:39:45 +0000 |
commit | ecc0a5ece2b3bbccdfb005c59508cec7473b9b06 (patch) | |
tree | 27314419442ba3b7a59cb220531d703ec45fd5eb | |
parent | ae3b675ce6e4ac62451ea08169c2b4dc45cf533b (diff) | |
download | zsh-ecc0a5ece2b3bbccdfb005c59508cec7473b9b06.tar.gz zsh-ecc0a5ece2b3bbccdfb005c59508cec7473b9b06.tar.xz zsh-ecc0a5ece2b3bbccdfb005c59508cec7473b9b06.zip |
39654: (based on patch by Baptiste Daroussin) Better support bmake, FreeBSD's default make(1) implementation.
Don't pass gmake options to bmake. Add bmake-speciic codepath for completing targets and parsing the makefile.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | Completion/Unix/Command/_make | 19 |
2 files changed, 15 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog index 8c6ea18b1..98b40a070 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2016-10-18 Daniel Shahaf <d.s@daniel.shahaf.name> + * 39654: Completion/Unix/Command/_make: (based on patch by + Baptiste Daroussin) Better support bmake, FreeBSD's default + make(1) implementation. + * 39657: Completion/Zsh/Command/_zstyle: Complete the -g, -s,-b,-a, -t,-T, -m options. diff --git a/Completion/Unix/Command/_make b/Completion/Unix/Command/_make index d10c8eece..35a892cc4 100644 --- a/Completion/Unix/Command/_make +++ b/Completion/Unix/Command/_make @@ -263,17 +263,20 @@ _make() { if [[ -n "$file" ]] then - if [[ $is_gnu == gnu ]] && zstyle -t ":completion:${curcontext}:targets" call-command + if [[ $is_gnu == gnu ]] then - _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null) + if zstyle -t ":completion:${curcontext}:targets" call-command; then + _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null) + else + _make-parseMakefile $PWD < $file + fi else - case "$OSTYPE" in - freebsd*) - _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp -f "$file" .PHONY 2> /dev/null) - ;; - *) + if [[ $OSTYPE == (freebsd|dragonfly|netbsd)* || /$words[1] == */bmake* ]]; then + TARGETS+=(${=${(f)"$(_call_program targets "$words[1]" -s -f "$file" -V.ALLTARGETS 2> /dev/null)"}}) + _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsdg1Fstdout -f "$file" .PHONY 2> /dev/null) + else _make-parseMakefile $PWD < $file - esac + fi fi fi |