From ecc0a5ece2b3bbccdfb005c59508cec7473b9b06 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 16 Oct 2016 16:34:26 +0000 Subject: 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. --- Completion/Unix/Command/_make | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'Completion/Unix/Command/_make') 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 -- cgit 1.4.1