automake
[Top][All Lists]
Advanced

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

Re: Automake and make include


From: Дилян Палаузов
Subject: Re: Automake and make include
Date: Mon, 23 Apr 2012 16:53:11 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1

Hello,

that is the point. I want to include "Mfilename" in the very beginning of Makefile.in . You said, that Automake automatically makes sure, that all variables are defined, before they are used, but Automake has not idea what Mfilename contains (Mfilename does not exist when Automake is run). So how can it make sure, that the variables defined in Mfilename are defined at the time they are used, when "-include Mfilename" is put near the end of Makefile.in (after _SOURCES is defined) and Automake has no idea what Mfilename contains?

I cannot insert "-include Mfilename" before using any variable, because Automake inserts "-include Mfilename" after I have used the variables in "_SOURCES" and "_LDADD".

So how can I include Mfilename at the beginning of Makefile.in?

Thanks in advance for your answer
  Dilian



On 23.04.2012 16:40, Stefano Lattarini wrote:
[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' definitions 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]