80 | | Go back to the source root of HelenOS and start the build process |
81 | | |
82 | | {{{ |
83 | | $ cd .. |
84 | | $ make PROFILE=ia32 |
| 60 | Since the summer of 2019, HelenOS uses the Meson build system. |
| 61 | Make sure you have a recent-enough version of Meson and Ninja. |
| 62 | The safest bet is installing both using `pip3` tool. |
| 63 | |
| 64 | {{{ |
| 65 | $ pip3 install ninja |
| 66 | $ pip3 install meson |
| 67 | }}} |
| 68 | |
| 69 | Meson does not support in-tree builds, so you have to create a directory |
| 70 | for your build. You can have as many build directories as you want, each with |
| 71 | its own configuration. `cd` into your build directory and run `configure.sh` |
| 72 | script which exists in the source root. `configure.sh` can be run with a profile |
| 73 | name, to use one of the predefined profiles, or without arguments for interactive |
| 74 | configuration. |
| 75 | |
| 76 | {{{ |
| 77 | $ cd HelenOS |
| 78 | $ mkdir -p ../HelenOS-build/amd64 |
| 79 | $ cd ../HelenOS-build/amd64 |
| 80 | $ ../../HelenOS/configure.sh amd64 |
| 81 | }}} |
| 82 | |
| 83 | Note: If you installed the toolchain to a custom directory, make sure `CROSS_PREFIX` |
| 84 | environment variable is correctly set. |
| 85 | |
| 86 | Once configuration is finished, use `ninja` to build HelenOS. |
| 87 | Invoking `ninja` without arguments builds all binaries and |
| 88 | debug files, but not bootable image. This is because during |
| 89 | development, most builds are incremental and only meant to check |
| 90 | that code builds properly. In this case, the time-consuming process of |
| 91 | creating a boot image is not useful and takes most time. This behavior |
| 92 | might change in the future. |
| 93 | |
| 94 | In case you want to rebuild the bootable image, you must invoke |
| 95 | `ninja image_path`. This also emits the name of the bootable image into the |
| 96 | file `image_path` in build directory. |
| 97 | |
| 98 | {{{ |
| 99 | $ ninja |
| 100 | $ ninja image_path |
| 123 | |
| 124 | === Building all predefined profiles === |
| 125 | |
| 126 | First, you need to build all required cross-compiler targets. |
| 127 | The `toolchain.sh` script makes this easy. |
| 128 | |
| 129 | Remember to set your `CROSS_PREFIX` variable if you want non-default location. |
| 130 | |
| 131 | {{{ |
| 132 | $ cd HelenOS/tools |
| 133 | $ ./toolchain.sh essential |
| 134 | }}} |
| 135 | |
| 136 | Next, create a directory in which you want build files to be created. |
| 137 | |
| 138 | {{{ |
| 139 | $ cd HelenOS |
| 140 | $ mkdir ../HelenOS-build-all |
| 141 | $ cd ../HelenOS-build-all |
| 142 | }}} |
| 143 | |
| 144 | To run the build, use `tools/build_all.sh`. |
| 145 | |
| 146 | {{{ |
| 147 | $ ../HelenOS/tools/build_all.sh |
| 148 | }}} |
| 149 | |
| 150 | Now wait for all profiles to be configured and built. |
| 151 | This is the recommended way to check all default (supported) configurations. |
| 152 | |
| 153 | If you are lazy, you can run `tools/build_all.sh` right in the source directory. |
| 154 | |
| 155 | {{{ |
| 156 | $ cd HelenOS |
| 157 | $ tools/build_all.sh |
| 158 | }}} |
| 159 | |
| 160 | This will build everything in a `build_all` subdirectory in the source directory, as a special case. |
150 | | $ make distclean && make |
151 | | }}} |
152 | | |
153 | | this will cause the HelenOS build to automatically start once you are done with the configuration. |
| 204 | $ cd HelenOS-build |
| 205 | $ ../HelenOS/configure.sh profile |
| 206 | $ ninja config # Interactive configuration |
| 207 | $ ninja # Build code |
| 208 | $ ninja image_path # Build boot image |
| 209 | }}} |
| 210 | |
| 211 | You can change configuration at any time, and the build system should be able to resolve all necessary rebuilds automatically. |
| 212 | Note however that you cannot change target platform/machine type once the initial configuration is finished. |
| 213 | To build for a different device, you need to create a new build directory for it. |
159 | | Before building release files make sure you have no uncommitted changes. These will not be build since we are building from exported sources. |
160 | | |
161 | | To build all release files go to the source root and run: |
162 | | |
163 | | {{{ |
164 | | $ make release |
165 | | }}} |
166 | | |
167 | | To build an individual release file go to the source root and run: |
168 | | |
169 | | {{{ |
170 | | $ make -C release release PROFILES=profile_name |
171 | | }}} |
172 | | |
173 | | This builds a release file (boot image / disk image) based on the specified configuration profile `profile_name`. |
| 219 | Before building release files make sure you have no uncommitted changes. These would get incorporated into the release. |
| 220 | |
| 221 | To build all release files, create a build directory and run: |
| 222 | |
| 223 | {{{ |
| 224 | $ path/to/HelenOS/tools/release.sh |
| 225 | }}} |
| 226 | |