SConscript 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 sys.platform == 'win32':
  33. LIBPATH.append(os.path.abspath(os.path.join(cwd, '../SDL2/lib/x86')))
  34. CPPPATH.append(os.path.abspath(os.path.join(cwd, '../SDL2/include')))
  35. if GetDepend('RT_USING_DFS') == True:
  36. if GetDepend('RT_USING_DFS_ELMFAT') == True:
  37. src += ['sd_sim.c']
  38. if GetDepend('RT_USING_MTD_NAND') == True:
  39. src += ['nanddrv_file.c']
  40. if GetDepend('RT_USING_MTD_NOR') == True:
  41. src += ['sst25vfxx_mtd_sim.c']
  42. if sys.platform == "win32":
  43. if GetDepend('RT_USING_DFS_WINSHAREDIR') == True:
  44. src += ['dfs_win32.c']
  45. if GetDepend('RT_USING_MODULE') == True:
  46. src += ['module_win32.c']
  47. if GetDepend('BSP_USING_RTC') == True:
  48. src += ['drv_rtc.c']
  49. if GetDepend('BSP_USING_SOCKET') == True:
  50. src += [cwd + '/winsock/drv_win_eth.c']
  51. src += [cwd + '/winsock/sal_winsock.c']
  52. group = DefineGroup('Drivers', src, depend = [''],
  53. CPPPATH = CPPPATH, LIBS=LIBS, LIBPATH=LIBPATH, CPPDEFINES=CPPDEFINES)
  54. list = os.listdir(cwd)
  55. for item in list:
  56. if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
  57. group = group + SConscript(os.path.join(item, 'SConscript'))
  58. Return('group')