iotivity 0.9.0
[platform/upstream/iotivity.git] / tools / SConstruct
1 ##
2 # The main build script
3 #
4 ##
5
6 # Load common build config
7 SConscript('build_common/SConscript')
8
9 # Load extra options
10 SConscript('extra_options.scons')
11 Import('env')
12
13 target_os = env.get('TARGET_OS')
14 if target_os == 'arduino':
15         SConscript('arduino.scons')
16 # By default, src_dir is current dir, the build_dir is:
17 #     ./out/<target_os>/<target_arch>/<release or debug>/
18 #
19 # The build_dir is a variant directory of the source directory(You can
20 # consider build_dir as a soft link to src_dir, for detail please refer to:
21 #     http://www.scons.org/doc/production/HTML/scons-user.html#f-VariantDir
22 #
23 # Any way, to make the output is in build_dir, when load scripts, the path should
24 # be relevant to build_dir.
25 build_dir = env.get('BUILD_DIR')
26
27 # Build 'resource' sub-project
28 SConscript(build_dir + 'resource/SConscript')
29
30 # Build 'service' sub-project
31 SConscript(build_dir + 'service/SConscript')
32
33 # Append targets information to the help information, to see help info, execute command line:
34 #     $ scon [options] -h
35 env.PrintTargets()
36
37 # Print bin upload command line (arduino only)
38 if target_os == 'arduino':
39         env.UploadHelp()