Improvements to make support, added debug target.

This commit is contained in:
James Goppert
2015-09-13 14:39:19 -04:00
parent 2ab9f0baa8
commit 3203f9ac9e
7 changed files with 50 additions and 14 deletions
+2
View File
@@ -551,6 +551,7 @@ function(px4_add_common_flags)
endif()
set(c_compile_flags
-g3
-std=gnu99
-fno-common
)
@@ -559,6 +560,7 @@ function(px4_add_common_flags)
-Wno-missing-field-initializers
)
set(cxx_compile_flags
-g3
-fno-exceptions
-fno-rtti
-std=gnu++0x
+13 -4
View File
@@ -55,10 +55,19 @@ run_cmd("{ld:s} -r -o {obj:s}.bin.o {obj:s}.c.o -b binary {in_bin:s}",
# get size of image
stdout = run_cmd("{nm:s} -p --radix=x {obj:s}.bin.o", locals())
re_size = re.compile("(^[0-9A-Fa-f]*) .*{sym:s}_size".format(
**locals()))
size_match = re.match(re_size, stdout)
size = size_match.group(1)
re_string = r"^([0-9A-F-a-f]+) .*{sym:s}_size\n".format(**locals())
re_size = re.compile(re_string, re.MULTILINE)
size_match = re.search(re_size, stdout)
try:
size = size_match.group(1)
except AttributeError as e:
raise RuntimeError("{:s}\nre:{:s}\n{:s}".format(
e, re_string, stdout))
except IndexError as e:
group0 = size_match.group(0)
raise RuntimeError("{:s}\ngroup 0:{:s}\n{:s}".format(
e, group0, stdout))
#print("romfs size: ", size)
# write size to file
@@ -37,7 +37,7 @@ endif()
cmake_force_cxx_compiler(${CXX_COMPILER} GNU)
# compiler tools
foreach(tool objcopy nm ld)
foreach(tool objcopy nm ld gdb)
string(TOUPPER ${tool} TOOL)
find_program(${TOOL} arm-none-eabi-${tool})
if(NOT ${TOOL})