SConscript 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # RT-Thread building script for JerryScript
  2. import os
  3. from building import *
  4. # get current directory
  5. cwd = GetCurrentDir()
  6. jerry_core_dir = 'jerryscript/jerry-core'
  7. jerry_core = Glob(jerry_core_dir + '/*.c')
  8. jerry_core += Glob(jerry_core_dir + '/api/*.c')
  9. jerry_core += Glob(jerry_core_dir + '/debugger/*.c')
  10. jerry_core += Glob(jerry_core_dir + '/ecma/base/*.c')
  11. jerry_core += Glob(jerry_core_dir + '/ecma/builtin-objects/*.c')
  12. jerry_core += Glob(jerry_core_dir + '/ecma/builtin-objects/typedarray/*.c')
  13. jerry_core += Glob(jerry_core_dir + '/ecma/operations/*.c')
  14. jerry_core += Glob(jerry_core_dir + '/jcontext/*.c')
  15. jerry_core += Glob(jerry_core_dir + '/jmem/*.c')
  16. jerry_core += Glob(jerry_core_dir + '/jrt/*.c')
  17. jerry_core += Glob(jerry_core_dir + '/lit/*.c')
  18. jerry_core += Glob(jerry_core_dir + '/parser/js/*.c')
  19. jerry_core += Glob(jerry_core_dir + '/parser/regexp/*.c')
  20. jerry_core += Glob(jerry_core_dir + '/vm/*.c')
  21. jerry_ext_dir = 'jerryscript/jerry-ext'
  22. jerry_ext = Glob(jerry_ext_dir + '/arg/*.c')
  23. jerry_ext += Glob(jerry_ext_dir + '/handler/*.c')
  24. jerry_ext += Glob(jerry_ext_dir + '/include/*.c')
  25. jerry_ext += Glob(jerry_ext_dir + '/module/*.c')
  26. src = jerry_core + jerry_ext
  27. CPPPATH = [cwd]
  28. CPPPATH += [jerry_core_dir + '/api']
  29. CPPPATH += [jerry_core_dir + '/debugger']
  30. CPPPATH += [jerry_core_dir + '/ecma/base']
  31. CPPPATH += [jerry_core_dir + '/ecma/builtin-objects']
  32. CPPPATH += [jerry_core_dir + '/ecma/builtin-objects/typedarray']
  33. CPPPATH += [jerry_core_dir + '/ecma/operations']
  34. CPPPATH += [jerry_core_dir + '/include']
  35. CPPPATH += [jerry_core_dir + '/jcontext']
  36. CPPPATH += [jerry_core_dir + '/jmem']
  37. CPPPATH += [jerry_core_dir + '/jrt']
  38. CPPPATH += [jerry_core_dir + '/lit']
  39. CPPPATH += [jerry_core_dir + '/parser/js']
  40. CPPPATH += [jerry_core_dir + '/parser/regexp']
  41. CPPPATH += [jerry_core_dir + '/vm']
  42. CPPPATH += [jerry_ext_dir + '/arg']
  43. CPPPATH += [jerry_ext_dir + '/handler']
  44. CPPPATH += [jerry_ext_dir + '/include']
  45. CPPPATH += [jerry_ext_dir + '/module']
  46. LOCAL_CCFLAGS = ''
  47. import rtconfig
  48. if rtconfig.CROSS_TOOL == 'keil':
  49. LOCAL_CCFLAGS += ' --gnu'
  50. CPPDEFINES = ['JERRY_JS_PARSER', 'JERRY_ENABLE_EXTERNAL_CONTEXT']
  51. if GetDepend('PKG_JERRY_ENABLE_ERROR_MESSAGES'):
  52. CPPDEFINES += ['JERRY_ENABLE_ERROR_MESSAGES']
  53. if GetDepend('PKG_JERRY_ENABLE_LOGGING'):
  54. CPPDEFINES += ['JERRY_ENABLE_LOGGING']
  55. if GetDepend('PKG_JMEM_STATS'):
  56. CPPDEFINES += ['JMEM_STATS']
  57. if GetDepend('PKG_CONFIG_DISABLE_ES2015'):
  58. CPPDEFINES += ['CONFIG_DISABLE_ES2015']
  59. group = DefineGroup('JerryScript', src, depend = ['PKG_USING_JERRYSCRIPT'], CPPPATH = CPPPATH,
  60. CPPDEFINES = CPPDEFINES, LOCAL_CCFLAGS = LOCAL_CCFLAGS)
  61. if GetDepend('PKG_USING_JERRYSCRIPT'):
  62. group = group + SConscript(os.path.join('rtthread-port', 'SConscript'))
  63. Return('group')