[Omake] help not exporting the loop variable?
Erick Tryzelaar
erickt at dslextreme.com
Sun Jan 7 13:49:37 PST 2007
Aleksey Nogin wrote:
> Erik, there seem to be several minor problems in your code - each is
> pretty harmless, but they add up together.
Thats what I thought. Thanks for the suggestions.
>> OMakefile:
>> packages. =
>> extends $(Map)
>>
>> register-package(package) =
>> echo register $(package.name)
>> packages = $(packages.add $(package.name), $(package))
>> export
>
> Note that the above "export" call will export the full environment - and
> that includes not only the "packages" variable that was explicitly
> modified, but the "package" variable that was passed in as an argument!
> You might want to change it into an explicit "export packages" (this
> would be sufficient to correct the problem).
I didn't know you could do that. That makes things a lot simpler.
> Will every package file always add a single package? If so, then I'd
> suggest moving the register-package call into the foreach loop:
I like that, but I'm not sure that at this stage in the build, this
foreach is aware of what are the package properties, as these would
depend on another set of build plugins. Is there something like ocaml or
python where you can import a file as a module, so I could do something
like:
package = $(import $x)
register-package($(package))
> P.S. In a somewhat similar situation in MetaPRL, we use "MetaprlInfo"
> files (that define MetaPRL "theories" - somewhat similar to your
> packages) that each only define a bunch of variables and the "central"
> code that reads all of those info file will use the variable values to
> do the actual work. See the big section block at the end of
> http://svn.metaprl.org/viewvc/*checkout*/mojave/metaprl/OMakefile_theories
> if interested.
I'll check it out. Thanks for the help!
-e
More information about the Omake
mailing list