[Omake] Passing full target paths to compilers
Benjamin Pierce
bcpierce at cis.upenn.edu
Mon Jun 12 09:56:53 PDT 2006
I see -- very interesting.
Based on this, I agree that the fix you chose was probably the best,
though I'd have preferred the TRANSLATE_TARGETS = false version
(changing command line args seems magical, while changing variables
that are used to determine how other things work seems "normal" :-).
As usual, I'm tempted to say this should get into the documentation
in some form. Besides documenting the new flag itself, I think what
I was missing was a clear understanding of where filenames are used
as files and where as text, and what that implies for the way other
things work. Your examples below are very helpful.
- B
On Jun 12, 2006, at 12:25 PM, Jason Hickey wrote:
> 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
> _______________________________________________
> Omake mailing list
> Omake at metaprl.org
> https://lists.metaprl.org/mailman/listinfo/omake
More information about the Omake
mailing list