You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Windows, you will require Windows Subsystem for Linux 2 (WSL2). [Follow the WSL2 instructions here.](https://github.com/SerenityOS/serenity/blob/master/Documentation/NotesOnWSL.md)
90
90
Do note the ```Hardware acceleration``` and ```Note on filesystems``` sections, otherwise performance will be terrible.
91
91
Once you have installed a distro for WSL2, follow the Linux prerequisites above for the distro you installed, then continue as normal.
92
92
93
+
You may also want to install [ninja](https://github.com/ninja-build/ninja/releases)
94
+
93
95
### Build
94
96
Go into the `Toolchain/` directory and run the **BuildIt.sh** script:
95
97
```bash
96
98
$ cd Toolchain
97
99
$ ./BuildIt.sh
98
100
```
99
101
100
-
Building the toolchain will also automatically create a `Build/` directory for the build to live in, and build cmake inside that directory.
102
+
Building the toolchain will also automatically create a `Build/` directory for the build to live in.
101
103
102
-
Once the toolchain and cmake have been built, go into the `Build/` directory and run the `make`and `make install` commands:
104
+
Once the toolchain has been built, go into the `Build/` directory and run the commands. Note that while `ninja` seems to be faster, you can also just use GNU make, by omitting `-G Ninja`and calling `make` instead of `ninja`:
103
105
```bash
104
106
$ cd ..
105
107
$ cd Build
106
-
$ cmake ..
107
-
$ make
108
-
$ make install
108
+
$ cmake .. -G Ninja
109
+
$ ninja
110
+
$ ninja install
109
111
```
110
112
111
-
This will compile all of SerenityOS and install the built files into `Root/` inside the build tree. `make install` actually pulls in the regular `make` (`make all`) automatically, so there isn't really a need to run it explicitly. You may also want ask `make`to build things in parallel by using`-j`, optionally specifying the maximum number of jobs to run.
113
+
This will compile all of SerenityOS and install the built files into `Root/` inside the build tree. `ninja install` actually pulls in the regular `ninja` (`ninja all`) automatically, so there isn't really a need to run it explicitly. `ninja` will automatically build as many jobs in parallel as it detects processors; `make`builds only one job in parallel. (Use the`-j` option with an argument if you want to change this.)
112
114
113
-
Now to build a disk image, run `make image`, and if nothing breaks too much, take it for a spin by using `make run`.
115
+
Now to build a disk image, run `ninja image`, and take it for a spin by using `ninja run`.
114
116
```bash
115
-
$ make image
116
-
$ make run
117
+
$ ninja image
118
+
$ ninja run
117
119
```
118
120
119
121
Note that the `anon` user is able to become `root` without password by default, as a development convenience.
@@ -125,20 +127,7 @@ Bare curious users may even consider sourcing suitable hardware to [install Sere
125
127
126
128
Outside of QEMU, Serenity will run on VirtualBox. If you're curious, see how to [install Serenity on VirtualBox.](https://github.com/SerenityOS/serenity/blob/master/Documentation/VirtualBox.md)
127
129
128
-
Later on, when you `git pull` to get the latest changes, there's no need to rebuild the toolchain. You can simply run `make install`, `make image`, `make run` again. CMake will only rebuild those parts that have been updated.
129
-
130
-
#### Faster than make: "Ninja"
131
-
132
-
You may also want to replace `make` with `ninja` in the above commands for some additional build speed benefits, like reduced double-building of headers.
133
-
Most of the process stays the same:
134
-
- Go to an empty directory at the root (e.g. `Build/`) and call `cmake .. -G Ninja` inside that directory
135
-
- You might either create a new directory or reuse the existing `Build` directory after cleaning it.
136
-
-`make` becomes `ninja`
137
-
-`make install` becomes `ninja install`
138
-
-`make image` becomes `ninja image`
139
-
-`make run` becomes `ninja run`
140
-
141
-
Note that ninja automatically chooses a sane value for `-j` automatically, and if something goes wrong it will print the full compiler invocation. Otherwise, `ninja` behaves just like `make`. (And is a tad faster.)
130
+
Later on, when you `git pull` to get the latest changes, there's (usually) no need to rebuild the toolchain. You can simply run `ninja install`, `ninja image`, and `ninja run` again. CMake will only rebuild those parts that have been updated.
142
131
143
132
#### Ports
144
133
To add a package from the ports collection to Serenity, for example curl, go into `Ports/curl/` and run **./package.sh**. The sourcecode for the package will be downloaded and the package will be built. After that, run **make image** from the `Build/` directory to update the disk image. The next time you start Serenity with **make run**, `curl` will be available.
0 commit comments