Marlin_Firmware/Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py

60 lines
1.5 KiB
Python
Raw Normal View History

from __future__ import print_function
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__":
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",
"-fno-strict-aliasing",
2017-06-17 16:19:42 -05:00
"--specs=nano.specs",
"--specs=nosys.specs",
# For external libraries
"-IMarlin/src/HAL/HAL_LPC1768/include",
2017-06-17 16:19:42 -05:00
# For MarlinFirmware/U8glib-HAL
"-IMarlin/src/HAL/HAL_LPC1768/u8g",
2017-06-17 16:19:42 -05:00
"-MMD",
"-MP",
"-DTARGET_LPC1768"
2017-06-17 16:19:42 -05:00
])
for i in range(1, len(sys.argv)):
args += " " + sys.argv[i]
print(args)
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",
],
)