SConscript 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #-*- encoding: utf-8 -*-
  2. #---------------------------------------------------------------------------------
  3. # SConscript
  4. # Copyright (c) Shanghai Real-Thread Electronic Technology Co., Ltd.
  5. #---------------------------------------------------------------------------------
  6. import os
  7. from building import *
  8. Import('RTT_ROOT')
  9. Import('rtconfig')
  10. #---------------------------------------------------------------------------------
  11. # Package configuration
  12. #---------------------------------------------------------------------------------
  13. PKGNAME = 'MicroPython'
  14. DEPENDS = ['COMP_USING_MICROPYTHON']
  15. #---------------------------------------------------------------------------------
  16. # Compile the configuration
  17. #---------------------------------------------------------------------------------
  18. SOURCES = Glob('py/*.c')
  19. SOURCES += Glob('lib/mp-readline/*.c')
  20. SOURCES += Glob('lib/utils/*.c')
  21. SOURCES += Glob('extmod/*.c')
  22. SOURCES += Glob('port/*.c')
  23. SOURCES += Glob('port/modules/*.c')
  24. SOURCES += Glob('port/modules/machine/*.c')
  25. SOURCES += Glob('port/modules/user/*.c')
  26. SOURCES += Glob('lib/netutils/*.c')
  27. SOURCES += Glob('lib/timeutils/*.c')
  28. SOURCES += Glob('drivers/bus/*.c')
  29. SOURCES += Glob('port/native/*.c')
  30. LOCAL_CPPPATH = []
  31. LOCAL_CCFLAGS = ""
  32. LOCAL_ASFLAGS = ""
  33. CPPPATH = [os.path.join(GetCurrentDir(), '.')]
  34. CPPPATH += [os.path.join(GetCurrentDir(), 'port')]
  35. CPPPATH += [os.path.join(GetCurrentDir(), 'port/modules')]
  36. CPPPATH += [os.path.join(GetCurrentDir(), 'port/modules/machine')]
  37. CCFLAGS = " -std=gnu99"
  38. ASFLAGS = ""
  39. CPPDEFINES = []
  40. LOCAL_CPPDEFINES = []
  41. LIBS = []
  42. LIBPATH = [GetCurrentDir()]
  43. LINKFLAGS = ""
  44. #---------------------------------------------------------------------------------
  45. # Feature clip configuration, optional
  46. #---------------------------------------------------------------------------------
  47. #---------------------------------------------------------------------------------
  48. # Compiler platform configuration, optional
  49. #---------------------------------------------------------------------------------
  50. #---------------------------------------------------------------------------------
  51. # System variables
  52. #---------------------------------------------------------------------------------
  53. objs = []
  54. root = GetCurrentDir()
  55. #---------------------------------------------------------------------------------
  56. # Sub target
  57. #---------------------------------------------------------------------------------
  58. list = os.listdir(root)
  59. if GetDepend(DEPENDS):
  60. for d in list:
  61. path = os.path.join(root, d)
  62. if os.path.isfile(os.path.join(path, 'SConscript')):
  63. objs = objs + SConscript(os.path.join(d, 'SConscript'))
  64. #---------------------------------------------------------------------------------
  65. # Main target
  66. #---------------------------------------------------------------------------------
  67. objs += DefineGroup(name = PKGNAME, src = SOURCES, depend = DEPENDS,
  68. CPPPATH = CPPPATH,
  69. CCFLAGS = CCFLAGS,
  70. ASFLAGS = ASFLAGS,
  71. LOCAL_CPPPATH = LOCAL_CPPPATH,
  72. LOCAL_CCFLAGS = LOCAL_CCFLAGS,
  73. LOCAL_ASFLAGS = LOCAL_ASFLAGS,
  74. CPPDEFINES = CPPDEFINES,
  75. LOCAL_CPPDEFINES = LOCAL_CPPDEFINES,
  76. LIBS = LIBS,
  77. LIBPATH = LIBPATH,
  78. LINKFLAGS = LINKFLAGS)
  79. Return("objs")
  80. #---------------------------------------------------------------------------------
  81. # End
  82. #---------------------------------------------------------------------------------