[Omake] "export" failure

Christopher L Conway cconway at cs.nyu.edu
Mon Aug 25 11:10:44 PDT 2008


In the following case, exporting a variable has no effect whatsoever.
This is with OMake 0.9.8.5, installed via GODI.

Incidentally, the code I'm working on here is trying to support
running ocamldoc both with and without ocamlfind. It would be great if
there were a built-in rule for ocamldoc.

Regards,
Chris

<file name="OMakefile">
.PHONY: doc

OCAMLDOC = ocamldoc
USE_OCAMLFIND = true
OCAMLINCLUDES[] = +pcre
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)
	    println($"OCAMLPACKS=$(OCAMLPACKS)")
            OCAMLDOCFLAGS += -package $(concat $",", $(OCAMLPACKS))
	    println($"OCAMLDOCFLAGS=$(OCAMLDOCFLAGS)")
            export OCAMLDOCFLAGS

        println($"OCAMLDOCFLAGS=$(OCAMLDOCFLAGS)")
        $(OCAMLFIND) $(OCAMLDOC) $(OCAMLDOCFLAGS) \
            $`(mapprefix -I, $(OCAMLINCLUDES)) -dump $(@) $(SRC_FILES)

    doc: $(ODOCFILE)

OCAMLPACKS = pcre
ocaml_doc(foo, abc)
</file>

<shell>
$ omake doc
make[0]: Entering directory `/home/chris/src/tests/omake/omake.scope'
*** omake: reading OMakefiles
*** omake: finished reading OMakefiles (0.01 sec)
make[1]: Entering directory `/home/chris/src/tests/omake/omake.scope'
- build . foo.odoc
+ <compute 5 value dependencies>
- build . foo.odoc
+ <if ... then ... [else ...]>
OCAMLPACKS=pcre
OCAMLDOCFLAGS=-keep-code -sort -stars -package pcre
- build . foo.odoc
+ global.println((quote "OCAMLDOCFLAGS=", $(global.OCAMLDOCFLAGS), ""))
OCAMLDOCFLAGS=-keep-code -sort -stars
- build . foo.odoc
+ ocamlfind ocamldoc -keep-code -sort -stars -I +pcre -I . -d . -dump
foo.odoc abc.ml
File "abc.ml", line 1, characters 0-9:
Unbound module Pcre
1 error(s) encountered
- exit . foo.odoc, 0.20 sec, code 1
make[1]: Leaving directory `/home/chris/src/tests/omake/omake.scope'
*** omake: 9/11 targets are up to date
*** omake: failed (0.21 sec, 0/0 scans, 1/1 rules, 2/72 digests)
*** omake: targets were not rebuilt because of errors:
   foo.odoc
</shell>


More information about the Omake mailing list