SConscript 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. Import('rtconfig')
  2. import os
  3. from building import *
  4. #get current directory
  5. cwd = GetCurrentDir()
  6. CPPDEFINES=[]
  7. # Update include path
  8. path = [ os.path.join(cwd, 'debug_console'), os.path.join(cwd, 'touch'), os.path.join(cwd, 'usb'), os.path.join(cwd, 'dma_mgr')]
  9. # The set of source files associated with this SConscript file.
  10. src = []
  11. src += [ os.path.join(cwd, 'debug_console', 'hpm_debug_console.c') ]
  12. src += [ os.path.join(cwd, 'dma_mgr', 'hpm_dma_mgr.c') ]
  13. if GetDepend(['BSP_USING_TOUCH_GT9xx']):
  14. src += [os.path.join(cwd, 'touch', 'gt9xx', 'hpm_touch_gt9xx.c') ]
  15. src += [os.path.join(cwd, 'touch', 'gt9xx', 'hpm_gt9xx.c') ]
  16. path += [ os.path.join(cwd, 'touch', 'gt9xx') ]
  17. CPPDEFINES += ['CONFIG_TOUCH_GT9XX=1']
  18. if GetDepend(['BSP_USING_TOUCH_FT5406']):
  19. src += [ os.path.join(cwd, 'touch', 'ft5406', 'hpm_touch_ft5406.c') ]
  20. src += [ os.path.join(cwd, 'touch', 'ft5406', 'hpm_ft5406.c') ]
  21. path += [ os.path.join(cwd, 'touch', 'ft5406') ]
  22. CPPDEFINES += ['CONFIG_TOUCH_FT5406=1']
  23. if GetDepend(['BSP_USING_USB_DEVICE']):
  24. src += [ os.path.join(cwd, 'usb', 'device', 'hpm_usb_device.c') ]
  25. path += [ os.path.join(cwd, 'usb', 'device') ]
  26. if GetDepend(['BSP_USING_USB_HOST']):
  27. src += [ os.path.join(cwd, 'usb', 'host', 'hpm_usb_host.c') ]
  28. path += [ os.path.join(cwd, 'usb', 'host') ]
  29. CPPDEFINES += ['USB_HOST_MCU_CORE=HPM_CORE0']
  30. if GetDepend(['BSP_USING_ETH0']):
  31. if GetDepend(['BSP_USING_ENET_PHY_DP83867']):
  32. src += [ os.path.join(cwd, 'enet_phy/dp83867/hpm_dp83867.c') ]
  33. path += [ os.path.join(cwd, 'enet_phy') ]
  34. path += [ os.path.join(cwd, 'enet_phy/dp83867') ]
  35. CPPDEFINES += ['__USE_DP83867=1']
  36. if GetDepend(['BSP_USING_ETH1']):
  37. if GetDepend(['BSP_USING_ENET_PHY_DP83848']):
  38. src += [ os.path.join(cwd, 'enet_phy/dp83848/hpm_dp83848.c') ]
  39. path += [ os.path.join(cwd, 'enet_phy') ]
  40. path += [ os.path.join(cwd, 'enet_phy/dp83848') ]
  41. CPPDEFINES += ['__USE_DP83848=1']
  42. if GetDepend(['BSP_USING_ETH0']):
  43. if GetDepend(['BSP_USING_ENET_PHY_RTL8211']):
  44. src += [ os.path.join(cwd, 'enet_phy/rtl8211/hpm_rtl8211.c') ]
  45. path += [ os.path.join(cwd, 'enet_phy') ]
  46. path += [ os.path.join(cwd, 'enet_phy/rtl8211') ]
  47. CPPDEFINES += ['__USE_RTL8211=1']
  48. if GetDepend(['BSP_USING_ENET_PHY_RTL8201']):
  49. src += [ os.path.join(cwd, 'enet_phy/rtl8201/hpm_rtl8201.c') ]
  50. path += [ os.path.join(cwd, 'enet_phy') ]
  51. path += [ os.path.join(cwd, 'enet_phy/rtl8201') ]
  52. CPPDEFINES += ['__USE_RTL8201=1']
  53. if GetDepend(['BSP_USING_ETH1']):
  54. if GetDepend(['BSP_USING_ENET_PHY_RTL8201']):
  55. src += [ os.path.join(cwd, 'enet_phy/rtl8201/hpm_rtl8201.c') ]
  56. path += [ os.path.join(cwd, 'enet_phy') ]
  57. path += [ os.path.join(cwd, 'enet_phy/rtl8201') ]
  58. CPPDEFINES += ['__USE_RTL8201=1']
  59. if GetDepend(['BSP_USING_ENET_PHY_LAN8720']):
  60. src += [ os.path.join(cwd, 'enet_phy/lan8720/hpm_lan8720.c') ]
  61. path += [ os.path.join(cwd, 'enet_phy') ]
  62. path += [ os.path.join(cwd, 'enet_phy/lan8720') ]
  63. CPPDEFINES += ['__USE_LAN8720=1']
  64. if GetDepend(['BSP_USING_CAMERA']):
  65. path += [ os.path.join(cwd, 'camera') ]
  66. if GetDepend(['BSP_USING_CAMERA_MT9M114']):
  67. src += [os.path.join(cwd, 'camera', 'mt9m114', 'hpm_mt9m114.c') ]
  68. src += [os.path.join(cwd, 'camera', 'mt9m114', 'hpm_camera_mt9m114.c') ]
  69. path += [ os.path.join(cwd, 'camera', 'mt9m114') ]
  70. CPPDEFINES += ['CONFIG_CAMERA_MT9M114=1']
  71. if GetDepend(['BSP_USING_CAMERA_OV5640']):
  72. src += [os.path.join(cwd, 'camera', 'ov5640', 'hpm_camera_ov5640.c') ]
  73. src += [os.path.join(cwd, 'camera', 'ov5640', 'hpm_ov5640.c') ]
  74. path += [ os.path.join(cwd, 'camera', 'ov5640') ]
  75. CPPDEFINES += ['CONFIG_CAMERA_OV5640=1']
  76. if GetDepend(['BSP_USING_CAMERA_OV7725']):
  77. src += [os.path.join(cwd, 'camera', 'ov7725', 'hpm_camera_ov7725.c') ]
  78. src += [os.path.join(cwd, 'camera', 'ov7725', 'hpm_ov7725.c') ]
  79. path += [ os.path.join(cwd, 'camera', 'ov7725') ]
  80. CPPDEFINES += ['CONFIG_CAMERA_OV7725=1']
  81. if GetDepend(['BSP_USING_PANEL']):
  82. path += [ os.path.join(cwd, 'panel') ]
  83. src += [os.path.join(cwd, 'panel', 'hpm_panel.c') ]
  84. CPPDEFINES += ['CONFIG_HPM_PANEL']
  85. if GetDepend(['BSP_USEING_PANEL_RGB_TM070RDH13']):
  86. src += [os.path.join(cwd, 'panel', 'panels', 'tm070rdh13.c') ]
  87. path += [ os.path.join(cwd, 'panel', 'panels') ]
  88. CPPDEFINES += ['PANEL_SIZE_WIDTH=800']
  89. CPPDEFINES += ['PANEL_SIZE_HEIGHT=480']
  90. CPPDEFINES += ['CONFIG_PANEL_RGB_TM070RDH13=1']
  91. if GetDepend(['BSP_USEING_PANEL_MIPI_MC10128007_31B']):
  92. src += [os.path.join(cwd, 'panel', 'panels', 'mc10128007_31b.c') ]
  93. path += [ os.path.join(cwd, 'panel', 'panels') ]
  94. CPPDEFINES += ['PANEL_SIZE_WIDTH=800']
  95. CPPDEFINES += ['PANEL_SIZE_HEIGHT=1280']
  96. CPPDEFINES += ['CONFIG_PANEL_MIPI_MC10128007_31B=1']
  97. if GetDepend(['BSP_USEING_PANEL_LVDS_TM103XDGP01']):
  98. src += [os.path.join(cwd, 'panel', 'panels', 'tm103xdgp01.c') ]
  99. path += [ os.path.join(cwd, 'panel', 'panels') ]
  100. CPPDEFINES += ['PANEL_SIZE_WIDTH=1920']
  101. CPPDEFINES += ['PANEL_SIZE_HEIGHT=720']
  102. CPPDEFINES += ['CONFIG_PANEL_LVDS_TM103XDGP01=1']
  103. if GetDepend(['BSP_USEING_PANEL_LVDS_CC10128007']):
  104. src += [os.path.join(cwd, 'panel', 'panels', 'cc10128007.c') ]
  105. path += [ os.path.join(cwd, 'panel', 'panels') ]
  106. CPPDEFINES += ['PANEL_SIZE_WIDTH=800']
  107. CPPDEFINES += ['PANEL_SIZE_HEIGHT=1280']
  108. CPPDEFINES += ['CONFIG_PANEL_LVDS_CC10128007=1']
  109. group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES=CPPDEFINES)
  110. Return ('group')