aboutsummaryrefslogtreecommitdiff
path: root/Marlin/src/HAL/STM32F1/build_flags.py
diff options
context:
space:
mode:
authorGeorgiy Bondarenko <69736697+nehilo@users.noreply.github.com>2021-03-04 20:54:23 +0300
committerGeorgiy Bondarenko <69736697+nehilo@users.noreply.github.com>2021-03-04 20:54:23 +0300
commite8701195e66f2d27ffe17fb514eae8173795aaf7 (patch)
tree9f519c4abf6556b9ae7190a6210d87ead1dfadde /Marlin/src/HAL/STM32F1/build_flags.py
downloadkp3s-lgvl-e8701195e66f2d27ffe17fb514eae8173795aaf7.tar.xz
kp3s-lgvl-e8701195e66f2d27ffe17fb514eae8173795aaf7.zip
Initial commit
Diffstat (limited to 'Marlin/src/HAL/STM32F1/build_flags.py')
-rw-r--r--Marlin/src/HAL/STM32F1/build_flags.py53
1 files changed, 53 insertions, 0 deletions
diff --git a/Marlin/src/HAL/STM32F1/build_flags.py b/Marlin/src/HAL/STM32F1/build_flags.py
new file mode 100644
index 0000000..c51fd4f
--- /dev/null
+++ b/Marlin/src/HAL/STM32F1/build_flags.py
@@ -0,0 +1,53 @@
+from __future__ import print_function
+import sys
+
+#dynamic build flags for generic compile options
+if __name__ == "__main__":
+ args = " ".join([ "-std=gnu++14",
+ "-Os",
+ "-mcpu=cortex-m3",
+ "-mthumb",
+
+ "-fsigned-char",
+ "-fno-move-loop-invariants",
+ "-fno-strict-aliasing",
+
+ "--specs=nano.specs",
+ "--specs=nosys.specs",
+
+ "-IMarlin/src/HAL/STM32F1",
+
+ "-MMD",
+ "-MP",
+ "-DTARGET_STM32F1"
+ ])
+
+ for i in range(1, len(sys.argv)):
+ args += " " + sys.argv[i]
+
+ print(args)
+
+# extra script for linker options
+else:
+ from SCons.Script import DefaultEnvironment
+ env = DefaultEnvironment()
+ env.Append(
+ ARFLAGS=["rcs"],
+
+ ASFLAGS=["-x", "assembler-with-cpp"],
+
+ CXXFLAGS=[
+ "-fabi-version=0",
+ "-fno-use-cxa-atexit",
+ "-fno-threadsafe-statics"
+ ],
+ LINKFLAGS=[
+ "-Os",
+ "-mcpu=cortex-m3",
+ "-ffreestanding",
+ "-mthumb",
+ "--specs=nano.specs",
+ "--specs=nosys.specs",
+ "-u_printf_float",
+ ],
+ )