[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 @empty@include 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