help / color / Atom feed
* [PATCH] _make: use --always-make instead of .PHONY for GNU make
@ 2019-09-02  9:58 Daniel Hahler
  0 siblings, 0 replies; only message in thread
From: Daniel Hahler @ 2019-09-02  9:58 UTC (permalink / raw)
  To: zsh-workers

From: Daniel Hahler <git@thequod.de>

Using ".PHONY" might actually execute (phony) targets then, while
"--always-make" triggers processing of all targets, respecting `-n`
(This can be seen with `make -nsp .PHONY` in
https://github.com/neomake/neomake/tree/76b110d49a, where it actually
causes infinite processing then)

".PHONY" was used since the beginning here (37012f06a [1]).

As for bmake (which also uses `.PHONY`): there does not appear to be a
similar option for it.
While it might work better there (i.e. not causing targets to be run),
it causes an error at least when testing it quickly - which indicates
that it behaves as if using any other non-existing (or special) target
there maybe:

> bmake: don't know how to make .PHONY. Stop

This was added in ecc0a5ece [2] (workers-39654).

Since it uses `-s -f "$file" -V.ALLTARGETS` with `bmake` before to get
targets explicitly, there might not be a reason for calling `bmake` with
`-nsdg1Fstdout … .PHONY` additionally in the first place?!

1: https://github.com/danielshahaf/zsh/commit/37012f06a
2: https://github.com/danielshahaf/zsh/commit/ecc0a5ece
 Completion/Unix/Command/_make | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Completion/Unix/Command/_make b/Completion/Unix/Command/_make
index e23906373..56d47f4ea 100644
--- a/Completion/Unix/Command/_make
+++ b/Completion/Unix/Command/_make
@@ -262,7 +262,7 @@ _make() {
       if [[ $is_gnu == gnu ]] 
         if zstyle -t ":completion:${curcontext}:targets" call-command; then
-          _make-parseMakefile < <(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null)
+          _make-parseMakefile < <(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" --always-make 2> /dev/null)
           _make-parseMakefile < $file

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-02  9:58 [PATCH] _make: use --always-make instead of .PHONY for GNU make Daniel Hahler


Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git