Build output now saved in a .out file ... so that we can grep for warnings!

This commit is contained in:
Bertrand Songis
2016-03-25 16:53:09 +01:00
parent 862199f822
commit 7501608aca
+42 -28
View File
@@ -167,36 +167,50 @@ else:
filename += ext filename += ext
firmware = "firmware" + ext firmware = "firmware" + ext
# Launch CMake path = os.path.join(directory, filename)
cmd = ["cmake"] outpath = path + ".out"
for opt, value in command_options.items(): errpath = path + ".err"
cmd.append("-D%s=%s" % (opt, value))
if "OPENTX_VERSION_SUFFIX" in os.environ: if os.path.isfile(errpath):
cmd.append('-DVERSION_SUFFIX="%s"' % os.environ["OPENTX_VERSION_SUFFIX"])
cmd.append(srcdir)
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, error = proc.communicate()
if proc.returncode != 0:
file("%s.err" % filename, "w").write(output + error)
exit(COMPILATION_ERROR) exit(COMPILATION_ERROR)
# Launch make firmware if not os.path.isfile(path):
cmd = ["make", "firmware"] # Launch CMake
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) cmd = ["cmake"]
output, error = proc.communicate() for opt, value in command_options.items():
if proc.returncode != 0: cmd.append("-D%s=%s" % (opt, value))
file("%s.err" % filename, "w").write(output + error) if "OPENTX_VERSION_SUFFIX" in os.environ:
exit(COMPILATION_ERROR) cmd.append('-DVERSION_SUFFIX="%s"' % os.environ["OPENTX_VERSION_SUFFIX"])
cmd.append(srcdir)
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, error = proc.communicate()
if proc.returncode == 0:
file(outpath, "a").write(output + error)
else:
file(errpath, "w").write(output + error)
exit(COMPILATION_ERROR)
# Check binary size # Launch make firmware
if board_family == BOARD_FAMILY_ARM: cmd = ["make", "firmware"]
size = os.stat(firmware).st_size proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
else: output, error = proc.communicate()
size = subprocess.check_output('avr-size -A %s | grep Total | cut -f2- -d " "' % firmware, shell=True) if proc.returncode == 0:
size = int(size.strip()) file(outpath, "a").write(output + error)
if size > maxsize: else:
exit(FIRMWARE_SIZE_TOO_BIG) file(errpath, "w").write(output + error)
exit(COMPILATION_ERROR)
# Check binary size
if board_family == BOARD_FAMILY_ARM:
size = os.stat(firmware).st_size
else:
size = subprocess.check_output('avr-size -A %s | grep Total | cut -f2- -d " "' % firmware, shell=True)
size = int(size.strip())
if size > maxsize:
exit(FIRMWARE_SIZE_TOO_BIG)
# Copy binary to the binaries directory
shutil.copyfile(firmware, path)
# Copy binary to the binaries directory
shutil.copyfile(firmware, os.path.join(directory, filename))
print filename print filename
exit(0)