SDCC FW - Build system
Created by: valen, Last modification: Tue 27 of Dec, 2011 (13:38 UTC)
SCons build system
The build system of SDCC framework is based on well-known SCons utility (advanced analog of make utility). SCons have a clean syntax and can do more advanced builds, than classic make. SCons can do platform independent builds (in Windows and Linux). SCons build script is a Python program.
To use SCons based build system, you need to install:
- Python v2.4 later (Python 3 is not supported)
- scons-2.1.0 or later
Installation.
Windows:
Download and install Python Windows installer and when Scons Windows installer. When SCons is installed, add dir (where scons.bat) to the system variable PATH.(for example my dir is C:\Python27\Scripts\)
Try to run 'scons' somewhere from command line, it should run SCons script.
Linux:
Install Python from your repositories or from scons.org.Install SCons.
Installing SCons From Pre-Built Packages
Building and Installing SCons on Any System
How to build your project.
Go to “c_programs” dir, there is main SConstruct file located. You should run scons from this dir.To build your project (for example test0) run
scons src/test0
or to build and upload
scons src/test0 upload_test0
There is another way to build.
To build all projects, run scons without any targets
scons
or to build and upload all projects
scons upload_all
See others SConscript files, for more info. For example, see commented example of build file src/test0/SConscript.
The build dir
The output build dir, is c_programs/build. This dir contain all files, generated in compile time.(exe, objects, binary files). Thus the source files are completely separated from output files.
(You can delete build dir, it will be re-created, when you will run build process.)
How to create new project
- in dir c_programs/src, create new project dir, put there project sources
- put build script SConscript to project dir
Info:
Each project have it's own SConscript file, in the project dir.When you run scons, it will read main SConstruct file in current dir, and will search for SConscript files (is the sub dirs of 'src' dir).
- Note: the old, makefile based, build system marked as deprecated.