-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: convert README.org in example to markdown (#7738)
We use markdown for other READMEs, so let's be consistent. Signed-off-by: Etienne Millon <[email protected]>
- Loading branch information
Showing
4 changed files
with
53 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
This project is called `hello_world`. It defines one library called | ||
`hello_world` and one executable called `hello_world`. | ||
|
||
The library is defined in `lib` and the executable in `bin`. It also defines a | ||
test in `test`. | ||
|
||
At the toplevel of the project, there is a `hello_world.opam` file. This file | ||
is required so that Dune knows that this is the `hello_world` project. | ||
|
||
To build everything that is meant to be installed in this project, type: | ||
|
||
$ dune build @install | ||
|
||
To run the tests, type: | ||
|
||
$ dune runtest |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
This project shows how to add a configure step to a project using Dune. | ||
|
||
In order to keep things composable, it offers several way to configure | ||
the project: | ||
|
||
1. with the classic `./configure <args...>`. When doing this, the | ||
configuration script are run immediately, and the resulting configuration | ||
is frozen for the rest of the build. | ||
|
||
2. by copying `config.defaults` to `config` and editing it. The configuration | ||
scripts will be run as part of the build using what is written in `config`. | ||
When `config` is edited, the configuration scripts will be automatically | ||
rerun. | ||
|
||
3. by doing nothing. The configuration scripts will be run as part of the | ||
build using the default values provided in `config.defaults`. | ||
|
||
Technically this is how it works: | ||
|
||
`configure` is a simple OCaml script that: | ||
|
||
- parses the command line | ||
- generates a `config` file using what was given on the command line | ||
- calls `ocaml real_configure.ml` | ||
- `real_configure.ml` does some stuff and generates `config.full` | ||
|
||
`config.full` is what is used by the rest of the build. | ||
|
||
Now in order to support (2) and (3), we setup the following rules in the | ||
toplevel `dune` file: | ||
|
||
- a rule to produce `config` by copying `config.default` | ||
- a rule to produce `config.full` by running `real_configure.ml` | ||
|
||
This all works as described because if Dune knows how to build a file and this | ||
file is already present in the source tree, it will always prefer the file | ||
that's already there. |
This file was deleted.
Oops, something went wrong.