Article View: comp.sys.next.programmer
Article #1022Re: Make bug?
From: Howard Brenner
Date: Mon, 14 Sep 1992 13:20
Date: Mon, 14 Sep 1992 13:20
78 lines
2885 bytes
2885 bytes
Julie Zelenski writes > In article <BuF2u0.EIC@monitor.com> howard@monitor.com (Howard Brenner) > writes: > I can't watch innocent source files get eaten without wanting to help out. > Here's the text from NextAnswers.736. Be sure to put the PRECIOUS target > in the *postamble* (SRCFILES isn't defined til after Makefile gets > processed) > > Julie Zelenski > Developer Support > > make removes files > > Q: Every now and then, if I use control-c to interrupt a make(1), it > decides to remove one of my files. I admit that my code isn't always the > cleanest, but is my computer trying to tell me something? Is there a cure > for this? > > A: There is a bug in make where it sometimes removes a source file > instead of the target when interrupted. Here is a script of one of those > nasty interchanges between you and make: > > hostname> make debug > ^C*** `File.m' removed > *** Exit 2 > Stop. > > hostname> make debug > Make: Don't know how to make File.m. Stop. > *** Exit 1 > Stop. > > As a workaround, you can add the .PRECIOUS pseudo-target in your > Makefile.postamble to protect yourself from this unwanted deletion. (See > below for more about .PRECIOUS) It should depend on SRCFILES (which > covers CFILES, MFILES, HFILES, nibs, tiffs, etc). > # > # Make sure we don't remove anything by accident if > # interrupted at the wrong time. > # > PRECIOUS : $(SRCFILES) > > > > About .PRECIOUS > > make normally stops if any command it generates returns a non-zero exit > code. Before quitting, however, it removes the current target it is > making. The assumption here is that target is probably in a partly > finished state. If it were left in place, it would show as up-to-date in > subsequent invocations of make, due to its now-revised date of last > modification. > > There may be occasions when you do not want the target removed upon > occurrence of errors. The .PRECIOUS: pseudo-target allows you to specify > any file you do not want destroyed. For example., the description fie > entry > .PRECIOUS : target1 target2 target3 > prevents any of the three named targets from being removed by make. This > entry can occur anywhere in the description file. > > QA736 > > Valid for 1.0 > Valid for 2.0 > Thanks for all the help and responses I have received. The command is now in my Makefile.postamble!
Technical Details
Message-ID:
<BuKL1n.MDM@monitor.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!tmc!howardReferences:
<4977@rosie.NeXT.COM>Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!tmc!howard From: howard@monitor.com (Howard Brenner) Subject: Re: Make bug? Message-ID: <BuKL1n.MDM@monitor.com> Sender: howard@monitor.com (Howard Brenner) Reply-To: howard@monitor.com (Howard Brenner) Organization: Monitor Company / IE References: <4977@rosie.NeXT.COM> Date: Mon, 14 Sep 1992 13:20:10 GMT Lines: 78