automake
[Top][All Lists]
Advanced

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

Re: AM_CFLAGS usage


From: Marc Alff
Subject: Re: AM_CFLAGS usage
Date: Sun, 11 Jun 2006 06:31:12 -0700
User-agent: Thunderbird 1.5.0.4 (X11/20060608)

Hi


Norbert Sendetzky wrote:
> Hi all
>
> I've tried to set the C flags for my package globally and used AM_CLFAGS for 
> this. Unfortunately AM_CLFAGS is only honored if it is defined in the same 
> Makefile.am.
>
> AM_CFLAGS = -Wall -ansi -pedantic
> pkglib_LTLIBRARIES = libmysqlbackend.la
> libmysqlbackend_la_SOURCES = mysqlbackend.c
> libmysqlbackend_la_CFLAGS = $(AM_CFLAGS)
>
> This works, but as soon as I move AM_CFLAGS to the Makefile.am in the parent 
> directory, they aren't set any more. Is this the way it was intended and the 
> only way to set them globally is to AC_SUBST them or is there something wrong 
> in my files?
>
>   
As far as I know, this is intended.

If you need to share common code in multiple Makefile.am within the same
project,
you can also try :

common.am :
(AM_CFLAGS goes here)

dir1/subdir2/Makefile.am :
include ../../common.am

Personally, I do things like this :

dir1/subdir2/Makefile.am :

include $(top_srcdir)/PreRules.am
(... content of Makefile.am goes here ...)
include $(top_srcdir)/PostRules.am

where PreRules.am contains among other things common compilation flags,
and PostRules contains common rules that depends on variables set (or
not) in the body of each Makefile.am

Hope this helps,
Marc Alff





reply via email to

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