Command line tools

This section describes the usage of some commandline tools installed with ppci.

Building projects

It can be convenient to bundle a series of build steps into a script, for example a makefile. The zcc.py utility can be used to build entire projects defined by a build.xml file. Every project contains a build.xml file which describes how the project should be build. This format is more or less taken from ant build files, which are also described using xml.

Take for example the stm32f4 led project build file:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
<project name="Examples" default="all">

    <target name="all" depends="burn2">
    </target>

    <property name="src" value="src" />
    <property name="arch" value="arm"/>

    <target name="burn2">
        <assemble source="startup_stm32f4.asm" target="thumb" 
            output="startup.o" />
        <compile target="thumb" sources="burn2.c3;arch.c3;../io.c3" includes="stm32f4xx.c3"
            output="burn2.o" />
        <link output="burn2.elf" layout="stm32f4.mmap" 
            target="thumb"
            objects="startup.o;burn2.o" />
        <objcopy objectfile="burn2.elf" imagename="flash" format="hex" 
            output="burn2.hex" />
    </target>

</project>

To build the project, run zcc.py in the same directory:

$ cd test/data/stm32f4xx
$ zcc.py build

Or specify the buildfile:

$ zcc.py build -b test/data/stm32f4xx/build.xml