camlspotter avatar camlspotter committed ce0d1c6

auto update of OMyMakefile

Comments (0)

Files changed (1)

   else
       return $(array)
 
-#|Create md5 sum file of $(targets)
+#|Create md5 sum file of files $(targets)
 CreateCheckSum(pack, targets)=
     chan=$(fopen $(pack), w)
     fprintln($(chan), $(string $(targets)))
         println(dump md5 $(INSTALLED)/$(pack))
         CreateCheckSum($(INSTALLED)/$(pack), $(targets))
 
-# Misc tools
-# ======================================================================
-
-#|ditto.
-mkdir_if_not_exists(dir) =
-  if $(not $(test -e $(dir))):
-    mkdir $(dir) 
-  return
-
 # OCaml -where
 # ========================================================================
 
 #   Subdirs()
 #
 # It includes "findlib" by default. If you want to build findlib in OMy framework, you have to remove it from the list.
-OCAML_PREINSTALLED_PACKS[]= bigarray camlp4 dbm dynlink graphics num num-top stdlib str threads unix findlib compiler-libs
+OCAML_PREINSTALLED_PACKS[]= bigarray camlp4 dbm dynlink graphics num num-top stdlib str threads unix findlib compiler-libs compiler-libs.common
 
-# byte/nat
+#|If set false in a project directory, native/byte compilation is disabled locally.
 NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
-#|If set false in a project directory, byte compilation is disabled there.
 BYTE_ENABLED = true
 
 ######################### Compiler
 
+#|Never use OCAMLFLAGS += ... to override this default. Redefine as OCAMLFLAGS = ...
 OCAMLFLAGS = -w A-4-9 -warn-error A-4-9
 
 OCAMLPACKAGEFLAGS=
     value $(OCAMLFIND) $(OCAMLOPT) $(OCAMLPACKAGEFLAGS) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS)\
               $(OCAMLOPTFLAGS) $(OCAMLPPFLAGS) $(PREFIXED_OCAMLINCLUDES)
 
-# Spot files (OCamlSpotter)
-# ==================================================================
-
-#| OCAML_SPOT is true if the compiler supports ocamlspot
-OCAML_SPOT = false
-match $(string $(shell ocamlc -version)) # We cannot use OCamlC since there may not be ocamlfind
-case $"ocamlspot"
-  OCAML_SPOT = true 
-  export
-
-#| Define OCAML_ANNOT so that custom ocamlc/ocamlopt automatically create spot/spit/annot files, even without -annot option.
+#| Define OCAML_ANNOT so that custom ocamlc/ocamlopt automatically create spot/spit/annot/cmt/cmti files, even without -annot/-bin-annot option. This requires a special compiler patch 
 setenv(OCAML_ANNOT, 1)
+setenv(OCAMLRUNPARAM, b)
 
 # Additional implicit rules by file extensions
 
 # annot, spot, spit files
-%.annot %.spot: %.ml %.cmi
+%.annot %.spot %.cmt: %.ml %.cmi
 	$(OCamlC) -c $<
 
-%.spit: %.mli 
+%.spit %.cmti: %.mli 
 	$(OCamlC) -c $<
 
 # Packages
 #
 # .. note:: These functions introduce implicit rules: *you may need to export it, if you use this function in a local context.*
 OCamlRequire(files) =
-    %.cmx %.cmo %.cmi %.cma %.cmxa %.annot %.spot %.spit : $(files)
+    %.cmx %.cmo %.cmi %.cma %.cmxa %.annot %.spot %.spit %.cmt %.cmti: $(files)
     export
 
 #|Add dependencies of OCaml compiled files (cmx, cmo, etc.) over $(packages).
 OCamlRequirePackages(packages) =
     required_packs = $(OMyManagedPackages $(packages))
     if $(defined INSTALLED)
-      %.cmx %.cmo %.cmi %.cma %.cmxa %.annot %.spot %.spit : $(Installed $(required_packs))
+      %.cmx %.cmo %.cmi %.cma %.cmxa %.annot %.spot %.spit %.cmt %.cmti: $(Installed $(required_packs))
       export
     export
 
    protected.BYTE_TARGETS   = $(CMO)
    protected.NATIVE_TARGETS = $(CMX) $(OBJ)
 
-   if $(OCAML_SPOT)
-       if $(BYTE_ENABLED)
-          BYTE_TARGETS += $(file $(name).spot)
-          export
-       else
-          NATIVE_TARGETS += $(file $(name).spot)
-          export
-       export
+   if $(BYTE_ENABLED)
+      BYTE_TARGETS += $(file $(name).cmt)
+      export
+   else
+      NATIVE_TARGETS += $(file $(name).cmt)
+      export
+   export
 
    protected.TARGETS = $(CMI)
    if $(NATIVE_ENABLED)
   ## clean
   AutoClean()
   clean:
-	rm -f $(library_name).spot
+	rm -f $(library_name).spot $(library_name).cmt
 
   ## install
 
   # CR jfuruse: x.cmi is required if x.mli does not exist!
   targets[]=META $(glob i, *.mli) $(library_name).cmi $(library_name).cmo $(library_name).cmx $(library_name).cma $(library_name).cmxa $(library_name).o $(library_name).a $(CSTUBLIBRARIES) $(MyOCamlPackageExtras)
 
-  if $(OCAML_SPOT)
-    targets[]+= $(library_name).spot
+  targets[]+= $(library_name).cmt
 
   if $(defined INSTALLED)
     $(Installed $(library_name)): $(targets)
 #| Obtain files installed as PACK
 GET_OCAMLFIND_OBJS(pack)=
     return $(Files $(OCAMLFIND_DESTDIR)/$(pack))
+
+# Misc tools
+# ======================================================================
+
+#|ditto.
+mkdir_if_not_exists(dir) =
+  if $(not $(test -e $(dir))):
+    mkdir $(dir) 
+  return
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.