1 #******************************************************************
3 # Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
5 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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
11 # http://www.apache.org/licenses/LICENSE-2.0
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.
19 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
22 # 'resource' sub-project main build script
28 target_os = env.get('TARGET_OS')
29 src_dir = env.get('SRC_DIR')
30 rd_mode = env.get('RD_MODE')
32 if target_os == 'tizenrt' and not env.get('RELEASE'):
33 env.AppendUnique(CCFLAGS = ['-g'])
36 SConscript('csdk/logger/SConscript')
38 if target_os not in ['arduino', 'darwin', 'ios', 'android', 'msys_nt', 'windows', 'tizenrt']:
39 env.AppendUnique(LIBS=['rt'])
41 # Download (if not already present) & build libcoap
42 SConscript('#extlibs/libcoap/SConscript')
44 # Build C Common dependencies
45 SConscript('c_common/SConscript')
48 SConscript('csdk/connectivity/SConscript')
50 if env.get('ROUTING') in ['GW', 'EP']:
52 SConscript('csdk/routing/SConscript')
54 if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
55 SConscript('csdk/resource-directory/SConscript')
58 SConscript('csdk/security/SConscript')
61 SConscript('csdk/SConscript')
63 if target_os not in ['arduino','darwin', 'tizenrt']:
65 SConscript('oc_logger/SConscript')
68 SConscript('src/SConscript')
70 #if target_os not in ['arduino','darwin','ios','android', 'tizenrt']:
72 # SConscript('examples/SConscript')
74 if target_os in ['linux', 'windows']:
76 SConscript('csdk/stack/test/linux/SConscript')
77 SConscript('csdk/stack/samples/linux/SimpleClientServer/SConscript')
79 if env.get('SECURED') == '1':
80 # Build secure samples
81 SConscript('csdk/stack/samples/linux/secure/SConscript')
83 # Build C/C++ unit tests
84 SConscript('unit_tests.scons')
86 elif target_os == 'darwin':
87 env.Command('../../out/darwin/iotivity-csdk.framework',None,src_dir + '/tools/darwin/mkfwk_osx.sh')
88 # Build linux samples for now
89 SConscript('csdk/stack/samples/linux/SimpleClientServer/SConscript')
91 # Build C stack's unit tests.
92 SConscript('unit_tests.scons')
94 elif target_os == 'arduino':
95 SConscript('csdk/stack/samples/arduino/SimpleClientServer/ocserver/SConscript')
97 elif target_os == 'msys_nt':
98 # Build secure samples. Using linux samples for now.
99 SConscript('csdk/stack/samples/linux/secure/SConscript')
101 # Build C/C++ unit tests
102 SConscript('unit_tests.scons')