Build system

It can be convenient to bundle a series of build steps into a script, for example a makefile. Instead of depending on make, yet another build tool was created. The build specification is specified in xml. Much like msbuild and Ant.

A project can contain a build.xml file which describes how the project should be build. The name of the file can be build.xml or another filename. This file can than be given to ppci-build.py.

An example build file:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<project name="Snake" default="snake">
    <import name="ppci.buildtasks" />

    <target name="snake">
        <assemble
            source="lm3s6965/startup.asm"
            target="arm:thumb"
            output="startup.o" />
        <compile
            target="arm:thumb"
            sources="snake/main.c3;lm3s6965/bsp.c3;../librt/io.c3;snake/game.c3"
            output="snake.o"
            report="snake_report.html"/>
        <link output="snake.elf"
            layout="lm3s6965/memlayout.mmap" 
            target="arm:thumb"
            objects="startup.o;snake.o" />
        <objcopy
            objectfile="snake.elf"
            imagename="flash"
            format="bin"
            output="snake.bin" />
    </target>

</project>

Projects

The root element of a build file is the project tag. This tag contains a name and optionally a default target attribute. When no target is given when building the project, the default target is selected.

Targets

Like make, targets can depend on eachother. Then one target is run, the build system makes sure to run depending targets first. Target elements contain a list of tasks to perform.

Tasks

The task elements are contained within target elements. Each task specifies a build action. For example the link task takes multiple object files and combines those into a merged object.