🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #983

Re: Make bug?

#983
From: Julie Zelenski
Date: Sat, 12 Sep 1992 02:20
76 lines
2912 bytes
In article <BuF2u0.EIC@monitor.com> howard@monitor.com (Howard Brenner)  
writes:
> This is rare, but it has happened to me twice.
> 
> In V2.1 of NeXTStep I was performing a make on my program when in the  
> middle I realized I wanted to change a file.  I pressed CNTRL-C during  
the  
> make and got the following message:
> 	<filename>.m removed
> 
> and sure enough my source file was gone!
> 
> Has anyone else run into this problem?

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
Technical Details
Message-ID: <4977@rosie.NeXT.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!rosie!next.com
References: <BuF2u0.EIC@monitor.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!rosie!next.com
From: julie@next.com (Julie Zelenski)
Newsgroups: comp.sys.next.programmer
Subject: Re: Make bug?
Keywords: make deletes files
Message-ID: <4977@rosie.NeXT.COM>
Date: 12 Sep 92 02:20:38 GMT
References: <BuF2u0.EIC@monitor.com>
Sender: news@NeXT.COM
Reply-To: julie@next.com
Lines: 77