You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lpc1768_flag_script.py 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. from __future__ import print_function
  2. import sys
  3. #dynamic build flags for generic compile options
  4. if __name__ == "__main__":
  5. args = " ".join([ "-std=gnu11",
  6. "-std=gnu++11",
  7. "-Os",
  8. "-mcpu=cortex-m3",
  9. "-mthumb",
  10. "-fsigned-char",
  11. "-fno-move-loop-invariants",
  12. "-fno-strict-aliasing",
  13. "-fsingle-precision-constant",
  14. "--specs=nano.specs",
  15. "--specs=nosys.specs",
  16. # For external libraries
  17. "-IMarlin/src/HAL/HAL_LPC1768/include",
  18. # For MarlinFirmware/U8glib-HAL
  19. "-IMarlin/src/HAL/HAL_LPC1768/u8g",
  20. "-DU8G_HAL_LINKS",
  21. "-MMD",
  22. "-MP",
  23. "-DTARGET_LPC1768"
  24. ])
  25. for i in range(1, len(sys.argv)):
  26. args += " " + sys.argv[i]
  27. print(args)
  28. # extra script for linker options
  29. else:
  30. from SCons.Script import DefaultEnvironment
  31. env = DefaultEnvironment()
  32. env.Append(
  33. ARFLAGS=["rcs"],
  34. ASFLAGS=["-x", "assembler-with-cpp"],
  35. CXXFLAGS=[
  36. "-fabi-version=0",
  37. "-fno-use-cxa-atexit",
  38. "-fno-threadsafe-statics"
  39. ],
  40. LINKFLAGS=[
  41. "-Wl,-Tframeworks/CMSIS/LPC1768/system/LPC1768.ld,--gc-sections",
  42. "-Os",
  43. "-mcpu=cortex-m3",
  44. "-mthumb",
  45. "--specs=nano.specs",
  46. "--specs=nosys.specs",
  47. "-u_printf_float"
  48. ],
  49. )