[Omake] "export" failure
Christopher L Conway
cconway at cs.nyu.edu
Tue Sep 2 10:16:19 PDT 2008
Thanks, Aleksey. The lazy solution works for me.
Regards,
Chris
On Tue, Sep 2, 2008 at 12:49 PM, Aleksey Nogin <nogin at metaprl.org> wrote:
> On 25.08.2008 11:10, Christopher L Conway wrote:
>
>> In the following case, exporting a variable has no effect whatsoever.
>> This is with OMake 0.9.8.5, installed via GODI.
>>
> [...]
>>
>> OCAMLDOCFLAGS = -keep-code -sort -stars
>>
>> # Build a .odoc file for a subdirectory
>> ocaml_doc(name,files) =
>> SRC_FILES = $(filter-exists $(addsuffixes .mli .ml, $(files)))
>> ODOCFILE = $(file $(name).odoc)
>>
>> $(ODOCFILE):
>> if $(USE_OCAMLFIND)
>> OCAMLDOCFLAGS += -package $(concat $",", $(OCAMLPACKS))
>> export OCAMLDOCFLAGS
>>
>> $(OCAMLFIND) $(OCAMLDOC) $(OCAMLDOCFLAGS) \
>> $`(mapprefix -I, $(OCAMLINCLUDES)) -dump $(@) $(SRC_FILES)
>
> [...]
>
> Chris,
>
> The issue here is that in a rule body, each command it independent. In order
> to make your code work as is, you need to put the body of the rule inside a
> section. A better solution may be to use the lazy evaluation:
>
> OCAMLDOCFLAGS = -keep-code -sort -stars \
> $`(if $(USE_OCAMLFIND), -package $(concat $",", $(OCAMLPACKS)))
> ...
> $(ODOCFILE):
> $(OCAMLFIND) $(OCAMLDOC) $(OCAMLDOCFLAGS) \
> $(PREFIXED_OCAMLINCLUDES) -dump $@ $(SRC_FILES)
> ...
>
> Aleksey
>
> P.S. Sorry for the slow response - somehow I didn't see your message until
> today.
> _______________________________________________
> Omake mailing list
> Omake at metaprl.org
> https://lists.metaprl.org/mailman/listinfo/omake
>
>
More information about the Omake
mailing list