Unleashed v1.4
[unleashed.git] / README.md
blob6ba96796205852c107b40249fc468c430693927d
1 How to build Unleashed
2 ======================
4 Install Unleashed
5 -----------------
7 Building Unleashed requires Unleashed, so first, download and install the
8 latest snapshot from https://www.unleashed-os.org/snapshots/latest/
10 Get the source
11 --------------
13 Clone this repository:
15 ```
16 $ git clone git://repo.or.cz/unleashed.git
17 $ cd unleashed
18 ```
20 Build
21 -----
23 Objects generated during the build are stored in `/usr/obj`, so create it and
24 allow the build user to write to it.
26 ```
27 # zfs create -o mountpoint=/usr/obj rpool/obj && install -m 1777 -d /usr/obj
28 ```
30 Afterward, you can use make normally.
32 ```
33 $ make -j32 build            # adjust -j<num> as necessary for your hardware
34 ```
36 `make build` installs the built artifacts into `proto/root_i386`, and generates
37 packages into the `packages/nightly/repo.redist` repository.
39 NOTE: objects generated by the legacy build system `dmake` in the `usr/src`
40 directories are stored directly inside the directories, so it is currently not
41 enough to clear `/usr/obj` to get a clean workspace. Instead use:
42 ```
43 $ make -j32 cleandir         # removes objects, proto/root_i386 and packages/i386/nightly/repo.redist
44 ```
46 Single component build
47 ----------------------
49 To build a component that is using the new build system (e.g., cat(1)), change
50 into the source directory and run make. For example:
52 ```
53 $ cd bin/cat
54 $ make
55 # make install
56 ```
58 The component will be linked against the running system and installed to `/`.
59 To install to an alternate directory (eg. `proto/root_i386`), use `make install
60 DESTDIR=path`.
62 To build a component under the legacy (dmake) build system, ie. things under
63 `usr/src`, first complete a full build so that prerequisite objects for the
64 component are made, and then:
66 ```
67 $ ./tools/bldenv.sh
68 $ cd usr/src/cmd/w
69 $ dmake install
70 ```
72 The component will be built against the "proto area" in `proto/root_i386` and
73 installed there.