2 # The main build script
6 # Load common build config
7 # Load common build config
8 SConscript('./build/SConscript')
12 sample_env = env.Clone()
14 target_os = env.get('TARGET_OS')
15 transport = env.get('TARGET_TRANSPORT')
16 secured = env.get('SECURED')
17 release_mode = env.get('RELEASE')
18 buildsample = env.get('BUILD_SAMPLE')
20 print "Given Transport is %s" % transport
21 print "Given OS is %s" % target_os
22 print "Secured %s" % env.get('SECURED')
23 print "Build sample is set to %s" % buildsample
25 build_dir = env.get('BUILD_DIR')
27 if target_os == 'tizen':
28 command = "sh build/tizen/gbsbuild.sh %s %s %s" % (transport, buildsample, release_mode)
29 print "Created Command is %s" % command
30 gbs_script = env.Command('gbs_build', None, command)
31 AlwaysBuild ('gbs_script')
32 elif target_os == 'arduino':
33 SConscript('build/arduino/arduino.scons')
35 # Build 'libcoap' library
36 SConscript(build_dir + 'lib/libcoap-4.1.1/SConscript')
38 # Build 'src' sub-project
39 SConscript(build_dir + 'SConscript')
41 # Build 'samples' sub-project
42 SConscript(build_dir + 'samples/arduino/SConscript')
43 elif target_os == 'linux':
45 # Build 'libcoap' library
46 SConscript(build_dir + 'lib/libcoap-4.1.1/SConscript')
48 # Build 'src' sub-project
49 SConscript(build_dir + 'SConscript')
51 # Build 'samples' sub-project
52 env.SConscript(build_dir + 'samples/linux/SConscript')
53 elif target_os == 'android':
55 # Build 'libcoap' library
56 SConscript(build_dir + 'lib/libcoap-4.1.1/SConscript')
58 # Build 'src' sub-project
59 SConscript(build_dir + 'SConscript')