aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2019-07-25 12:44:47 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2019-07-26 13:24:07 +0000
commit1635126722f94174563575d69a337bd07032908c (patch)
tree16fd395de7f11ea9819744005359ab53a314672b /share
parent08ee82112c4bb16d5401a7e748b5dbf336211f3e (diff)
bare-metal: Add STM8 architecture for SDCC toolchain
Previous implementation of SDCC toolchain based on an assumption, that the default target architecture always is MCS51. But, the SDCC compiler support multiple architectures: * http://sdcc.sourceforge.net/ So, it is makes sense to add support and for STM8 architecture to the SDCC toolchain. Change-Id: Ibbd32764fe2fac3e45fda93ac3d903c3619efb18 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'share')
-rw-r--r--share/qbs/modules/cpp/sdcc.js4
-rw-r--r--share/qbs/modules/cpp/sdcc.qbs31
2 files changed, 32 insertions, 3 deletions
diff --git a/share/qbs/modules/cpp/sdcc.js b/share/qbs/modules/cpp/sdcc.js
index 2f148d2c2..38783aa1a 100644
--- a/share/qbs/modules/cpp/sdcc.js
+++ b/share/qbs/modules/cpp/sdcc.js
@@ -42,12 +42,16 @@ var WindowsUtils = require("qbs.WindowsUtils");
function targetArchitectureFlag(architecture) {
if (architecture === "mcs51")
return "-mmcs51";
+ if (architecture === "stm8")
+ return "-mstm8";
}
function guessArchitecture(macros)
{
if (macros["__SDCC_mcs51"] === "1")
return "mcs51";
+ if (macros["__SDCC_stm8"] === "1")
+ return "stm8";
}
function guessEndianness(macros)
diff --git a/share/qbs/modules/cpp/sdcc.qbs b/share/qbs/modules/cpp/sdcc.qbs
index a0d795b40..3349e9158 100644
--- a/share/qbs/modules/cpp/sdcc.qbs
+++ b/share/qbs/modules/cpp/sdcc.qbs
@@ -87,6 +87,8 @@ CppModule {
switch (qbs.architecture) {
case "mcs51":
return "sdas8051" + compilerExtension;
+ case "stm8":
+ return "sdasstm8" + compilerExtension;
}
}
assemblerPath: FileInfo.joinPaths(toolchainInstallPath, assemblerName)
@@ -95,6 +97,8 @@ CppModule {
switch (qbs.architecture) {
case "mcs51":
return "sdld" + compilerExtension;
+ case "stm8":
+ return "sdldstm8" + compilerExtension;
}
}
linkerPath: FileInfo.joinPaths(toolchainInstallPath, linkerName)
@@ -104,12 +108,33 @@ CppModule {
runtimeLibrary: "static"
- staticLibrarySuffix: ".lib"
+ staticLibrarySuffix: {
+ switch (qbs.architecture) {
+ case "mcs51":
+ return ".lib";
+ case "stm8":
+ return ".a";
+ }
+ }
executableSuffix: ".ihx"
- property string objectSuffix: ".rel"
+ property string objectSuffix: {
+ switch (qbs.architecture) {
+ case "mcs51":
+ return ".rel";
+ case "stm8":
+ return ".o";
+ }
+ }
- imageFormat: "ihx"
+ imageFormat: {
+ switch (qbs.architecture) {
+ case "mcs51":
+ return "ihx";
+ case "stm8":
+ return "elf";
+ }
+ }
enableExceptions: false
enableRtti: false