Xref: utzoo comp.sys.apollo:7111 gnu.utils.bug:1538 Path: utzoo!utgpu!watserv1!watmath!uunet!shelby!snorkelwacker.mit.edu!ai-lab!ai.mit.edu!gnulists From: abair@turbinia.sps.mot.com (Alan Bair) Newsgroups: mot.general,comp.sys.apollo,gnu.utils.bug Subject: Re: Gnu Make Question Message-ID: Date: 14 Nov 90 06:10:03 GMT References: <2455@dover.sps.mot.com> Followup-To: gnu.utils.bug Organization: SSDT, Motorola Inc., Austin, Texas. Lines: 40 Approved: info-gnu@prep.ai.mit.edu To: uunet!gnu-emacs-announce@uunet.uu.net In-Reply-To: donh@victory.oakhill.uucp's message of 13 Nov 90 13:39:24 GMT --text follows this line-- With any Make program, if you use the default rules, like Robert is in his example, you have to except what the builtin action does. One fix is what Don suggested, add to the actions performed for the target. A more general fix, is to define your own actions to perform for a rule. Here is what I believe the default rules to be (the make man page tells how to get the whole list): .c~.o: $(GET) $(GFLAGS) -p $< > $*.c $(CC) $(CFLAGS) -c $*.c -rm -f $*.c Which when make finds a file needs to be checked out (thats what the ~ means), it does a get, compiles it, then erases the checked out file. .h~.h: $(GET) $(GFLAGS) -p $< > $*.h This is what make uses to checkout the required .h file. There is also a similar one for .c files. Now, if we were to assume that you want to erase any files that are checked out, which means they are younger than the target, the following new rule for building .o files from .c files may work. .c.o: cc $(CFLAGS) -c $< rm $? This says that .o files depend on .c files and the dependent .c file, $<, is compiled and then any dependent files younger than the target, $?, are to be erased. This will use the default rules to checkout .c and .h files. I haven't tested this, just wrote it from memory and a peek at the man page, so it could be wrong. However, I think it will provide some ideas to try. -- Alan Bair SSDT (formerly SPS CAD) Motorola, Inc. Logic Simulation & Test Austin, Texas abair@turbinia.sps.mot.com