SConscript 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. import os
  2. import rtconfig
  3. from building import *
  4. cwd = GetCurrentDir()
  5. # add file
  6. src = Split('''
  7. platform/posix/btstack_stdin_posix.c
  8. platform/posix/btstack_uart_block_posix.c
  9. platform/posix/btstack_tlv_posix.c
  10. platform/posix/btstack_run_loop_posix.c
  11. chipset/bcm/btstack_chipset_bcm.c
  12. chipset/bcm/btstack_chipset_bcm_download_firmware.c
  13. src/btstack_util.c
  14. src/btstack_run_loop.c
  15. src/btstack_tlv.c
  16. src/hci_dump.c
  17. src/hci_cmd.c
  18. src/ad_parser.c
  19. src/btstack_linked_list.c
  20. src/btstack_crypto.c
  21. src/hci.c
  22. src/l2cap.c
  23. src/l2cap_signaling.c
  24. src/btstack_memory.c
  25. src/btstack_memory_pool.c
  26. src/hci_transport_h4.c
  27. src/classic/btstack_link_key_db_tlv.c
  28. src/ble/le_device_db_tlv.c
  29. src/ble/att_server.c
  30. src/ble/sm.c
  31. src/ble/att_dispatch.c
  32. src/ble/att_db.c
  33. src/ble/gatt-service/battery_service_server.c
  34. port/posix-h4-bcm/btstack_main.c
  35. rtt_adapter/rtt_btstack_adapter.c
  36. src/btstack_crypto.c
  37. ''')
  38. path = [cwd]
  39. path += [cwd + '/src']
  40. path += [cwd + '/platform/posix']
  41. path += [cwd + '/chipset/bcm']
  42. path += [cwd + '/port/posix-h4-bcm']
  43. path += [cwd + '/rtt_adapter']
  44. path += [cwd + '/src/ble/gatt-service']
  45. #MESH
  46. if GetDepend(['PKG_BTSTACK_MESH']):
  47. path += [cwd + '/src/mesh']
  48. src += Split("""
  49. src/mesh/adv_bearer.c
  50. src/mesh/mesh_access.c
  51. src/mesh/beacon.c
  52. src/mesh/gatt_bearer.c
  53. src/mesh/mesh.c
  54. src/mesh/mesh_crypto.c
  55. src/mesh/mesh_configuration_client.c
  56. src/mesh/mesh_configuration_server.c
  57. src/mesh/mesh_foundation.c
  58. src/mesh/mesh_generic_default_transition_time_client.c
  59. src/mesh/mesh_generic_default_transition_time_server.c
  60. src/mesh/mesh_generic_level_client.c
  61. src/mesh/mesh_generic_level_server.c
  62. src/mesh/mesh_generic_on_off_client.c
  63. src/mesh/mesh_generic_on_off_server.c
  64. src/mesh/mesh_health_server.c
  65. src/mesh/mesh_iv_index_seq_number.c
  66. src/mesh/mesh_keys.c
  67. src/mesh/mesh_lower_transport.c
  68. src/mesh/mesh_network.c
  69. src/mesh/mesh_peer.c
  70. src/mesh/mesh_proxy.c
  71. src/mesh/mesh_node.c
  72. src/mesh/mesh_upper_transport.c
  73. src/mesh/mesh_virtual_addresses.c
  74. src/mesh/pb_adv.c
  75. src/mesh/pb_gatt.c
  76. src/mesh/provisioning.c
  77. src/mesh/provisioning_device.c
  78. src/mesh/provisioning_provisioner.c
  79. src/ble/gatt-service/mesh_provisioning_service_server.c
  80. src/ble/gatt-service/mesh_proxy_service_server.c
  81. """)
  82. #example
  83. if GetDepend('PKG_BTSTACK_SAMPLE_DISABLE') == False:
  84. path += [cwd + '/example/inc']
  85. if GetDepend(['PKG_BTSTACK_SAMPLE_LE_COUNTER']):
  86. example_src = Split("""
  87. example/gatt_counter.c
  88. """)
  89. if GetDepend(['PKG_BTSTACK_SAMPLE_LE_DATA_CHANNEL_SERVER']):
  90. example_src = Split("""
  91. example/le_data_channel_server.c
  92. """)
  93. if GetDepend(['PKG_BTSTACK_SAMPLE_LE_DATA_CHANNEL_SERVER']):
  94. example_src = Split("""
  95. example/le_data_channel_server.c
  96. """)
  97. if GetDepend(['PKG_BTSTACK_SAMPLE_LE_BLUFI_SERVER']):
  98. example_src = Split("""
  99. rtt_adapter/rtt_btstack_gatt_blufi.c
  100. """)
  101. if GetDepend(['PKG_BTSTACK_SAMPLE_LE_STREAMER']):
  102. example_src = Split("""
  103. example/nordic_spp_le_streamer.c
  104. src/ble/gatt-service/nordic_spp_service_server.c
  105. """)
  106. if GetDepend(['PKG_BTSTACK_SAMPLE_NORDIC_LE_COUNTER']):
  107. example_src = Split("""
  108. example/nordic_spp_le_counter.c
  109. src/ble/gatt-service/nordic_spp_service_server.c
  110. """)
  111. if GetDepend(['PKG_BTSTACK_SAMPLE_ATT_DELAYED_RESPONSE']):
  112. example_src = Split("""
  113. example/att_delayed_response.c
  114. """)
  115. if GetDepend(['PKG_BTSTACK_SAMPLE_SM_PAIRING_PERIPHERAL']):
  116. example_src = Split("""
  117. example/sm_pairing_peripheral.c
  118. """)
  119. if GetDepend(['PKG_BTSTACK_SAMPLE_GATT_STREAMER_PERIPHERAL']):
  120. example_src = Split("""
  121. example/gatt_streamer_server.c
  122. """)
  123. if GetDepend(['PKG_BTSTACK_SAMPLE_ANCS_CLIENT_DEMO']):
  124. example_src = Split("""
  125. example/ancs_client_demo.c
  126. src/ble/ancs_client.c
  127. src/ble/gatt_client.c
  128. """)
  129. if GetDepend(['PKG_BTSTACK_SAMPLE_MESH_DEMO']):
  130. example_src = Split("""
  131. example/mesh_node_demo.c
  132. """)
  133. if GetDepend(['PKG_BTSTACK_SAMPLE_TMALL_MESH_DEMO']):
  134. example_src = Split("""
  135. rtt_adapter/mesh_node_demo_tmall.c
  136. """)
  137. LOCAL_CCFLAGS = ''
  138. if rtconfig.CROSS_TOOL == 'keil':
  139. LOCAL_CCFLAGS += ' --gnu'
  140. group = DefineGroup('RTT_BTSTACK', src, depend = [''], CPPPATH = path, LOCAL_CCFLAGS = LOCAL_CCFLAGS)
  141. if GetDepend('PKG_BTSTACK_SAMPLE_DISABLE') == False:
  142. group = group + DefineGroup('btstack_example', example_src, depend = [''], CPPPATH = path)
  143. Return('group')