Commit Graph

150 Commits (bdd9ca391e3a56253d7480b07bb1a8aac361904c)

Author SHA1 Message Date
Sébastien Hinderer bdd9ca391e Add the $(EXE) suffix to all programs at build rather than install time
This commit touches neither boot/ocamlc nor boot/ocamllex

It has the side-effect of fixing the cleanup rules which did not use the
$(EXE) extension when removing a file although it was produced with the
$(EXE) extension.
2020-06-18 11:16:55 +02:00
Sébastien Hinderer 41e4dc1dc8 tools/Makefile: stop considering ocamldep and cvt_emit as precious 2020-06-18 11:13:12 +02:00
octachron 0963b0c6b6 Restore ocamloptp 2020-05-14 10:11:42 +02:00
Gabriel Scherer fab58a938a makefiles: move the inclusion of Makefile.build_config in Makefile.common 2020-05-06 12:10:02 +02:00
David Allsopp 3a40b2fd94 Introduce Makefile.build_config.in
This moves the configure-generated parts of Makefile.common to a
separate (generated) Makefile, allowing Makefile.common to be a normal
Makefile.

OCaml's build system Makefile's now include Makefile.build_config (which
itself includes Makefile.config) but Makefile.config is still installed
as before. This allows configure to generate variables which are
specific to the build process and are not intended to be exported to the
installation.
2020-04-17 13:53:49 +01:00
Enguerrand Decorne b7f0494df5 Rewrite the instrumented runtime to store traces in the CTF format.
The instrumentation code in the instrumented runtime was replaced
with new APIs to gather runtime statistics and output them in a new format
(Common Trace Format).
This commit also exposes new functions in the Gc module to pause or resume
instrumentation during a program execution (Gc.eventlog_pause and
Gc.eventlog_resume).
2020-04-30 10:32:01 +02:00
David Allsopp 13786d7d12 Ensure make distclean works on an unconfigured tree 2019-10-15 11:46:36 +01:00
David Allsopp d4a566573f Allow make to be invoked before configure
This should be improved to give better warnings for when Makefile.config
and Makefile.common are required.
2018-12-04 10:28:36 +00:00
Nicolás Ojeda Bär 57d329e07b
Deprecate -annot (#2141)
* Move driver code from Cmt2annot to Read_cmt
* Move cmt2annot.ml into typing/
* make depend
* Use standard error handling
* Move specific logic to read_cmt
* Do not pass full cmt record as argument
* Better locations
* Emit .annot files produced from cmt data
* Remove direct calls to Stypes
* Deprecate -annot
* Changes
* make depend
* Adapt doc
* make -C tools depend
2020-03-13 12:59:34 +01:00
Sébastien Hinderer a831ba1adc objinfo_hellper fix
This commit modifies objinfo_helper so that the caml_plugin_header
symbol is also looked up in the static symbol table, if it is
not found in the dynamic one.

This is useful e.g. on Windows where the symbol can not be found
without this commit.

It is also necessary to look for the _-prefixed version of the symbol.
2019-12-17 10:10:14 +01:00
Gabriel Scherer 5fc29e52a4
Merge pull request #8992 from Octachron/shared_args
Share argument implementations
2019-10-01 12:08:54 +02:00
Jacques Garrigue 1e895dbaee
Allow compiling ocamldoc with -principal (#8955)
Also solves issue #6922
2019-09-30 21:14:06 +02:00
Florian Angeletti a509157eb9 share argument implementation across executable
This commit defines five default argument modules in
Main_args.default. Those modules provide a default implementation
for the argument of ocaml, ocamlnat, ocamlc, ocamlopt, ocamldoc,
ocamlcp, ocamloptp, and expect_test.

Grouping together those implementations allow to share as much as
possible similar implementation across executables. It should make
easier to keep synchronized the various implementation, or reuse
those implementation in alternative drivers.
2019-09-30 15:56:40 +02:00
David Allsopp 705739fa54 Fix failure to install tools links
In --disable-installing-bytecode-programs mode, the .opt version of the
tools is installed, but the symlink for the tool itself is not created.
2019-09-29 13:57:15 +01:00
Sébastien Hinderer e3b33a5750 Build system: introduce the BFD_LDFLAGS variable
This variable is not really used yet but will be used soon.
2019-09-23 14:45:54 +02:00
Sébastien Hinderer 762fe0abaa Build system: rename the LIBBFD_INCLUDE variable to BFD_CPPFLAGS 2019-09-23 14:45:54 +02:00
Sébastien Hinderer d718cd9db3 Build system: rename the LIBBFD_LINK variable to BFD_LDFLAGS 2019-09-23 14:45:54 +02:00
Sébastien Hinderer 5ec649f0cb
Build system: share rules to compile C files (#8930)
This commit deduplicates some of the Makefile rules used to compile C files.

Rather than having one such rule per Makefile for each directory
containing C files, the relevant rules are moved to Makefile.common.in.
2019-09-11 09:16:15 +02:00
Valentin Gatien-Baron f40011556c in -dtimings output, show time spent in C linker clearly 2019-08-26 07:58:28 +02:00
Sébastien Hinderer 3e52e4e6a8 Remove the scrapelabels and addlabels tools 2019-05-07 11:49:44 +02:00
Sébastien Hinderer 6f2d142df2 Remove the ocaml299to3 tool 2019-05-07 11:49:44 +02:00
Sébastien Hinderer a201ade7f3 Build system: make ocamllex silent by default (#8664)
This commit makes e.g. make -s world.opt completely
silent when everything works, in order to increase the visibility of
any unexpected message occurring during the build.
This will be useful for instance during CI, in particular it should
make it easier to catch undefined build variables.

The implementation is straightforward. The OCAMLLEX_FLAGS variable is
defined in Makefile.common.in and then used consistently by all
lexing recipes.

In addition, in tools/Makefile, the two rules producing the lexers
from cvt_emit.mll and make_opcodes.mll have been replaced by a
pattern-rule and the useless .SUFFIXES target has been removed.
2019-05-07 11:32:05 +02:00
Mark Shinwell 72ea849d2a
Move some middle-end files around (#2281)
* Various file moves in the middle end: this is the first stage of improving separation between the middle end and backend.
* Creation of file_formats/ directory (with associated file moves) to hold the definitions of compilation artifact formats.
* Creation of lambda/ directory (with associated file moves) to hold Lambda language definition files, transformation passes and construction passes from Typedtree.
* Disable (hopefully temporarily) dynlink, debugger and ocamldoc for the dune build.
2019-04-01 17:18:47 +01:00
Stephen Dolan 46c427f519 Use boot/ocamlc.opt for building, if available. 2019-03-20 10:31:46 +00:00
Mark Shinwell 2cc1ea26b9 Remove gprof support (#2314)
This commit removes support for gprof-based profiling (the -p option to ocamlopt).  It follows a discussion on the core developers' list, which indicated that removing gprof support was a reasonable thing to do. The rationale is that there are better easy-to-use profilers out there now, such as perf for Linux and Instruments on macOS; and the gprof support has always been patchy across targets. We save a whole build of the runtime and simplify some other parts of the codebase by removing it.
2019-03-16 19:56:53 +01:00
Jeremie Dimino 7e0862a212 Refactor load path management and initial environment
- Add a Load_path module which caches files lookup

- Instead of falling back to the external environment, allow to
  declare in the environment that a module comes from the external
  world. This allows persistent structures to shadows non-persistent
  ones
2019-01-30 16:36:38 +00:00
David Allsopp 832db132d9 Make unix, vmthreads and str optional libraries
--disable-unix-lib, --disable-vmthreads and --disable-str-lib added to
prevent building these three libraries.

ocamldoc, the debugger and caml-tex are automatically disabled if their
prerequisites are not built. Using --enable-debugger and
--enable-ocamldoc will result in errors if these tools cannot be built.
2019-01-08 17:27:42 +01:00
Sébastien Hinderer 8550f71441 Build system: use $(ROOTDIR) rather than hardcoded paths to access ocamlc 2019-01-03 17:02:25 +01:00
Sébastien Hinderer d258bb78ac Build system: use ocamlc -depend rather than ocamldep 2019-01-03 16:43:23 +01:00
Gabriel Scherer 46ef054330 Makefiles: restructure CAMLDEP usage to easily add flags
This change should be a refactoring no-op.

Before, a DEPFLAGS variable existed in some makefiles to contain
include directories to be passed to ocamldep invocations, but no
support for easily adding command-line flags to ocamldep was available
(invocations would systematically use -slash, which was duplicated
across callsites).

With this PR, a new DEPINCLUDES variable contains the include
directories, and DEPFLAGS is repurposed to contain other command-line
flags for the tool -- currently "slash".
2018-12-12 09:30:55 +01:00
alainfrisch 0d968e357b Move variable printer to Pprintast
- The code responsible for printing Syntaxerr errors is moved to the
  Parse module (so that it can depend on the variable printer in
  Pprintast).

- Pprintast becomes a dependency for a few tools that link some
  compiler modules in an ad hoc way (they would better be implemented
  in terms of compiler-libs).
2018-11-06 13:12:54 +01:00
Sébastien Hinderer b799715cae tools: move the definition of mklib from ocamlmklibconfig.ml to ocamlmklib.ml 2018-10-23 09:01:29 +02:00
Mark Shinwell 2b5f13c913 GPR#2056 (Backend_var) 2018-09-28 17:59:01 +02:00
Sébastien Hinderer ba6362a07d Move config/Makefile to Makefile.config
In order to prepare the transition to autoconf, this commit moves the
configuration Makefile out of the config directory which will disappear
and gives it the name it will have once intstalled, namely Makefile.config.
2018-09-17 14:23:35 +02:00
David Allsopp b069f692b4 Remove space from end of FLEXLINK_ENV 2018-09-07 08:34:53 +02:00
David Allsopp ad07b6d9b5 Use $(addprefix ...) and spacing adjustments 2018-09-07 08:34:53 +02:00
David Allsopp 4756a576f0 Move FLEXLINK_ENV definition to Makefile.common 2018-09-07 08:34:53 +02:00
David Allsopp cd64e2ac33 Always use ROOTDIR in tools Makefile 2018-09-07 08:34:53 +02:00
David Allsopp c13c200f87 Standardise setting and use of OCAML_FLEXLINK
Some Makefiles were using export to set OCAML_FLEXLINK "globally" while
others set a variable FLEXLINK_ENV and set the environment explicitly.

All Makefiles now use FLEXLINK_ENV and also only invoke it on linking
commands (rather than, for example, all invocations of ocamlopt).
2018-09-07 08:34:53 +02:00
Gabriel Scherer ac265e9ea3 (minor) remove unused CAMLYACC variables 2018-09-01 23:17:06 +02:00
Gabriel Scherer d09349f631 rename parsing/parser_menhir into parsing/parser 2018-09-01 23:17:06 +02:00
Gabriel Scherer f571282d7d menhir parser: rename MenhirLib into CamlinternalMenhirLib
The goal of this change is to avoid conflicts encountered by
compiler-libs users that would also use their own MenhirLib runtime
for their own parsers.

I first tried to implement a solution to this module-name-conflict
issue using module aliases and -open, but this proven too fragile and
too difficult to get right.
2018-09-01 23:17:04 +02:00
Gabriel Scherer 9a38c848fc Setup and use a Menhir parser for the OCaml grammar (REBASE POINT)
Uses the new $symbolstartpos feature of Menhir
to get locations identical to the OCamlYacc ones.

REBASE POINT: at the point of this commit, using a diff program
on parser.mly and parser_menhir.mlyp should give identical results
after the header code. If you rebase the Menhir-parser patchset
against a newer ocamlyacc parser (parser.mly), those two files
will have diverged, and you need to merge the parser.mly change
back into parser_menhir.mlyp -- and then deal with them in the
rest of the patch series.
2018-09-01 23:17:03 +02:00
Gabriel Scherer d5af6d972f caml_etex: use the location of the attribute, now available 2018-08-27 07:42:31 +02:00
Xavier Clerc 7e29162582 Pass the elements from `BUILD_PATH_PREFIX_MAP` to the assembler (#1930) 2018-07-27 12:25:23 +02:00
Florian Angeletti 4be6cafcc3
manual, code example preprocessor : full conversion to compiler-libs (#1863)
* manual tools: use toploop directly in caml_tex2
* manual tool: improved error messages
* manual: always print errors and warnings
* fix nefarious interaction with GPR#1120
* move manual/tools/caml_tex2 to tools/caml_tex
* Basic text for caml-tex
2018-07-25 10:38:08 +02:00
Nicolás Ojeda Bär 84bc3621b4 Build tools with debugging information 2018-07-24 13:39:39 +02:00
Gabriel Radanne 1be47bf7ab Just some tbl things. (#1699) 2018-07-23 13:19:41 +01:00
Sébastien Hinderer d3e73595e5 Merge the asmrun and byterun directories into the runtime directory 2018-06-28 17:50:33 +02:00
Gabriel Scherer f3aca2376f
Merge pull request #1821 from gasche/makefiles-consistent-opt-targets
Makefiles: consistently offer `allopt` and `opt.opt` targets
2018-06-24 00:46:50 +02:00