home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / next / programm / 6124 < prev    next >
Encoding:
Internet Message Format  |  1992-09-11  |  2.8 KB

  1. Path: sparky!uunet!rosie!next.com
  2. From: julie@next.com (Julie Zelenski)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Re: Make bug?
  5. Keywords: make deletes files
  6. Message-ID: <4977@rosie.NeXT.COM>
  7. Date: 12 Sep 92 02:20:38 GMT
  8. References: <BuF2u0.EIC@monitor.com>
  9. Sender: news@NeXT.COM
  10. Reply-To: julie@next.com
  11. Lines: 77
  12.  
  13. In article <BuF2u0.EIC@monitor.com> howard@monitor.com (Howard Brenner)  
  14. writes:
  15. > This is rare, but it has happened to me twice.
  16. > In V2.1 of NeXTStep I was performing a make on my program when in the  
  17. > middle I realized I wanted to change a file.  I pressed CNTRL-C during  
  18. the  
  19. > make and got the following message:
  20. >     <filename>.m removed
  21. > and sure enough my source file was gone!
  22. > Has anyone else run into this problem?
  23.  
  24. I can't watch innocent source files get eaten without wanting to help out.   
  25. Here's the text from NextAnswers.736.   Be sure to put the PRECIOUS target  
  26. in the *postamble* (SRCFILES isn't defined til after Makefile gets  
  27. processed)
  28.  
  29. Julie Zelenski
  30. Developer Support
  31.  
  32. make removes files
  33.  
  34. Q:  Every now and then, if I use control-c to interrupt a make(1), it  
  35. decides to remove one of  my files.  I admit that my code isn't always the  
  36. cleanest, but is my computer trying to tell me something?  Is there a cure  
  37. for this? 
  38.  
  39. A:  There is a bug in make where it sometimes removes a source file  
  40. instead of the target when interrupted.  Here is a script of one of those  
  41. nasty interchanges between you and make:
  42.  
  43. hostname> make debug
  44. ^C*** `File.m' removed
  45. *** Exit 2
  46. Stop.
  47.  
  48. hostname> make debug
  49. Make:  Don't know how to make File.m.  Stop.
  50. *** Exit 1
  51. Stop.
  52.  
  53. As a workaround, you can add the .PRECIOUS pseudo-target in your  
  54. Makefile.postamble to protect yourself from this unwanted deletion.  (See  
  55. below for more about .PRECIOUS)  It should depend on SRCFILES (which  
  56. covers CFILES, MFILES, HFILES, nibs, tiffs, etc).
  57. #
  58. #  Make sure we don't remove anything by accident if 
  59. #  interrupted at the wrong time.
  60. #
  61. PRECIOUS : $(SRCFILES)
  62.  
  63.  
  64.  
  65. About .PRECIOUS
  66.  
  67. make normally stops if any command it generates returns a non-zero exit  
  68. code.  Before quitting, however, it removes the current target it is  
  69. making.  The assumption here is that target is probably in a partly  
  70. finished state.  If it were left in place, it would show as up-to-date in  
  71. subsequent invocations of make, due to its now-revised date of last  
  72. modification.  
  73.  
  74. There may be occasions when you do not want the target removed upon  
  75. occurrence of errors.  The .PRECIOUS: pseudo-target allows you to specify  
  76. any file you do not want destroyed.  For example., the description fie  
  77. entry
  78.     .PRECIOUS : target1 target2 target3
  79. prevents any of the three named targets from being removed by make.  This  
  80. entry can occur anywhere in the description file.
  81.  
  82. QA736
  83.  
  84. Valid for 1.0
  85. Valid for 2.0
  86.  
  87.