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