Skip to content

Commit ecc0a5e

Browse files
committed
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.
1 parent ae3b675 commit ecc0a5e

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
2016-10-18 Daniel Shahaf <d.s@daniel.shahaf.name>
22

3+
* 39654: Completion/Unix/Command/_make: (based on patch by
4+
Baptiste Daroussin) Better support bmake, FreeBSD's default
5+
make(1) implementation.
6+
37
* 39657: Completion/Zsh/Command/_zstyle: Complete the -g,
48
-s,-b,-a, -t,-T, -m options.
59

Completion/Unix/Command/_make

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -263,17 +263,20 @@ _make() {
263263

264264
if [[ -n "$file" ]]
265265
then
266-
if [[ $is_gnu == gnu ]] && zstyle -t ":completion:${curcontext}:targets" call-command
266+
if [[ $is_gnu == gnu ]]
267267
then
268-
_make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null)
268+
if zstyle -t ":completion:${curcontext}:targets" call-command; then
269+
_make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null)
270+
else
271+
_make-parseMakefile $PWD < $file
272+
fi
269273
else
270-
case "$OSTYPE" in
271-
freebsd*)
272-
_make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp -f "$file" .PHONY 2> /dev/null)
273-
;;
274-
*)
274+
if [[ $OSTYPE == (freebsd|dragonfly|netbsd)* || /$words[1] == */bmake* ]]; then
275+
TARGETS+=(${=${(f)"$(_call_program targets "$words[1]" -s -f "$file" -V.ALLTARGETS 2> /dev/null)"}})
276+
_make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsdg1Fstdout -f "$file" .PHONY 2> /dev/null)
277+
else
275278
_make-parseMakefile $PWD < $file
276-
esac
279+
fi
277280
fi
278281
fi
279282

0 commit comments

Comments
 (0)