2017-11-07 06:03:59 +01:00
|
|
|
from __future__ import print_function
|
|
|
|
import sys
|
|
|
|
|
|
|
|
#dynamic build flags for generic compile options
|
|
|
|
if __name__ == "__main__":
|
|
|
|
args = " ".join([ "-std=gnu11",
|
|
|
|
"-Os",
|
|
|
|
"-mcpu=cortex-m3",
|
|
|
|
"-mthumb",
|
|
|
|
|
|
|
|
"-fsigned-char",
|
|
|
|
"-fno-move-loop-invariants",
|
|
|
|
"-fno-strict-aliasing",
|
|
|
|
|
|
|
|
"--specs=nano.specs",
|
|
|
|
"--specs=nosys.specs",
|
|
|
|
|
2019-01-03 17:38:39 +01:00
|
|
|
"-IMarlin/src/HAL/HAL_STM32F1",
|
2017-11-07 06:03:59 +01: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:
|
|
|
|
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",
|
|
|
|
],
|
|
|
|
)
|