automake
[Top][All Lists]
Advanced

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

Re: Allow per-object cflags?


From: Emil Ong
Subject: Re: Allow per-object cflags?
Date: Thu, 8 Feb 2001 20:11:03 -0600 (CST)

On 8 Feb 2001, Tom Tromey wrote:

> >>>>> "Emil" == Emil Ong <address@hidden> writes:
> 
> Emil> What is the state of per-object cflags in automake?  Is anyone
> Emil> working on them?  If not, how difficult would it be to implement
> Emil> it?
> 
> What do you mean by `object'?

Sorry, I took that straight from the TODO file.  What I'm talking about is
a cleaner way to do something like the etags/ctags example in the manual.
It was the topic of a FAQ in the book (_GNU Autoconf, Automake, and
Libtool_, nice job, BTW) so I thought this would be something that people
would be interested in.  

My particular interest is that I'm writing a wrapper program in C that
changes based on a preprocessor define.  I'd like to be able to do
something like:

bin_PROGRAMS = prog1 prog2

prog1_SOURCES = prog.c
prog1_CFLAGS  = -DPROG_NAME=\"prog1\"

prog2_SOURCES = prog.c
prog2_CFLAGS  = -DPROG_NAME=\"prog2\"

And get a makefile that does something like:

gcc -o prog1 -DPROG_NAME=\"prog1\" prog.c
gcc -o prog2 -DPROG_NAME=\"prog2\" prog.c

As I understand things now, you have to define the make rules directly,
which I'd rather not do for maintainability. Please correct me if I'm
wrong here.

> We have per-executable and per-library flag support in the most recent
> automake (cvs or 1.4b).  I doubt it is documented though :-(
> 
> If you want per-`.o' flags then that is not done and nobody is working
> on it.  That wouldn't be hugely complex to implement, I imagine, but
> so far there hasn't been demand.

I'm not sure if we're talking about the same thing, but I tried something 
like what I did above with 1.4b and it didn't work.  I didn't try the cvs
version though.

If someone did want to do this, like me perhaps, where would this 
hypothetical person start?

Thanks,
Emil





reply via email to

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