home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / next / programm / 6146 < prev    next >
Encoding:
Text File  |  1992-09-14  |  2.7 KB  |  91 lines

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