Skip to content

Commit 7d2f216

Browse files
committed
Rewrite README to focus on the Fortran fpm version
- describe complete bootstapping process in collapsed details section
1 parent 105644c commit 7d2f216

File tree

1 file changed

+54
-22
lines changed

1 file changed

+54
-22
lines changed

README.md

Lines changed: 54 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,44 @@ __Note:__ On Linux and MacOS, you will need to enable executable permission befo
2424

2525
_e.g._ `$ chmod u+x fpm-v0.1.0-linux-x86_64`
2626

27-
### Build from source
27+
For other platforms and architectures have a look at the [bootstrapping instructions](#bootstrapping-fpm).
28+
29+
### Creating a new project
30+
31+
Creating a new *fpm* project is as simple as running the command
32+
`fpm new project_name`. This will create a new folder in your current directory
33+
with the following contents and initialized as a git repository.
34+
35+
* `fpm.toml` – with your project’s name and some default standard meta-data
36+
* `README.md` – with your project’s name
37+
* `.gitignore`
38+
* `src/project_name.f90` – with a simple hello world subroutine
39+
* `app/main.f90` (if `--with-executable` flag used) – a program that calls the subroutine
40+
* `test/main.f90` (if `--with-test` flag used) – an empty test program
41+
42+
### Building your Fortran project with fpm
43+
44+
*fpm* understands the basic commands:
45+
46+
* `fpm build` – build your library, executables and tests
47+
* `fpm run` – run executables
48+
* `fpm test` – run tests
49+
50+
The command `fpm run` can optionally accept the name of the specific executable
51+
to run, as can `fpm test`; like `fpm run specific_executable`. Command line
52+
arguments can also be passed to the executable(s) or test(s) with the option
53+
`--args "some arguments"`.
54+
55+
See additional instructions in the [Packaging guide](PACKAGING.md) or
56+
the [manifest reference](manifest-reference.md).
57+
58+
<details>
59+
<summary><b>Bootstrapping instructions</b></summary>
60+
61+
### Bootstrapping instructions
62+
63+
This guide explains the process of building *fpm* on a platform for the first time.
64+
If your platform and architecture are already supported, download the binary from the [release page](https://github.com/fortran-lang/fpm/releases) instead.
2865

2966
#### Install Haskell
3067

@@ -64,31 +101,26 @@ $ stack install
64101

65102
On Linux, the above command installs `fpm` to `${HOME}/.local/bin/`.
66103

67-
### Creating a new project
104+
Now you can build the Fortran *fpm* version with
68105

69-
Creating a new *fpm* project is as simple as running the command
70-
`fpm new project_name`. This will create a new folder in your current directory
71-
with the following contents and initialized as a git repository.
106+
```bash
107+
$ cd fpm/
108+
$ fpm build
109+
```
72110

73-
* `fpm.toml` – with your project’s name and some default standard meta-data
74-
* `README.md` – with your project’s name
75-
* `.gitignore`
76-
* `src/project_name.f90` – with a simple hello world subroutine
77-
* `app/main.f90` (if `--with-executable` flag used) – a program that calls the subroutine
78-
* `test/main.f90` (if `--with-test` flag used) – an empty test program
111+
Test that everything is working as expected
79112

80-
### Building your Fortran project with fpm
113+
```bash
114+
$ fpm test
115+
```
81116

82-
*fpm* understands the basic commands:
117+
Finally, install the Fortran *fpm* version with
83118

84-
* `fpm build` – build your library, executables and tests
85-
* `fpm run` – run executables
86-
* `fpm test` – run tests
119+
```bash
120+
$ fpm run --runner cp -- ~/.local/bin
121+
```
87122

88-
The command `fpm run` can optionally accept the name of the specific executable
89-
to run, as can `fpm test`; like `fpm run specific_executable`. Command line
90-
arguments can also be passed to the executable(s) or test(s) with the option
91-
`--args "some arguments"`.
123+
Or choose another location if you do not want to overwrite the bootstrapping version.
124+
From now on you can rebuild *fpm* with your Fortran *fpm* version.
92125

93-
See additional instructions in the [Packaging guide](PACKAGING.md) or
94-
the [manifest reference](manifest-reference.md).
126+
</details>

0 commit comments

Comments
 (0)