[Omake] building C binding library

Anastasia Gornostaeva ermine at ermine.pp.ru
Tue Sep 18 12:24:46 PDT 2007


On Tue, Sep 18, 2007 at 10:01:33PM +0400, Anastasia Gornostaeva wrote:

> > >> section
> > >>    CFILES = mczlib_stub$(EXT_OBJ)
> > >>    OCAML_LINK_FLAGS += -cclib -lz $(CFILES)
> > >>    OCAMLLIBS = $(OCamlLibrary mlzlib, mlzlib)
> > >>    $(OCAMLLIBS): $(CFILES)
> > >>    .DEFAULT: $(OCAMLLIBS)
> 
> [zip]
> 
> s/OCAML_LINK_FLAGS/OCAML_LIBS_FLAGS/
> Okay, thanks, I get it compiled.
> 
> But I cannot link another programs against such library: a linker cannot
> find mlzlib_stub.a, if those programms are not in a directory where library is.

I've won:

FILES = mlzlib
LIB = mlzlib

section
   CCLIB = $(StaticCLibrary libmlzlib_stub, mlzlib_stub)
   OCAML_LIB_FLAGS += -cclib -lz -cclib -lmlzlib_stub
   OCAMLLIBS = $(OCamlLibrary $(LIB), $(FILES))
   $(OCAMLLIBS): $(CCLIB)
   .DEFAULT: $(LIB)$(EXT_LIB)

It is interesting, if it will work on any platform?

Thanks all very much.
ermine



More information about the Omake mailing list