automake
[Top][All Lists]
Advanced

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

Re: renaming source files


From: Ralf Wildenhues
Subject: Re: renaming source files
Date: Sun, 5 Aug 2007 15:39:07 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Baurzhan,

* Baurzhan Ismagulov wrote on Thu, Aug 02, 2007 at 09:20:43AM CEST:
> 
> if I rename a file (from .c to .cpp, or move to another dir) and update
> Makefile.am, calling make in an already configured dir fails with the
> following message:
> 
> make: *** No rule to make target `foo.c', needed by `foo.lo'. Stop.
> 
> I have to cd $builddir; find -name foo.\* |xargs rm; ./config.status to
> fix this. Is there a way to detect and fix this in the autotools?

I don't know an easy one.  Having automake add stub rules
   foo.c:

seems problematic to me, as it prevents useful warnings at 'make all'
time that then are only caught at 'make dist' time.

I suppose one could try to modify depcomp to wipe out the `foo.lo:
foo.c' resp. `foo.$(OBJEXT): foo.c' dependencies.  Unless gcc is
modified to have a switch to not output this in the first place though,
it will kill the nice fast-path compilation for it, though.  IMVHO this
feature is more important than being able to rename source files without
a distclean in between.  Besides, I haven't really considered how
objects with per-target flags fit in the picture here.

Having a special *clean target wipe out these dependencies after the
fact seems like an error-prone (and slightly ugly) possibility.  ATM,
distclean is a hammer for that.

Hope that helps.

Cheers,
Ralf




reply via email to

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