zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Guilherme Salazar <gmesalazar@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: zsh make(1) completion on FreeBSD
Date: Tue, 11 Oct 2016 21:21:50 +0000	[thread overview]
Message-ID: <20161011212150.GA24484@fujitsu.shahaf.local2> (raw)
In-Reply-To: <CA+Hmt2iOypn5PDukmM3TH1=g-194QC_6FLVeaM-U0vFG1YbO7w@mail.gmail.com>

Guilherme Salazar wrote on Wed, Oct 05, 2016 at 23:56:52 -0300:
> Hey,
> 
> The _make completion script has the following snippet:
> 
> case "$OSTYPE" in
>   freebsd*)
>     _make-parseMakefile $PWD < <(_call_program targets "$words[1]"
> -nsp -f "$file" 4| .PHONY 2> /dev/null)
>   ;;
> 
> That is, _call_program invokes the make command ($words[1]) with the
> given options (-nsp...) to get the make database. The issue is the
> default make utility in FreeBSD is not GNU Make and it does not
> support these options; to get something in FreeBSD make, we could use
> the -d option (for debugging), along with A (for all) -- see [1] for
> details.
> 

I'd like to see this fixed but I'm not on FreeBSD right now.  Any chance
you could write a patch?  I think there are two approaches, either (a)
figure out what incantation of BSD make is equivalent to «gmake -nspf
$file», or (b) use the -d switch to ask make what are the targets,
variables, and other things that _make-parseMakefile extracts.

> If one has gmake installed, one can replace "$words[1]" with gmake or
> g"$words[1]" to have gmake dump the database info, but I'm not sure
> it's the ideal solution.
> 

g$words[1] won't work when $words[1] is "/usr/bin/make", and in any case
I'd be concerned about syntaxes that are valid to BSD make but not to
GNU make; there are bound to be numerous instances of that in the ports
tree.

Thanks,

Daniel

> [1] https://www.freebsd.org/cgi/man.cgi?query=make&apropos=0&sektion=1&manpath=FreeBSD+11-current&arch=default&format=html
> 
> Cheers,
> G. Salazar
> 


  reply	other threads:[~2016-10-11 21:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-06  2:56 Guilherme Salazar
2016-10-11 21:21 ` Daniel Shahaf [this message]
2016-10-11 23:27   ` Guilherme Salazar
2016-10-12  0:02     ` Daniel Shahaf
2016-10-12  0:24       ` Guilherme Salazar
2016-10-12  0:36         ` Daniel Shahaf
2016-10-12  1:14           ` Guilherme Salazar
2016-10-12  3:27             ` Guilherme Salazar
2016-10-13 10:08               ` Oliver Kiddle
2016-10-14  6:10                 ` Daniel Shahaf
2016-10-16 16:34             ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161011212150.GA24484@fujitsu.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=gmesalazar@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).