[Omake] Order of evaluation
Benjamin Pierce
bcpierce at cis.upenn.edu
Tue Jun 13 08:16:01 PDT 2006
OK, here's today's question... :-)
One of the generated modules in the Harmony build can be constructed
in either of two ways:
- When we're building a binary that's going to be installed
elsewhere in the filesystem,
this module gets built from a whole bunch of other files in a
complicated way.
- When we're building a binary that's going to be used "in
place" (i.e., during testing),
we can get by with a stub version of this module that has no
dependencies.
In GNU Make, I would handle this situation like this (in pseudocode,
since I'm trying to forget make syntax :-)...
.PHONY: fast slow
fast:
make $(RESULT) FAST=true
slow:
make $(RESULT) FAST=false
if FAST=true then
foo.ml:
cp foo.ml.fast foo.ml
else
foo.ml: <lots of dependencies>
<complicated stuff>
fi
$(RESULT): foo.o ...
<regular compile and link stuff>
But in OMake I can't do the recursive invocation, so this can't be
translated directly. I could just give the FAST flag on the command
line every time (typing "omake FAST=true"), but this is a lot of
typing, compared to just "omake fast", for something I'm going to do
a lot. (Moreover, what I really want is not just "fast" and "slow"
targets: e.g., I want to incorporate the "slow" stuff into a larger
"omake install" behavior...)
What would be the most idiomatic way to do this?
Thanks!
- Benjamin
More information about the Omake
mailing list