Commit Graph

698 Commits (master)

Author SHA1 Message Date
Thomas Refis e63e8421a1 move Rec_check out of typecore 2018-05-23 10:53:53 +01:00
Mark Shinwell 8054e4f819 Add configure option to not install ".byte" executables (#1776)
In environments where the executables compiled to native code,
such as ocamlopt.opt, are always used in preference to the bytecode
versions then space can be saved by not installing the latter.
This patch provides a configure option to do such. It is relatively lightly
engineered; in particular, it won't complain if the native code executables
aren't themselves being built; but given this is an option for knowledgeable
users we think that it is reasonable.
2018-05-14 10:44:01 +02:00
Mark Shinwell ea2d6a1e31
Add configure options to control installation of source artifacts (#1777) 2018-05-14 08:15:44 +01:00
Xavier Clerc d88dbba9a0 Flambda: Add [Closure_origin.t] to trace inlined functions (merged) (#1707) 2018-04-10 10:33:28 +01:00
Leo White 656aa42677 Organise and simplify translation of primitives 2018-04-09 13:00:01 +01:00
Leo White bc9f032e2a Reduce cmx sizes by sharing variable names (#1627) 2018-04-09 08:43:47 +01:00
Xavier Clerc 835cad1686 Further reduce the size of cmx files (flambda) (#1666) 2018-04-09 07:46:50 +01:00
Pierre Chambart 0a42259060 Turn flambda invariants checks off by default (#1686) 2018-04-06 09:49:57 +01:00
Nicolás Ojeda Bär ab16747647
Merge pull request #1537 from nojb/remove_boot_ocamldep
Remove boot/ocamldep
2018-03-29 21:47:41 +02:00
Gabriel Scherer 3702f53692 factorize common makefile definitions in Makefile.common 2018-03-29 17:04:05 +02:00
Gabriel Scherer afcd29eb0c makefiles: turn the 'install' command into a variable
(Suggestion made by Sébastien Hinderer during review.)
2018-03-29 14:40:23 +02:00
Gabriel Scherer 3a0c7d97f3 Makefile: rename INSTALL_FLEXDLL into INSTALL_FLEXDLLDIR for consistency 2018-03-29 14:40:23 +02:00
Gabriel Scherer ecfd39f127 makefiles: use 'install' instead of 'cp' in 'make install' targets
I can observe weird performance bottlenecks on my machine caused by
the use of 'cp' in the 'install' scripts of OCaml. When installing
into a directory that is already populated by an existing
installation, 'make install' can routinely take 10s on my machine¹. After this
change it reliably takes 1.5s, independently of whether the
destination is already populated or not.

¹: a brtfs filesystem on an old-ish SSD

Why I care
----------

An extra 10s delay due to 'make install' can be noticeable in tight
change-build-install-test feedback loops for a compiler change where
we change the compiler, have a fast 'make world.opt' due to
incremental builds, install the change and test it -- possibly after
installing a couple opam packages, which can be fairly quick.

Partial diagnosis
-----------------

The performance issue seems to be caused by the fact that 'cp' (at
least the GNU coreutils version), when the file already exists,
replaces it by opening it in writeonly+truncate mode and writing the
file content ('strace' shows that the delay is caused within an
'openat' call). In particular, using the --remove-destination option
(which changes 'cp' to just remove the destination file before
copying) removes the performance issue, but this option seems missing
from the BSD/OSX 'cp' so it could cause portability issue.

Change
------

The present commit rewrites the 'install' targets of all Makefiles to
use the 'install' command instead. 'install' by default gives
executable-like permission to the destination file, instead of reusing
the source file's permissions, so we specify manually the permission
modes, depending on whether the installed file is an executable (or
dynamically-linked library) or just data (including other compiled
object files).

Testing
-------

I checked manually that the permissions of the installed files are
identical to the ones of the current 'cp'-using targets, except for
some '.mli' file in middle_end which currently have +x bits enabled
for no good reason.

Remark: To test this, playing with the DESTDIR variable is very useful
(this lets you install to a new directory (or the same as before)
without having to re-run the configure script). I used the following,
fairly slow shell script to collect permissions:

    for f in $(find $DESTDIR); do \
      echo $(basename $f) $(ls -l $f | cut -d' ' -f1); \
    done | sort

Remark: it is important to run `sync` in-between 'make install' runs
to avoid timing effects due to filesystem or disk caching
strategies. I believe that this corresponds to the natural time delay
(and unrelated disk activity) that would occur in realistic
change-install-test feedback loops.
2018-03-29 14:40:22 +02:00
Nicolás Ojeda Bär 524907a2dc Use boot/ocamlc -depend instead of tools/ocamldep to make depend 2018-03-28 22:15:08 +02:00
Nicolas Ojeda Bar 1ec9e3aa7e Remove boot/ocamldep 2018-03-28 22:15:08 +02:00
Sébastien Hinderer 18b9e58710 Make it possible to control where test results are logged
This commit logs the output of running tests to the file given in
the TESTLOG build variable whose value defaults to _log.
2018-03-21 12:32:22 +01:00
Xavier Clerc 52919a7340 Make the `check_all_arches` target no-op on 32-bit architectures. (#1671) 2018-03-20 15:33:58 +00:00
Gabriel Scherer 0489cfaf9e build_path_prefix_map: update .depend and Makefiles 2018-03-01 17:41:28 +01:00
David Allsopp 34767a4bb3 Determine runtop includes using OTHERLIBRARIES 2018-02-25 11:24:38 +00:00
David Allsopp f8864d9ec2 Don't build opt.opt in natruntop 2018-02-25 10:13:16 +00:00
David Allsopp 87b5712eba Sync runtop and natruntop and add otherlibs
RUNTOP and NATRUNTOP now include the same directories and include all
the directories in otherlibs.
2018-02-25 10:13:15 +00:00
Jeremie Dimino 84304a3282 Core review work
- Apply the __ heuristic more systematically
- Update tests
- Fix Windows builds
2018-02-12 08:29:17 +00:00
Gabriel Scherer 3882302fa6
Merge pull request #1434 from damiendoligez/makefile-cleanup
Makefile cleanup
2017-12-10 17:14:12 +01:00
Thomas Refis 60c5f6fe91 parmatch: split pretty printing out into Printpat 2017-12-04 12:11:21 +00:00
Damien Doligez 1252941d4e fix Makefile bug for lintapidiff and add missing @since in stdlib/format.mli
(cherry picked from commit 4b323be96a920b6e65d948f700d8568029fa13dd)
2017-11-10 17:20:44 +01:00
David Allsopp 8b22c9af5d Refactor lintapidiff command for long-line 2017-10-25 23:54:39 +01:00
David Allsopp 11c3df41ed Tidy-up generation of utils/config.ml
Simultaneously deals with an overly-long line and also ensure that
backslashes would be escaped no matter which variables they happened to
appear in.
2017-10-25 23:54:39 +01:00
Damien Doligez af78f02368 take some reviewers' remarks into account 2017-10-19 17:15:52 +02:00
Damien Doligez 577badafee fix bootstrap instructions 2017-10-18 17:19:15 +02:00
Damien Doligez cc9b78917c clean up Makefile 2017-10-18 13:59:01 +02:00
Leo White 8f6c6aca92 Enable call counts in spacetime by default 2017-10-12 16:52:09 +01:00
Damien Doligez db88523db3 Fix flexdll section in README (#1359)
Fix flexdll section in `README.win32.adoc`.
Pass the whole OCaml config to the Flexdll Makefile instead of a few chosen variables.
2017-10-05 16:48:08 +02:00
Gabriel Scherer a202aa032b rename the configure-time safe-string options for clarity
-(un)safe-string becomes -(no-)force-safe-string
-(un)safe-string-default becomes -default-unsafe-string

Config.safe_string (and Clflags.unsafe_string) keep their name for
backward-compatibility, as well as the C define CAML_SAFE_STRING
(which corresponds to -force-safe-string).
2017-10-02 14:42:19 +02:00
Gabriel Scherer 6550a30719 safe-string: clarify the relation between configure- and compile-time options 2017-10-02 14:42:19 +02:00
Jacques Garrigue 70b02405e0 Merge pull request #1365 from yallop/let-rec-patch-406
GPR#556, PR#7215, PR#7231, PR#6738: Add a new check that 'let rec' bindings are well formed.
2017-09-22 15:37:10 +09:00
Nicolás Ojeda Bär 9fe6d0e2c2 Unicode support for the Windows runtime (#1200)
* Add support code

* Explicitly reference ANSI Windows APIs

* Adapt Sys.is_directory

* Adapt ocamlrun

* Add Changes entry

* Add testsuite

* Adapt Unix.open_process{_in,_out,_full,}, Unix.create_process{_env,}

* Adapt headernt.c

* Adapt Pervasives.open_{in,out}, Filename.temp_file, etc.

* Adapt Sys.file_exists

* Adapt Sys.remove

* Adapt Sys.chdir

* Adapt Sys.getcwd

* Adapt Sys.getenv

* Adapt Sys.command

* Adapt Sys.readdir

* Adapt CPLUGINS

* Remove use of FormatMessageA, CreateFileA

* Adapt Unix.mkdir

* Adapt Unix.openfile

* Adapt Unix.readlink

* Adapt Unix.rename

* Adapt Unix.{LargeFile,}.{l,}stat

* Adapt Unix.system

* Adapt Unix.{open,read}dir

* Adapt Unix.link

* Adapt Unix.symlink

* Adapt Unix.getcwd

* Adapt Unix.rmdir

* Adapt Unix.utimes

* Adapt Unix.unlink

* Adapt Unix.chdir

* Adapt Unix.chmod

* Adapt Unix.{execv,execve,execvp,execvpe}

* Compile with -DUNICODE -D_UNICODE under Windows

* Add configure-time switch, Config.windows_unicode

* Adapt Unix.putenv

* Re-implement Unix.environment using GetEnvironmentStrings()

* Use Unicode-aware flexdll

* Adapt Unix.environment

* AppVeyor: bootstrap flexdll

* Adapt tests/embedded/cmmain.c

* Adapt tests/lib-dynlink-csharp/entry.c

* Remove exec tests

* Fixup

* Pass -municode to MinGW compiler

* Try to fix tests/embedded

* Adapt Sys.rename

* Correct Changes entry

* Makefile.several: use $(O) and $(NATIVECODE_ONLY)

* Display => skipped correctly for tests/win-unicode

* Add missing casts to execv* calls

It's not clear why these aren't necessary for with char, but they are
necessary with wchar_t on GCC (but not MSVC).

* Missing header in systhreads (Win32 only)

* Revert "Pass -municode to MinGW compiler"

This reverts commit a4ce7fb319c429068a5b9d1ab14a2cc3969c355f.

* Revert "Try to fix tests/embedded"

This reverts commit 5197d8922295b7b339b970ec3189374aa15de4b8.

* Revert "Remove exec tests"

This reverts commit 306ccef2e79eca5b38ecfa285b912c7bcf3e9f52.

* Don't pass $(LDFLAGS) when build ocamlc.opt

It's already included via CC anyway, and it causes Unicode problems for
Winodws (because the linker options need to be prefixed "-link" to go via
flexlink).

* Use wmain on Windows for ocamlrun

* Build Unicode applications on Windows

* Use wmain in headernt.c

* Minor correction to win-unicode Makefile

* Switch submodule to FlexDLL 0.36

* Build ocamlyacc as an ANSI application

* Revert "Fixup"

This reverts commit 500bd6b575ffd6c5b71c6953e55d740f0b090185.

* Fix casts for execvp/execve

* Remove tabs from test code

* Fix Changes entry

* shell32.lib is no longer necessary

* Free allocated string

* Changes: signal breaking change

* Disable exec_tests

* Protect with CAML_INTERNALS
2017-09-18 17:41:29 +02:00
Sébastien Hinderer 77adbb0ae6 Integrate the build of ocamltest to the main build system
This commit ensures ocamltest.byte and ocamltest.opt get built along with
the other tools.
2017-09-18 17:40:14 +02:00
Leo White e1fd8d5d3a Merge pull request #1332 from bobot/fix_output_complete_obj
[OCamlc] fixes output-complete-object
2017-09-16 06:54:58 +01:00
François Bobot 1343658f5d [OCamlc] use OUTPUTOBJ and move CAML_INTERNAL
in the generated file instead of in the command line
2017-09-15 21:28:59 +02:00
Damien Doligez f086eda9c0 add -no-flat-float-array configure option 2017-09-15 18:24:36 +02:00
Mark Shinwell b65096678b Register availability analysis (#856) 2017-09-15 11:08:14 +01:00
Sébastien Hinderer 004dc6b018 Fix `make alldepend`: don't build dependencies for num (#1310)
This is a follow-up to PR #1178
2017-08-30 16:15:17 +02:00
Xavier Leroy 3de0115bfe At installation time, remove some leftover files from otherlibs/num
In $(INSTALL_LIBDIR) there can be leftover files from an earlier installation of OCaml, including files from the now defunct otherlibs/num library.  Those files can cause findlib/ocamlfind to think that the Num library is still provided by the core OCaml distribution.

This is a temporary hack, to be cleaned up in 4.07 for example.
2017-08-19 17:44:26 +02:00
Leo White b3f54cb726 Move complugin and friends from BYTECOMP to COMP (#1216) 2017-08-16 14:33:21 +01:00
Mark Shinwell 9683393625 Call counts in Spacetime (#1180) 2017-06-16 13:51:12 +01:00
sliquister 3f76c0525b generalize -dtimings to show allocation, top heap size (#1152) 2017-06-09 12:29:21 +01:00
Fabrice Le Fessant 8daa184d95 New -depend option for ocamlc/ocamlopt 2017-06-01 15:56:30 +02:00
Sébastien Hinderer 6a381fcfa9 Revert "Make 'alldepend' work even when opt compiler is disabled"
This reverts commit 1de47e2d87.

This commit introduced other issues so it seems better to revert it.
2017-04-28 15:49:09 +02:00
Sébastien Hinderer 1de47e2d87 Make 'alldepend' work even when opt compiler is disabled
This is achieved by not including the architecture-specific files in the
prerequesites of 'beforedepend'.
2017-04-28 11:40:20 +02:00
Sébastien Hinderer 40fcbb5f0a Move configuration header files from the config to the byterun/caml directory
This commit moves:
  - config/m.h to byterun/caml/m.h
  - config/s.h to byterun/caml/s.h

Consequently, m.h and s.h now get installed alongside other
OCaml header files.

This commit also updates the .depend files, introducing updates in the
dependencies which are not consequences of this commit itself.
2017-04-26 19:28:17 +02:00
Sébastien Hinderer 376435be98 Make 'make depend' fail as soon as a sub-command it invokes fails.
With this commit, 'make alldepend' will stop and report an error as
soon as one of the invoked command fails, which was not the case before.

This commit thus makes it possible to test that 'make alldepend' works
in an automated way.
2017-04-26 18:23:22 +02:00
David Allsopp 0301576685 Fix \r problems on recent Cygwins
The Cygwin packages for awk, grep and sed were updated on 20 February
2017 so that they no longer automatically strip \r characters on binary
mounts. This affects the OCaml build system in a few places, requiring
the addition of a few tr calls.

References:
  * https://cygwin.com/ml/cygwin/2017-02/msg00152.html
  * https://cygwin.com/ml/cygwin/2017-02/msg00189.html
  * https://cygwin.com/ml/cygwin/2017-02/msg00188.html
2017-04-13 14:17:28 +02:00
Mark Shinwell 3efe66e043 Remove SPARC backend 2017-04-10 09:18:13 +01:00
David Allsopp 80e7529be5 Fix installation of bytecode flexlink.exe
The bytecode version of flexlink.exe is compiled before camlheader is
available, so it needs to have that prepended when it's installed.
2017-04-09 19:00:06 +02:00
David Allsopp 7ef4018bd7 Don't build flexlink.opt in opt.opt
Require flexlink.opt to be specified. Old behaviour:

make flexdll world.opt install

now becomes:

make flexdll world.opt flexlink.opt install

Without flexlink.opt, a bytecode version of flexlink.exe is installed.
2017-04-09 19:00:06 +02:00
David Allsopp 5a29efa469 Split FlexDLL bootstrap into flexdll and flexlink
Allows the C object files to be provided separately and just the
flexlink binary itself to be bootstrapped.
2017-04-09 19:00:06 +02:00
David Allsopp 65fd726329 Install bootstrapped FlexDLL objects to flexdll/
The install-flexdll target now puts the object files for FlexDLL in a
subdirectory flexdll of the Standard Library instead of in the Standard
Library itself.

A configuration tweak means that -I +flexdll is effectively added to all
compiler invocations and also a pseudo-option -L+flexdll to ocamlmklib
calls to Config.mkdll which fixes PR#7373.
2017-04-09 19:00:06 +02:00
David Allsopp 614dd0b756 Allow backslashes in FLEXLINK_FLAGS
Also in MKEXE, MKDLL and MKMAINDDLL as a result.
2017-04-09 19:00:06 +02:00
Sébastien Hinderer eef958007e Build system: rename variables related to manual pages
Rename MANEXT (resp. LIB_MANEXT) to PROGRAMS_MAN_SECTION (resp.
LIBRARIES_MAN_SECTION).

Also get rid of a useless variable assignment in configure.
2017-03-29 11:10:06 +02:00
Sébastien Hinderer 3564aade19 Introduce and use the OUTPUTEXE and OUTPUTOBJ build variables 2017-03-29 11:10:06 +02:00
Sébastien Hinderer f2d5d60376 Define new build variables for C compiler and preprocessor flags 2017-03-29 11:10:06 +02:00
Sébastien Hinderer 8868a7c023 Rename the BYTECCLINKOPTS build variable to LDFLAGS 2017-03-29 11:10:05 +02:00
Pierre Chambart cb81cc6fe2 Declare record type for flambda function parameters (#1028) 2017-03-16 10:40:47 +00:00
Sébastien Hinderer d05d521d6e Fix dependencies generation for otherlibs
Generate dependencies for all of them, not just those that will
actually be built.
2017-03-09 17:12:02 +01:00
Sébastien Hinderer a85b39654a Clearly report that dependencies cannot be regenerated for the MSVC ports 2017-03-09 17:12:02 +01:00
Sébastien Hinderer ccf22c8471 Make .depend files generated for C sources more portable
This implements a suggestion provided by @xavierleroy in
https://github.com/ocaml/ocaml/pull/941#issuecomment-266047690

Before this commit, the dependencies of the win32unix C files were not
taken into account at all. This commit fixes this, too.
2017-03-09 17:12:02 +01:00
Christopher Zimmermann feaab3e40e use $(MAKE) variable 2017-03-05 21:36:13 +01:00
Gabriel Scherer 838b6f8fd2 Merge pull request #1074 from stedolan/parallel-make-fix
Fix for parallel make
2017-03-02 17:00:01 -05:00
Stephen Dolan fa576384b2 Fix for parallel make 2017-03-02 10:15:40 +00:00
Nicolas Ojeda Bar e75c87dc48 Initial import of linear-scan-register-allocator
The code in this commit was written by Marcell Fischbach & Benedikt Meurer.
See [Mantis#5324](http://caml.inria.fr/mantis/view.php?id=5324) for some
context.

The code (which was originally written against 3.12) was ported to trunk by
doing

```bash
git clone https://github.com/bmeurer/ocaml-experimental/
cd ocaml-experimental
git diff master...linear-scan-register-allocator > t.diff
```

and then applying the diff by hand.
2017-02-22 17:09:18 +01:00
Török Edwin d1cd849d3f Documentation tool: add tools/lintapidiff.ml
Run 'make lintapidiff' in the root of a git checkout to get a list of
potentially missing or wrong @since annotations.

The tool is not built by default, you have to first run 'make
world.opt', and then run 'make lintapidiff'.

lintapidiff doesn't support stop comments: add explicit list of changes to ignore.

see copyright header for license.
2017-02-21 17:13:38 +02:00
fdopen 9174a1d1ec also install ocamlyacc 2017-02-17 16:38:26 +01:00
Sébastien Hinderer 42ae45f5b4 Makefile: declare the distclean and coreboot targets as PHONY
Makefile: declare the coreboot target as PHONY
2017-02-15 16:06:23 +01:00
Sébastien Hinderer 14614a5c2e Makefile: reorder a few phony and variable declarations 2017-02-15 11:19:08 +01:00
Sébastien Hinderer 05005bd7d3 Makefile: get rid of commented rule 2017-02-15 11:19:08 +01:00
Sébastien Hinderer 460019eb69 Makefile: minor improvement of a rule related to the native dynlink library 2017-02-15 11:19:08 +01:00
Sébastien Hinderer a23bec29ec Makefile: minor fix of the clean rule
Move the phony declaration above the first definition of the clean rule.
2017-02-15 11:19:08 +01:00
Sébastien Hinderer 73179f8972 Makefile: slightly improve the flexdll rule 2017-02-15 11:19:07 +01:00
Sébastien Hinderer 4c9ac6d2bf Makefile: slightly improve the opt-core rule 2017-02-15 11:19:07 +01:00
Sébastien Hinderer 7c988144bc Makefile: define the INCLUDES variable earlier to improve readability 2017-02-15 11:19:07 +01:00
Sébastien Hinderer 294e0a73a1 Makefile: get rid of variables related to ocamlbuild
They have become useless
2017-02-15 11:19:07 +01:00
Sébastien Hinderer f8dc9e4c85 Move the content of Makefile.shared to Makefile
Also update Makefile.nt so as to include Makefile
2017-02-15 11:19:05 +01:00
Sébastien Hinderer 7e034f20fa Get rid of the MAKEREC and MAKECMD make variables
Now that the Unix and Windows build systems have been merged, thiese
variables are no longer useful.
2017-02-15 11:18:10 +01:00
Sébastien Hinderer 4865cbac4f Makefiles: deduplicate the inclusion of the .depend file 2017-02-15 11:18:10 +01:00
Sébastien Hinderer fbead55c66 Makefiles: deduplicate the world.opt rule 2017-02-15 11:18:10 +01:00
Sébastien Hinderer ae4eb8ba9a Makefiles: deduplicate the natruntop rule 2017-02-15 11:18:10 +01:00
Sébastien Hinderer 11fd71c6ff Makefiles: deduplicate the opt and opt.opt rules
The recipes work differently on Unix and Windows. This commit
preserves this situation but this will probably need to be clarified.
2017-02-15 11:18:10 +01:00
Sébastien Hinderer 5eb5cdfd04 Move the base.opt recipe from Makefile to Makefile.shared
This target thus becomes available under Windows (Makefile.nt did not
define it).

Since no other rule makes use of this target, its usefulness needs to be
confirmed.
2017-02-15 11:18:10 +01:00
Sébastien Hinderer d7fdcd6a93 Makefiles: deduplicate the opt-core rule 2017-02-15 11:18:10 +01:00
Sébastien Hinderer b7845ece69 Move the reconfigure rule from Makefile to Makefile.shared
Make sure it can be used only on Unix, though, since ./configure does
not work on Windows yet.
2017-02-15 11:18:10 +01:00
Sébastien Hinderer fca37bb47b Makefiles: deduplicate the world rule 2017-02-15 11:18:10 +01:00
Sébastien Hinderer a000862dd3 Makefiles: deduplicate the runtop rule
The recipes for the Unix and Windows build systems are different. This
difference has been preserved for the moment but the rules should be
unified.
2017-02-15 11:18:10 +01:00
Sébastien Hinderer 44097e323a Deduplicate the bootstrap rule 2017-02-15 11:18:10 +01:00
Sébastien Hinderer 2bd60155ef Makefiles: deduplicate the all rule
Before this commit, the rule was more sequential on the Unix build system
than on the Windows one. The more sequential version has been kept
so as not to break parallel builds.
2017-02-15 11:18:09 +01:00
Sébastien Hinderer 6d5914f4d1 Makefiles: deduplicate the coreboot rule
Note: since commit dd74659c68, the
coreboot target on the Unix build system calls make promote with
CAMLRUN=byterun/ocamlrun, which the equivalent target on the Windows
system did not use before the present commit.

The present commit uses CAMLRUN=byterun/ocamlrun on both build systems.
2017-02-15 11:18:09 +01:00
Sébastien Hinderer 50071de8ff Makefiles: deduplicate .PHONY declarations of tools-related rules
The ocamltools, ocamltoolsopt and ocamltoolsopt.opt rules were already
shared but their .PHONY declarations were duplicated.
2017-02-15 11:18:09 +01:00
Sébastien Hinderer 749eb08256 Makefiles: deduplicate the promote-cross, promote and cleanboot rules 2017-02-15 11:18:09 +01:00
Sébastien Hinderer 21cd9de7ad Makefiles: deduplicate the backup, restore and compare rules 2017-02-15 11:18:09 +01:00
Sébastien Hinderer 91e353acc8 Makefiles: deduplicate the coreall and core rules
On Unix core builds coldstart and coreall while on Windows core builds runtime
and coreall. This behaviour has been preserved but needs to be
clarified.
2017-02-15 11:18:09 +01:00
Sébastien Hinderer 731766c3b2 Makefiles: deduplicate the coldstart rule
On the Unix build system, this recipe was creating stdlib/caml as a symlink
to byterun/caml. This is no longer done because it is not done on
Windows either and seems not useful.
2017-02-15 11:18:09 +01:00
Sébastien Hinderer 7a24ff49e5 Makefiles: deduplicate the default rules
After this commit, ocamldep is called with the -shash option under
Unix, which was not the case before but should not change anything
in practice.
2017-02-15 11:18:09 +01:00
Sébastien Hinderer 83aff485b3 Move the rules related to MacOS X pakcaging from Makefile to Makefile.shared
Make sure they can be used only under Unix, though.
2017-02-15 11:18:09 +01:00
Sébastien Hinderer e5cb725761 Move the checkstack rule from Makefile to Makefile.shared
It will however be available only on Unix because checkstack does not
yet work on Windows.

This commit removes the '@' character in front of the commands of
the checkstack rule to make debugging easier.

It also fixes the target by ensuiring that the $(EXE) extension
is used everywhere.
2017-02-15 11:18:09 +01:00
Sébastien Hinderer df392ade71 Makefiles: deduplicate the rules that clean the testsuite 2017-02-15 11:18:09 +01:00
Sébastien Hinderer 842ca03fde Makefiles: deduplicate the rules related to the OCaml debugger
Under Unix the debugger depends on the otherlibraries target, which was
not the case on Windows before this commit.
2017-02-15 11:18:09 +01:00
Sébastien Hinderer 2cbefd684c Makefiles: deduplicate the rules related to the other libraries
On Unix the otherlibraries target depends on ocamltools, which was not
the case under Windows before this commit. This commit keeps the Unix
version to make sure no constraint is lost.
2017-02-15 11:18:09 +01:00
Sébastien Hinderer 36f8a959eb Makefiles: deduplicate the rules related to ocamldoc
This commiit makes the html_doc target available under Windows.
2017-02-15 11:18:09 +01:00
Sébastien Hinderer 921379d24e Makefiles: deduplicate rules related to ocamllex and ocamlyacc
On Windows the ocamllex and ocamllex.opt target did not depend on
anything, whereas they did on Unix. The dependencies have been kept as
they were under Unix to make sure no constraint is lost.

However the dependencies between ocamllex and ocamllex.opt do not seem
very coherent either.
2017-02-15 11:18:09 +01:00
Sébastien Hinderer e3ec33d4d7 Makefiles: deduplicate the rules related to the standard library 2017-02-15 11:18:09 +01:00
Sébastien Hinderer bca810108f Makefiles: deduplicate the rules related to the runtime systems 2017-02-15 11:18:09 +01:00
Sébastien Hinderer ab518b545d Makefiles: deduplicate the rules related to the expunge utility 2017-02-15 11:18:09 +01:00
Sébastien Hinderer 0d29ef1410 Makefiles: deduplicate the rules choosing the right machine-dependent files 2017-02-15 11:18:08 +01:00
Sébastien Hinderer 04a50de5f9 Makefiles: deduplicate the rules related to the preprocessing of code emiters 2017-02-15 11:18:08 +01:00
Sébastien Hinderer 126db6d129 Makefiles: get rid of the ARCH_OCAMLOPT make variable
It is a synonymous of the ARCH variable and is not exported so get rid
of it.
2017-02-15 11:18:08 +01:00
Sébastien Hinderer a458358db6 Makefiles: deduplicate the rules related to the predefined exceptions and primitives 2017-02-15 11:18:08 +01:00
Sébastien Hinderer c2e5587002 Makefiles: deduplicate the rules building compilers and compilerlibs 2017-02-15 11:18:08 +01:00
Sébastien Hinderer c61cf64314 Makefiles: deduplicate the rules building the OCaml parser and lexer 2017-02-15 11:18:08 +01:00
Sébastien Hinderer bb4736be2c Makefiles: deduplicate the rule building otherlibs/dynlink/dynlink.cmxa 2017-02-15 11:18:08 +01:00
Sébastien Hinderer 082aec0731 Makefiles: deduplicate rules to build ocaml, ocamlc, ocamlopt and compilerlibs 2017-02-15 11:18:08 +01:00
Sébastien Hinderer 652792f537 Makefiles: deduplicate the clean rule 2017-02-15 11:18:08 +01:00
Sébastien Hinderer c682f152e7 Move the manual-pregen rule from Makefile to Makefile.shared
This target thus becomes available under Windows
2017-02-15 11:18:08 +01:00
Sébastien Hinderer 597b2cd76d Makefiles: deduplicate the install rule 2017-02-15 11:18:08 +01:00
Sébastien Hinderer 630f55b599 Makefile: improve the way ocamlyacc is installed
Before this commit, ocamlyacc.byte was installed as ocamlyacc
unconditionally and then overwritten by ocamlyacc.opt, if available.
After this commit, ocamlyacc is provided as a symlink to (or copy of)
ocamlyacc.byte only if the native code version is not available.
2017-02-15 11:18:08 +01:00
Sébastien Hinderer 31ff24eb69 Makefile: re-order commands in the install rule
This is to match the (alphabetical) ordering of the Windows build system.
2017-02-15 11:18:08 +01:00
Sébastien Hinderer 1a46ea3c68 Makefile: install flexdll
This makes the install rule of the Unix build system closer to its
Windows counterpart but has no other effect.
2017-02-15 11:18:08 +01:00
Sébastien Hinderer f3466c08ea Makefile: continue tidying up the install rule
* Use make -C instead of cd-ing into subdirectories
 * Quote directory names
 * Shorten long lines
 * Use the LN variable rather than the "ln -s" string
2017-02-15 11:18:07 +01:00
Sébastien Hinderer 34ef720b5f Makefile: stop removing shared libraries while installing
This had been introduced in commit a49cf7b0 but does not seem useful any
longer.
2017-02-15 11:18:07 +01:00
Sébastien Hinderer 11c4fa62a7 Makefile: gather commands related to the installation of manual pages
This commit also makes sure the man pages get installed only on Unix
systems. This is useless at the moment but will become useful once the
install rule will be shared.
2017-02-15 11:18:07 +01:00
Sébastien Hinderer c001d0dad9 Makefile: simplify the way make install creates directories
Also remove a superfluous / and make sure directory names are quoted.
2017-02-15 11:18:07 +01:00
Sébastien Hinderer 0e3a34b315 Makefiles: deduplicate the installopt rule 2017-02-15 11:18:07 +01:00
Sébastien Hinderer 40b98b0d01 Makefile: installopt enhancement
If appropriate, install flexdll/flexlink.opt as
$(INSTALL_BINDIR)/flexlink$(EXE). This will not happen under Unix where
flexlink is not compiled but makes this target identical to its Windows
counterpart.
2017-02-15 11:18:07 +01:00
Sébastien Hinderer f556f3e007 Makefiles: bring the two variants of installopt closer to each other
This contains only cosmetic modifications
2017-02-15 11:18:07 +01:00
Sébastien Hinderer 3dea9847bd Makefiles: simplify the invocation of sub-makefiles in the installopt rules
This commit replaces idioms like ``cd dir; $(MAKE) foo'' and
``cd dir && $(MAKE) foo'' by ``$(MAKE) -C dir foo''.

In Makefile.nt, the command ``$(MAKEREC) installoptopt'' has also been
replaced by ``$(MAKE) installoptopt''.
2017-02-15 11:18:07 +01:00
Sébastien Hinderer 99084ca4d3 Makefile: installopt rule enhancements
Make sure installation directories are properly quoted. Use the LN variable.
2017-02-15 11:18:07 +01:00
Sébastien Hinderer ecbd4e4f9f Makefiles: deduplicate the installoptopt rule 2017-02-15 11:18:07 +01:00
Sébastien Hinderer 96057a4468 Makefiles: make indentation consistent in the installoptopt rules 2017-02-15 11:18:06 +01:00
Sébastien Hinderer 81b7a902f6 Makefile: make the intstalloptopt rule more general
This is done by replacing the hard-coded .a and .o file extensions by
their more general .$(A) and .$(O) counterparts.
2017-02-15 11:18:06 +01:00
Sébastien Hinderer 600de03d00 Makefile: quote installation directories used in the installoptopt target 2017-02-15 11:18:06 +01:00
Sébastien Hinderer b6fa7fdb62 Makefile: use the LN variable in the installoptopt rule 2017-02-15 11:18:06 +01:00
Sébastien Hinderer 3a0f450e0b Move the install-compiler-sources target from Makefile to Makefile.shared
This target has been introduced by GPR #827 but added only to the
Unix build system. This commit makes it available to the Windows build
system, too.
2017-02-15 11:18:06 +01:00
Sébastien Hinderer 5863841aac Makefiles: deduplicate the tests rule 2017-02-15 11:18:06 +01:00
Sébastien Hinderer 127d660826 Makefiles: share the definition of general-purpose variables 2017-02-15 11:06:41 +01:00
Sébastien Hinderer 1e632bc1de Makefiles: deduplicate the rules related to utils/config.ml 2017-02-15 10:45:21 +01:00
Sébastien Hinderer 2f59a729b4 Add support for FLEXLINK_FLAGS to Makefile
This commit affects the recipe used to generate utils/config.ml
from utils/config.mlp. It adds an expression to the sed command to
replace the %%FLEXLINK_FLAGS%% token by a value. Given that this
variable is not defined for Unix build this will have no effect, except
making the recipe identical to the one used on the Windows build system.
2017-02-15 10:45:21 +01:00
Sébastien Hinderer 635abf5fda Makefiles: unify the way file extensions are generated
This commit deals with the rule that generates utils/config.ml
2017-02-15 10:24:09 +01:00
Sébastien Hinderer f1a250ed14 Makefiles: sed expressions cleanup in the recipes building utils/config.ml
The recipes to build utils/config.ml from utils/config.ml in Makefile
and Makefile.nt essentially are sed invocations with several

expressions. This commit sorts the expressions in alphabetical order in
both files and also makes sure all the expressions use the same
quoting style, namely single quotes.

This has no practical effect but makes the two recipes easier to
compare.
2017-02-15 10:24:09 +01:00
Sébastien Hinderer b06158bacb Makefile: stop removing -Werror from compiler options
This commit removes the line introduced by commit
59853fa694

Since the proposal to have separate variables for warning
options has been implemented, such a precaution should no longer be
necessary. Moreover, this had been implemented for the Unix build system
only, not for the Windows one.
2017-02-15 10:24:09 +01:00
Sébastien Hinderer e169dc4bfc Introduce the BYTECODE_C_COMPILER and NATIVE_C_COMPILER make variables
These variables represent the C compilers ocamlc and ocamlopt should use
to compile a third-party C source file when no -cc command-line option
has been specified.

Thanks to these variables, the substitutions performed in Makefile and
Makefile.nt to generate utils/config.ml from utils/config.ml become
similar.

(The NATIVE_C_COMPILER variable is not really necessary but it has still
been introduced to preserve symetry.)
2017-02-15 10:24:09 +01:00
Sébastien Hinderer 04aa870b9b Define BYTERUN as a real make variable
This variable is used to give a value to standard_runtime in
utils/config.ml.

Before this commit, its values were hard-coded in Makefile and
Makefile.nt, in the rules generating utils/config.ml from utils/config.mlp.

This commit gets rid of this hardcoding, to prepare the sharing of the
rules mentionned above.
2017-02-15 10:24:09 +01:00
Sébastien Hinderer 02e2cf2c6c Makefiles: Deduplicate the defaultentry rule 2017-02-15 10:24:09 +01:00
pierreweis 14c90d7bbc Some cleaning: consistent for loops display, indenting long lines, tabify
target recepees.
2017-01-18 12:10:24 +01:00
Nicolas Ojeda Bar 77dba7758e Add make_opcodes 2016-12-29 08:22:37 +05:30
Gabriel Scherer d4cd072d4c Merge pull request #935 from ygrek/termux-build
allow build in termux
2016-12-23 16:53:24 -05:00
Fabrice Le Fessant df546b92f5 Fix problem with ocamlopt.opt -plugin
Add NATDYNLINKOPTS options to ocamlbytecomp.cmxa
2016-12-23 14:49:30 -05:00
Jonathan Protzenko 7d1998d839 Some fixups for runtop; add runtop to Makefile.nt 2016-12-15 21:33:53 -05:00
Gabriel Scherer d89b1a7b83 PR#7172: ocamlc -config: add int_size, word_size, ext_exe (#970) 2016-12-14 09:43:19 -05:00
Stephen Dolan a35c6117e6 Instrumentation for american fuzzy lop (afl-fuzz) (#504) 2016-12-06 17:18:04 +01:00
ygrek ff34efc8c5 drop explicit SHELL specification from Makefile
it breaks build on termux where /bin/sh is not available, while make finds the proper shell itself just fine
2016-11-26 14:11:12 -08:00
Sébastien Hinderer 54e6aecd77 Improve handling of platforms that do not have gprof profiling support (#933)
This commit modifies these two behaviours:

1. ``make install'' installs libraries with profiling support only when
this makes sense.

2. On platforms that do not support profiling with gprof, the -p option of
ocamlopt produces an error message.
On such platforms, ``make install'' was installing dummy profiling
libraries and ocamlopt's -p option was silently ignored.

In addition, this commit modifies the values of the PROFILING make
variable. Before the commit it was either prof or noprof. After the
commit it is either true or false.

In the asmrun directory, the call to ranlib for libasmrunp.a has also been
removed from the install target because this command is already invoked
in the rule that builds libasmrunp.a.

ocamlc/ocamlopt -config now prints the state of profiling support
2016-11-25 17:24:44 +01:00
Gabriel Scherer 0657fd8193 Revert "Improve handling of platforms that do not have gprof profiling support (#933)"
This reverts commit 8adfe15f18.

This is a temporary revert caused by Continuous Integration
failure. We'll investigate the issue and merge again when it is fixed.
2016-11-25 11:12:56 -05:00
whitequark 0670dc2be9 Fix install of symlinks with installopt but without installoptopt. (#932) 2016-11-25 15:01:04 +00:00
Sébastien Hinderer 8adfe15f18 Improve handling of platforms that do not have gprof profiling support (#933)
This commit modifies these two behaviours:

1. ``make install'' installs libraries with profiling support only when
this makes sense.

2. On platforms that do not support profiling with gprof, the -p option of
ocamlopt produces an error message.
On such platforms, ``make install'' was installing dummy profiling
libraries and ocamlopt's -p option was silently ignored.

In addition, this commit modifies the values of the PROFILING make
variable. Before the commit it was either prof or noprof. After the
commit it is either true or false.

In the asmrun directory, the call to ranlib for libasmrunp.a has also been
removed from the install target because this command is already invoked
in the rule that builds libasmrunp.a.

ocamlc/ocamlopt -config now prints the state of profiling support
2016-11-25 15:57:14 +01:00
Sébastien Hinderer 3e81da2234 Clarify and slightly modify the use of C compiler related make variables.
Before this commit, there was no distinction between the options
used to compile C source files coming with the OCaml distribution
and third-party C source files compiled by calling ocamlc or ocamlopt.

This commit makes it possible to use options when compiling C source
files that come with OCaml without imposing these options to the compilation
of third-party code.

More specifically, the options in the BYTECCCOMPOPTS and NATIVECCCOMPOPTS
variables are not passed to the C compiler when called by ocamlc and
ocamlopt any longer.

This commit also documents the role of each concerned variable.

In addition:

- On Unix:
  * The -Wall and -Werror options are no longer passed to the C
    compiler by ocamlc and ocamlopt for third-party C source files

- For the MinGW port:
  * The -O option has been removed from the SHAREDCCCOMPOPTS variable
  * The -Wall and -Wno-unused options are no longer passed to the C
    compiler by ocamlc and ocamlopt for third-party C source files

- For the msvc port: the
  * The -Ox option has been removed from the SHAREDCCCOMPOPTS variable.
  * The -Wall and -Wno-unused options are no longer passed to the C
    compiler by ocamlc and ocamlopt for third-party C source files
2016-11-16 08:44:47 +01:00
hendriktews 0bb16e0934 improve installation of additional material (#827)
- install missing mli and cmti files for compiler-libs and otherlibs
- new make target install-compiler-sources to install compiler-libs ml files
2016-10-21 16:40:14 +02:00
Fabrice Le Fessant 632ad93b71 Merge pull request #735 from lefessan/2016-08-02-with-prof-id
Add --reserved-header-bits XX to ./configure
2016-09-05 15:45:58 +02:00
octachron e2fbb9145f Update root makefile manual-pregen target 2016-09-02 01:02:37 +02:00
octachron b76ee8d8d8 GPR#693: add a manual-pregen makefile target 2016-09-02 01:01:33 +02:00
Fabrice Le Fessant 6b436a43ea Add --reserved-header-bits XX to ./configure
with XX a number smaller than 32 (to leave at least 22 bits for the size)
2016-08-29 22:33:32 +02:00
Sébastien Hinderer e1b57c4a39 Make sure ocamlnat is built with a $(EXE) extension.
Before this commit, 'make ocamlnat' was building 'ocamlnat' without any
extension, even on Windows. The extension was added by 'make install', though.

With this commit, 'ocamlnat' is given its $(EXE) extension already
at build time.
2016-08-01 17:28:51 +02:00
Sébastien Hinderer e47f29bf85 Share the rules needed to build the native toplevel.
One side-effect is that ocamlnat is now removed by make clean under
Windows (mingw and msvc), which was not the case before.
2016-08-01 17:28:51 +02:00
Damien Doligez 0b4fbc2b30 fix whitespace, long lines, headers 2016-08-01 16:06:59 +02:00
Mark Shinwell cd0bd8aa73 Spacetime: a new memory profiler (#585) 2016-07-29 15:07:10 +01:00
Damien Doligez d2ed1221c1 fix GPR#587: install byte-code versions of ocamlc and ocamllex 2016-07-20 17:08:59 +02:00
alainfrisch 012e1ef878 "./configure -safe-string" to force safe-string mode
When configured with -safe-string, the OCaml tools will default to the
safe-string mode and ignore -unsafe-string command-line arguments.  This
is intended to serve two purposes:

 - Facilitate the detection of packages that are not ready
   for -safe-string ready.  (Perhaps with some OPAM switch?)

 - Enable some optimizations that assume that all linked units are
   compiled with -safe-string.

Note: currently, there is no check that units compiled with an OCaml
configured without -safe-string are not linked in.
2016-07-19 14:28:51 +02:00
Fabrice Le Fessant d1418bc031 Remove dependency on Dynlink in ocamlnat 2016-07-18 17:49:52 +02:00
Fabrice Le Fessant f26c0ff8b6 Add plugins in the compiler 2016-07-18 17:43:05 +02:00
Fabrice Le Fessant 99b4d7bac9 Add a target `make reconfigure` to restart configure with the same options 2016-07-13 16:02:51 +02:00
alainfrisch 618e3ff309 Support check_all_arches under Windows. Make it more robust by removing all .cmo files in asmcomp. 2016-07-11 11:35:51 +02:00
Demi Obenour d89af40f64 Install native versions of tools by default.
Previously, `ocamlc`, `ocamlopt`, `ocamllex`, and `ocamldep` defaulted
to the bytecode versions of the tools.  However, there is normally no
advantage to the bytecode versions if the native-code versions are
available, except in unusual circumstances.  Instead, install the
native-code versions without the `.opt` suffix.  They are still
installed with the `.opt` suffix for backwards compatibility.  Finally,
install the bytecode versions with the `.byte` suffix, and build
native-code versions of tools that are not currently built in native
code.

Also, remove some duplication in tools/Makefile.shared.

Supersedes GPR #512.
2016-06-06 14:44:10 -04:00
François Bobot 2aec849922 Merge remote-tracking branch 'origin/4.03' into trunk
travis.yml is kept from trunk

Conflicts:
  	.depend
	Changes
	Makefile
	VERSION
	boot/ocamlc
	boot/ocamldep
	boot/ocamllex
	parsing/parser.mly
	parsing/pprintast.ml
	stdlib/hashtbl.ml
	testsuite/tests/unwind/Makefile
	tools/check-typo
2016-03-11 18:44:32 +01:00
alainfrisch de857d6fb9 GPR#324: Make boot/ocamlc read directly byterun/primitives (patch by Francois Bobot). 2016-03-10 10:46:19 +01:00
Alain Frisch 8eb9c0b46e An quick way to ensure that ocamlopt compiles fine on supported archs.
Examples: `make check_arch=power`, `make check_all_arches`.
2016-03-09 18:54:15 +01:00
Jacques-Henri Jourdan dd74659c68 * Fix coreboot target. This target calls promote, which itself now
uses tools/stripdebug. This executable has to be ran with the new
  runtime, not the one in boot/.

* Update .depend for byterun/ and asmrun/
2016-03-07 23:24:52 +01:00
Adrien Nader 78bdfa53ca Makefile: use "$(EXT_DLL)" instead of hard-cording ".so". 2016-03-05 14:25:11 +01:00
Damien Doligez 69a906872f tweak tools/check-typo and break more overlong lines 2016-02-19 17:13:53 +01:00
Damien Doligez d5f61a4e54 tweak tools/check-typo and break more overlong lines 2016-02-19 12:28:36 +01:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
Damien Doligez ee8f71101b clean up whitespace and cut long lines 2016-02-17 13:36:27 +01:00
alainfrisch 6661919762 Move more stuff into Makefile.shared in order to fix the build on Windows. 2016-02-11 10:34:36 +01:00
Mark Shinwell 4f3b8bf872 Fix ocamlobjinfo for Flambda (includes work from Runhang Li) 2016-02-10 15:56:13 +01:00
Gabriel Scherer f8f2a6277f remove ocamlbuild from the compiler distribution 2016-02-01 15:05:18 -05:00
Pierre Chambart 050c454765 Add middle_end to Makefiles 2016-01-22 01:24:02 +01:00
Pierre Chambart 828cb4ebb9 Add field in Config for flambda and change the cmx and cmxa magic number 2016-01-14 14:20:23 +01:00
Leo White 3ef4b2c95e Install compiler libs .cmx files 2015-12-26 08:29:48 +00:00
Thomas Refis d004615e38 Makefile: add a 'natruntop' target, similar to 'runtop' 2015-12-18 10:39:36 +00:00
Jeremie Dimino d0e62811c0 make ocamlnat build again
Conflicts:
	Changes
	Makefile.shared
2015-12-18 10:39:36 +00:00
Xavier Leroy 5b62da1835 Merge pull request #340 from ocaml/stripped-bootstrap
Reduce size of bootstrap compilers by stripping debug info
2015-12-18 11:13:37 +01:00
Gabriel Scherer 2e8de3ff85 Makefile: a 'runtop' target to build and run the toplevel
Pass the content of the TOPFLAGS variable as additional arguments, eg.

  TOPFLAGS="-dparsetree" make runtop
2015-12-11 13:36:28 +01:00
Xavier Leroy 2810763764 Strip debugging information off the bootstrap compilers, to reduce their size
The stripping is done during bootstrap, when copying the new ocamlc, ocamllex and ocamldep to boot/.  The new "stripdebug" tool performs this task.

As a consequence, comparing the new compilers with the boot/ compilers at the end of bootstrap is more complicated, since the debug section must be ignored.  A new tool, "cmpbyt" in tools/, performs this comparison.
2015-12-09 10:45:31 +01:00
Alain Frisch 90323d0d1e Starting to share identical parts in the root Makefile and Makefile.nt.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16534 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-23 13:49:59 +00:00