automake
[Top][All Lists]
Advanced

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

Re: Why variable `FOO' not defined even if not needed? What to do instea


From: Ralf Wildenhues
Subject: Re: Why variable `FOO' not defined even if not needed? What to do instead?
Date: Thu, 21 Jan 2010 21:41:24 +0100
User-agent: Mutt/1.5.20 (2009-10-28)

* Steffen Dettmer wrote on Thu, Jan 21, 2010 at 01:44:44PM CET:
> in a include *.mak a file is created and added to `mydir_DATA'.
> The including (super-/caller) Makefile should be able to change
> the default of this file name. If the Makefile takes no action
> (except directly or indirectly including this *.mak), the
> defaults should be used.

--- Makefile.am ---
mydir_DATA =
include fragment.mak
# here, you can append:
mydir_DATA += foo
# or override:
mydir_DATA = bar

-- fragment.mak ---
# here, you can append:
mydir_DATA += baz
# or override:
mydir_DATA = bla
# but the including Makefile.am might override you later.


Ordering of includes matters, both for automake and by consequence for
make, and there is little you can do about it.

If the above is not good enough for you, maybe you instead want
something like this in the fragment:

frag_variable = default-value
mydir_DATA = $(frag_variable)


and be able to override frag_variable later in Makefile.am?

The ?= operator is GNU make-specific, but I suppose automake could learn
about it.

$(firstword ...) is GNU make-specific.  Current automake ignores it, so
you might want to update.


Cheers,
Ralf




reply via email to

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