Catch up 1.3-rel on resource scons reformats
[iotivity.git] / resource / provisioning / examples / SConscript
index 46372b2..8273ff0 100644 (file)
@@ -24,12 +24,13 @@ Import('env')
 # Examples build script
 ##
 examples_env = env.Clone()
-SConscript('#build_common/thread.scons', exports = {'thread_env' : examples_env})
+SConscript('#build_common/thread.scons', exports={'thread_env': examples_env})
 
 target_os = examples_env.get('TARGET_OS')
 
 # Add third party libraries
-SConscript('#resource/third_party_libs.scons', exports = {'lib_env' : examples_env})
+SConscript(
+    '#resource/third_party_libs.scons', exports={'lib_env': examples_env})
 
 with_ra = examples_env.get('WITH_RA')
 with_ra_ibb = examples_env.get('WITH_RA_IBB')
@@ -37,88 +38,109 @@ with_ra_ibb = examples_env.get('WITH_RA_IBB')
 ######################################################################
 # Build flags
 ######################################################################
-examples_env.AppendUnique(CPPPATH = [
-        '../../include/',
-        '../../csdk/include',
-        '../../csdk/stack/include',
-        '../../csdk/logger/include',
-        '../../oc_logger/include',
-        '../../csdk/connectivity/api',
-        '../../csdk/connectivity/inc/pkix',
-        '../../csdk/connectivity/common/inc',
-        '../../csdk/connectivity/lib/libcoap-4.1.1/include',
-        '../../csdk/security/include',
-        '../../csdk/security/include/internal',
-       '../../csdk/security/provisioning/include/cloud',
-        '../../csdk/security/provisioning/include',
-        '../../csdk/security/provisioning/include/oxm',
-        '../../csdk/security/provisioning/include/internal'
-               ])
-
-examples_env.AppendUnique(RPATH = [examples_env.get('BUILD_DIR')])
-examples_env.PrependUnique(LIBS = ['ocprovision', 'oc', 'ocpmapi', 'octbstack',
-                                    'oc_logger', 'connectivity_abstraction', 'coap'])
+examples_env.AppendUnique(CPPPATH=[
+    '../../include/',
+    '../../csdk/include',
+    '../../csdk/stack/include',
+    '../../csdk/logger/include',
+    '../../oc_logger/include',
+    '../../csdk/connectivity/api',
+    '../../csdk/connectivity/inc/pkix',
+    '../../csdk/connectivity/common/inc',
+    '../../csdk/connectivity/lib/libcoap-4.1.1/include',
+    '../../csdk/security/include',
+    '../../csdk/security/include/internal',
+    '../../csdk/security/provisioning/include/cloud',
+    '../../csdk/security/provisioning/include',
+    '../../csdk/security/provisioning/include/oxm',
+    '../../csdk/security/provisioning/include/internal'
+])
+
+examples_env.AppendUnique(RPATH=[examples_env.get('BUILD_DIR')])
+examples_env.PrependUnique(LIBS=[
+    'ocprovision',
+    'oc',
+    'ocpmapi',
+    'octbstack',
+    'oc_logger',
+    'connectivity_abstraction',
+    'coap'
+])
 if with_ra_ibb:
-       examples_env.AppendUnique(LIBS = examples_env['RALIBS'], LIBPATH = examples_env['RALIBPATH'], RPATH = examples_env['RARPATH'])
-       print "RALIBS = %s" % examples_env['RALIBS']
-       print "RALIBPATH = %s" % examples_env['RALIBPATH']
-       print "RARPATH = %s" % examples_env['RARPATH']
-       examples_env.AppendUnique(LIBS = 'wksxmppxep')
-else :
-       if with_ra:
-               examples_env.AppendUnique(LIBS = ['ra_xmpp'])
+    examples_env.AppendUnique(
+        LIBS=examples_env['RALIBS'],
+        LIBPATH=examples_env['RALIBPATH'],
+        RPATH=examples_env['RARPATH'])
+    print "RALIBS = %s" % examples_env['RALIBS']
+    print "RALIBPATH = %s" % examples_env['RALIBPATH']
+    print "RARPATH = %s" % examples_env['RARPATH']
+    examples_env.AppendUnique(LIBS='wksxmppxep')
+else:
+    if with_ra:
+        examples_env.AppendUnique(LIBS=['ra_xmpp'])
 
 if examples_env.get('SECURED') == '1':
-    examples_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509','mbedcrypto'])
+    examples_env.AppendUnique(LIBS=[
+        'mbedtls',
+        'mbedx509',
+        'mbedcrypto'
+    ])
 
 if 'g++' in examples_env.get('CXX'):
