delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/30/07:27:10

Date: Tue, 30 Sep 1997 13:25:49 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp AT delorie DOT com
cc: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Subject: Re: Make v3.76.1 bug?
Message-ID: <Pine.SUN.3.91.970930132150.6040C-100000@is>
MIME-Version: 1.0

The following patch (sent to me by the GNU Make maintainer) fixes the 
problem with processing the Allegro Makefile.  If you have Make 3.76.1 
source distribution, you might consider installing this patch.

I will try to upload a patched distribution as soon as I can.

--- read.c~	Wed Aug 27 16:31:24 1997
+++ read.c	Mon Sep 29 10:22:11 1997
@@ -271,7 +271,7 @@
   unsigned int commands_started;
   register char *p;
   char *p2;
-  int len;
+  int len, reading_target;
   int ignoring = 0, in_ignored_define = 0;
   int no_targets = 0;		/* Set when reading a rule without targets.  */
   char *passed_filename = filename;
@@ -467,15 +467,19 @@
         {}
       len = p2 - p;
 
-      /* Find the start of the second token.  If it's a `:', jump past
-         preprocessor stuff since it can't be that--this allows targets named
-         `export', etc. */
+      /* Find the start of the second token.  If it's a `:' remember it,
+         since it can't be a preprocessor token--this allows targets named
+         `ifdef', `export', etc. */
+      reading_target = 0;
       while (isspace (*p2))
         ++p2;
       if (*p2 == '\0')
         p2 = NULL;
       else if (p2[0] == ':' && p2[1] == '\0')
-        goto check_var;
+        {
+          reading_target = 1;
+          goto skip_conditionals;
+        }
 
       /* We must first check for conditional and `define' directives before
 	 ignoring anything, since they control what we will do with
@@ -551,12 +555,13 @@
 
 	  continue;
 	}
+ skip_conditionals:
 
       if (ignoring)
 	/* Ignore the line.  We continue here so conditionals
 	   can appear in the middle of a rule.  */
 	continue;
-      else if (word1eq ("export", 6))
+      else if (!reading_target && word1eq ("export", 6))
 	{
 	  struct variable *v;
 	  p2 = next_token (p + 6);
@@ -578,7 +583,7 @@
 		}
 	    }
 	}
-      else if (word1eq ("unexport", 8))
+      else if (!reading_target && word1eq ("unexport", 8))
 	{
 	  unsigned int len;
 	  struct variable *v;
@@ -614,9 +619,7 @@
 	  if (pattern != 0)
 	    free (pattern);
 	}
-      else
-    check_var:
-        if (word1eq ("include", 7) || word1eq ("-include", 8)
+      else if (word1eq ("include", 7) || word1eq ("-include", 8)
 	       || word1eq ("sinclude", 8))
 	{
 	  /* We have found an `include' line specifying a nested



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019