SConscript 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 = ''
  14. DEPENDS = []
  15. #---------------------------------------------------------------------------------
  16. # Compile the configuration
  17. #---------------------------------------------------------------------------------
  18. SOURCES = []
  19. LOCAL_CPPPATH = []
  20. LOCAL_CCFLAGS = ""
  21. LOCAL_ASFLAGS = ""
  22. CPPPATH = [os.path.join(GetCurrentDir(), '.'),
  23. os.path.join(GetCurrentDir(), 'kconfig', rtconfig.CHIP)]
  24. CCFLAGS = ""
  25. ASFLAGS = ""
  26. CPPDEFINES = []
  27. LOCAL_CPPDEFINES = []
  28. LIBS = []
  29. LIBPATH = [GetCurrentDir()]
  30. LINKFLAGS = ""
  31. #---------------------------------------------------------------------------------
  32. # Feature clip configuration, optional
  33. #---------------------------------------------------------------------------------
  34. #---------------------------------------------------------------------------------
  35. # Compiler platform configuration, optional
  36. #---------------------------------------------------------------------------------
  37. #---------------------------------------------------------------------------------
  38. # System variables
  39. #---------------------------------------------------------------------------------
  40. objs = []
  41. root = GetCurrentDir()
  42. #---------------------------------------------------------------------------------
  43. # Sub target
  44. #---------------------------------------------------------------------------------
  45. list = os.listdir(root)
  46. if GetDepend(DEPENDS):
  47. for d in list:
  48. path = os.path.join(root, d)
  49. if os.path.isfile(os.path.join(path, 'SConscript')):
  50. objs = objs + SConscript(os.path.join(d, 'SConscript'))
  51. #---------------------------------------------------------------------------------
  52. # Main target
  53. #---------------------------------------------------------------------------------
  54. objs += DefineGroup(name = PKGNAME, src = SOURCES, depend = DEPENDS,
  55. CPPPATH = CPPPATH,
  56. CCFLAGS = CCFLAGS,
  57. ASFLAGS = ASFLAGS,
  58. LOCAL_CPPPATH = LOCAL_CPPPATH,
  59. LOCAL_CCFLAGS = LOCAL_CCFLAGS,
  60. LOCAL_ASFLAGS = LOCAL_ASFLAGS,
  61. CPPDEFINES = CPPDEFINES,
  62. LOCAL_CPPDEFINES = LOCAL_CPPDEFINES,
  63. LIBS = LIBS,
  64. LIBPATH = LIBPATH,
  65. LINKFLAGS = LINKFLAGS)
  66. Return("objs")
  67. #---------------------------------------------------------------------------------
  68. # End
  69. #---------------------------------------------------------------------------------