-   examples_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
+    examples_env.AppendUnique(CXXFLAGS=['-std=c++0x', '-Wall'])
 
 if target_os in ['android']:
-       examples_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
-       examples_env.AppendUnique(LIBS = ['gnustl_shared'])
+    examples_env.AppendUnique(CXXFLAGS=['-frtti', '-fexceptions'])
+    examples_env.AppendUnique(LIBS=['gnustl_shared'])
 
-       if not examples_env.get('RELEASE'):
-               examples_env.AppendUnique(LIBS = ['log'])
+    if not examples_env.get('RELEASE'):
+        examples_env.AppendUnique(LIBS=['log'])
 
 if target_os in ['darwin', 'ios']:
-       examples_env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
+    examples_env.AppendUnique(CPPDEFINES=['_DARWIN_C_SOURCE'])
 
 if target_os == 'tizen':
-    examples_env.AppendUnique(CPPDEFINES = ['__TIZEN__'])
+    examples_env.AppendUnique(CPPDEFINES=['__TIZEN__'])
 if examples_env.get('MULTIPLE_OWNER') == '1':
-    examples_env.AppendUnique(CPPDEFINES = ['MULTIPLE_OWNER'])
+    examples_env.AppendUnique(CPPDEFINES=['MULTIPLE_OWNER'])
 
 ######################################################################
 # Source files and Targets
 ######################################################################
-provisioningclient = examples_env.Program('provisioningclient', 'provisioningclient.cpp')
+provisioningclient = examples_env.Program('provisioningclient',
+                                          'provisioningclient.cpp')
 if examples_env.get('MULTIPLE_OWNER') == '1':
-       subownerclient = examples_env.Program('subownerclient', 'subownerclient.cpp')
+    subownerclient = examples_env.Program('subownerclient',
+                                          'subownerclient.cpp')
 
 if examples_env.get('WITH_TCP') == True:
-       cloudClient = examples_env.Program('cloudClient',['cloudClient.cpp', 'cloudAuth.cpp', 'cloudWrapper.cpp'])
+    cloudClient = examples_env.Program('cloudClient', [
+        'cloudClient.cpp', 'cloudAuth.cpp', 'cloudWrapper.cpp'
+    ])
 
 src_dir = examples_env.get('SRC_DIR')
 svr_db_src_dir = src_dir + '/resource/provisioning/examples/'
-svr_db_build_dir = examples_env.get('BUILD_DIR') +'/resource/provisioning/examples/'
+svr_db_build_dir = examples_env.get(
+    'BUILD_DIR') + '/resource/provisioning/examples/'
 
-clientjson = examples_env.Install(svr_db_build_dir, svr_db_src_dir + 'oic_svr_db_client.json')
-clientdat = examples_env.Install(svr_db_build_dir, svr_db_src_dir + 'oic_svr_db_client.dat')
+clientjson = examples_env.Install(
+    svr_db_build_dir, svr_db_src_dir + 'oic_svr_db_client.json')
+clientdat = examples_env.Install(
+    svr_db_build_dir, svr_db_src_dir + 'oic_svr_db_client.dat')
 
 if examples_env.get('MULTIPLE_OWNER') == '1':
-       subownerclientdat = examples_env.Install(svr_db_build_dir,
-               svr_db_src_dir + 'oic_svr_db_subowner_client.dat')
-       Alias("subowner", [subownerclientdat, subownerclient])
-       examples_env.AppendTarget("subowner")
+    subownerclientdat = examples_env.Install(
+        svr_db_build_dir, svr_db_src_dir + 'oic_svr_db_subowner_client.dat')
+    Alias("subowner", [subownerclientdat, subownerclient])
+    examples_env.AppendTarget("subowner")
 
 if examples_env.get('WITH_TCP') == True:
-       clouddat = examples_env.Install(svr_db_build_dir,
-               svr_db_src_dir + 'cloud.dat')
-       rootcert = examples_env.Install(svr_db_build_dir,
-               svr_db_src_dir + 'rootca.crt')
-       Alias("cloud", [clouddat, rootcert, cloudClient])
-       examples_env.AppendTarget("cloud")
-
-Alias("examples", [provisioningclient, clientjson,clientdat])
+    clouddat = examples_env.Install(
+        svr_db_build_dir, svr_db_src_dir + 'cloud.dat')
+    rootcert = examples_env.Install(
+        svr_db_build_dir, svr_db_src_dir + 'rootca.crt')
+    Alias("cloud", [clouddat, rootcert, cloudClient])
+    examples_env.AppendTarget("cloud")
+
+Alias("examples", [provisioningclient, clientjson, clientdat])
 examples_env.AppendTarget('examples')