forked from RT-Thread-packages/freemodbus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SConscript
69 lines (56 loc) · 1.6 KB
/
SConscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Import('RTT_ROOT')
from building import *
src = Split("""
modbus/functions/mbfuncdiag.c
modbus/functions/mbutils.c
modbus/functions/mbfuncother.c
modbus/rtu/mbcrc.c
port/port.c
""")
master_rtu_src = Split("""
modbus/functions/mbfunccoils_m.c
modbus/functions/mbfuncdisc_m.c
modbus/functions/mbfuncholding_m.c
modbus/functions/mbfuncinput_m.c
modbus/rtu/mbrtu_m.c
modbus/mb_m.c
port/portevent_m.c
port/portserial_m.c
port/porttimer_m.c
port/user_mb_app_m.c
""")
slave_src = Split("""
modbus/functions/mbfunccoils.c
modbus/functions/mbfuncdisc.c
modbus/functions/mbfuncholding.c
modbus/functions/mbfuncinput.c
modbus/mb.c
port/portevent.c
port/portserial.c
port/porttcp.c
port/porttimer.c
port/user_mb_app.c
""")
# The set of source files associated with this SConscript file.
path = [GetCurrentDir() + '/modbus/include',
GetCurrentDir() + '/modbus/rtu',
GetCurrentDir() + '/modbus/ascii',
GetCurrentDir() + '/modbus/tcp',
GetCurrentDir() + '/port']
if GetDepend(['PKG_MODBUS_MASTER_RTU']):
src += master_rtu_src
if GetDepend(['PKG_MODBUS_SLAVE']):
src += slave_src
if GetDepend(['PKG_MODBUS_SLAVE_RTU']):
src += ['modbus/rtu/mbrtu.c']
if GetDepend(['PKG_MODBUS_SLAVE_ASCII']):
src += ['modbus/ascii/mbascii.c']
src += ['modbus/rtu/mbrtu.c']
if GetDepend(['PKG_MODBUS_SLAVE_TCP']):
src += ['modbus/tcp/mbtcp.c']
if GetDepend(['PKG_MODBUS_MASTER_SAMPLE']):
src += ['samples/sample_mb_master.c']
if GetDepend(['PKG_MODBUS_SLAVE_SAMPLE']):
src += ['samples/sample_mb_slave.c']
group = DefineGroup('FreeModbus', src, depend = ['PKG_USING_FREEMODBUS'], CPPPATH = path)
Return('group')