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 # The main build script
27 # Load common build config
28 SConscript('build_common/SConscript')
32 if os.environ.get('TERM') != None:
33 env['ENV']['TERM'] = os.environ['TERM']
36 SConscript('extra_options.scons')
38 target_os = env.get('TARGET_OS')
39 if target_os == 'arduino':
40 SConscript('arduino.scons')
42 if target_os == 'android':
43 SConscript('android/android_api/SConscript')
45 # By default, src_dir is current dir, the build_dir is:
46 # ./out/<target_os>/<target_arch>/<release or debug>/
48 # The build_dir is a variant directory of the source directory(You can
49 # consider build_dir as a soft link to src_dir, for detail please refer to:
50 # http://www.scons.org/doc/production/HTML/scons-user.html#f-VariantDir
52 # Any way, to make the output is in build_dir, when load scripts, the path should
53 # be relevant to build_dir.
54 build_dir = env.get('BUILD_DIR')
56 # Build 'resource' sub-project
57 SConscript(build_dir + 'resource/SConscript')
59 if target_os not in ['arduino','darwin','ios', 'android']:
60 SConscript(build_dir + 'examples/OICMiddle/SConscript')
62 # Build 'service' sub-project
63 SConscript(build_dir + 'service/SConscript')
65 # Build "cloud" sub-project
66 SConscript(build_dir + 'cloud/SConscript')
68 # Build "plugin interface" sub-project
69 SConscript(build_dir + 'plugins/SConscript')
71 # Append targets information to the help information, to see help info, execute command line:
75 # Print bin upload command line (arduino only)
76 if target_os == 'arduino':
79 # to install the generated pc file into custome prefix location
80 env.UserInstallTargetPCFile('iotivity.pc', 'iotivity.pc')