2018-08-19 12:15:40 -07:00
|
|
|
= Contributing to the standard library
|
2018-08-19 09:58:51 -07:00
|
|
|
|
|
|
|
For guidelines about standard library content, see
|
2018-08-19 13:01:02 -07:00
|
|
|
link:../CONTRIBUTING.md#contributing-to-the-standard-library[].
|
2018-08-19 09:58:51 -07:00
|
|
|
|
2018-08-20 18:12:53 -07:00
|
|
|
Note: All paths are given relative to the root of the repository.
|
|
|
|
|
2019-09-30 07:01:29 -07:00
|
|
|
First, build the compiler. Run `./configure`, then `make`. See
|
2018-08-19 13:01:02 -07:00
|
|
|
link:../HACKING.adoc[].
|
2018-08-19 09:58:51 -07:00
|
|
|
|
|
|
|
To add a new module, you must:
|
2018-08-19 12:15:40 -07:00
|
|
|
|
|
|
|
* Create new `.mli` and `.ml` files for the modules, obviously.
|
|
|
|
|
2019-10-03 07:27:32 -07:00
|
|
|
* Define the module in `stdlib/stdlib.mli` and `stdlib/stdlib.ml` in
|
2020-08-04 07:01:50 -07:00
|
|
|
the section of the code commented "MODULE_ALIASES". Please maintain
|
2019-10-03 07:27:32 -07:00
|
|
|
the same style as the rest of the code, in particular the
|
|
|
|
alphabetical ordering and whitespace alignment of module aliases.
|
2018-08-19 12:15:40 -07:00
|
|
|
|
2020-05-11 03:21:59 -07:00
|
|
|
* Add `module_name` to the definition of `STDLIB_MODS` in
|
2019-09-30 04:56:48 -07:00
|
|
|
`stdlib/StdlibModules`. You must keep the list sorted in dependency order.
|
2018-08-19 12:15:40 -07:00
|
|
|
|
|
|
|
* Run `make alldepend` to update all the `.depend` files. These files are not
|
2018-08-19 09:58:51 -07:00
|
|
|
edited by hand.
|
2018-08-19 12:15:40 -07:00
|
|
|
|
2019-09-30 07:01:29 -07:00
|
|
|
* Run `make clean` or `make partialclean`, then `make`.
|
2018-08-19 09:58:51 -07:00
|
|
|
|
|
|
|
If you are adding multiple modules, follow the steps above and rebuild the
|
|
|
|
compiler after adding each module. If you add multiple modules before
|
|
|
|
rebuilding, the build may fail.
|