aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2021-05-30 21:27:04 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2021-05-31 14:07:19 +0000
commit79c5b99a51994e84c98fee02ce60fbfe6ab71054 (patch)
tree1e604a4626ddf932964a97b180519198d3cd810f /share
parente375ff5608101ba447670316a57fc5940ed4df4b (diff)
baremetal: Long live COSMIC toolchain for COLDFIRE architecture
This patch adds support for Cosmic Software compiler for the bare metal platforms: * https://www.cosmicsoftware.com/download.php Note that this compiler only works on Windows host platforms. Also the COSMIC toolchain has been added to the Github CI. Fixes: QBS-1648 Change-Id: I39dfeef1c5696e69bed8969890cf4f8fdb3c2741 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'share')
-rw-r--r--share/qbs/modules/cpp/cosmic.js34
1 files changed, 27 insertions, 7 deletions
diff --git a/share/qbs/modules/cpp/cosmic.js b/share/qbs/modules/cpp/cosmic.js
index acb3e4d5d..ca8cc5a14 100644
--- a/share/qbs/modules/cpp/cosmic.js
+++ b/share/qbs/modules/cpp/cosmic.js
@@ -47,6 +47,8 @@ function compilerName(qbs) {
return "cx6808";
else if (architecture === "hcs12")
return "cx6812";
+ else if (architecture === "m68k")
+ return "cx332";
throw "Unable to deduce compiler name for unsupported architecture: '"
+ architecture + "'";
}
@@ -61,6 +63,8 @@ function assemblerName(qbs) {
return "ca6808";
else if (architecture === "hcs12")
return "ca6812";
+ else if (architecture === "m68k")
+ return "ca332";
throw "Unable to deduce assembler name for unsupported architecture: '"
+ architecture + "'";
}
@@ -70,7 +74,8 @@ function linkerName(qbs) {
if (architecture.startsWith("arm")
|| architecture === "stm8"
|| architecture === "hcs8"
- || architecture === "hcs12") {
+ || architecture === "hcs12"
+ || architecture === "m68k") {
return "clnk";
}
throw "Unable to deduce linker name for unsupported architecture: '"
@@ -82,7 +87,8 @@ function listerName(qbs) {
if (architecture.startsWith("arm")
|| architecture === "stm8"
|| architecture === "hcs8"
- || architecture === "hcs12") {
+ || architecture === "hcs12"
+ || architecture === "m68k") {
return "clabs";
}
throw "Unable to deduce lister name for unsupported architecture: '"
@@ -94,7 +100,8 @@ function archiverName(qbs) {
if (architecture.startsWith("arm")
|| architecture === "stm8"
|| architecture === "hcs8"
- || architecture === "hcs12") {
+ || architecture === "hcs12"
+ || architecture === "m68k") {
return "clib";
}
throw "Unable to deduce archiver name for unsupported architecture: '"
@@ -111,6 +118,8 @@ function staticLibrarySuffix(qbs) {
return ".h08";
else if (architecture === "hcs12")
return ".h12";
+ else if (architecture === "m68k")
+ return ".332";
throw "Unable to deduce static library suffix for unsupported architecture: '"
+ architecture + "'";
}
@@ -125,6 +134,8 @@ function executableSuffix(qbs) {
return ".h08";
else if (architecture === "hcs12")
return ".h12";
+ else if (architecture === "m68k")
+ return ".332";
throw "Unable to deduce executable suffix for unsupported architecture: '"
+ architecture + "'";
}
@@ -134,7 +145,8 @@ function objectSuffix(qbs) {
if (architecture.startsWith("arm")
|| architecture === "stm8"
|| architecture === "hcs8"
- || architecture === "hcs12") {
+ || architecture === "hcs12"
+ || architecture === "m68k") {
return ".o";
}
throw "Unable to deduce object file suffix for unsupported architecture: '"
@@ -146,7 +158,8 @@ function imageFormat(qbs) {
if (architecture.startsWith("arm")
|| architecture === "stm8"
|| architecture === "hcs8"
- || architecture === "hcs12") {
+ || architecture === "hcs12"
+ || architecture === "m68k") {
return "cosmic";
}
throw "Unable to deduce image format for unsupported architecture: '"
@@ -163,6 +176,8 @@ function guessArchitecture(compilerFilePath) {
return "hcs8";
else if (baseName === "cx6812")
return "hcs12";
+ else if (baseName === "cx332")
+ return "m68k";
throw "Unable to deduce architecture for unsupported compiler: '"
+ baseName + "'";
}
@@ -210,7 +225,7 @@ function dumpVersion(compilerFilePath) {
p.exec(compilerFilePath, ["-vers"]);
// COSMIC compiler use the errors output!
var output = p.readStdErr();
- var match = output.match(/^COSMIC.+V(\d+)\.?(\d+)\.?(\*|\d+)/);
+ var match = output.match(/^COSMIC.+V(\d+)\.?(\d+)\.?(\*|\d+)?/);
if (match) {
var major = match[1] ? parseInt(match[1], 10) : 0;
var minor = match[2] ? parseInt(match[2], 10) : 0;
@@ -224,7 +239,8 @@ function guessEndianness(architecture) {
if (architecture.startsWith("arm")
|| architecture === "stm8"
|| architecture === "hcs8"
- || architecture === "hcs12") {
+ || architecture === "hcs12"
+ || architecture === "m68k") {
return "big";
}
throw "Unable to deduce endianness for unsupported architecture: '"
@@ -251,6 +267,10 @@ function dumpDefaultPaths(compilerFilePath, architecture) {
includePath = FileInfo.joinPaths(rootPath, "h6812");
if (File.exists(includePath))
includePaths.push(includePath);
+ } else if (architecture === "m68k") {
+ includePath = FileInfo.joinPaths(rootPath, "h332");
+ if (File.exists(includePath))
+ includePaths.push(includePath);
}
var libraryPaths = [];