Finish removing DestroySource.
[oota-llvm.git] / bindings / ocaml / Makefile.ocaml
index 387b85159e7167a87eb15d486f67ee211332cf63..ac719de3a5b62dbb9f98d0411daada2cf32e225b 100644 (file)
@@ -81,7 +81,7 @@ OCAMLAFLAGS += $(patsubst %,-cclib %, \
 endif
 endif
 
-ifneq ($(ENABLE_OPTIMIZED),1)
+ifneq ($(DEBUG_SYMBOLS),1)
   OCAMLDEBUGFLAG := -g
 endif
 
@@ -90,8 +90,9 @@ Compile.CMO  := $(strip $(OCAMLFIND) c -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
 Compile.CMX  := $(strip $(OCAMLFIND) opt -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
 
 ifdef OCAMLSTUBS
-Archive.CMA  := $(strip $(OCAMLFIND) c -a -dllib -l$(LIBRARYNAME) $(OCAMLDEBUGFLAG) \
-                                       -o)
+# -dllib is engaged with ocamlc builds, $(OCAMLSTUBFLAGS) in ocamlc -custom builds.
+Archive.CMA  := $(strip $(OCAMLFIND) c -a -dllib -l$(LIBRARYNAME) $(OCAMLSTUBFLAGS) \
+                                                                                                                                                        $(OCAMLDEBUGFLAG) -o)
 else
 Archive.CMA  := $(strip $(OCAMLFIND) c -a -custom $(OCAMLAFLAGS) $(OCAMLDEBUGFLAG) \
                                        -o)
@@ -236,8 +237,8 @@ uninstall-local:: uninstall-shared
 
 $(SharedLib): $(ObjectsO) $(OcamlDir)/.dir
        $(Echo) "Building $(BuildMode) $(notdir $@)"
-       $(Verb) $(Link) $(SharedLinkOptions) $(OCAMLRPATH) $(LLVMLibsOptions) \
-                       -o $@ $(ObjectsO)
+       $(Verb) $(Link) $(SharedLinkOptions) $(OCAMLRPATH) -o $@ $(ObjectsO) \
+                       $(LLVMLibsOptions)
 
 clean-shared::
        -$(Verb) $(RM) -f $(SharedLib)