[Omake] Generating byte code and native executables (OCaml)
Mike Furr
furr at cs.umd.edu
Mon Nov 12 10:23:41 PST 2007
Nikhil Dinesh wrote:
> Hi,
>
> I have a bunch of unit tests in each subdir of a project, and would like
> to generate both byte code (for use with -b) and native code (for
> performance tests). While setting the BYTE_ENABLED and NATIVE_ENABLED
> flags lets me build .cma and .cmxa libs, it generates only native code.
> I've looked through the docs, but haven't found any variables to ask it
> to generate both. I could write my own rule...but was wondering if there
> is a built in way to do this. (Omake version 0.9.8.5)
It should build both versions of the executable and then simply link (cp
on windows) the actual executable name to the "best" version (i.e.
native when its available).
> [...]
> OCamlProgram(fooTest, fooTest $(LIB))
Note, this returns the array [fooTest$(EXE), fooTest.opt, fooTest.run]
which are all of the things it built.
You can then build your unit tests:
.PHONY: test_byte test_opt
test_byte: fooTest.run
./fooTest.run
test_opt: fooTest.opt
./fooTest.opt
Cheers,
-Mike
More information about the Omake
mailing list