SConscript 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import sys
  2. import os
  3. from building import *
  4. Import('rtconfig')
  5. cwd = GetCurrentDir()
  6. src = ['board.c', 'uart_console.c']
  7. LIBS = []
  8. LIBPATH = []
  9. CPPPATH = [cwd]
  10. CPPDEFINES = ['RT_USING_LIBC']
  11. if rtconfig.CROSS_TOOL == 'msvc':
  12. CPPDEFINES += \
  13. [
  14. # avoid to conflict with the inherent STDC in VS
  15. '_CRT_DECLARE_NONSTDC_NAMES=0',
  16. # errno macro redefinition
  17. '_CRT_ERRNO_DEFINED',
  18. # avoid time.h conflicts, such as struct timespec, ctime, difftime...
  19. '_CRT_NO_TIME_T',
  20. # disable deprecation of unsafe functions, such as strncpy
  21. '_CRT_SECURE_NO_WARNINGS',
  22. # lean and mean for Windows.h, exclude winsock.h when include Windows.h
  23. # avoid conlicts between sys/select.h, time.h, and winsock.h
  24. # such as fd_set related, struct timeval...
  25. 'WIN32_LEAN_AND_MEAN'
  26. ]
  27. # remove no need file.
  28. if GetDepend('PKG_USING_GUIENGINE') == True:
  29. src += ['sdl_fb.c']
  30. else:
  31. LIBS.append('SDL2')
  32. if GetDepend('RT_USING_DFS') == True:
  33. if GetDepend('RT_USING_DFS_ELMFAT') == True:
  34. src += ['sd_sim.c']
  35. if GetDepend('RT_USING_MTD_NAND') == True:
  36. src += ['nanddrv_file.c']
  37. if GetDepend('RT_USING_MTD_NOR') == True:
  38. src += ['sst25vfxx_mtd_sim.c']
  39. if sys.platform == "win32":
  40. if GetDepend('RT_USING_DFS_WINSHAREDIR') == True:
  41. src += ['dfs_win32.c']
  42. if GetDepend('RT_USING_MODULE') == True:
  43. src += ['module_win32.c']
  44. if GetDepend('BSP_USING_RTC') == True:
  45. src += ['drv_rtc.c']
  46. if GetDepend('BSP_USING_SOCKET') == True:
  47. src += [cwd + '/winsock/drv_win_eth.c']
  48. src += [cwd + '/winsock/sal_winsock.c']
  49. group = DefineGroup('Drivers', src, depend = [''],
  50. CPPPATH = CPPPATH, LIBS=LIBS, LIBPATH=LIBPATH, CPPDEFINES=CPPDEFINES)
  51. list = os.listdir(cwd)
  52. for item in list:
  53. if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
  54. group = group + SConscript(os.path.join(item, 'SConscript'))
  55. Return('group')