100 lines
3.1 KiB
Python
100 lines
3.1 KiB
Python
import os
|
|
from building import *
|
|
import rtconfig
|
|
|
|
import shutil
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
|
|
|
src = []
|
|
inc = []
|
|
|
|
cwd = cwd + '/erpc_c/'
|
|
|
|
inc = inc + [cwd]
|
|
for root, dirs, files in os.walk(cwd):
|
|
for dir in dirs:
|
|
inc = inc + [os.path.join(root,dir)]
|
|
|
|
src = Split("""
|
|
|
|
erpc_c/infra/erpc_basic_codec.cpp
|
|
erpc_c/infra/erpc_message_buffer.cpp
|
|
erpc_c/infra/erpc_message_loggers.cpp
|
|
erpc_c/infra/erpc_crc16.cpp
|
|
erpc_c/infra/erpc_pre_post_action.cpp
|
|
erpc_c/infra/erpc_framed_transport.cpp
|
|
|
|
|
|
erpc_c/setup/erpc_setup_mbf_static.cpp
|
|
erpc_c/setup/erpc_setup_mbf_dynamic.cpp
|
|
|
|
""")
|
|
|
|
if GetDepend(['ERPC_USING_RTT']):
|
|
src += Glob('erpc_c/port/erpc_threading_pthreads.cpp')
|
|
src += Glob('erpc_c/port/erpc_port_rtt.cpp')
|
|
# src += Glob('erpc_c/port/erpc_port_threadx.cpp')
|
|
|
|
if GetDepend(['ERPC_TRANSPORTS_SPI','ERPC_MODE_CLIENT']):
|
|
src += Glob('erpc_c/setup/erpc_setup_spi_master.cpp')
|
|
src += Glob('erpc_c/transports/erpc_spi_master_transport.cpp')
|
|
|
|
if GetDepend(['ERPC_TRANSPORTS_SPI','ERPC_MODE_SERVER']):
|
|
src += Glob('erpc_c/setup/erpc_setup_spi_slave.cpp')
|
|
src += Glob('erpc_c/transports/erpc_spi_slave_transport.cpp')
|
|
#
|
|
# if GetDepend(['ERPC_TRANSPORTS_UART']):
|
|
# src += Glob('erpc_c/setup/erpc_setup_uart_cmsis.cpp')
|
|
# src += Glob('erpc_c/transports/erpc_uart_cmsis_transport.cpp')
|
|
if GetDepend(['ERPC_TRANSPORTS_UART']):
|
|
src += Glob('erpc_c/setup/erpc_setup_serial.cpp')
|
|
src += Glob('erpc_c/transports/erpc_serial_transport.cpp')
|
|
|
|
if GetDepend(['ERPC_TRANSPORTS_USB_CDC']):
|
|
src += Glob('erpc_c/setup/erpc_setup_usb_cdc.cpp')
|
|
src += Glob('erpc_c/transports/erpc_usb_cdc_transport.cpp')
|
|
|
|
if GetDepend(['ERPC_TRANSPORTS_TCP']):
|
|
src += Glob('erpc_c/setup/erpc_setup_tcp.cpp')
|
|
src += Glob('erpc_c/transports/erpc_tcp_transport.cpp')
|
|
|
|
if GetDepend(['ERPC_MODE_CLIENT']):
|
|
src += Glob('erpc_c/infra/erpc_client_manager.cpp')
|
|
src += Glob('erpc_c/setup/erpc_client_setup.cpp')
|
|
|
|
|
|
if GetDepend(['ERPC_MODE_SERVER']):
|
|
src += Glob('erpc_c/infra/erpc_simple_server.cpp')
|
|
src += Glob('erpc_c/infra/erpc_server.cpp')
|
|
src += Glob('erpc_c/setup/erpc_server_setup.cpp')
|
|
|
|
|
|
if GetDepend(['ERPC_MODE_CLIENT','ERPC_USING_RTT']):
|
|
src += Glob('erpc_c/infra/erpc_arbitrated_client_manager.cpp')
|
|
src += Glob('erpc_c/infra/erpc_transport_arbitrator.cpp')
|
|
src += Glob('erpc_c/setup/erpc_arbitrated_client_setup.cpp')
|
|
src += Glob('erpc_c/transports/erpc_inter_thread_buffer_transport.cpp')
|
|
|
|
|
|
if GetDepend(['ERPC_MODE_SERVER','ERPC_USING_RTT']):
|
|
src += Glob('erpc_c/infra/erpc_transport_arbitrator.cpp')
|
|
src += Glob('erpc_c/transports/erpc_inter_thread_buffer_transport.cpp')
|
|
|
|
|
|
# LOCAL_CCFLAGS = ''
|
|
# if rtconfig.PLATFORM == 'gcc': # GCC
|
|
# LOCAL_CCFLAGS += ' -std=c99'
|
|
# elif rtconfig.PLATFORM == 'armcc': # Keil AC5
|
|
# LOCAL_CCFLAGS += ' --c99 --gnu -g -W'
|
|
# elif rtconfig.PLATFORM == 'armclang': # Keil AC6
|
|
# LOCAL_CCFLAGS += ' -std=c99 -g -w'
|
|
#
|
|
# # group = DefineGroup('erpc', src, depend = [''],CPPPATH = inc,LOCAL_CCFLAGS = LOCAL_CCFLAGS)
|
|
group = DefineGroup('erpc', src, depend = [''],CPPPATH = inc)
|
|
|
|
Return('group')
|
|
|