Our make (bsd make) has "alternate" dependency operators :: and !

Twenty years ago, we made it so that ambiguous constructs like
File::Find.3p: File/Find.pm

would no longer be ambiguous thanks to the added space.

Now, I believe that !  should be trumped by :  if both are present in the
same line without intervening spaces.

This means that standard Makefile lines   won't be interpreted differently
if run under our make.

This is what this patch achieves.

okay? objections ?

Index: parse.c
===================================================================
RCS file: /cvs/src/usr.bin/make/parse.c,v
retrieving revision 1.132
diff -u -p -r1.132 parse.c
--- parse.c     26 Jan 2020 12:41:21 -0000      1.132
+++ parse.c     9 Apr 2020 16:30:17 -0000
@@ -598,7 +598,10 @@ found_delimiter(const char *s)
                do {
                        p += strcspn(p, "!:");
                        if (*p == '\0')
-                           break;
+                               break;
+                       /* always prefer : to ! if not space separated */
+                       if (*p == ':' && *s == '!')
+                               return false;
                        p++;
                } while (*p != '\0' && !ISSPACE(*p));
 

Reply via email to