help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU make, gcc, and auto-dependencies


From: Ken Smith
Subject: Re: GNU make, gcc, and auto-dependencies
Date: Thu, 6 Jan 2005 11:25:36 -0500
User-agent: Mutt/1.5.6i

If I understand the intent of your $(BUILDDIR) prerequisite, you may
wish to make this an order-only dependency. (manual section 4.3)

Instead of

%.o : %.c $(BUILDDIR)

you can write

%.o : %.c | $(BUILDDIR)

to make $(BUILDDIR) an order dependency.

This doesn't solve your other problem though.  The error in the email
shows that your gmake is invoking "pc" as the compiler to build the .p
file from the .o file.

Since you don't list "pc" anywhere in your makefile, I believe it must
come from the pattern rules for building Pascal.  Try cancelling this
particular pattern rule like this. (manual section 10.5.6)

%.o: %.p

You can delete all the internal pattern rules by saying this in your
makefile. (manual section 10.7)

.SUFFIXES:

  HTH,
  Ken

On Thu, Jan 06, 2005 at 07:43:39AM -0800, Travis Spencer wrote:
> On Thu, Jan 06, 2005 at 10:06:34AM +0100, address@hidden wrote:
> > Is it maybe because you've listed a dir as prerequisite here?
> > 
> 
> That wasn't it.  I issued a make veryclean followed by a make command.
> It failed though because the build directory was deleted by the
> veryclean target.  I recreated the directory manually, issued the make
> again, and it completed successfully.  Then, I appended an empty
> string into one of my C files called kill.c, and remade it.  I got the
> same error again:
> 
> pc    -c -o build/kill.o build/kill.p
> make: pc: Command not found
> make: *** [build/kill.o] Error 127
> 
> I think this might be because the P file is older than the object
> file.  When a source file is updated, make finds out which
> dependencies it has.  It concluded that the corresponding P and O
> files are needed, so it tries to rebuild them starting with the
> prerequisite file; however, there is no rule for building P files, so
> it gives up saying that it can't find "pc," a command that make has
> presumed is responsible for building P files from C files.
> 
> It is these lines in the debug output that make me think this is the case:
> 
>     Finished prerequisites of target file `build/kill.o'.
>     Prerequisite        `build/kill.p' is older  than target `build/kill.o'.
>     Prerequisite `kill.c' is newer than target `build/kill.o'.
>     Prerequisite `vers.h' is older than target `build/kill.o'.
>     Must remake target `build/kill.o'.
> 
> Why is the P file being considered a prerequisite for the O file?
> Could it be because make is looking for all files with the same root
> name as it seems to be saying in this line of debug output:
> 
>     Trying pattern rule with stem `kill'.
>     ...
>     Trying implicit prerequisite    `build/kill.p'.
>     Found an implicit rule for `build/kill.o'.
> 
> I appreciate the feedback and look forward to any other suggestions.
> 
> -- 
> 
> Regards,
> 
> Travis Spencer
> 
> 
> _______________________________________________
> Help-make mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-make




reply via email to

[Prev in Thread] Current Thread [Next in Thread]