As META files are generated from META.in files, they should be cleaned by clean rules. Signed-off-by: Vincent Bernardoff <vincent.bernardoff@citrix.com> --- tools/ocaml/Makefile.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ocaml/Makefile.rules b/tools/ocaml/Makefile.rules index ff19067..5e6d81e 100644 --- a/tools/ocaml/Makefile.rules +++ b/tools/ocaml/Makefile.rules @@ -45,7 +45,7 @@ ALL_OCAML_OBJ_SOURCES=$(addsuffix .ml, $(ALL_OCAML_OBJS)) $(call quiet-command, $(OCAMLDEP) $(ALL_OCAML_OBJ_SOURCES) *.mli $o,MLDEP,) clean: $(CLEAN_HOOKS) - $(Q)rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot *.spot *.spit $(LIBS) $(PROGRAMS) $(GENERATED_FILES) .ocamldep.make + $(Q)rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot *.spot *.spit $(LIBS) $(PROGRAMS) $(GENERATED_FILES) .ocamldep.make META quiet-command = $(if $(V),$1,@printf " %-8s %s\n" "$2" "$3" && $1) -- 1.7.10.4
Vincent Bernardoff
2013-Apr-15 16:02 UTC
[PATCH v3 2/2] tools/ocaml: Fix library generation
* Summary of changes: - .cma are created by using ocamlc with the -dllib -l<libname> option that will make a bytecode OCaml program link against <libname> at runtime. The -cclib/-ccopt options are only used in "custom runtime" mode, which we do not use, so I removed them. I changed <libname>.so to -l<libname>, as ocamlc only supports (according to its documentation) arguments in the form -l<libname> for -dllib. - $(CC) -shared is used in lieu and place of $(OCAMLMKLIB). ocamlmklib do not provide enough flexibility for doing what we want, i.e. linking against specific .so libraries that we give in the command line. Using $(CC) directly addresses this issue. Signed-off-by: Vincent Bernardoff <vincent.bernardoff@citrix.com> --- tools/ocaml/Makefile.rules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ocaml/Makefile.rules b/tools/ocaml/Makefile.rules index 5e6d81e..1ff5e43 100644 --- a/tools/ocaml/Makefile.rules +++ b/tools/ocaml/Makefile.rules @@ -54,18 +54,18 @@ mk-caml-lib-bytecode = $(call quiet-command, $(OCAMLC) $(OCAMLCFLAGS) -a -o $1 $ mk-caml-stubs = $(call quiet-command, $(OCAMLMKLIB) -o `basename $1 .a` $2,MKLIB,$1) mk-caml-lib-stubs = \ - $(call quiet-command, $(AR) rcs $1 $2 && $(OCAMLMKLIB) -o `basename $1 .a | sed -e ''s/^lib//''` $2,MKLIB,$1) + $(call quiet-command, $(AR) rcs $1 $2 && $(CC) -shared -o dll`basename $1 .a | sed -e ''s/^lib//''`.so $2 $3,MKLIB,$1) # define a library target <name>.cmxa and <name>.cma define OCAML_LIBRARY_template $(1).cmxa: lib$(1)_stubs.a $(foreach obj,$($(1)_OBJS),$(obj).cmx) $(call mk-caml-lib-native,$$@, -cclib -l$(1)_stubs $(foreach lib,$(LIBS_$(1)),-cclib $(lib)), $(foreach obj,$($(1)_OBJS),$(obj).cmx)) $(1).cma: $(foreach obj,$($(1)_OBJS),$(obj).cmo) - $(call mk-caml-lib-bytecode,$$@, -dllib dll$(1)_stubs.so -cclib -l$(1)_stubs, $$+) + $(call mk-caml-lib-bytecode,$$@, -dllib -l$(1)_stubs, $$+) $(1)_stubs.a: $(foreach obj,$$($(1)_C_OBJS),$(obj).o) $(call mk-caml-stubs,$$@, $$+) lib$(1)_stubs.a: $(foreach obj,$($(1)_C_OBJS),$(obj).o) - $(call mk-caml-lib-stubs,$$@, $$+) + $(call mk-caml-lib-stubs,$$@, $$+, $(foreach lib,$(LIBS_$(1)),$(lib))) endef define OCAML_NOC_LIBRARY_template -- 1.7.10.4
On Mon, 2013-04-15 at 17:02 +0100, Vincent Bernardoff wrote:> As META files are generated from META.in files, they should be cleaned > by clean rules. > > Signed-off-by: Vincent Bernardoff <vincent.bernardoff@citrix.com>Acked + applied, thanks.