wiki:BuildSystem

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:

TargetDescription
allBuild everything (default target)
cleanRemoves all the temporary files and objects
distcleanRestores the tree to the original state
installBuilds everything and installs if successful
imageCreate a redistributable image
uninstallRemove 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

VariableDefault valueDescription
CFLAGSFlags transmitted to the C compiler
DESTDIR$PWD/destdirTemporary directory where the files are installed
CPPFLAGSFlags transmitted to the C preprocessor
LDFLAGSFlags transmitted to the library linker
SUBDIRSplatform-specificList of directories to recurse

Executables

VariableDefault valueDescription
CCccThe C compiler executable
LD$CC -sharedThe shared library linker executable
MAKEmakeThe make executable
MKDIRmkdir -pCalled when creating directories
RMrm -fCalled when deleting files or directories ($RM -r)

Platform

VariableDefault valueDescription
IMAGE_FILE$VENDOR-$IMAGE_TYPE.imgFilename to use for the image target
IMAGE_TYPEplatform-specificType of the image to build
MACHINEdetectedForce a hardware type for the build
SYSTEMdetectedForce a system (OS) for the build
TARGET$MACHINE-$SYSTEMForce a platform (hardware and OS) for the build
VENDORRunningBearEnables 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:

TargetDescription
allBuild everything (default target)
cleanRemoves all the temporary files and objects
distcleanRestores the tree to the original state
distWhere available, creates a source package
installBuilds everything and installs if successful
uninstallRemove any file installed by the install target
Last modified 12 years ago Last modified on Sep 22, 2008, 1:07:39 AM