+endif
+
+
+##===- Build stub library from C sources ----------------------------------===##
+
+ifdef SharedLib
+all-local:: $(SharedLib)
+clean-local:: clean-shared
+install-local:: install-shared
+uninstall-local:: uninstall-shared
+
+$(SharedLib): $(ObjectsO) $(OcamlDir)/.dir
+ $(Echo) "Building $(BuildMode) $(notdir $@)"
+ $(Verb) $(Link) $(SharedLinkOptions) $(OCAMLRPATH) $(LLVMLibsOptions) \
+ -o $@ $(ObjectsO)
+
+clean-shared::
+ -$(Verb) $(RM) -f $(SharedLib)
+
+install-shared:: $(SharedLib)
+ $(Echo) "Installing $(BuildMode) $(DestSharedLib)"
+ $(Verb) $(MKDIR) $(PROJ_libocamldir)
+ $(Verb) $(INSTALL) $(SharedLib) $(DestSharedLib)
+ $(Verb)
+
+uninstall-shared::
+ $(Echo) "Uninstalling $(DestSharedLib)"
+ -$(Verb) $(RM) -f $(DestSharedLib)
+endif
+
+
+##===- Deposit dependent libraries adjacent to Ocaml libs -----------------===##
+
+all-local:: build-deplibs
+clean-local:: clean-deplibs
+install-local:: install-deplibs
+uninstall-local:: uninstall-deplibs
+
+build-deplibs: $(OutputLibs)
+
+$(OcamlDir)/%.a: $(LibDir)/%.a
+ $(Verb) ln -sf $< $@
+
+$(OcamlDir)/%.o: $(LibDir)/%.o
+ $(Verb) ln -sf $< $@
+
+clean-deplibs:
+ $(Verb) $(RM) -f $(OutputLibs)
+
+install-deplibs:
+ $(Verb) $(MKDIR) $(PROJ_libocamldir)
+ $(Verb) for i in $(DestLibs:$(PROJ_libocamldir)/%=%); do \
+ ln -sf "$(PROJ_libdir)/$$i" "$(PROJ_libocamldir)/$$i"; \
+ done
+
+uninstall-deplibs:
+ $(Verb) $(RM) -f $(DestLibs)