-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
93 lines (82 loc) · 3.47 KB
/
build.xml
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="postbuild" name="test">
<property name="project.name" value="Sheppard"/>
<property name="project.debug" value="Debug"/>
<property name="project.obj" value="Debug/obj"/>
<property name="project.bin" value="Debug/bin"/>
<!-- associate current path to the link file path-->
<dirname file="$${basedir}" property="linkdir"/>
<target depends="compile" name="postbuild">
<exec executable="cmd">
<arg line="/C "${gcc.home}\arm-none-eabi-objdump" -d "${project.bin}\${project.name}.elf" > "${project.bin}\${project.name}.txt""/>
</exec>
<exec executable="cmd">
<arg line="/C "${gcc.home}\arm-none-eabi-objcopy" -O binary "${project.bin}\${project.name}.elf" "${project.bin}\${project.name}.bin""/>
</exec>
<exec executable="cmd">
<arg line="/C "${gcc.home}\arm-none-eabi-objcopy" -O ihex "${project.bin}\${project.name}.elf" "${project.bin}\${project.name}.hex""/>
</exec>
<exec dir="${basedir}\${project.bin}" executable="cmd">
<arg line="/C "${gcc.home}\arm-none-eabi-size" "${project.name}.elf""/>
</exec>
</target>
<taskdef resource="cpptasks.tasks"/>
<target name="compile">
<mkdir dir="${project.bin}"/>
<mkdir dir="${project.obj}"/>
<cc debug="true" objdir="${project.obj}" outfile="${project.bin}/${project.name}.elf" outtype="executable" subsystem="console">
<!-- compile all the c source file in the project -->
<fileset dir=".">
<include name="**/*.c"/>
<include name="**/*.s"/>
<exclude name="template.c"/>
<exclude name="template.h"/>
</fileset>
<project outfile="${project.name}.elf" overwrite="true" type="xcode"/>
<!-- defines -->
<defineset>
<define name="STM32F10X_MD_VL"/>
<define name="USE_STDPERIPH_DRIVER"/>
<define name="__ASSEMBLY__"/>
<define name="STM32F100RB"/>
</defineset>
<!-- include compile path -->
<includepath path="."/>
<includepath path="cmsis"/>
<includepath path="cmsis_boot"/>
<includepath path="stm_lib"/>
<includepath path="stm_lib/inc"/>
<!-- arm-none-eabi-gcc compiler arguments -->
<compilerarg value="-mcpu=cortex-m3"/>
<compilerarg value="-mthumb"/>
<compilerarg value="-Wall"/>
<compilerarg value="-ffunction-sections"/>
<compilerarg value="-Os"/>
<compilerarg value="-std=c99"/>
<compilerarg value="-g"/>
<!-- arm-none-eabi-gcc linker arguments -->
<linkerarg value="-Os"/>
<linkerarg value="-nostartfiles"/>
<linkerarg value="-Map=${project.name}.map"/>
<linkerarg value="-mcpu=cortex-m3"/>
<linkerarg value="-mthumb"/>
<linkerarg value="-L${linkdir}"/>
<linkerarg value="--gc-sections"/>
<linkerarg value="-lgcc"/>
<linkerarg value="-lc"/>
<linkerarg value="-lm"/>
<linkerarg value="-TH:\Projects\MichaelClift\STM32VLDISCOVERY\Sheppard\link.ld"/>
<!-- linked libraries -->
<libset dir="" libs="m"/>
</cc>
</target>
<target name="clean">
<delete dir="${project.bin}"/>
<delete dir="${project.obj}"/>
<delete dir="${project.debug}"/>
<delete dir="${project.name}.elf.xcodeproj"/>
</target>
<target depends="clean" name="rebuild">
<antcall target="postbuild"/>
</target>
</project>