Commit Graph

667 Commits (475df06021264b22cf425500fe2503a06c38ba6f)

Author SHA1 Message Date
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
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
Isaac Avram 87f999734b Merge remote-tracking branch 'origin/trunk' into tast_iterator2 2019-03-25 13:49:04 -07:00
Isaac Avram 8468464354 Updated Makefile 2019-03-23 19:12:43 -07:00
Stephen Dolan f495bfb7cb
Merge pull request #8514 from stedolan/boot-ocamlc-opt
Use boot/ocamlc.opt for building, if available.
2019-03-22 12:22:14 +00:00
Stephen Dolan 46c427f519 Use boot/ocamlc.opt for building, if available. 2019-03-20 10:31:46 +00:00
Mark Shinwell dbede46c2e
Improve the packing mechanism used to build Dynlink (#2268) 2019-03-19 10:26:35 +00:00
Jérémie Dimino c413136fa3 Delete otherlib/{graph,win32graph} (#2318)
The Graphics library is now distributed as a separate package.
The sources are at https://github.com/ocaml/graphics .

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2019-03-18 15:05:57 +01:00
Mark Shinwell e3a62eef91
Add Compute_ranges pass (#2291) 2019-03-18 08:52:34 +00:00
Mark Shinwell 36c163248d Remove support for compiler plugins (#2276)
After consultation on the core developers' list I am proposing this patch to remove support for compiler plugins.

The main motivations for removing compiler plugins are:
- They are a potential security risk.
 - They increase the complexity of the build system and make maintenance of the Dynlink libraries more difficult (although actually, this complexity could probably be reduced after #2268 is merged).
 - Many applications of plugins should be able to be expressed by building custom compiler drivers that link against compilerlibs.

* Remove compiler plugins and hooks
* Add new function Dynlink.unsafe_get_global_symbol but keep it outside the documented API.
* Remove otherlibs/dynlink/nodynlink.ml
* Update Changes
2019-03-13 11:46:37 +01:00
Nicolás Ojeda Bär 612dbf1b74 Makefile: adapt to removal from vmthreads 2019-03-11 20:52:17 +01:00
Mark Shinwell 7cb0da58f1
Don't generate Clambda constants during Cmmgen, etc. (#2280) 2019-03-05 17:09:40 +00:00
David Allsopp 8831395f32 Move FLEXDLL_DIR definition to utils/Makefile (#2259)
Missed in d68e0e207. Fixes second part of MPR#7923.
2019-02-28 11:21:52 +01:00
Mark Shinwell 3133699187
Add bytecomp/opcodes.mli (#2265) 2019-02-26 16:17:38 +00:00
Gabriel Scherer 93f0ce31bb env refactoring: separate the cmi/crc handling into a persistent_env module
Persistent_env is a new module that handles the relation between the
type-checking state and the "persistent" typing information laying in
.cmi files on the filesystem. In particular, it handles the collection
and production of CRC information for the .cmi files being read and
written to the filesystem; the using modules (in our case, only Env)
are in charge of turning the cmi files into higher-level information
(components and signatures).

Persistent_env exposes a type `'a t` of a persistent environment,
which acts as a mutable store of `'a` values. There is no global state
in the module itself: while Env (and thus the OCaml type-checker) uses
a single global persistent environment, it should be possible to
create several independent environments to represent, for example,
several independent type-checking sessions.
2019-02-18 17:02:47 +01:00