[Omake] Passing full target paths to compilers
Jason Hickey
jyh at cs.caltech.edu
Mon Jun 12 09:25:10 PDT 2006
Benjamin Pierce wrote:
> Thanks, Jason -- That should do the trick for me. I'm a little
> surprised, though, that this requires adding a flag to OMake itself:
> I'd have thought that it should be easy to do it entirely by
> programming within OMake, by adding a variable that changes the way
> rules are built by OCaml.om. Is this not the case?
In rules, the targets and dependencies go through a (value -> filename)
translation, and then to string for the command line.
.PHONY: demo
demo: $(absname a)
echo $<
# omake demo
a
One can argue with the semantics here--should the $< refer to the
dependency file, or to the dependency text? The reason why we use the
former is because of Win32. For simplicity, omake views both \ and / as
pathname separators.
demo: a/b
echo $<
# omake demo
a\b
I'm open to alternate semantics. With --absname, the file->string
translation is changed. --absname is an option only for efficiency, but
it works the same as a variable (and could be changed to a variable if
that seems more appropriate).
section
OMakeFlags(--absname)
demo: a
echo $<
# omake demo
/...path.../a
Alternately, we could define a way to specify that target/dependencies
are to be viewed as text, not files, on the command line.
# Treat dependencies like strings, not filenames
TRANSLATE_TARGETS = false
demo: $(absname a)
echo $<
Jason
--
Jason Hickey http://www.cs.caltech.edu/~jyh
Caltech Computer Science Tel: 626-395-6568 FAX: 626-792-4257
More information about the Omake
mailing list