Build system
A design goal of RunningBear is to keep the building process as simple as possible. This is currently achieved this way:
- using only Makefiles;
- not assuming any particular implementation of make;
- completing with portable shell scripts.
Main script
Syntax
The build.sh script found at the root of the source tree should be used at all times. It uses the following syntax:
$ ./build.sh [option=value...] target...
Targets
At least one target is necessary among:
| Target | Description |
| all | Build everything (default target) |
| clean | Removes all the temporary files and objects |
| distclean | Restores the tree to the original state |
| install | Builds everything and installs if successful |
| image | Create a redistributable image |
| uninstall | Remove any file installed by the install target |
Variables
A number of variables can be used to alter the process. They are declined in categories, and may be extended by platform-specific extensions.
Build process
| Variable | Default value | Description |
| CFLAGS | Flags transmitted to the C compiler | |
| DESTDIR | $PWD/destdir | Temporary directory where the files are installed |
| CPPFLAGS | Flags transmitted to the C preprocessor | |
| LDFLAGS | Flags transmitted to the library linker | |
| SUBDIRS | platform-specific | List of directories to recurse |
Executables
| Variable | Default value | Description |
| CC | cc | The C compiler executable |
| LD | $CC -shared | The shared library linker executable |
| MAKE | make | The make executable |
| MKDIR | mkdir -p | Called when creating directories |
| RM | rm -f | Called when deleting files or directories ($RM -r) |
Platform
| Variable | Default value | Description |
| IMAGE_FILE | $VENDOR-$IMAGE_TYPE.img | Filename to use for the image target |
| IMAGE_TYPE | platform-specific | Type of the image to build |
| MACHINE | detected | Force a hardware type for the build |
| SYSTEM | detected | Force a system (OS) for the build |
| TARGET | $MACHINE-$SYSTEM | Force a platform (hardware and OS) for the build |
| VENDOR | RunningBear | Enables vendor-specific filenames or image targets |
Native builds
It is also possible to compile parts or all of the source tree natively, by simply positioning oneself in a given directory and using make directly.
Syntax
make is typically used like this:
$ make [target]
where target is optional and one of:
| Target | Description |
| all | Build everything (default target) |
| clean | Removes all the temporary files and objects |
| distclean | Restores the tree to the original state |
| dist | Where available, creates a source package |
| install | Builds everything and installs if successful |
| uninstall | Remove any file installed by the install target |
