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