[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Interesting automake bug(?)
On Mon, 25 Nov 2002, Bill Kendrick wrote:
>On Mon, Nov 25, 2002 at 12:32:02PM +0200, Jan Ekholm wrote:
>> Ok, I'll do that later today. I have no doubt that it works, but I'm still
>> interested in why automake thinks it's ok to clobber files named "foo",
>> any why it ends up doing it. Compiling "foo.cpp" file should IMO not write
>> the output to "foo".
>Because that's just "how it's done." From the "make" info pages:
That explains absolutely nothing to me. Since when should the switch "-c"
not write to a .o file? I know about implicit rules, I'm really not too
big an idiot. The header files are not compiled, merely included by the
pre-processor, why should they affect the name of the output files?
I accept that it's the way things seem to work, and using .hh or similar
would solve the problem (I'll use .hh). Still there is something wrong in
the toolchain if it does what it currently does, and it does it
irregularly. The auto* toolchain behaves differently when doing a clean
rebuild and when doing an incremental one. Why?
> Certain standard ways of remaking target files are used very often.
> For example, one customary way to make an object file is from a C
> source file using the C compiler, `cc'.
> "Implicit rules" tell `make' how to use customary techniques so that
> you do not have to specify them in detail when you want to use them.
> For example, there is an implicit rule for C compilation. File names
> determine which implicit rules are run. For example, C compilation
> typically takes a `.c' file and makes a `.o' file. So `make' applies
> the implicit rule for C compilation when it sees this combination of
> file name endings.
> A chain of implicit rules can apply in sequence; for example, `make'
> will remake a `.o' file from a `.y' file by way of a `.c' file.
> The built-in implicit rules use several variables in their commands
> so that, by changing the values of the variables, you can change the
> way the implicit rule works. For example, the variable `CFLAGS'
> controls the flags given to the C compiler by the implicit rule for C
Real stupidity beats artificial intelligence every time.
-- Terry Pratchett, Hogfather