[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #63510] Confusing "update target 'foo' due to: target does not exis
From: |
Paul D. Smith |
Subject: |
[bug #63510] Confusing "update target 'foo' due to: target does not exist" message |
Date: |
Sat, 17 Dec 2022 13:59:40 -0500 (EST) |
Follow-up Comment #2, bug #63510 (project make):
I'm not sure if there are other situations where this happens, besides PHONY,
but I've applied this patch:
diff --git a/src/job.c b/src/job.c
index b78f279c..cdca7ce1 100644
--- a/src/job.c
+++ b/src/job.c
@@ -1893,7 +1893,6 @@ new_job (struct file *file)
Use message here so that changes to working directories are logged. */
if (ISDB (DB_WHY))
{
- char *newer = allocated_variable_expand_for_file ("$?", c->file);
const char *nm;
if (! cmds->fileinfo.filenm)
@@ -1905,11 +1904,17 @@ new_job (struct file *file)
nm = n;
}
- OSSS (message, 0,
- _("%s: update target '%s' due to: %s"), nm, c->file->name,
- newer[0] == '\0' ? _("target does not exist") : newer);
-
- free (newer);
+ if (c->file->phony)
+ OSS (message, 0, _("%s: update target '%s' due to: target is
phony"),
+ nm, c->file->name);
+ else
+ {
+ char *newer = allocated_variable_expand_for_file ("$?", c->file);
+ OSSS (message, 0,
+ _("%s: update target '%s' due to: %s"), nm, c->file->name,
+ newer[0] == '\0' ? _("target does not exist") : newer);
+ free (newer);
+ }
}
/* The job is now primed. Start it running.
Now the output is:
Makefile:2: update target 'hello' due to: target is phony
touch hello
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63510>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/