Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 1 | Building: |
| 2 | ========= |
| 3 | |
| 4 | You will usually build in the source-tree. |
| 5 | |
| 6 | Alternatively you can build out-of-tree to have the object files separated |
| 7 | from the source. This allows for building several different configurations |
| 8 | from the same set of sources. |
| 9 | |
| 10 | A) Building in the source-tree: |
| 11 | ------------------------------- |
| 12 | |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 13 | 1) Run 'make config' or 'make menuconfig' and select the |
Eric Andersen | cd8c436 | 2001-11-10 11:22:46 +0000 | [diff] [blame] | 14 | functionality that you wish to enable. |
Matt Kraai | 6e91f69 | 2001-05-10 14:12:20 +0000 | [diff] [blame] | 15 | |
Mike Frysinger | 0ec71bf | 2005-09-16 04:21:25 +0000 | [diff] [blame] | 16 | 2) Run 'make' |
Matt Kraai | 6e91f69 | 2001-05-10 14:12:20 +0000 | [diff] [blame] | 17 | |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 18 | 3) Run 'make install' or 'make PREFIX=/target install' to |
Eric Andersen | cb81e64 | 2003-07-14 21:21:08 +0000 | [diff] [blame] | 19 | install busybox and all the needed links. Some people |
| 20 | will prefer to install using hardlinks and will instead |
| 21 | want to run 'make install-hardlinks'.... |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 22 | |
| 23 | B) Building out-of-tree: |
| 24 | ------------------------ |
| 25 | |
Bernhard Reutner-Fischer | b8faa7e | 2005-10-07 17:44:14 +0000 | [diff] [blame] | 26 | Note that top_srcdir, O and top_builddir have to be given as absolute paths. |
| 27 | |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 28 | 1) make the directory to hold the object files and chdir to it: |
| 29 | 'mkdir /tmp/bb ; cd /tmp/bb' |
| 30 | Then prepare the config giving the full path to the source in top_srcdir: |
| 31 | make top_srcdir=/path/busybox -f /path/busybox/Makefile O=/tmp/b allyesconfig |
| 32 | |
| 33 | Note that O=$(pwd) is the default if no O= was specified. |
| 34 | |
| 35 | You now have a buildable tree in $O and can run 'make' without the need |
| 36 | to specify any paths. |
| 37 | |
| 38 | Proceed with step #A2 above. |
| 39 | |
| 40 | |
| 41 | Installation: |
| 42 | ============= |
| 43 | |
| 44 | After the build is complete, a busybox.links file is generated. This is |
| 45 | used by 'make install' to create symlinks to the BusyBox binary for all |
| 46 | compiled in functions. By default, 'make install' will place the symlink |
| 47 | forest into `pwd`/_install unless you have defined the PREFIX environment |
| 48 | variable (i.e., 'make PREFIX=/tmp/foo install') |
| 49 | |
| 50 | If you wish to install hard links, rather than symlinks, you can use |
| 51 | 'make PREFIX=/tmp/foo install-hardlinks' instead. |
| 52 | |