...
 
Commits (2)
......@@ -2,15 +2,28 @@
NuttX in itself is comprised mainly of a core component, the NuttX source itself, and possibly other components such as external applications, libraries, etc.
The build process encompasses 4 phases:
1. Organizing your NuttX project
2. Configuration of Nuttx to a specific board and build platform
3. Compile and linking the Nuttx binary
4. Flashing of a Nuttx binary to hardware
## Build process
There are two main ways of organizing your NuttX based project: building your code inside NuttX build process or first building NuttX as a library and then linking your application against NuttX. In the first case, issuing `make` will compile both NuttX and your project code, while in the second, issuing `make export` will generate a library and set of headers which can then be used by you separately. In this case, compiling and linking the final image is up to you.
There are two main ways of organizing your NuttX based project:
* building your code inside NuttX build process
* first building NuttX as a library and then linking your application against NuttX.
In the first case, issuing `make` will compile both NuttX and your project code, while in the second, issuing `make export` will generate a library and set of headers which can then be used by you separately. In this case, compiling and linking the final image is up to you.
In either case, building NuttX itself closely resembles the build process of the GNU/Linux kernel, involving first a configuration step (using the known `menuconfig` approach) and then a build step. During configuration, you would choose the target architecture, platform and lots of different options and features that can be turned on or off.
### Inside NuttX tree
NuttX build system is designed for a specific directory layout (althought there are slight variants to this) where the core NuttX source directory should be placed alongside any other optional components. For example, when including the optional `apps` component, the directory layout will look like this:
NuttX build system is designed for a specific directory layout (although there are slight variants to this) where the core NuttX source directory should be placed alongside any other optional components. For example, when including the optional `apps` component, the directory layout will look like this:
$ cd my_nuttx_project
$ ls
......@@ -71,7 +84,7 @@ You can always undo this by issuing `make distclean` in the main NuttX directory
In order to remove all output generated by the `make` process you can issue a `make clean`. Note that this will not remove the configuration copied by the `configure.sh` script.
If you only which to clean the output of the `apps` build you can use `make apps_clean`.
If you only wish to clean the output of the `apps` build you can use `make apps_clean`.
Finally, you can usually flash the resulting NuttX image to the board using the `make download` target, although this requires the board code to include the relevant target in the `Make.defs` file. Otherwise, you should flash the image manually using your prefered tool.
......