2017-11-07 08:03:59 +03:00
|
|
|
from __future__ import print_function
|
|
|
|
import sys
|
|
|
|
|
|
|
|
#dynamic build flags for generic compile options
|
|
|
|
if __name__ == "__main__":
|
2020-11-06 21:51:52 -08:00
|
|
|
args = " ".join([ "-std=gnu++14",
|
2017-11-07 08:03:59 +03:00
|
|
|
"-Os",
|
|
|
|
"-mcpu=cortex-m3",
|
|
|
|
"-mthumb",
|
|
|
|
|
|
|
|
"-fsigned-char",
|
|
|
|
"-fno-move-loop-invariants",
|
|
|
|
"-fno-strict-aliasing",
|
2021-05-31 08:44:38 +02:00
|
|
|
"-fsingle-precision-constant",
|
2017-11-07 08:03:59 +03:00
|
|
|
|
|
|
|
"--specs=nano.specs",
|
|
|
|
"--specs=nosys.specs",
|
|
|
|
|
2020-03-13 16:29:29 -05:00
|
|
|
"-IMarlin/src/HAL/STM32F1",
|
2017-11-07 08:03:59 +03:00
|
|
|
|
|
|
|
"-MMD",
|
|
|
|
"-MP",
|
|
|
|
"-DTARGET_STM32F1"
|
|
|
|
])
|
|
|
|
|
|
|
|
for i in range(1, len(sys.argv)):
|
|
|
|
args += " " + sys.argv[i]
|
|
|
|
|
|
|
|
print(args)
|
|
|
|
|
|
|
|
# extra script for linker options
|
|
|
|
else:
|
2021-11-04 17:28:42 +07:00
|
|
|
import pioutil
|
|
|
|
if pioutil.is_pio_build():
|
|
|
|
from SCons.Script import DefaultEnvironment
|
|
|
|
env = DefaultEnvironment()
|
|
|
|
env.Append(
|
2017-11-07 08:03:59 +03:00
|
|
|
ARFLAGS=["rcs"],
|
|
|
|
|
|
|
|
ASFLAGS=["-x", "assembler-with-cpp"],
|
|
|
|
|
|
|
|
CXXFLAGS=[
|
2021-11-04 17:28:42 +07:00
|
|
|
"-fabi-version=0",
|
|
|
|
"-fno-use-cxa-atexit",
|
|
|
|
"-fno-threadsafe-statics"
|
2017-11-07 08:03:59 +03:00
|
|
|
],
|
|
|
|
LINKFLAGS=[
|
2021-11-04 17:28:42 +07:00
|
|
|
"-Os",
|
|
|
|
"-mcpu=cortex-m3",
|
|
|
|
"-ffreestanding",
|
|
|
|
"-mthumb",
|
|
|
|
"--specs=nano.specs",
|
|
|
|
"--specs=nosys.specs",
|
|
|
|
"-u_printf_float",
|
2017-11-07 08:03:59 +03:00
|
|
|
],
|
2021-11-04 17:28:42 +07:00
|
|
|
)
|