root_dir = './'
tinydtls_src_path = root_dir
-env.AppendUnique(CPPPATH = [root_dir])
-env.AppendUnique(CPPPATH = [root_dir+'aes/'])
-env.AppendUnique(CPPPATH = [root_dir+'ecc/'])
-env.AppendUnique(CPPPATH = [root_dir+'sha2/'])
+dtls_env = env.Clone()
+
+dtls_env.PrependUnique(CPPPATH = [root_dir])
+dtls_env.AppendUnique(CPPPATH = [root_dir+'aes/'])
+dtls_env.AppendUnique(CPPPATH = [root_dir+'ecc/'])
+dtls_env.AppendUnique(CPPPATH = [root_dir+'sha2/'])
if target_os not in ['arduino', 'windows', 'winrt']:
- env.AppendUnique(CPPDEFINES = ['HAVE_SYS_TIME_H'])
+ dtls_env.AppendUnique(CPPDEFINES = ['HAVE_SYS_TIME_H'])
######################################################################
# Source files and Target(s)
'sha2/sha2.c',
]
-env.AppendUnique(TINYDTLS_SRC = tinydtls_src)
+dtls_env.AppendUnique(TINYDTLS_SRC = tinydtls_src)
-if not env.get('RELEASE'):
+if not dtls_env.get('RELEASE'):
if(target_os) not in ['arduino']:
- env.AppendUnique(TINYDTLS_SRC = ['debug.c'])
+ dtls_env.AppendUnique(TINYDTLS_SRC = ['debug.c'])
else:
- env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ dtls_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
else:
- env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ dtls_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
-env.AppendUnique(CPPDEFINES = ['DTLSV12', 'WITH_SHA256', 'DTLS_CHECK_CONTENTTYPE', 'SHA2_USE_INTTYPES_H'])
+dtls_env.AppendUnique(CPPDEFINES = ['DTLSV12', 'WITH_SHA256', 'DTLS_CHECK_CONTENTTYPE', 'SHA2_USE_INTTYPES_H'])
-libtinydtls = env.StaticLibrary('libtinydtls', env.get('TINYDTLS_SRC'), OBJPREFIX='libtinydtls_')
+libtinydtls = dtls_env.StaticLibrary('libtinydtls', dtls_env.get('TINYDTLS_SRC'), OBJPREFIX='libtinydtls_')
######################################################################
# Generate tinydtls samples
# IOT-395
######################################################################
if not env.get('RELEASE'):
- samples_env = env.Clone()
+ samples_env = dtls_env.Clone()
if target_os not in ['arduino', 'windows', 'winrt']:
samples_env.AppendUnique(CPPDEFINES = ['_GNU_SOURCE'])
samples_env.AppendTarget('samples')
-env.InstallTarget(libtinydtls, 'libtinydtls');
+dtls_env.InstallTarget(libtinydtls, 'libtinydtls');
ca_os = env.get('TARGET_OS')
ca_transport = env.get('TARGET_TRANSPORT')
-src_dir = env.get('SRC_DIR')
-root_dir = './../'
-src_dir = './../util/src/'
+project_root = env.get('SRC_DIR')
+root_dir = os.path.join(project_root, 'resource', 'csdk', 'connectivity')
+src_dir = os.path.join(root_dir, 'util', 'src')
env.PrependUnique(CPPPATH = [ os.path.join(root_dir, 'api') ])
env.AppendUnique(CPPPATH = [ os.path.join(root_dir, 'inc'),
- os.path.join(root_dir, 'lib/libcoap-4.1.1'),
- os.path.join(src_dir, '/resource/csdk/logger/include/'),
- os.path.join(root_dir, 'common/inc'),
- os.path.join(root_dir, 'util/inc') ])
-
-if ca_os == 'android':
- env.AppendUnique(CPPPATH = [ os.path.join(root_dir, 'util/src/android') ])
+ os.path.join(project_root, 'resource', 'csdk', 'logger', 'include'),
+ os.path.join(root_dir, 'lib', 'libcoap-4.1.1'),
+ os.path.join(root_dir, 'common', 'inc'),
+ os.path.join(root_dir, 'util', 'inc') ])
######################################################################
# Source files to build common for platforms
if (('BLE' in ca_transport) or ('ALL' in ca_transport)):
if ca_os in ['linux', 'tizen', 'arduino']:
env.AppendUnique(CA_SRC = [
- os.path.join(src_dir,'camanager/' + ca_os + '/caleconnectionmanager.c')])
+ os.path.join(src_dir, 'camanager', ca_os, 'caleconnectionmanager.c')])
if ca_os == 'android':
env.AppendUnique(CA_SRC = [
- os.path.join(src_dir,'camanager/android/caleconnectionmanager.c'),
- os.path.join(src_dir,'camanager/android/caleautoconnector.c'),
- os.path.join(src_dir,'camanager/android/camanagerleutil.c'),
- os.path.join(src_dir,'camanager/android/camanagerdevice.c')])
+ os.path.join(src_dir, 'camanager', 'android', 'caleconnectionmanager.c'),
+ os.path.join(src_dir, 'camanager', 'android', 'caleautoconnector.c'),
+ os.path.join(src_dir, 'camanager', 'android', 'camanagerleutil.c'),
+ os.path.join(src_dir, 'camanager', 'android', 'camanagerdevice.c')])
if (('BT' in ca_transport) or ('ALL' in ca_transport)):
if ca_os == 'android':
env.AppendUnique(CA_SRC = [
- os.path.join(src_dir,'btpairing/android/cabtpairing.c')])
\ No newline at end of file
+ os.path.join(src_dir, 'btpairing' ,'android', 'cabtpairing.c')])