Commit Graph

681 Commits (ac2a9dd188f0738a87018f5ee6e6b0b301bb1b63)

Author SHA1 Message Date
David Allsopp ac2a9dd188 Cease committing C dependendency information
When building for the first time, the only requirement is that generated
header files have been built (jumptbl.h, version.h and opnames.h).
Detailed dependency information is only required when headers have been
edited.

COMPUTE_DEPS in Makefile.config controls whether C dependency
information should be generated on a per-file basis. This variable is
controlled by a new --disable-dependency-generation in configure which
is enabled for Git checkouts and disabled for tarballs (i.e. releases).

The Microsoft C compiler (cl) cannot generate dependencies in a
consistent way which we can consume, so for a Git checkout configure
searches for an additional C compiler in order to compute dependencies.
This is obviously not required for a user-build.

As a result, the MSVC port can now safely run make alldepend, since only
OCaml dependency information is committed to the repo after this change.

CI does not need to waste time testing the dependency information,
because it only tests a single build. A single Travis job has been added
which tests the build system code to generate the dependency information
(and provides a single `make -j` run in CI, although Inria's CI also
tests parallel building continuously).
2020-04-17 14:11:22 +01: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
Nicolás Ojeda Bär 8f3833c4d0
Add RISC-V native-code backend (#9441)
This is a port of ocamlopt for the RISC-V processor in 64-bit mode.
2020-04-24 16:04:50 +02:00
Greta Yorsh b823c8d8fc Remove stray newlines 2020-04-20 13:56:53 +01:00
Greta Yorsh 44af4aea7c Check FUNCTION_SECTIONS in Makefile.common.in to update OPTCOMPFLAGS 2020-04-20 13:56:53 +01:00
Greta Yorsh 7465e9f2c7 Define OPTCOMPFLAGS in Makefile.common.in 2020-04-20 13:56:53 +01:00
David Allsopp 9c5d7c1112 Correct implementation of --disable-stdlib-manpages 2020-02-26 15:07:17 +00:00
David Allsopp a2ddf5571b Only enable for required targets 2019-10-15 12:04:19 +01:00
David Allsopp 13786d7d12 Ensure make distclean works on an unconfigured tree 2019-10-15 11:46:36 +01:00
David Allsopp b1c78c041f Clean-up autoconf files in make distclean 2018-12-04 11:01:52 +00:00
David Allsopp 91913bc505 autogen -> make configure 2018-12-04 10:29:02 +00: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
David Allsopp b03c1c78c7 Add --disable-ocamltest 2020-01-16 16:50:27 +00:00
Gabriel Scherer cfb67f8153 Makefile: move the targets for compilerlibs archives to an included Makefie 2019-12-26 14:32:33 +01:00
David Allsopp 9ebb105797 Display the configure error once in make -j 2019-11-12 12:52:41 +00:00
Gabriel Scherer b0d1d6084c Makefile: install all compiler-libs archives instead of a manual listing
The issue #9050 comes (partly) from #2281 forgetting to add the
compilerlibs/ocamlmiddleend archives in the installation target. The
present patch should solve this issue once and for all, by using
a wildcard to install all archives that have been built in
compilerlibs/, instead of using a manual listing.

Compared to trunk, the following extra files are installed in
$(LIBDIR)/compilerlibs: ocamlmiddleend.{a,cma,cmxa}. There are no
other changes in the installed-files list.
2019-10-29 18:07:51 +01:00
Thomas Refis 79f1c73462
Warn about unused functor parameters (#8891) 2019-10-14 11:11:01 +01:00
Gabriel Scherer 0bc3e66d9c Makefile: minor fix to the ocamltest rules
(make -C ocamltest) will run the first rule of the ocamltest Makefile,
which happens to be the 'all' rule. This is not robust to the addition
of new rules in some of the included Makefile, and indeed a previous
version of the previous commit broke it inadvertently.
2019-10-12 10:23:29 +02:00
David Allsopp 345fd4c3f9 Allow Git config options to be passed to configure
The Git configuration value ocaml.configure is now passed to the
configure script's arguments before $@ if (and only if) OCaml is being
configured from a Git clone.

This allows, for example:

- Developer-specific preferences (e.g. `--disable-ocamldoc` or
  `--disable-debug-runtime`)
- Automatic use of autoconf cach files (-C option)

It is implemented by inserting a test at the top of `configure`, which
is bypassed if `.git` doesn't exist.
2019-10-05 14:50:35 +01:00
Vincent Laviron 60f58174ba
Split cmmgen into generic cmm helpers and clambda-specific transformations (#1963) 2019-10-04 17:49:59 +02:00
David Allsopp fb6f58ea69
Merge pull request #8951 from shindere/make-default-target
Let make's default target build the compiler
2019-10-04 14:23:27 +01:00
Sébastien Hinderer 987b0814d7 Let make's default target build the compiler
This commit makes it possible to build the OCaml compiler according to
its configuration by simply runnning make. There is no need to specify
neither world nor world.opt explicitly, although the two targets
remain available.

This commit also introduces (and starts making use of) the
NATIVE_COMPILER build variable whosse value is true when the native
compiler is enabled and false otherwise.
2019-09-30 16:01:29 +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 4047336bfe Windows supports make reconfigure now 2019-09-29 15:44:53 +01:00
David Allsopp 7b078dedd8 check-parser-uptodate-or-warn.sh: improve shell script 2019-09-26 08:26:02 +02:00
David Allsopp 9490f7a89a check-parser-uptodate-or-warn.sh: Use make syntax for ignoring errors 2019-09-26 08:25:46 +02:00
Gabriel Scherer 3f77dade9f make check-parser-uptodate-or-warn.sh more robust to script failures 2019-09-25 15:01:07 +02:00
Jeremie Dimino 2d31ebfc8b Add support for [@@immediate64]
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2019-09-24 07:56:15 +01:00
Gabriel Scherer 3be535c273
Merge pull request #8870 from gretay-js/linear
Split Linearize into two modules
2019-09-09 11:26:20 +02:00
Greta Yorsh bf0a885d03 Install artifacts from asmcomp/debug 2019-09-06 16:07:34 +01:00
Greta Yorsh 0b6b544fcb Split Linearize into two modules
Separate the description of the IR from the transformations
performed on it by moving type declarations from linearize.ml
into their own file, called linear.ml.
2019-09-04 11:55:11 +01:00
Gabriel Scherer 2bbf7caa72 ocamldoc: build manpages explicitly in root Makefile 2019-08-30 09:57:18 +02:00
KC Sivaramakrishnan a84b20e601 Remove unnecessary prerequite from make rule for domainstate.mli 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan 8ab825d7e9 Fix makefile, gitignore and a stray extern declaration 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan f7920a127f Domain state works on Power64 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan b212aed0cb Make depend and fix typos 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan fc6f028492 Introduce domain state and steal exception pointer 2019-08-23 09:50:05 +05:30
Greta Yorsh 351edb49bb Add compile-time option -function-sections 2019-07-15 10:25:26 +01:00
David Allsopp 668055de77 Missing beforedepend dependencies for Menhir
Ensures that Menhir's sources are in place for a "from scratch"
`make alldepend`
2019-06-24 07:55:15 +01:00
Gabriel Scherer 8ba174facf Makefile: ocamllex does not depend on ocamlc, it uses BOOT_OCAMLC
It seems that the dependency was introduced in 1998
  87b17301f4
and it was already unnecessary at the time.
2019-06-24 08:17:58 +02:00
David Allsopp 93ee6b43b0
Move AST testing rules to Makefile.dev (#8743)
Makefile.dev is only included if a Git clone is detected.

make evaluates macros in target specifications when the Makefile is
read, which meant that the build-all-asts target caused `git ls-files`
to be called on every invocation of make. This tweaks it to be a
recursive call to make which puts the $(AST_FILES) macro in the recipe
where it is only evaluated when the target is requested.
2019-06-18 14:35:06 +01:00
David Allsopp 1fd3ddf8a0 Drop dependency utils/config.ml <-- Makefile
The recipe is trivial, so the dependency promotes unnecessary rebuilding.
2019-06-16 16:29:17 +02:00
David Allsopp 5231ae1283 Always build flexdll/flexlink.exe with camlheader 2019-06-10 11:17:54 +01:00
David Allsopp 627608a00a Missing -nostdlib options in flexdll bootstrap
If OCaml was already installed, camlheader would be used from the
installation when building the bytecode flexdll/flexlink.exe
2019-06-10 11:17:54 +01:00
Mark Shinwell 6cbdfad125 Move some code from Asmgen to the middle end directory etc. (#2288)
Followup to (#2281)
2019-05-10 15:11:22 +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
Xavier Leroy 01f2ac8d70 Check that native-code is supported in world.opt
Previously, if the native-code compiler is not supported
(e.g. because configure doesn't recognize the target architecture,
or is run with --disable-native-compiler), "make world.opt"
fails late and with a mysterious error message
(a warning about undeclared C functions in runtime/roots_nat.c
or runtime/backtrace_nat.c, typically).

This commit ensures that "make world.opt", "make opt" and "make opt.opt"
fail immediately with a meaningful error message if the native-code
compiler is not supported.

Note: in "world.opt", make sure that "checknative" is run, and only
then "coldstart"; don't run them in parallel.
2019-05-02 19:43:17 +02:00
Thomas Refis 8ee36fe2db turn off warning 40 2019-04-16 10:41:35 +01:00
Nicolás Ojeda Bär 8897fe60cc make clean: do not remove emacs backups 2019-04-10 14:18:04 +02:00