[Omake] Re: CProgram sets no dependcies on LIBS - is it a bug?

David Kågedal davidk at lysator.liu.se
Fri Sep 8 02:41:06 PDT 2006


"Yegor Bryukhov" <ybryukhov at gmail.com> writes:

> I noticed that OCamlProgram explicitly says that BYTEPROG depends on LIBS
> but CProgram states only dependencies on OFILES.
> Looks like a bug to me, is it?
> (my project actually confirms it - omake does not want to compile libraries
> needed for the target executable)

That depends on how you use LIBS when compiling C.  The current C.om
and documentation seems to assume that you only ever use static
libraries, and that you link them by including the library file names
on the linker command line.

The normal way to link libraries (on UNIX) is to use the -l flag.  And
if you set LIBS=-lfoo -lbar, you obviously don't want to depend on
$(LIBS) directly.  Some of these libraries are often system libraries
anyway, and there's no point in depending on those if omake doesn't
track them.  And for the libraries that are part of the project, you
have to search for them by looking at -L flags and $(getenv
LD_LIBRARY_PATH).

There is also a variable LDFLAGS in C.om, but that is included on the
linker command line *after* LIBS, so obviously that isn't meant to be
used as the place to put -L flags.  So LIBS will have to contain those
too.

I think there is room for improvement in C.om.

-- 
David Kågedal



More information about the Omake mailing list