This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch to include $(CFLAGS) into specflags


Hello, Lars!

>  In that part of my message you didn't quote, I wrote that I currently
>  use explicit dependencies. This breaks utterly with ansi2knr, a case which
>  should be considered with per-object cflags.
> 
> > This is not so harmful as replacing CFLAGS, since using AM_CFLAGS is kind
> > of advanced use, so explicit adding AM_CFLAGS to prog_CFLAGS will not
> > complicate things very much. Cases when AM_CFLAGS should be replaced are
> > perhaps not so singular as those when CFLAGS can do any harm.
> 
>  There is virtually no documentation of AM_.FLAGS except for a
>  couple of list emails recommending them in certain situations.

AM_CFLAGS are added to CFLAGS. The only difference is that CFLAGS are
supplied by configure or by user, whereas AM_CFLAGS are hardcoded in
Makefile.am

You can put your defines and includes to Makefile.am e.g.:

AM_CFLAGS = -I. -DDEBUG

and remove your hacks. Hopefully, ansi2knr will work properly. If not,
report it as a bug.

If you really need to specify different flags for different objects, try
to group the objects into libraries and use per-library flags.

This is what I would do, but there may be a simpler way.

Pavel Roskin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]