[Omake] can't find the error in my omakefile
Aleksey Nogin
nogin at metaprl.org
Mon Feb 12 09:14:38 PST 2007
On 12.02.2007 01:50, micha wrote:
> - build . hello.run
> + ocamlc.opt -warn-error A -g -I . -custom -o hello.run ask.cmo
> color.cmo draw.cmo font.cmo labeltype.cmo box.cmo widget.cmo window.cmo
> hello.cmo valuator.cmo libofltk.a -cclib "-lstdc++ -L/usr/local/lib
> -lfltk2 -lX11 -lXi -lm -lsupc++"
> /usr/local/godi/bin/ocamlc.opt: unknown option `-L/usr/local/lib'.
[...]
> OCAML_LINK_FLAGS = -cclib \"-lstdc++ -L/usr/local/lib -lfltk2 -lX11 -lXi -lm -lsupc++\"
Note that OMake (as of version 0.9.8) parses command lines internally
and the thing that is printed is more or what it got _after_ parsing
(improving the command line printouts is on our "to do list"). Also note
that the \ before " in the OCAML_LINK_FLAGS line is interpreted
essentially in the same way a shell would do it - as indication that
quotes should _not_ be interpreted in any special way and the spaces
between should retain their usual meaning.
Basically, you are asking OMake to run
ocamlc.opt -warn-error A -g -I . -custom -o hello.run ask.cmo color.cmo
draw.cmo font.cmo labeltype.cmo box.cmo widget.cmo window.cmo hello.cmo
valuator.cmo libofltk.a -cclib \"-lstdc++ -L/usr/local/lib -lfltk2 -lX11
-lXi -lm -lsupc++\"
And you are getting the exact same error that you would get if you ran
the above line in a shell.
Aleksey
P.S. Using the OMake's internal quotation syntax $"..." is a slightly
cleaner way of quoting white space than "...". It does not matter if all
you want is to use the value on the command line, but it does matter if
you want to use it in OMake functions, as the "..." form would not only
quote the whitespace in between, but would also include the quotes
themselves in the value.
For example, consider the following in osh:
% cd /tmp/
% file ($"a b")
- : /tmp/a b : File
% file ("a b")
- : /tmp/"a b" : File
% touch $(file "a b")
% ls -l $(file "a b")
-rw-r--r-- 1 anogin wheel 0 Feb 12 09:10 "a b"
% touch $(file $"a b")
% ls -l $(file $"a b")
-rw-r--r-- 1 anogin wheel 0 Feb 12 09:11 a b
% ls -l *$"a b"*
-rw-r--r-- 1 anogin wheel 0 Feb 12 09:10 "a b"
-rw-r--r-- 1 anogin wheel 0 Feb 12 09:11 a b
% ls -l *"a b"*
-rw-r--r-- 1 anogin wheel 0 Feb 12 09:10 "a b"
-rw-r--r-- 1 anogin wheel 0 Feb 12 09:11 a b
% ls -l $(file a b)
/bin/ls: a: No such file or directory
/bin/ls: b: No such file or directory
- : <exit-code 1> : Int
More information about the Omake
mailing list