2017-10-12 22:39:06 +00:00
|
|
|
from __future__ import print_function
|
2017-09-20 00:25:59 +00:00
|
|
|
import sys
|
|
|
|
|
2017-09-06 11:28:32 +00:00
|
|
|
#dynamic build flags for generic compile options
|
2017-06-17 21:19:42 +00:00
|
|
|
if __name__ == "__main__":
|
2017-09-20 00:25:59 +00:00
|
|
|
args = " ".join([ "-std=gnu11",
|
2017-06-17 21:19:42 +00:00
|
|
|
"-std=gnu++11",
|
|
|
|
"-Os",
|
|
|
|
"-mcpu=cortex-m3",
|
|
|
|
"-mthumb",
|
|
|
|
|
|
|
|
"-ffreestanding",
|
|
|
|
"-fsigned-char",
|
|
|
|
"-fno-move-loop-invariants",
|
2017-10-24 22:28:33 +00:00
|
|
|
"-fno-strict-aliasing",
|
2017-06-17 21:19:42 +00:00
|
|
|
|
|
|
|
"--specs=nano.specs",
|
|
|
|
"--specs=nosys.specs",
|
|
|
|
|
2017-08-01 16:19:23 +00:00
|
|
|
"-IMarlin/src/HAL",
|
2017-09-20 00:25:59 +00:00
|
|
|
"-IMarlin/src/HAL/HAL_LPC1768/include",
|
2017-06-17 21:19:42 +00:00
|
|
|
|
|
|
|
"-MMD",
|
|
|
|
"-MP",
|
|
|
|
"-DTARGET_LPC1768",
|
|
|
|
"-DIS_REARM"
|
|
|
|
])
|
|
|
|
|
2017-09-20 00:25:59 +00:00
|
|
|
for i in range(1, len(sys.argv)):
|
|
|
|
args += " " + sys.argv[i]
|
|
|
|
|
2017-10-12 22:39:06 +00:00
|
|
|
print(args)
|
2017-09-20 00:25:59 +00:00
|
|
|
|
2017-06-17 21:19:42 +00:00
|
|
|
# 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",
|
|
|
|
],
|
|
|
|
)
|