[IOT-1386] Update ins value after deleting resource from rd
[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 rd_mode = env.get('RD_MODE')
31
32 # Build liblogger
33 SConscript('csdk/logger/SConscript')
34
35 if target_os not in ['arduino', 'darwin', 'ios', 'android', 'msys_nt', 'windows']:
36         env.AppendUnique(LIBS=['rt'])
37
38 # Download (if not already present) & build libcoap
39 SConscript('#extlibs/libcoap/SConscript')
40
41 # Build C Common dependencies
42 SConscript('c_common/SConscript')
43
44 # Build connectivity
45 SConscript('csdk/connectivity/SConscript')
46
47 if env.get('ROUTING') in ['GW', 'EP']:
48         # Build Routing
49         SConscript('csdk/routing/SConscript')
50
51 if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
52     SConscript('csdk/resource-directory/SConscript')
53
54 # Build libocsrm
55 SConscript('csdk/security/SConscript')
56
57 # Build liboctbstack
58 SConscript('csdk/SConscript')
59
60 if target_os not in ['arduino','darwin','ios']:
61         # Build liboc_logger
62         SConscript('oc_logger/SConscript')
63
64         # Build liboc
65         SConscript('src/SConscript')
66
67 if target_os not in ['arduino','darwin','ios','android']:
68         # Build examples
69         SConscript('examples/SConscript')
70
71 if target_os in ['linux', 'windows']:
72         # Build C Samples
73         SConscript('csdk/stack/test/linux/SConscript')
74         SConscript('csdk/stack/samples/linux/SimpleClientServer/SConscript')
75
76         if env.get('SECURED') == '1':
77                 # Build secure samples
78                 SConscript('csdk/stack/samples/linux/secure/SConscript')
79
80         # Build C/C++ unit tests
81         SConscript('unit_tests.scons')
82
83 elif target_os == 'darwin':
84         env.Command('../../out/darwin/iotivity-csdk.framework',None,src_dir + '/tools/darwin/mkfwk_osx.sh')
85         # Build linux samples for now
86         SConscript('csdk/stack/samples/linux/SimpleClientServer/SConscript')
87
88         # Build C stack's unit tests.
89         SConscript('unit_tests.scons')
90
91 elif target_os == 'arduino':
92         SConscript('csdk/stack/samples/arduino/SimpleClientServer/ocserver/SConscript')
93
94 elif target_os == 'msys_nt':
95         # Build secure samples. Using linux samples for now.
96         SConscript('csdk/stack/samples/linux/secure/SConscript')
97
98         # Build C/C++ unit tests
99         SConscript('unit_tests.scons')