RD updates
[platform/upstream/iotivity.git] / resource / SConscript
1 #******************************************************************
2 #
3 # Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
4 #
5 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #      http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 ##
22 # 'resource' sub-project main build script
23 #
24 ##
25
26 Import('env')
27
28 target_os = env.get('TARGET_OS')
29 src_dir = env.get('SRC_DIR')
30
31 # Build liblogger
32 SConscript('csdk/logger/SConscript')
33
34 if target_os not in ['arduino', 'darwin', 'ios', 'android', 'msys_nt', 'windows']:
35         env.AppendUnique(LIBS=['rt'])
36
37 # Download (if not already present) & build libcoap
38 SConscript('#extlibs/libcoap/SConscript')
39
40 # Build C Common dependencies
41 SConscript('c_common/SConscript')
42
43 # Build connectivity
44 SConscript('csdk/connectivity/SConscript')
45
46 if env.get('ROUTING') in ['GW', 'EP']:
47         # Build Routing
48         SConscript('csdk/routing/SConscript')
49
50 if target_os in ['linux', 'android']:
51     rd_mode = env.get('RD_MODE')
52     if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
53         SConscript('csdk/resource-directory/SConscript')
54
55 # Build libocsrm
56 SConscript('csdk/security/SConscript')
57
58 # Build liboctbstack
59 SConscript('csdk/SConscript')
60
61 if target_os not in ['arduino','darwin','ios']:
62         # Build liboc_logger
63         SConscript('oc_logger/SConscript')
64
65         # Build liboc
66         SConscript('src/SConscript')
67
68 if target_os not in ['arduino','darwin','ios','android']:
69         # Build examples
70         SConscript('examples/SConscript')
71
72 if target_os in ['linux', 'windows']:
73         # Build C Samples
74         SConscript('csdk/stack/test/linux/SConscript')
75         SConscript('csdk/stack/samples/linux/SimpleClientServer/SConscript')
76
77         if env.get('SECURED') == '1':
78                 # Build secure samples
79                 SConscript('csdk/stack/samples/linux/secure/SConscript')
80
81         # Build C/C++ unit tests
82         SConscript('unit_tests.scons')
83
84 elif target_os == 'darwin':
85         env.Command('../../out/darwin/iotivity-csdk.framework',None,src_dir + '/tools/darwin/mkfwk_osx.sh')
86         # Build linux samples for now
87         SConscript('csdk/stack/samples/linux/SimpleClientServer/SConscript')
88
89         # Build C stack's unit tests.
90         SConscript('unit_tests.scons')
91
92 elif target_os == 'arduino':
93         SConscript('csdk/stack/samples/arduino/SimpleClientServer/ocserver/SConscript')
94
95 elif target_os == 'msys_nt':
96         # Build secure samples. Using linux samples for now.
97         SConscript('csdk/stack/samples/linux/secure/SConscript')
98
99         # Build C/C++ unit tests
100         SConscript('unit_tests.scons')