home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / gnu / utils / bug / 2360 < prev    next >
Encoding:
Text File  |  1993-01-08  |  3.6 KB  |  123 lines

  1. Newsgroups: gnu.utils.bug
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!davids.b11.ingr.com!davids
  3. From: davids@davids.b11.ingr.com (David Reed Smith)
  4. Subject: GNU Make 3.62 and including makefiles
  5. Message-ID: <199301082052.AA01488@davids.b11.ingr.com>
  6. Sender: gnulists@ai.mit.edu
  7. Reply-To: davids@davids.b11.ingr.com
  8. Organization: GNUs Not Usenet
  9. Distribution: gnu
  10. Date: Fri, 8 Jan 1993 08:52:24 GMT
  11. Approved: bug-gnu-utils@prep.ai.mit.edu
  12. Lines: 109
  13.  
  14. According to the texinfo file that comes with GNU make, in the section
  15. entitled "Including Other Makefiles":
  16.  
  17.     If an included makefile cannot be found in any of these
  18.     directories, a warning message is generated, but it is not a fatal
  19.     error; processing of the makefile containing the `include'
  20.     continues.
  21.  
  22. Unfortunately, this is not how the program acts.  Given the following
  23. makefile:
  24.  
  25.     include xxxx
  26.  
  27.     all:
  28.         @echo hi
  29.  
  30. If the file 'xxxx' doesn't exist, you do get a warning, but then the
  31. program dies, like this:
  32.  
  33.     gmake: fopen: xxxx: No such file or directory
  34.     gmake: *** No way to make target `xxxx'.  Stop.
  35.  
  36. If you make the following change to 'read.c', make acts properly and
  37. produces the correct output:
  38.  
  39.     make: fopen: xxxx: No such file or directory
  40.     hi
  41.  
  42. The change to read.c involves moving the section of code that adds the
  43. current filename to the chain of read makefiles so that this only
  44. happens if the file exists.
  45.  
  46. There are certainly other solutions to this problem, but this one
  47. seemed the best to me given my understanding (or lack thereof) of the
  48. code.
  49.  
  50. Does this solution seem appropriate to the current GNU make
  51. developers?
  52.  
  53. Thanks.
  54.  
  55. ---------------------------------------------------------------------------
  56. *** read.c-dist Tue Jul 21 16:39:22 1992
  57. --- read.c      Fri Jan  8 14:25:16 1993
  58. ***************
  59. *** 269,291 ****
  60.         }
  61.       }
  62.   
  63. -   /* Add FILENAME to the chain of read makefiles.  */
  64. -   deps = (struct dep *) xmalloc (sizeof (struct dep));
  65. -   deps->next = read_makefiles;
  66. -   read_makefiles = deps;
  67. -   deps->name = 0;
  68. -   deps->file = lookup_file (filename);
  69. -   if (deps->file == 0)
  70. -     {
  71. -       deps->file = enter_file (savestring (filename, strlen (filename)));
  72. -       if (type == 1)
  73. -       deps->file->dontcare = 1;
  74. -     }
  75. -   filename = deps->file->name;
  76. -   deps->file->precious = 1;
  77. -   deps->changed = type;
  78. -   deps = 0;
  79.     /* If the makefile can't be found at all,
  80.        either ignore it or give up entirely.  */
  81.   
  82. --- 269,274 ----
  83. ***************
  84. *** 294,299 ****
  85. --- 277,301 ----
  86.         if (type != 1)
  87.         perror_with_name ("fopen: ", filename);
  88.         return;
  89. +     }
  90. +   else
  91. +     {
  92. +       /* Add FILENAME to the chain of read makefiles.  */
  93. +       deps = (struct dep *) xmalloc (sizeof (struct dep));
  94. +       deps->next = read_makefiles;
  95. +       read_makefiles = deps;
  96. +       deps->name = 0;
  97. +       deps->file = lookup_file (filename);
  98. +       if (deps->file == 0)
  99. +         {
  100. +         deps->file = enter_file (savestring (filename, strlen (filename)));
  101. +         if (type == 1)
  102. +           deps->file->dontcare = 1;
  103. +         }
  104. +       filename = deps->file->name;
  105. +       deps->file->precious = 1;
  106. +       deps->changed = type;
  107. +       deps = 0;
  108.       }
  109.   
  110.     reading_filename = filename;
  111. ---------------------------------------------------------------------------
  112.  
  113. davids
  114.  
  115. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  116. David Smith                davids@davids.b11.ingr.com (Internet)
  117. Intergraph Corporation            uunet!ingr!b11!davids!davids (UUCP)
  118. Mailstop CR1104                (205) 730-5752
  119. Huntsville, AL 35894-0001
  120. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  121.  
  122.