[omake] Is there a way to 'export' variable value from sub-OMakefile to parent?

Nozomi Shibano shibano.nozomi at gmail.com
Wed Feb 17 09:21:29 GMT 2016


Hi,

I had a general question. Please help if someone had answer. (Also
advise if I should ask this question in other place.)

Is there any way to 'export' variable value from sub-OMakefile to
parent? Sometimes I want to declare 'accumulator' variable in root
OMakefile and append to it in sub-OMakefiles using += operator, and
then do some task with accumulated values in root OMakefile. For
example, accumulate paths of all .o files in sub-directories and link
them into single .exe file in the root directory.

It seems to me that, it is not possible. (Exceptionally, when
sub-OMakefile is written as .SUBDIRS section in root OMakefile,
'export' command works for this purpose.) Passing information from
sub-OMakefile to parent is only possible via target file in sub
directory and dependency to it from root OMakefile. For above example
case, I have to link .o files into .a file in sub-OMakefile and
declare dependency from .exe to that .a file in root OMakefile. Is
this correct understanding?

Regards,
Nozomi Shibano


More information about the Omake mailing list