#******************************************************************
#
-# Copyright 2014 Samsung Electronics All Rights Reserved.
+# Copyright 2016 Samsung Electronics All Rights Reserved.
#
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
#
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-##
-# easy-setup project build script
-##
-
-import os
-
-Import('env')
-
-env.AppendUnique(CPPDEFINES = ['EASY_SETUP_CA_INIT'])
-
-easy_setup_env = env.Clone()
-target_os = env.get('TARGET_OS')
-
-lib_env = env.Clone()
-if target_os == 'android':
- SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', exports = 'lib_env')
-
-######################################################################
-# Build flags
-######################################################################
-easy_setup_env.AppendUnique(CPPPATH = ['sdk/inc', 'sdk/src', 'sdk/common'])
-
-if target_os not in ['windows', 'winrt']:
- easy_setup_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
- if target_os not in ['android', 'arduino']:
- easy_setup_env.AppendUnique(CXXFLAGS = ['-pthread'])
-
-if target_os in ['android', 'linux']:
- easy_setup_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
- easy_setup_env.AppendUnique(RPATH = [env.get('BUILD_DIR')])
- easy_setup_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
- if target_os not in ['linux', 'arduino']:
- easy_setup_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'gnustl_shared'])
- else:
- easy_setup_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'pthread', 'connectivity_abstraction'])
-
- if not env.get('RELEASE'):
- easy_setup_env.AppendUnique(LIBS = ['log'])
-
-
-if target_os == 'arduino':
- easy_setup_env.AppendUnique(CPPPATH = [
- '../../resource/oc_logger/include',
- '../../resource/csdk/logger/include',
- '../../resource/csdk/stack/include',
- '../../extlibs/cjson',
- 'sdk/enrollee/arduino/wifi',
- 'sdk/enrollee/common/src',
- 'sdk/enrollee/common/inc'])
-
-if target_os in ['android','linux']:
- easy_setup_env.PrependUnique(CPPPATH = [
- env.get('SRC_DIR') + '/resource/csdk/ocmalloc/include',
- env.get('SRC_DIR') + '/resource/csdk/connectivity/common/inc',
- env.get('SRC_DIR') + '/resource/csdk/connectivity/api',
- env.get('SRC_DIR') + '/resource/csdk/stack/include',
- env.get('SRC_DIR') + '/resource/csdk/logger/include',
- env.get('SRC_DIR') + '/resource/csdk/security/include',
- env.get('SRC_DIR') + '/extlibs/cjson'
- ])
-
######################################################################
-# Source files and Targets
+# easy-setup project build script
######################################################################
+Import('env')
-if target_os == 'arduino':
- es_sdk_static = easy_setup_env.StaticLibrary('ESSDKLibrary',
- ['sdk/enrollee/common/src/easysetup.cpp',
- 'sdk/enrollee/common/src/resourceHandler.cpp',
- 'sdk/enrollee/arduino/wifi/networkHandler.cpp'])
- easy_setup_env.InstallTarget(es_sdk_static, 'libESSDK')
-
-
-if target_os == 'android':
- es_sdk_shared = easy_setup_env.SharedLibrary('libESSDK',
- ['sdk/src/easysetupmgr.cpp',
- 'sdk/src/camutex_pthreads.c',
- 'sdk/src/provisioninghandler.cpp'])
- easy_setup_env.InstallTarget(es_sdk_shared, 'libESSDK')
+es_target = env.get ('TARGET_OS')
+es_role = env.get('ES_ROLE')
+es_target_enrollee = env.get('ES_TARGET_ENROLLEE')
-if target_os == 'linux':
- es_sdk_shared = easy_setup_env.SharedLibrary('ESSDKLibrary',
- ['sdk/src/easysetupmgr.cpp',
- 'sdk/src/camutex_pthreads.c',
- 'sdk/src/provisioninghandler.cpp'])
- easy_setup_env.InstallTarget(es_sdk_shared, 'libESSDK')
+print "************************************************************************************"
+print "Easysetup device role --> %s " % es_role
+print "Target Platform --> %s " % es_target
+print "Target Enrollee platform --> %s " % es_target_enrollee
+print "************************************************************************************"
#Go to build sample apps
-SConscript('sampleapp/SConscript')
+if ('mediator' in es_role) :
+ print "Building Easysetup mediator SDKs [CSDK & RichSDK]"
+
+ if es_target in ['linux','android']:
+ SConscript('mediator/SConscript')
+ else :
+ print "****************************Mediator supports Linux and Android platform****************************"
+if ('enrollee' in es_role) :
+ print "Building Easysetup enrollee SDK"
+ if es_target in ['linux', 'arduino', 'tizen']:
+ SConscript('enrollee/SConscript')
+ else :
+ print "****************************Enrollee supports linux, tizen and arduino platform****************************"
\ No newline at end of file