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
+19 -5
View File
@@ -167,6 +167,14 @@ else:
filename += ext filename += ext
firmware = "firmware" + ext firmware = "firmware" + ext
path = os.path.join(directory, filename)
outpath = path + ".out"
errpath = path + ".err"
if os.path.isfile(errpath):
exit(COMPILATION_ERROR)
if not os.path.isfile(path):
# Launch CMake # Launch CMake
cmd = ["cmake"] cmd = ["cmake"]
for opt, value in command_options.items(): for opt, value in command_options.items():
@@ -176,16 +184,20 @@ if "OPENTX_VERSION_SUFFIX" in os.environ:
cmd.append(srcdir) cmd.append(srcdir)
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, error = proc.communicate() output, error = proc.communicate()
if proc.returncode != 0: if proc.returncode == 0:
file("%s.err" % filename, "w").write(output + error) file(outpath, "a").write(output + error)
else:
file(errpath, "w").write(output + error)
exit(COMPILATION_ERROR) exit(COMPILATION_ERROR)
# Launch make firmware # Launch make firmware
cmd = ["make", "firmware"] cmd = ["make", "firmware"]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, error = proc.communicate() output, error = proc.communicate()
if proc.returncode != 0: if proc.returncode == 0:
file("%s.err" % filename, "w").write(output + error) file(outpath, "a").write(output + error)
else:
file(errpath, "w").write(output + error)
exit(COMPILATION_ERROR) exit(COMPILATION_ERROR)
# Check binary size # Check binary size
@@ -198,5 +210,7 @@ if size > maxsize:
exit(FIRMWARE_SIZE_TOO_BIG) exit(FIRMWARE_SIZE_TOO_BIG)
# Copy binary to the binaries directory # Copy binary to the binaries directory
shutil.copyfile(firmware, os.path.join(directory, filename)) shutil.copyfile(firmware, path)
print filename print filename
exit(0)