SConstruct 2.18 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#******************************************************************
#
# Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
#
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Caiwen Zhang's avatar
Caiwen Zhang committed
21 22 23 24
##
# The main build script
#
##
25
import os
Caiwen Zhang's avatar
Caiwen Zhang committed
26 27 28 29

# Load common build config
SConscript('build_common/SConscript')

30 31 32 33 34
Import('env')

if os.environ.get('TERM') != None:
	env['ENV']['TERM'] = os.environ['TERM']

Caiwen Zhang's avatar
Caiwen Zhang committed
35 36 37 38 39 40
# Load extra options
SConscript('extra_options.scons')

target_os = env.get('TARGET_OS')
if target_os == 'arduino':
	SConscript('arduino.scons')
Tim Kourt's avatar
Tim Kourt committed
41 42 43 44

if target_os == 'android':
	SConscript('android/android_api/SConscript')

Caiwen Zhang's avatar
Caiwen Zhang committed
45 46 47 48 49 50 51 52 53 54 55 56 57 58
# By default, src_dir is current dir, the build_dir is:
#     ./out/<target_os>/<target_arch>/<release or debug>/
#
# The build_dir is a variant directory of the source directory(You can
# consider build_dir as a soft link to src_dir, for detail please refer to:
#     http://www.scons.org/doc/production/HTML/scons-user.html#f-VariantDir
#
# Any way, to make the output is in build_dir, when load scripts, the path should
# be relevant to build_dir.
build_dir = env.get('BUILD_DIR')

# Build 'resource' sub-project
SConscript(build_dir + 'resource/SConscript')

59
if target_os not in ['arduino','darwin','ios', 'android']:
60
	SConscript(build_dir + 'examples/OICMiddle/SConscript')
61

Caiwen Zhang's avatar
Caiwen Zhang committed
62
# Build 'service' sub-project
63
SConscript(build_dir + 'service/SConscript')
Caiwen Zhang's avatar
Caiwen Zhang committed
64 65 66 67 68 69 70 71

# Append targets information to the help information, to see help info, execute command line:
#     $ scon [options] -h
env.PrintTargets()

# Print bin upload command line (arduino only)
if target_os == 'arduino':
	env.UploadHelp()
72