SConscript 3.0 KB

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