[Omake] generating a list of commands to do for cross compiling
Aleksey Nogin
nogin at metaprl.org
Thu Jan 11 10:59:38 PST 2007
On 10.01.2007 15:55, Erick Tryzelaar wrote:
> Say we were cross compiling a program to a platform that doesn't support
> ocaml, and thus omake. Would it be possible to get omake to print out a
> list of all the operations that would be done? The "-n" option doesn't
> work as it errors out if a target doesn't exist:
Eric,
You are right - the -n option appears to be broken currently and
probably needs to be fixed (more on this below).
Short of posting OCaml and OMake runtimes (just enough of it to get a
bytecode OMake running), the most obvious options would seem to be:
- Compile on a platform that does support OMake and is sufficiently
similar. Collect the build steps (possibly throwing away the scanner
steps, if you are sure that they do not have "important" side-effects).
Possibly tweak (manually?) some of the command-line arguments to match
the right platform.
- Set up a proper cross-compiling environment. Run omake normally,
possibly after adding some support for passing the cross-compilation
flags to all the compiler invocations.
Now back to the -n option. The current problem with it is easily fixable
(and ought to be fixed) - basically, as OMake code was being modified
and improved, we forgot to maintain the support for -n and now several
places in the code fail to account for a possibility of -n and do the
right thing.
Still, I am not sure what the -n option should mean. In general, OMake
can affect things in 3 ways:
1) The evaluation of the OMake code itself may have side-effects (for
example, you are allowed to spawn external commands from the OMake code,
not just from the rules, although in most cases this is very bad style).
2) Scanner rules.
3) Regular rules.
While it is obvious that "-n" ought to disable the regular rules, the
rest is quite unclear. On one hand, the scanner rules ought to be
disabled to (for one, some scanner rules will in fact partially build
the target, which we want to avoid; second, the scanner rules may depend
on the targets that are built using the the regular rules). On the other
hand, without running the scanner rules, we will not know all the
dependencies, so the meaning of "-n" as "show me what would happen if I
run it" will be compromised. Finally, the first category is even less
clear as it is not even obvious how to decide what belongs in it, it is
unclear whether there would be a reasonable way of disabling it and
disabling it is likely to change the outcome in an unpredictable way,
making the "-n" even less close to what would happen without it.
Aleksey
More information about the Omake
mailing list