Merge commit '9992e6a682b1c35b4385c3b512db329ec8ab9ede'
[unleashed.git] / docs / how-to-build.md
blob9f9edd53a5c85294bb67651ac8028c3012b8d956
1 How to build unleashed
2 ======================
4 Install unleashed
5 -----------------
7 Building unleashed requires unleashed, so first you must install it (doing
8 which is not documented at the time of writing).
10 Get the source
11 --------------
13 Clone this repository from either:
15 * git://repo.or.cz/unleashed.git
16 * http://repo.or.cz/unleashed.git
18 For example:
20 ```
21 $ git clone git://repo.or.cz/unleashed.git
22 $ cd unleashed
23 ```
25 Build
26 -----
28 For a complete build, use 'tools/nightly.sh'. The user executing the build
29 needs to be able to write to `/usr/obj`, so make sure you can do that first.
31 ```
32 # install -m 1777 -d /usr/obj
33 $ ./tools/nightly.sh
34 ```
36 On success, this results in installable packages in the `packages` directory.
38 Incremental build
39 -----------------
41 To build a component that is using the new build system (e.g., cat(1)), change
42 into the source directory and run make. For example:
44 ```
45 $ cd bin/cat
46 $ make
47 # make install
48 ```
50 The component will be built against the running system and installed to /. To
51 install to the proto area, pass DESTDIR=path to 'make install'. Building
52 against libraries and headers in the "proto area" or in object directories is
53 not currently supported.
55 To build a component under the legacy (dmake) build system, ie. things under
56 'usr/src', first complete a full nightly build so that prerequisite objects for
57 the component are made, and then:
59 ```
60 $ ./tools/bldenv.sh tools/env.sh
61 $ cd usr/src/cmd/w
62 $ dmake install
63 ```
65 The component will be built against the "proto area" and installed there.