diff options
author | David Allsopp <david.allsopp@metastack.com> | 2022-03-01 16:26:34 +0000 |
---|---|---|
committer | David Allsopp <david.allsopp@metastack.com> | 2022-05-04 15:56:27 +0100 |
commit | a805f1f140d08acfc72402ee1225d2d796fffdc5 (patch) | |
tree | 871be3d2d05f1fb02680a16a93e7322a0dfaea00 /tools | |
parent | dd44a25f05f3b789f8a0154a211d9afbb6df0082 (diff) | |
download | ocaml-a805f1f140d08acfc72402ee1225d2d796fffdc5.tar.gz |
Install Profiling support module separately
ocamlcp and ocamloptp specify -I +profiling
Diffstat (limited to 'tools')
-rw-r--r-- | tools/Makefile | 12 | ||||
-rw-r--r-- | tools/ocamlcp.ml | 10 | ||||
-rw-r--r-- | tools/ocamloptp.ml | 10 |
3 files changed, 19 insertions, 13 deletions
diff --git a/tools/Makefile b/tools/Makefile index eff3f9d379..b4d805384f 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -109,20 +109,26 @@ ocamloptp.opt$(EXE): $(call byte2native, $(OCAMLCP) ocamloptp.cmo) opt:: profiling.cmx +INSTALL_LIBDIR_PROFILING = $(INSTALL_LIBDIR)/profiling + install:: +# If installing over a previous OCaml version, ensure the module is removed +# from the previous installation. + rm -f "$(INSTALL_LIBDIR)"/profiling.cm* "$(INSTALL_LIBDIR)/profiling.$(O)" + $(MKDIR) "$(INSTALL_LIBDIR_PROFILING)" $(INSTALL_DATA) \ profiling.cmi profiling.cmo \ - "$(INSTALL_LIBDIR)" + "$(INSTALL_LIBDIR_PROFILING)" ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true" $(INSTALL_DATA) \ profiling.cmt profiling.cmti \ - "$(INSTALL_LIBDIR)" + "$(INSTALL_LIBDIR_PROFILING)" endif installopt:: $(INSTALL_DATA) \ profiling.cmx profiling.$(O) \ - "$(INSTALL_LIBDIR)" + "$(INSTALL_LIBDIR_PROFILING)" # To help building mixed-mode libraries (OCaml + C) OCAMLMKLIB = config.cmo build_path_prefix_map.cmo misc.cmo ocamlmklib.cmo diff --git a/tools/ocamlcp.ml b/tools/ocamlcp.ml index 595a742328..2664a9d918 100644 --- a/tools/ocamlcp.ml +++ b/tools/ocamlcp.ml @@ -84,10 +84,10 @@ end; if !with_impl then rev_profargs := "-impl" :: !rev_profargs; if !with_intf then rev_profargs := "-intf" :: !rev_profargs; let status = - Sys.command - (Printf.sprintf "ocamlc -pp \"ocamlprof -instrument %s\" %s %s" - (String.concat " " (List.rev !rev_profargs)) - (if !make_archive then "" else "profiling.cmo") - (String.concat " " (List.rev !rev_compargs))) + ksprintf Sys.command + "ocamlc -pp \"ocamlprof -instrument %s\" -I +profiling %s %s" + (String.concat " " (List.rev !rev_profargs)) + (if !make_archive then "" else "profiling.cmo") + (String.concat " " (List.rev !rev_compargs)) in exit status diff --git a/tools/ocamloptp.ml b/tools/ocamloptp.ml index 397c421b96..8ca381cdf1 100644 --- a/tools/ocamloptp.ml +++ b/tools/ocamloptp.ml @@ -85,10 +85,10 @@ end; if !with_impl then rev_profargs := "-impl" :: !rev_profargs; if !with_intf then rev_profargs := "-intf" :: !rev_profargs; let status = - Sys.command - (Printf.sprintf "ocamlopt -pp \"ocamlprof -instrument %s\" %s %s" - (String.concat " " (List.rev !rev_profargs)) - (if !make_archive then "" else "profiling.cmx") - (String.concat " " (List.rev !rev_compargs))) + ksprintf Sys.command + "ocamlopt -pp \"ocamlprof -instrument %s\" -I +profiling %s %s" + (String.concat " " (List.rev !rev_profargs)) + (if !make_archive then "" else "profiling.cmx") + (String.concat " " (List.rev !rev_compargs)) in exit status |