Howto build » History » Version 6
Eric Krausser, 01/17/2012 12:51 AM
Customize the build with Makefile.local.opts
1 | 1 | Eric Krausser | h1. Howto build |
---|---|---|---|
2 | 1 | Eric Krausser | |
3 | 1 | Eric Krausser | h2. Fetch sources |
4 | 1 | Eric Krausser | |
5 | 4 | Eric Krausser | Check out the ZRouter source code with Mercurial hg or by fetching "the latest ZRouter sources":http://zrouter.org/hg/zrouter/archive/tip.tar.bz2 ("as zip":http://zrouter.org/hg/zrouter/archive/tip.zip) |
6 | 1 | Eric Krausser | |
7 | 1 | Eric Krausser | For this tutorial we expect you check out / unpack the sources to @/projects/ZRouter/zrouter@. |
8 | 1 | Eric Krausser | |
9 | 1 | Eric Krausser | For now you also need our patched FreeBSD sources. We work on getting this patches back to official FreeBSD-HEAD, so one day this step will be obsolete. |
10 | 1 | Eric Krausser | |
11 | 3 | Eric Krausser | Get it via Mercurial or by fetching "ZRouter's patched FreeBSD sources":http://archive.zrouter.org/nightly/FreeBSD-zrouter-head-latest.tgz |
12 | 5 | Eric Krausser | |
13 | 5 | Eric Krausser | For this tutorial we expect you check out / unpack the modified FreeBSD sources to @/projects/ZRouter/FreeBSD@. |
14 | 5 | Eric Krausser | |
15 | 5 | Eric Krausser | h2. Build |
16 | 5 | Eric Krausser | |
17 | 5 | Eric Krausser | For this tutorial we expect you want to build a firmware for a device from vendor D-Link, the model is DIR-320 (see [[Supported devices]]). |
18 | 5 | Eric Krausser | |
19 | 5 | Eric Krausser | As root do: |
20 | 5 | Eric Krausser | <pre> |
21 | 5 | Eric Krausser | cd /projects/ZRouter/zrouter |
22 | 5 | Eric Krausser | make FREEBSD_SRC_TREE=/projects/ZRouter/FreeBSD/head TARGET_PAIR=D-Link/DIR-320 |
23 | 5 | Eric Krausser | </pre> |
24 | 6 | Eric Krausser | |
25 | 6 | Eric Krausser | h2. Customize the build |
26 | 6 | Eric Krausser | |
27 | 6 | Eric Krausser | You can create the file _Makefile.local.opts_ in your ZRouter's home with predefined variables, so you can skip to specify them with every make run: |
28 | 6 | Eric Krausser | |
29 | 6 | Eric Krausser | e.g. /projects/ZRouter/zrouter/Makefile.local.opts |
30 | 6 | Eric Krausser | <pre> |
31 | 6 | Eric Krausser | FREEBSD_SRC_TREE=/projects/ZRouter/FreeBSD/head |
32 | 6 | Eric Krausser | |
33 | 6 | Eric Krausser | # override default /usr/obj |
34 | 6 | Eric Krausser | OBJ_DIR=/projects/ZRouter/obj |
35 | 6 | Eric Krausser | |
36 | 6 | Eric Krausser | TARGET_PAIR=D-Link/DIR-320 |
37 | 6 | Eric Krausser | </pre> |
38 | 6 | Eric Krausser | |
39 | 6 | Eric Krausser | Now just run @make@. |