bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Print warning if .ONESHELL has spurious dependency


From: Johannes Altmanninger
Subject: [PATCH] Print warning if .ONESHELL has spurious dependency
Date: Sat, 20 Mar 2021 10:50:19 +0100

If the ".ONESHELL" is mentioned as target, then all recipes will be
run in a single shell.  I accidentally used ".ONESHELL: some-target",
assuming it would only apply to that target. There was some discussions
about supporting that, but until then I think it's a good idea to
warn the user.  Treating these spurious dependencies as errors would
also work, but I'm not sure if that's okay.

* src/read.c (record_files): Print warning if .ONESHELL has spurious dependency
---
 src/read.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/read.c b/src/read.c
index 9dbe30e..06d0ee6 100644
--- a/src/read.c
+++ b/src/read.c
@@ -2245,6 +2245,10 @@ record_files (struct nameseq *filenames, int 
are_also_makes,
 
       name = f->name;
 
+      if (!strcmp(name, ".ONESHELL") && f->deps)
+        O (error, flocp,
+           _("*** warning: .ONESHELL does not take dependencies"));
+
       /* All done!  Set up for the next one.  */
       if (nextf == 0)
         break;
-- 
2.30.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]