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