automake
[Top][All Lists]
Advanced

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

Re: Automake and make include


From: Stefano Lattarini
Subject: Re: Automake and make include
Date: Mon, 23 Apr 2012 16:40:06 +0200

[re-adding the list; please keep it in loop in future answers]

On 04/23/2012 04:32 PM, Дилян Палаузов wrote:
> Hello,
> 
> thanks for your answer.
> 
>>> This file shall be read before BUILD_SOURCES is expanded, so the
>>> "include" shall happen at the beginning of Makefile.in.
>>>
>> No, it shall not, as automake always re-order its input to ensure that the
>> variables' defiintions come before everything else.
> 
> My experience showed, that putting in Makefile.am:
> -include Mfilename
> (instead of @address@hidden Mfilename) puts in Makefile.in:
> -include Mfilename
> near the end.  And make then reads "Mfilename" when it appears.
>  So after the variables defined in "Mfilename" were used undefined.
>
Yes, because automake *never* look at the content of Mfilename (in fact,
it doesn't even know that will be included in the generated Makefile.in).
So you must put the "-include Mfilename" before using any variable
defined in there:

  -include Mfilename
  foo:
      @echo $(VARIABLE_DEFINED_IN_MFILENAME)

HTH,
  Stefano



reply via email to

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