automake
[Top][All Lists]
Advanced

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

Re: XXX_CFLAGS


From: Ralf Corsepius
Subject: Re: XXX_CFLAGS
Date: 13 Aug 2001 14:12:41 +0200

Am 13 Aug 2001 10:21:45 +0200 schrieb Alexandre Duret-Lutz:
> >>> "Ralf" == Ralf Corsepius <address@hidden> writes:
> 
>  Ralf> Hi,
>  Ralf> automake-cvs/branch-real-1.5 confuses me:
> 
>  Ralf> # cat Makefile.am
>  Ralf> hello_c_CFLAGS = -Dhello
>  Ralf> noinst_PROGRAMS = hello-c
>  Ralf> hello_c_SOURCES = hello-c.c
> 
>  Ralf> # make 
> [...]
>  Ralf> gcc  -g -O2   -o hello-c  hello_c-hello-c.o  
> 
>  Ralf> Is this behavior intentional (filenaming of the *.o's)?
> 
> As soon as you start using per-target CFLAGS, Automake generates
> per-target object files (so that you can share a source file in
> two programs but still have it compiled twice, with different
> CFLAGS).
So I suppose this behavior is intentional :)

But I can't say to be pleased with this way of implementation.

IMHO, this naming scheme is inconsistent with the rest of automake's
naming conventions:

* I would expect <program|library>_CFLAGS to be handled similiar to
INCLUDES or DEFS (except for not being applied globally), but I do not
expect it to rename files.

* Similarily, I would expect hello_c_o_CFLAGS to be applied to the
compilation of a single *.c/o's only.

* I don't see why using a single set of per-target CFLAGS causes the
necessity of rename the files. 
Renaming them when using several such FLAGS for a _single_ target to
compile files multiple times might give sence. AFAIU, multiple
compilation however still requires to code the flags into Makefile.am,
therefore it should be detectable by automake and therefore it should be
technically possible to keep the old naming until multiple compiles are
used.

* Stylistically (A pure matter of personal taste), I am in favor of
compiling into subdirectories (debug/profile etc) instead of renaming
files.

Furthermore, I am concerned that renaming the files will probably break
custom suffix-rules and further custom rules applied somewhere.

I am not sure, but I suspect the naming not being safe against DOS/Win
filenaming conventions (At the moment, I don't have access to such
systems, so can't validate this statement).

Ralf





reply via email to

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