camlspotter avatar camlspotter committed 7887d74

cmt dependency problem...

Comments (0)

Files changed (1)

 # ==================================================================
 .PHONY: all install uninstall clean veryclean
 
+# Very clean
+# ======================================================================
+
+#| OCaml object files which are not real targets of OMake are not be
+# auto-cleaned away by ``omake clean``. This is not good in some situations
+# at linking.
+WithOCamlVeryClean() =
+    veryclean: 
+        rm -f *.cm* *.annot *.o *.a *.so *.exe *.byt *.opt *.run
+
 # Directories
 # =====================================================================
 
 #
 #  Todo: external C library
 MyOCamlPackage(library_name, files, cmodules, linkopts) =
+  WithOCamlVeryClean()
   AddLocalOCamlPackageDependencies()
   export # The above thing is local: need to be exported
 
 #      files
 #          OCaml module names (without .ml)
 MyOCamlTestProgram(name, files) =
+  WithOCamlVeryClean()
   AddLocalOCamlPackageDependencies()
   export # The above thing is local: need to be exported
 
 #          OCaml module names (without .ml)
 #  In addition to MyOCamlTestProgram, the binary is installed by omake install
 MyOCamlProgram(name, files) =
+  WithOCamlVeryClean()
   MyOCamlTestProgram($(name), $(files))
   export # The above thing is local: need to be exported
 
    return $(array $(PROG), $(BYTEPROG))
 
 MyOCamlTop(name, files) =
+  WithOCamlVeryClean()
   AddLocalOCamlPackageDependencies()
   export # The above thing is local: need to be exported
 
 #
 #   .. note :: Probably you should use MyOCamlPackage
 MyOCamlLibrary(library_name, files) =
+  WithOCamlVeryClean()
   AddLocalOCamlPackageDependencies()
   protected.CMIFILES = $(addsuffix .cmi, $(files))
   targets = $(OCamlLibrary $(library_name), $(files)) $(CMIFILES) $(glob i, *.mli) 
 
   if $(not $(defined NO_INSTALL))
     targets[] += META 
-    targets[] += $(addsuffix .cmt,  $(removesuffix $(glob i, $.cmo)))
-    targets[] += $(addsuffix .cmti, $(removesuffix $(glob i, $.mli)))
+    cmts =  $(addsuffix .cmt,  $(removesuffix $(glob i, *.cmo)))
+    cmts += $(addsuffix .cmti, $(removesuffix $(glob i, *.mli)))
     if $(defined INSTALLED)
       $(Installed $(library_name)): $(targets)
         $(OCAMLFIND) remove $(library_name)
         section:
-              $(OCAMLFIND) install $(library_name) $(targets)
+              $(OCAMLFIND) install $(library_name) $(targets) $(cmts)
               CreateInstalled($(library_name), $(targets))
 
       install: $(Installed $(library_name))
     else
       install: $(targets)
         $(OCAMLFIND) remove $(library_name)
-        $(OCAMLFIND) install $(library_name) $(targets)
+        $(OCAMLFIND) install $(library_name) $(targets) $(cmts)
 
       uninstall:
 	$(OCAMLFIND) remove $(library_name)
     mkdir $(dir) 
   return
 
-# Very clean
-# ======================================================================
-
-#| OCaml object files which are not real targets of OMake are not be
-# auto-cleaned away by ``omake clean``. This is not good in some situations
-# at linking.
-WithOCamlVeryClean() =
-    veryclean: 
-        rm -f *.cm* *.annot *.o *.a *.so *.exe *.byt *.opt *.run
-
 # Pa_ounit test
 # =======================================================================
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.