Commits

camlspotter  committed 8fbbfe6

omakefile

  • Participants
  • Parent commits 5f6235f

Comments (0)

Files changed (1)

 # Spot files (OCamlSpotter)
 # ==================================================================
 
+#| OCAML_SPOT is true if the compiler supports ocamlspot
+OCAML_SPOT = false
+match $(shell $(OCamlC) -version)
+case $"ocamlspot"
+  OCAML_SPOT = true 
+
 #| Define OCAML_ANNOT so that custom ocamlc/ocamlopt automatically create spot/spit/annot files, even without -annot option.
 setenv(OCAML_ANNOT, 1)
 
    protected.BYTE_TARGETS   = $(CMO)
    protected.NATIVE_TARGETS = $(CMX) $(OBJ)
 
-   if $(BYTE_ENABLED)
-      BYTE_TARGETS += $(file $(name).spot)
-      export
-   else
-      NATIVE_TARGETS += $(file $(name).spot)
-      export
+   if $(OCAML_SPOT)
+       if $(BYTE_ENABLED)
+          BYTE_TARGETS += $(file $(name).spot)
+          export
+       else
+          NATIVE_TARGETS += $(file $(name).spot)
+          export
 
    protected.TARGETS = $(CMI)
    if $(NATIVE_ENABLED)
   ## 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).spot
+  targets[]=META $(glob i, *.mli) $(library_name).cmi $(library_name).cmo $(library_name).cmx $(library_name).cma $(library_name).cmxa $(library_name).o
+
+  if $(OCAML_SPOT)
+    targets[]+= $(library_name).spot
 
 
   $(BIG_ROOT)/installed/$(library_name): $(targets)