Commit Graph

698 Commits (master)

Author SHA1 Message Date
Mark Shinwell 690116890e Various Makefile / dependency fixes 2018-11-15 10:42:49 +00:00
Mark Shinwell 960cef2e7d Fix makefile problems 2018-11-14 16:20:06 +00:00
Mark Shinwell a4c88eab27 Fixing dynlink makefiles 2018-11-14 13:10:08 +00:00
Mark Shinwell 6526a0c3d9 Make (nat)dynlink sound 2018-11-12 17:44:26 +00:00
Gabriel Scherer d4959ae5ff Makefile: reuse new rules of otherlibs/Makefile 2018-11-12 16:28:01 +01:00
Gabriel Scherer cbefaee438 minor typo fix 2018-11-09 20:37:03 +01:00
Alain Frisch 7baf33d6ad
Fix PR6638: add dedicated wrning for "unused open!" (#1110) 2018-11-09 13:41:34 +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
Thomas Refis e292cb97c5 correctly register dependencies 2018-10-11 17:13:22 +01:00
Thomas Refis d68e0e2077
Provide a way to build the bytecode compiler using Dune (#2093) 2018-10-10 16:16:00 +01:00
Mark Shinwell 2b5f13c913 GPR#2056 (Backend_var) 2018-09-28 17:59:01 +02:00
Sébastien Hinderer 132b3a151d
Get rid of the standard_runtime configuration variable (#2066)
This configuration variable was formerly used by the -make_runtime and
-use_runtime option but this is no longer the case.
2018-09-25 15:29:18 +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 6fab940f38 Export SUPPORTS_SHARED_LIBRARIES in ocamlc -config 2018-09-13 13:40:17 +01:00
Gabriel Scherer ef00dc7317 remove experimental/
This subdirectory was used to store experimental patches on some older
version-control system where branching (or discussing branches?) was
inconvenient. It doesn't make much sense anymore now, and getting rid
of it simplifies a couple places that had to grow around it.

Suggested-by: Nicolás Ojeda Bär

(no change entry needed)
2018-09-08 16:53:08 +02:00
Gabriel Scherer e024eeecd8 Makefile rules to test parser changes by comparing -dparsetree output 2018-09-08 12:24:29 +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 171a97407d Harden flexlink.opt target
If an error occurs while making flexlink.opt, the bytecode image was not
restored. It's now restored even if an error occurs while building the
native code image.
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 9e84a038cb Makefile: make the parser.mly timestamp heuristic more robust
Reviewed by Sébastien Hinderer.

(no change entry needed)
2018-09-06 12:17:17 +02:00
Gabriel Scherer 51912516fa [minor] documentation improvements for Makefile.menhir 2018-09-06 11:10:48 +02:00
octachron 075bf9bed6 doc: remove unprefix trick 2018-09-03 13:59:32 +01:00
Gabriel Scherer a0d2aeb7e1 Menhir update test: use POSIX (find .. -prune -newer) instead of bash's -nt 2018-09-02 12:04:05 +02:00
Gabriel Scherer cbb92d2817 remove unused ocamlyacc dependencies, never put it in boot/ 2018-09-01 23:17:06 +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 e6ecea4008 remove the yacc parser
The large diff in boot/menhir/parser_menhir.ml comes from the fact
that the token list is now included in it, instead of being merely
a reference to the yacc parsers' Parser.token type.
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 cbea1b6b69 menhir parser: move .mlyp to .mly, no cpp step anymore 2018-09-01 23:17:04 +02:00
Gabriel Scherer fc89685a17 Makefile: emit a warning if parser_menhir.mlyp is more recent 2018-09-01 23:17:03 +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
Drup abc0b7e3ed Add compile_common.ml which contains the basic compilation pipeline.
Factorize the part from compile.ml and optcompile.ml.
2018-07-27 15:07:43 +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
Gabriel Radanne 1be47bf7ab Just some tbl things. (#1699) 2018-07-23 13:19:41 +01:00
Xavier Clerc cd06e22582 Shadow the polymorphic comparison in the middle-end (#1811) 2018-07-11 13:50:02 +02:00
Valentin Gatien-Baron 7a6758b03b makefile: install .cmx from middle end directory 2018-07-01 18:49:30 -04:00
Valentin Gatien-Baron 7973231f60 makefile: define OPTCOMP, the native equivalent of BYTECOMP 2018-07-01 18:49:30 -04:00
Sébastien Hinderer d3e73595e5 Merge the asmrun and byterun directories into the runtime directory 2018-06-28 17:50:33 +02:00
Xavier Clerc 9c182f7e24 Add -dcamlprimc + pass -fdebug-prefix-map when available (#1845)
- Introduce `-dcamlprimc`, to keep the generated C file containing the primitive list
- Use `-fdebug-prefix-map` for compiling temporary C files when this option is supported
2018-06-27 14:56:29 +01:00
Sébastien Hinderer 507f27ccb0 Makefile, .gitignore: remove `make backup` leftovers 2018-06-20 17:16:35 +02:00
Sébastien Hinderer 85fa27f7e9 Rename C compiler related build variables
This commit renames a few C compiler related build variables so that
they are reserved for the build system. They will then be re-introduced,
but this time as user varialbes whose value can be freely customized
when compiling the package, without risking to conflict with those
command-line flags that are required by the build system itself.

Here are the variables this commit renames:

- CFLAGS -> OC_CFLAGS
- CPPFLAGS -> OC_CPPFLAGS
- LDFLAGS -> OC_LDFLAGS

Note: before this commit the compilation of scheduler.c in
otherlibs/threads was relying on make's implicit rule to compile C files.

Since this commit stops using the standard variables for flags,
it is necessary to introduce an explicit rule to compile C files
and that makes use of the newly introduced variables.
2018-06-20 14:01:42 +02:00
David Allsopp 02a3091a7d Export ARCH64 to config/Makefile as well as m.h
Allows it to be used more easily in the build system.
2018-06-11 22:52:00 +01:00
Sébastien Hinderer 96545e8cd0 Document the bootstrap procedure
* Remove the now obsolete comments at the beginning of the main Makefile
 * Move and fix documentation of the bootstrap from INSTALL to
   HACKING-bootstrap.adoc
 * Update install instructions
2018-05-31 15:45:25 +02:00
Sébastien Hinderer 4a2fa2978f Root Makefile enhancements
This commit contains the following fixes and enhancements to the
root Makefile:

 * coreall: add dependency on runtime
 * all: before this commit, this target was depending on runtime and started
   by making coreall. This commit simplifies this and just makes this target
   depend on coreall, which is both simpler and semantically more accurate.
 * compare: let this target exit if the comparison fails
 * bootstrap: this commit removes the final invocation to make compare.
   The comparison was actually done twice, (1) as the final step of coreboot
   and (2) as the final step of bootstrap. The motivation for that was to
   ensure that the comparison messages were not lost and did appear last.
   Actually, it turns out that if the comparison fails, it makes no
   sense to continue the bootstrap process. That's why compare now exits
   immediately when it fails and there is thus no need to perform it twice.
 * Get rid of backup and restore targets which have become obsolete
   with the use of a revision control system
2018-05-31 14:35:57 +02:00
Sébastien Hinderer b2240b9878 Make sure the make_opcode tool is run using byterun/ocamlrun
This tool is used to compile ocamlc. Given that make_opcodes is itself
recompiled as part of the bootstrap process, it needs to be run on the new
(rather than old) runtime. In other words, make_opcodes needs to be run
using byterun/ocamlrun rather than boot/ocamlrun.

This commit fixes this.
2018-05-31 14:35:57 +02:00
Sébastien Hinderer ecb42aa78f Makefile: the promote-cross target should use cp rather than stripdebug
The compiler's bootstrap procedure involves calling the promote-cross
target of the root Makefile.

When this target is invoked e.g. in the context of an executable
magic number update, it is actually not possible to use the stripdebug
tool.

Thus, this commit makes sure the promote-cross target uses cp
to promote the bytecode tools, rather than stripdebug.

This is not an issue because in the promote rule used later
during the bootstrap the stripdebug tool can be used, so that the
bytecode executables one gets after a complete bootstrap will remain
small and won't contain any debugging symbol.
2018-05-31 14:35:57 +02:00
Sébastien Hinderer 712f08872a Root Makefile: clean testsuite only once
There were two recipes to run make clean in the testsuite directory.
This commit gets rid of one of them.
2018-05-29 16:46:06 +02:00
Sébastien Hinderer 0704a4b78a Root Makefile: simplify tests target
* Remove dependencies

 * Simplify recipe
2018-05-29 16:45:58 +02:00
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